iLLD_TC27xC  1.0
IfxPsi5s_Psi5s.h
Go to the documentation of this file.
1 /**
2  * \file IfxPsi5s_Psi5s.h
3  * \brief PSI5S PSI5S details
4  * \ingroup IfxLld_Psi5s
5  *
6  * \version iLLD_0_1_0_10
7  * \copyright Copyright (c) 2013 Infineon Technologies AG. All rights reserved.
8  *
9  *
10  * IMPORTANT NOTICE
11  *
12  *
13  * Infineon Technologies AG (Infineon) is supplying this file for use
14  * exclusively with Infineon's microcontroller products. This file can be freely
15  * distributed within development tools that are supporting such microcontroller
16  * products.
17  *
18  * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
19  * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
20  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
21  * INFINEON SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL,
22  * OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
23  *
24  * \defgroup IfxLld_Psi5s_Psi5s_Usage How to use the PSI5S PSI5S Interface driver?
25  * \ingroup IfxLld_Psi5s
26  *
27  * PSI5S defines a current loop based serial communication link typically used to connect airbag sensors or other peripheral devices.Data transmission and configuration of the sensor can be done by modulation of the Sync Pulses.
28  *
29  * In the following sections it will be described, how to integrate the driver into the application framework.
30  *
31  * \section IfxLld_Psi5s_Psi5s_Preparation Preparation
32  * \subsection IfxLld_Psi5s_Psi5s_Include Include Files
33  *
34  * Include following header file into your C code:
35  * \code
36  *
37  * #include <Psi5s/Psi5s/IfxPsi5s_Psi5s.h>
38  *
39  * \endcode
40  *
41  * \subsection IfxLld_Psi5s_Psi5s_Variables Variables
42  *
43  * \code
44  *
45  * // PSI5S handle
46  * IfxPsi5s_Psi5s psi5s;
47  *
48  * \endcode
49  *
50  * \subsection IfxLld_Psi5s_Psi5s_initModule Module Initialisation
51  * \code
52  *
53  * // create module config
54  * IfxPsi5s_Psi5s_Config psi5sModuleConfig;
55  * IfxPsi5s_Psi5s_initModuleConfig(&psi5sModuleConfig, &MODULE_PSI5S);
56  * IfxPsi5s_Psi5s_initModule(&psi5s, &psi5sModuleConfig);
57  *
58  * \endcode
59  *
60  * \subsection IfxLld_Psi5s_Psi5s_initChannel Channel Initialisation
61  * \code
62  *
63  * // create channel config
64  * IfxPsi5s_Psi5s_ChannelConfig psi5sChannelConfig;
65  * IfxPsi5s_Psi5s_initChannelConfig(&psi5sChannelConfig, &psi5s);
66  * // change channel (default is channel 0, change to channel 4)
67  * psi5sChannelConfig.channelId = IfxPsi5s_ChannelId_4;
68  *
69  * // change payloadlength (default is 0, i.e., no frame expecte; change to 8)
70  * for(int slot=0; slot<6; ++slot)
71  * {
72  * psi5sChannelConfig.receiveControl.payloadLength[slot] = 8;
73  * }
74  * // change channel (default is channel 0, change to channel 4)
75  * psi5sChannelConfig.channelId = IfxPsi5s_ChannelId_4;
76  *
77  * // initialize the channel
78  * IfxPsi5s_Psi5s_Channel psi5sChannel;
79  * IfxPsi5s_Psi5s_initChannel(&psi5sChannel, &psi5sChannelConfig);
80  *
81  * \endcode
82  *
83  * Now, PSI5S is ready. Then, call the below APIs to do operation.
84  *
85  * \subsection IfxLld_Psi5s_Psi5s_sendChannelData Send Channel Data
86  * \code
87  * uint32 channels = (1 << IfxPsi5s_ChannelId_4); // enable channel 4
88  * uint32 mask = (1 << IfxPsi5s_ChannelId_4); // modify the selection for channel 4
89  *
90  * // enable the channel trigger counter
91  * IfxPsi5s_Psi5s_enableDisableChannelTriggerCounters(&psi5s, channels, mask);
92  *
93  * // enable the channel
94  * IfxPsi5s_Psi5s_enableDisableChannels(&psi5s, channels, mask);
95  *
96  * // start ASC interface
97  * IfxPsi5s_Psi5s_startAscTransactions(&psi5s);
98  *
99  * uint32 data = 0x5;
100  * // send data
101  * if(IfxPsi5s_Psi5s_sendChannelData(&psi5sChannel, data))
102  * {
103  * // wait till data transfer is completed
104  * while(psi5s.psi5s->INTSTAT[IfxPsi5s_ChannelId_4].B.TPI == 0);
105  * }
106  *
107  * \endcode
108  *
109  * \subsection IfxLld_Psi5s_Psi5s_readFrame Read Channel Frame
110  * \code
111  * // enable ASC receiver
112  * IfxPsi5s_Psi5s_enableAscReceiver(&psi5s);
113  *
114  * // start ASC interface
115  * IfxPsi5s_Psi5s_startAscTransactions(&psi5s);
116  *
117  * // add the code below to initiate the sensor to transmit frames
118  * // end of code to initiate the sensor to transmit frames
119  *
120  * IfxPsi5s_Psi5s_Frame frame;
121  *
122  * IfxPsi5s_Psi5s_readFrame(&psi5sChannel, &frame))
123  *
124  * \endcode
125  *
126  * \defgroup IfxLld_Psi5s_Psi5s Psi5s
127  * \ingroup IfxLld_Psi5s
128  * \defgroup IfxLld_Psi5s_Psi5s_Structures Data Structures
129  * \ingroup IfxLld_Psi5s_Psi5s
130  * \defgroup IfxLld_Psi5s_Psi5s_Module Module Initialise Functions
131  * \ingroup IfxLld_Psi5s_Psi5s
132  * \defgroup IfxLld_Psi5s_Psi5s_Channel Channel Functions
133  * \ingroup IfxLld_Psi5s_Psi5s
134  * \defgroup IfxLld_Psi5s_Psi5s_Utility Utility Functions
135  * \ingroup IfxLld_Psi5s_Psi5s
136  */
137 
138 #ifndef IFXPSI5S_PSI5S_H
139 #define IFXPSI5S_PSI5S_H 1
140 
141 /******************************************************************************/
142 /*----------------------------------Includes----------------------------------*/
143 /******************************************************************************/
144 
145 #include "Psi5s/Std/IfxPsi5s.h"
146 
147 /******************************************************************************/
148 /*-----------------------------Data Structures--------------------------------*/
149 /******************************************************************************/
150 
151 /** \addtogroup IfxLld_Psi5s_Psi5s_Structures
152  * \{ */
153 /** \brief Clock configuration data structure
154  */
155 typedef struct
156 {
157  uint32 frequency; /**< \brief Specifies the frequency for the clock */
158  IfxPsi5s_DividerMode mode; /**< \brief Specifies the mode of division for the clock */
159  IfxPsi5s_ClockType type; /**< \brief Specifies the type of clock (fracDiv / timestamp) */
161 
162 /** \brief Received individual bits
163  */
164 typedef struct
165 {
166  uint8 xcrc : 6; /**< \brief Received XCRC */
167  uint8 xcrcError : 1; /**< \brief XCRC error flag */
168  uint8 crc : 3; /**< \brief Received CRC */
169  uint8 crcError : 1; /**< \brief CRC error flag */
170  uint8 errorFlag0 : 1; /**< \brief Error signalling flag 0 */
171  uint8 errorFlag1 : 1; /**< \brief Error signalling flag 1 */
172  uint8 headerErrorFlag : 1; /**< \brief Header error signalling flag */
173  uint8 ascParityErrorFlag : 1; /**< \brief ASC parity error flag */
174  uint8 ascFramingErrorFlag : 1; /**< \brief ASC framing error flag */
175  uint8 ascOverrunErrorFlag : 1; /**< \brief ASC overrun error flag */
176  uint8 watchdogTimeoutErrorFlag : 1; /**< \brief Watchdog timeout error flag */
177  uint8 receiveBufferOverflowFlag : 1; /**< \brief Receive buffer overflow flag */
178  uint8 frameId : 3; /**< \brief Frame ID */
179  uint8 channelId : 3; /**< \brief Channel ID */
180  uint8 actualUartFrameCount : 3; /**< \brief UART frames actually received */
181  uint8 packetFrameCount : 4; /**< \brief Packet frame count */
183 
184 /** \brief Receive data structure with different segments of data
185  */
186 typedef struct
187 {
188  uint32 readData : 28; /**< \brief Received data */
189  uint8 packetFrameCount; /**< \brief Packet frame count */
191 
192 /** \brief Received timestamp contents structure
193  */
194 typedef struct
195 {
196  uint8 packetFrameCount : 4; /**< \brief Packet frame count */
197  uint32 timestamp : 24; /**< \brief Received data */
199 
200 /** \} */
201 
202 /** \addtogroup IfxLld_Psi5s_Psi5s_Structures
203  * \{ */
204 /** \brief PSI5S handle data structure
205  */
206 typedef struct
207 {
208  Ifx_PSI5S *psi5s; /**< \brief Specifies the pointer to the PSI5S module registers */
210 
211 /** \brief PSI5S module configuration structure
212  */
213 typedef struct
214 {
215  boolean parityCheckEnabled; /**< \brief Specifies whether parity check is enabled or not */
216  boolean framingCheckEnabled; /**< \brief Specifies whether framing check is enabled or not */
217  boolean overrunCheckEnabled; /**< \brief Specifies whether overrun check is enabled or not */
218  boolean fractionalDividerEnabled; /**< \brief Specifies whether fractional divider is enabled or not */
219  boolean receiverOddParityEnabled; /**< \brief Specifies whether receiver parity check should be for even or odd */
220  boolean loopbackEnabled; /**< \brief Specifies whether loopback is enabled or not */
221  boolean transmitterOddParityEnabled; /**< \brief Specifies whether transmit parity generation should be even or odd */
222  uint32 baudrateFrequency; /**< \brief Specifies the baudrate frequency */
223  IfxPsi5s_AscStopBits stopBits; /**< \brief Specifies the number of stop bits */
224  IfxPsi5s_AscMode receiveMode; /**< \brief Specifies the mode of operation for ASC receiver */
225  IfxPsi5s_AscBaudratePrescalar baudrateSelection; /**< \brief Specifies whether divide-by-2 or divide-by-3 is selected for baudrate prescalar */
226  IfxPsi5s_AscMode transmitMode; /**< \brief Specifies the mode of operation for ASC transmitter */
227  IfxPsi5s_Psi5s_Clock clockOutput; /**< \brief Specifies the output clock properties */
229 
230 /** \brief channel trigger configuration structure
231  */
232 typedef struct
233 {
234  uint32 channelTriggerValue; /**< \brief Specifies the channel trigger value CTV */
235  uint32 channelTriggerCounter; /**< \brief Specifies the channel trigger counter */
237 
238 /** \brief PSI5S global control configuration structure
239  */
240 typedef struct
241 {
242  boolean ascOnlyMode; /**< \brief Specifies if the module is in ASC only mode */
243  boolean crcErrorConsideredForRSI; /**< \brief Specifies whether CRCI is considered for RSI assertion */
244  boolean xcrcErrorConsideredForRSI; /**< \brief Specifies whether XCRCI is considered for RSI assertion */
245  boolean transmitErrorConsideredForRSI; /**< \brief Specifies whether TEI is considered for RSI assertion */
246  boolean parityErrorConsideredForRSI; /**< \brief Specifies whether PE is considered for RSI assertion */
247  boolean framingErrorConsideredForRSI; /**< \brief Specifies whether FE is considered for RSI assertion */
248  boolean overrunErrorConsideredForRSI; /**< \brief Specifies whether OE is considered for RSI assertion */
249  boolean receiveBufferErrorConsideredForRSI; /**< \brief Specifies whether RBI is considered for RSI assertion */
250  boolean headerErrorConsideredForRSI; /**< \brief Specifies whether HDI is considered for RSI assertion */
251  uint32 idleTime; /**< \brief Specifies the number of stop bits in addition to last UART frame that is required for start of frame detection */
253 
254 /** \brief Structure for PSI5S pin configuration
255  */
256 typedef struct
257 {
258  const IfxPsi5s_Rx_In *rx; /**< \brief PSI5S Rx pin */
259  IfxPort_InputMode rxMode; /**< \brief Rx pin as input */
260  const IfxPsi5s_Tx_Out *tx; /**< \brief PSI5S Tx pin */
261  IfxPort_OutputMode txMode; /**< \brief Tx as output */
262  const IfxPsi5s_Sclk_Out *sclk; /**< \brief PSI5S Sclk Pin */
263  IfxPort_OutputMode sclkMode; /**< \brief Sclk as output */
264  IfxPort_PadDriver pinDriver; /**< \brief pad driver */
266 
267 /** \brief Sync pulse generation configuration structure
268  */
269 typedef struct
270 {
271  uint32 codeforZero; /**< \brief Specifies the code used to represent '0' - referred as TXCMD */
272  uint32 codeforOne; /**< \brief Specifies the code used to represent '1' - referred as ATXCMD */
273  IfxPsi5s_TimeBase timeBaseSelect; /**< \brief Specifies the clock source for CTV as internal or external */
274  IfxPsi5s_Trigger externalTimeBaseSelect; /**< \brief Specifies the clock source for CTV in the case of external */
275  IfxPsi5s_TriggerType periodicOrExternal; /**< \brief Specifies whether periodic trigger or external trigger or bypass is selected */
276  IfxPsi5s_Trigger externalTriggerSelect; /**< \brief Specifies the trigger source in case of external triggerring */
278 
279 /** \brief Receive control configuration structure - covers control fields from RCRA, RCRB and NFC registers
280  */
281 typedef struct
282 {
283  boolean timestampEnabled; /**< \brief Specifies whether the timestamp is enabled or not */
284  uint32 payloadLength[IFXPSI5S_SLOT_COUNT]; /**< \brief Specifies the payload length to be received for each slot */
285  IfxPsi5s_CrcOrParity crcOrParity[IFXPSI5S_SLOT_COUNT]; /**< \brief Specifies the crc or parity selection for the slots 0 to 5 */
286  IfxPsi5s_TimestampRegister timestampSelect; /**< \brief Specifies the timestamp register selection for pulses */
287  IfxPsi5s_TimestampTrigger timestampTriggerSelect; /**< \brief Specifies the timestamp register selection for pulses */
288  IfxPsi5s_FrameId frameIdSelect; /**< \brief Specifies if frame ID is updated from frame header or is a rolling number 0..5 copied from FCNT */
289  IfxPsi5s_WatchdogTimerMode watchdogTimerModeSelect; /**< \brief Specifies the watchdog timer restart is wrt frame or sync pulse reception */
290  IfxPsi5s_UartFrameCount uartFrameCount[IFXPSI5S_SLOT_COUNT]; /**< \brief Specifies the expected number of UART frames per packet frame for each slot */
291  IfxPsi5s_NumberExpectedFrames numberOfFramesExpected; /**< \brief Specifies the number of psi5s frames expected */
293 
294 /** \brief "Received data" data structure
295  */
296 typedef union
297 {
298  uint32 rdr; /**< \brief received data with frame count */
299  IfxPsi5s_Psi5s_ReceivedData receivedData; /**< \brief Receive data structure with different segments of data */
301 
302 /** \brief Receiver status data structure
303  */
304 typedef union
305 {
306  uint32 rds; /**< \brief received status data. */
307  IfxPsi5s_Psi5s_ReceivedBits receivedBits; /**< \brief Received individual bits */
309 
310 /** \brief Receiver timestamp data structure
311  */
312 typedef union
313 {
314  uint32 tsm; /**< \brief received timestamp along with frame count */
315  IfxPsi5s_Psi5s_Timestamp timeStamp; /**< \brief Received timestamp contents structure */
317 
318 /** \brief Timestamp configuration data structure
319  */
320 typedef struct
321 {
322  IfxPsi5s_Trigger externalTimeBaseSelect; /**< \brief Specifies the clock base for counter CTS in the case of external */
323  IfxPsi5s_TimeBase timeBaseSelect; /**< \brief Specifies the clock source for CTS as internal or external */
325 
326 /** \brief Transmit control configuration structure
327  */
328 typedef struct
329 {
330  boolean bitStuffControl; /**< \brief Specifies whether the bit stuffing is turned on or not */
331  boolean crcGenerationControl; /**< \brief Specifies whether the crc generation is turned on or not */
332  boolean startSequenceGenerationControl; /**< \brief Specifies whether the start sequence generation is turned on or not */
333  uint32 payloadLength; /**< \brief Specifies the payload length to be sent */
334  IfxPsi5s_EnhancedProtocol enhancedProtocolSelection; /**< \brief Specifies whether the enhanced protocol is selected or not */
336 
337 /** \} */
338 
339 /** \addtogroup IfxLld_Psi5s_Psi5s_Structures
340  * \{ */
341 /** \brief Channel handle data structure
342  */
343 typedef struct
344 {
345  IfxPsi5s_Psi5s *module; /**< \brief The PSI5S handle structure */
346  IfxPsi5s_ChannelId channelId; /**< \brief Specifies the channel index */
348 
349 /** \brief Channel configuration structure
350  */
351 typedef struct
352 {
353  const IfxPsi5s_Psi5s *module; /**< \brief Specifies pointer to the IfxPsi5s_Psi5s module handle */
354  uint32 watchdogTimerLimit; /**< \brief Specifies the watchdog timer limit for each of the slots 0 to 6 */
355  IfxPsi5s_ChannelId channelId; /**< \brief Specifies the channel index */
356  IfxPsi5s_Psi5s_PulseGeneration pulseGeneration; /**< \brief Specifies the configuration for sync pulse generation */
357  IfxPsi5s_Psi5s_ChannelTrigger channelTrigger; /**< \brief Specifies the configuration for channel trigger */
358  IfxPsi5s_Psi5s_ReceiveControl receiveControl; /**< \brief Specifies the configuration for reception */
359  IfxPsi5s_Psi5s_TransmitControl sendControl; /**< \brief Specifies the configuration for transmission */
361 
362 /** \brief PSI5S module configuration structure
363  */
364 typedef struct
365 {
366  Ifx_PSI5S *module; /**< \brief Specifies the pointer to the PSI5S module registers */
367  IfxPsi5s_Psi5s_Clock fracDiv; /**< \brief Specifies fractionally divided clock properties */
368  IfxPsi5s_Psi5s_Clock timestampClock; /**< \brief Specifies the time stamp clock properties */
369  IfxPsi5s_Psi5s_TimeStampConfig timestampCounterA; /**< \brief Specifies the time stamp counter A properties */
370  IfxPsi5s_Psi5s_TimeStampConfig timestampCounterB; /**< \brief Specifies the time stamp counter B properties */
371  IfxPsi5s_Psi5s_AscConfig ascConfig; /**< \brief Specifies the configuration for ASC */
372  IfxPsi5s_Psi5s_GlobalControlConfig globalControlConfig; /**< \brief Specifies the global control configuration */
373  const IfxPsi5s_Psi5s_Pins *pins; /**< \brief structure for PSI5S pin configuration */
375 
376 /** \brief Psi5s frame data structure
377  */
378 typedef struct
379 {
380  IfxPsi5s_Psi5s_ReceiveData data; /**< \brief Received data */
381  IfxPsi5s_Psi5s_ReceiveStatus status; /**< \brief Receiver status */
382  IfxPsi5s_Psi5s_ReceiveTimestamp timestamp; /**< \brief Receiver timestamp */
384 
385 /** \} */
386 
387 /** \addtogroup IfxLld_Psi5s_Psi5s_Module
388  * \{ */
389 
390 /******************************************************************************/
391 /*-------------------------Global Function Prototypes-------------------------*/
392 /******************************************************************************/
393 
394 /** \brief De-initialise the PSI5S module
395  * \param psi5s pointer to the PSI5S module
396  * \return None
397  */
399 
400 /** \brief Initialise the PSI5S with the supplied configureation
401  * \param psi5s pointer to the PSI5S module
402  * \param config pointer to the PSI5S configuration
403  * \return TRUE if valid otherwise FALSE
404  *
405  * Usage Example: \ref IfxPsi5s_Psi5s_sendChannelData
406  *
407  */
409 
410 /** \brief Initialise buffer with default PSI5S configuration
411  * \param config pointer to the PSI5S module configuration buffer
412  * \param psi5s pointer to the PSI5S register space
413  * \return None
414  *
415  * Usage Example: \ref IfxPsi5s_Psi5s_sendChannelData
416  *
417  */
419 
420 /** \} */
421 
422 /** \addtogroup IfxLld_Psi5s_Psi5s_Channel
423  * \{ */
424 
425 /******************************************************************************/
426 /*-------------------------Inline Function Prototypes-------------------------*/
427 /******************************************************************************/
428 
429 /** \brief Enable ASC interface receiver
430  * \param psi5s pointer to the PSI5S module
431  * \return None
432  *
433  * Usage Example: \ref IfxPsi5s_Psi5s_readFrame
434  *
435  */
437 
438 /** \brief Access function to enable/disable any combination of channel trigger counters selected by mask parameter
439  * \param psi5s pointer to the PSI5S module
440  * \param channels specifies the channel trigger counters which should be enabled/disabled
441  * \param mask specifies the channel trigger counters which should be modified
442  * \return None
443  *
444  * Usage Example: \ref IfxPsi5s_Psi5s_sendChannelData
445  *
446  */
448 
449 /** \brief Access function to enable/disable any combination of channels selected by mask parameter
450  * \param psi5s pointer to the PSI5S module
451  * \param channels specifies the channels which should be enabled/disabled
452  * \param mask specifies the channels which should be modified
453  * \return None
454  *
455  * Usage Example: \ref IfxPsi5s_Psi5s_sendChannelData
456  *
457  */
459 
460 /** \brief Start ASC transactions
461  * \param psi5s pointer to the PSI5S module
462  * \return None
463  *
464  * Usage Example: \ref IfxPsi5s_Psi5s_sendChannelData
465  *
466  */
468 
469 /******************************************************************************/
470 /*-------------------------Global Function Prototypes-------------------------*/
471 /******************************************************************************/
472 
473 /** \brief Initialize the channel with the supplied configuration
474  * \param channel pointer to the PSI5S channel
475  * \param config pointer to the PSI5S channel configuration
476  * \return TRUE on success & FALSE if configuration not valid (e.g. missing resource)
477  *
478  * Usage Example: \ref IfxPsi5s_Psi5s_sendChannelData
479  *
480  */
482 
483 /** \brief Initialise buffer with default channel configuration
484  * \param config pointer to the PSI5S channel configuration
485  * \param psi5s pointer to the PSI5S module
486  * \return None
487  *
488  * Usage Example: \ref IfxPsi5s_Psi5s_sendChannelData
489  *
490  */
492 
493 /** \brief Get the received psi5s frame for the channel
494  * \param channel pointer to the PSI5S module
495  * \param frame pointer to the PSI5S frame buffer
496  * \return TRUE if successful; FALSE if no frame available
497  *
498  * \code
499  * // initialize module pointer
500  * IfxPsi5s_Psi5s psi5s;
501  * psi5s.psi5s = &MODULE_PSI5S;
502  *
503  * // create module config
504  * IfxPsi5s_Psi5s_Config psi5sModuleConfig;
505  * IfxPsi5s_Psi5s_initModuleConfig(&psi5sModuleConfig, &psi5s);
506  *
507  * // create channel config
508  * IfxPsi5s_Psi5s_ChannelConfig psi5sChannelConfig;
509  * IfxPsi5s_Psi5s_initChannelConfig(&psi5sChannelConfig, &psi5s);
510  *
511  * // change payloadlength (default is 0, i.e., no frame expecte; change to 8)
512  * for(int slot=0; slot<6; ++slot)
513  * {
514  * psi5sChannelConfig.receiveControl.payloadLength[slot] = 8;
515  * }
516  * // change channel (default is channel 0, change to channel 4)
517  * psi5sChannelConfig.channelId = IfxPsi5s_ChannelId_4;
518  *
519  * // initialize the channel
520  * IfxPsi5s_Psi5s_Channel psi5sChannel;
521  * IfxPsi5s_Psi5s_initChannel(&psi5sChannel, &psi5sChannelConfig);
522  *
523  * uint32 channels = (1 << IfxPsi5s_ChannelId_4); // enable channel 4
524  * uint32 mask = (1 << IfxPsi5s_ChannelId_4); // modify the selection for channel 4
525  *
526  * // enable the channel
527  * IfxPsi5s_Psi5s_enableDisableChannels(&psi5s, channels, mask);
528  *
529  * // enable ASC receiver
530  * IfxPsi5s_Psi5s_enableAscReceiver(&psi5s);
531  *
532  * // start ASC interface
533  * IfxPsi5s_Psi5s_startAscTransactions(&psi5s);
534  *
535  * // add the code below to initiate the sensor to transmit frames
536  * // end of code to initiate the sensor to transmit frames
537  *
538  * // uncomment the below code after the adding the code to initiate the sensor to transmit frames
539  * // IfxPsi5s_Psi5s_Frame frame;
540  * // frame.status.rds = 0;
541  * // frame.data.rdr = 0;
542  * // frame.timestamp.tsm = 0;
543  * if(IfxPsi5s_Psi5s_readFrame(&psi5sChannel, &frame))
544  * // {
545  * // printf("RDS %x", frame.status.rds);
546  * // printf("RDR` %x", frame.data.rdr);
547  * // printf("TSM %x", frame.timestamp.tsm);
548  * // }
549  * \endcode
550  *
551  */
553 
554 /** \brief Transmit the data through the channel
555  * \param channel pointer to the PSI5S channel
556  * \param data data to be sent
557  * \return TRUE if Sends data otherwise FALSE
558  *
559  * \code
560  * // initialize module pointer
561  * IfxPsi5s_Psi5s psi5s;
562  * psi5s.psi5s = &MODULE_PSI5S;
563  *
564  * // create module config
565  * IfxPsi5s_Psi5s_Config psi5sModuleConfig;
566  * IfxPsi5s_Psi5s_initModuleConfig(&psi5sModuleConfig, &psi5s);
567  *
568  * // create channel config
569  * IfxPsi5s_Psi5s_ChannelConfig psi5sChannelConfig;
570  * IfxPsi5s_Psi5s_initChannelConfig(&psi5sChannelConfig, &psi5s);
571  * // change channel (default is channel 0, change to channel 4)
572  * psi5sChannelConfig.channelId = IfxPsi5s_ChannelId_4;
573  *
574  * // initialize the channel
575  * IfxPsi5s_Psi5s_Channel psi5sChannel;
576  * IfxPsi5s_Psi5s_initChannel(&psi5sChannel, &psi5sChannelConfig);
577  *
578  * uint32 channels = (1 << IfxPsi5s_ChannelId_4); // enable channel 4
579  * uint32 mask = (1 << IfxPsi5s_ChannelId_4); // modify the selection for channel 4
580  *
581  * // enable the channel trigger counter
582  * IfxPsi5s_Psi5s_enableDisableChannelTriggerCounters(&psi5s, channels, mask);
583  *
584  * // enable the channel
585  * IfxPsi5s_Psi5s_enableDisableChannels(&psi5s, channels, mask);
586  *
587  * // start ASC interface
588  * IfxPsi5s_Psi5s_startAscTransactions(&psi5s);
589  *
590  * uint32 data = 0x5;
591  * // send data
592  * if(IfxPsi5s_Psi5s_sendChannelData(&psi5sChannel, data))
593  * {
594  * // wait till data transfer is completed
595  * while(psi5s.psi5s->INTSTAT[IfxPsi5s_ChannelId_4].B.TPI == 0);
596  * }
597  * \endcode
598  *
599  */
601 
602 /** \} */
603 
604 /******************************************************************************/
605 /*---------------------Inline Function Implementations------------------------*/
606 /******************************************************************************/
607 
609 {
611 }
612 
613 
615 {
616  IfxPsi5s_enableDisableChannelTriggerCounters(psi5s->psi5s, channels, mask);
617 }
618 
619 
621 {
622  IfxPsi5s_enableDisableChannels(psi5s->psi5s, channels, mask);
623 }
624 
625 
627 {
629 }
630 
631 
632 #endif /* IFXPSI5S_PSI5S_H */