iLLD_TC27xC  1.0
IfxEray.h
Go to the documentation of this file.
1 /**
2  * \file IfxEray.h
3  * \brief ERAY basic functionality
4  * \ingroup IfxLld_Eray
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_Eray ERAY
25  * \ingroup IfxLld
26  * \defgroup IfxLld_Eray_Std Standard Driver
27  * \ingroup IfxLld_Eray
28  * \defgroup IfxLld_Eray_Std_Enumerations Enumerations
29  * \ingroup IfxLld_Eray_Std
30  * \defgroup IfxLld_Eray_Std_Interrupt Interrupt Functions
31  * \ingroup IfxLld_Eray_Std
32  * \defgroup IfxLld_Eray_Std_IO IO Pin Configuration Functions
33  * \ingroup IfxLld_Eray_Std
34  * \defgroup IfxLld_Eray_Std_Module Module Functions
35  * \ingroup IfxLld_Eray_Std
36  * \defgroup IfxLld_Eray_Std_Status Status Functions
37  * \ingroup IfxLld_Eray_Std
38  * \defgroup IfxLld_Eray_Std_Configuration Configuration Functions
39  * \ingroup IfxLld_Eray_Std
40  * \defgroup IfxLld_Eray_Std_Structures Data Structures
41  * \ingroup IfxLld_Eray_Std
42  * \defgroup IfxLld_Eray_Std_Operative Operative Functions
43  * \ingroup IfxLld_Eray_Std
44  */
45 
46 #ifndef IFXERAY_H
47 #define IFXERAY_H 1
48 
49 /******************************************************************************/
50 /*----------------------------------Includes----------------------------------*/
51 /******************************************************************************/
52 
53 #include "_Impl/IfxEray_cfg.h"
54 #include "_PinMap/IfxEray_PinMap.h"
55 #include "Src/Std/IfxSrc.h"
56 
57 /******************************************************************************/
58 /*--------------------------------Enumerations--------------------------------*/
59 /******************************************************************************/
60 
61 /** \addtogroup IfxLld_Eray_Std_Enumerations
62  * \{ */
63 /** \brief Baudrate on the flexray bus, defined in MODULE_ERAY0.PRTC1.B.BRP.
64  */
65 typedef enum
66 {
67  IfxEray_Baudrate_10 = 0, /**< \brief baudrate is 10MBits/Sec */
68  IfxEray_Baudrate_5 = 1, /**< \brief baudrate is 5MBits/Sec */
69  IfxEray_Baudrate_2_5 = 2 /**< \brief baudrate is 2.5MBits/Sec */
71 
72 /** \brief wheather transmit buffer or receive buffer, defined in MODULE_ERAY0.WRHS1.B.CFG.
73  */
74 typedef enum
75 {
76  IfxEray_BufferDirection_receive = 0, /**< \brief buffer is configured as receive buffer */
77  IfxEray_BufferDirection_transmit = 1 /**< \brief buffer is configured as transmit buffer */
79 
80 /** \brief Channel Id
81  */
82 typedef enum
83 {
84  IfxEray_Channel_a = 0, /**< \brief channel A */
85  IfxEray_Channel_b = 1 /**< \brief channel B */
87 
88 /** \brief Selection of error flag to clear defined in MODULE_ERAY.EIR.U
89  */
90 typedef enum
91 {
92  IfxEray_ClearErrorFlag_pemc = 1, /**< \brief POC error mode change bit. */
93  IfxEray_ClearErrorFlag_cna = 2, /**< \brief command not accepted event bit. */
94  IfxEray_ClearErrorFlag_sfbm = 4, /**< \brief sync frame below minimum bit. */
95  IfxEray_ClearErrorFlag_sfo = 8, /**< \brief sync frame overflow event bit */
96  IfxEray_ClearErrorFlag_ccf = 16, /**< \brief clock correction failure event. */
97  IfxEray_ClearErrorFlag_ccl = 32, /**< \brief CHI command locked event. */
98  IfxEray_ClearErrorFlag_eerr = 64, /**< \brief ECC error event bit. */
99  IfxEray_ClearErrorFlag_rfo = 128, /**< \brief RxFIFO overrun event bit. */
100  IfxEray_ClearErrorFlag_efa = 256, /**< \brief empty FIFO access event bit. */
101  IfxEray_ClearErrorFlag_iiba = 512, /**< \brief illegal input buffer access event. */
102  IfxEray_ClearErrorFlag_ioba = 1024, /**< \brief illegal output buffer access event. */
103  IfxEray_ClearErrorFlag_mhf = 2048, /**< \brief message handler constraint flag. */
104  IfxEray_ClearErrorFlag_eda = 65536, /**< \brief error event on channel A. */
105  IfxEray_ClearErrorFlag_ltva = 131072, /**< \brief latest transmit violation flag on channel A . */
106  IfxEray_ClearErrorFlag_taba = 262144, /**< \brief transmission across channel A boundary flag. */
107  IfxEray_ClearErrorFlag_edb = 16777216, /**< \brief error event on channel B. */
108  IfxEray_ClearErrorFlag_ltvb = 33554432, /**< \brief latest transmit violation flag on channel B . */
109  IfxEray_ClearErrorFlag_tabb = 67108864 /**< \brief transmission across channel B boundary flag. */
111 
112 /** \brief Selection of status flag to clear defined in MODULE_ERAY.SIR.U
113  */
114 typedef enum
115 {
116  IfxEray_ClearStatusFlag_wst = 1, /**< \brief wakeup status bit. */
117  IfxEray_ClearStatusFlag_cas = 2, /**< \brief collision avoidance bit. */
118  IfxEray_ClearStatusFlag_cycs = 4, /**< \brief cycle start service bit. */
119  IfxEray_ClearStatusFlag_txi = 8, /**< \brief transmit service request bit. */
120  IfxEray_ClearStatusFlag_rxi = 16, /**< \brief receive service request bit. */
121  IfxEray_ClearStatusFlag_rfne = 32, /**< \brief receive fifo not empty bit. */
122  IfxEray_ClearStatusFlag_rfcl = 64, /**< \brief RxFIFO critical level reached bit. */
123  IfxEray_ClearStatusFlag_nmvc = 128, /**< \brief network management vector bit. */
124  IfxEray_ClearStatusFlag_ti0 = 256, /**< \brief timer0 service request bit. */
125  IfxEray_ClearStatusFlag_ti1 = 512, /**< \brief timer1 service request bit. */
126  IfxEray_ClearStatusFlag_tibc = 1024, /**< \brief transfer input buffer completion request bit. */
127  IfxEray_ClearStatusFlag_tobc = 2048, /**< \brief transfer output buffer completion request bit. */
128  IfxEray_ClearStatusFlag_swe = 4096, /**< \brief stop watch event bit. */
129  IfxEray_ClearStatusFlag_sucs = 8192, /**< \brief startup success event bit. */
130  IfxEray_ClearStatusFlag_mbsi = 16384, /**< \brief message buffer service status bit. */
131  IfxEray_ClearStatusFlag_sds = 32768, /**< \brief dynamic segment start bit. */
132  IfxEray_ClearStatusFlag_wupa = 65536, /**< \brief wakeup pattern channel A bit. */
133  IfxEray_ClearStatusFlag_mtsa = 131072, /**< \brief MTS receive channel A bit. */
134  IfxEray_ClearStatusFlag_wupb = 16777216, /**< \brief wakeup pattern channel B bit. */
135  IfxEray_ClearStatusFlag_mtsb = 33554432 /**< \brief MTS receive channel B bit. */
137 
138 /** \brief Clock divider in RUN mode, defined in MODULE_ERAY0.B.RMC.
139  */
140 typedef enum
141 {
142  IfxEray_ClockDivider_none = 0, /**< \brief no clock signal */
143  IfxEray_ClockDivider_1 = 1, /**< \brief run mode clock divider 1 */
144  IfxEray_ClockDivider_2, /**< \brief run mode clock divider 2 */
145  IfxEray_ClockDivider_3, /**< \brief run mode clock divider 3 */
146  IfxEray_ClockDivider_4, /**< \brief run mode clock divider 4 */
147  IfxEray_ClockDivider_5, /**< \brief run mode clock divider 5 */
148  IfxEray_ClockDivider_6, /**< \brief run mode clock divider 6 */
149  IfxEray_ClockDivider_7, /**< \brief run mode clock divider 7 */
151 
152 /** \brief External offset correction control defined in MODULE_ERAY0.GTU11.B.EOCC.
153  */
154 typedef enum
155 {
156  IfxEray_ExternalOffset_noCorrection = 1, /**< \brief No external correction control. */
157  IfxEray_ExternalOffset_correctionSubtracted = 2, /**< \brief External offset correction subtracted from calculated correction. */
158  IfxEray_ExternalOffset_correctionAdded = 3 /**< \brief External offset correction added to calculated correction. */
160 
161 /** \brief External clock offset correction value defined in MODULE_ERAY0.GTU11.B.EOC.
162  */
163 typedef enum
164 {
165  IfxEray_ExternalOffsetCorrection_0 = 0, /**< \brief external clock offset correction value 0 */
166  IfxEray_ExternalOffsetCorrection_1, /**< \brief external clock offset correction value 1 */
167  IfxEray_ExternalOffsetCorrection_2, /**< \brief external clock offset correction value 2 */
168  IfxEray_ExternalOffsetCorrection_3, /**< \brief external clock offset correction value 3 */
169  IfxEray_ExternalOffsetCorrection_4, /**< \brief external clock offset correction value 4 */
170  IfxEray_ExternalOffsetCorrection_5, /**< \brief external clock offset correction value 5 */
171  IfxEray_ExternalOffsetCorrection_6, /**< \brief external clock offset correction value 6 */
172  IfxEray_ExternalOffsetCorrection_7, /**< \brief external clock offset correction value 7 */
174 
175 /** \brief External rate correction control MODULE_ERAY0.GTU11.B.ERCC.
176  */
177 typedef enum
178 {
179  IfxEray_ExternalRate_noCorrection = 1, /**< \brief No external correction control. */
180  IfxEray_ExternalRate_correctionSubtracted = 2, /**< \brief External rate correction subtracted from calculated correction. */
181  IfxEray_ExternalRate_correctionAdded = 3 /**< \brief External rate correction added to calculated correction. */
183 
184 /** \brief External clock rate correction value defined in MODULE_ERAY0.GTU11.B.ERC.
185  */
186 typedef enum
187 {
188  IfxEray_ExternalRateCorrection_0 = 0, /**< \brief external clock rate correction value 0 */
189  IfxEray_ExternalRateCorrection_1, /**< \brief external clock rate correction value 1 */
190  IfxEray_ExternalRateCorrection_2, /**< \brief external clock rate correction value 2 */
191  IfxEray_ExternalRateCorrection_3, /**< \brief external clock rate correction value 3 */
192  IfxEray_ExternalRateCorrection_4, /**< \brief external clock rate correction value 4 */
193  IfxEray_ExternalRateCorrection_5, /**< \brief external clock rate correction value 5 */
194  IfxEray_ExternalRateCorrection_6, /**< \brief external clock rate correction value 6 */
195  IfxEray_ExternalRateCorrection_7, /**< \brief external clock rate correction value 7 */
197 
198 /** \brief Duration of dynamic slot idle phase, defined in MODULE_ERAY0.B.DSI.
199  */
200 typedef enum
201 {
202  IfxEray_IdleDynamicSlots_0 = 0, /**< \brief duration of dynamic slot idle phase is 0 */
203  IfxEray_IdleDynamicSlots_1, /**< \brief duration of dynamic slot idle phase is 1 */
204  IfxEray_IdleDynamicSlots_2, /**< \brief duration of dynamic slot idle phase is 2 */
206 
207 /** \brief Wakeup or Startup listen timeout in presence of noise, defined in MODULE_ERAY0.SUCC2.B.LTN.
208  */
209 typedef enum
210 {
211  IfxEray_ListenTimeOutNoise_2 = 1, /**< \brief listen Time-out noise 2 */
212  IfxEray_ListenTimeOutNoise_3, /**< \brief listen Time-out noise 3 */
213  IfxEray_ListenTimeOutNoise_4, /**< \brief listen Time-out noise 4 */
214  IfxEray_ListenTimeOutNoise_5, /**< \brief listen Time-out noise 5 */
215  IfxEray_ListenTimeOutNoise_6, /**< \brief listen Time-out noise 6 */
216  IfxEray_ListenTimeOutNoise_7, /**< \brief listen Time-out noise 7 */
217  IfxEray_ListenTimeOutNoise_8, /**< \brief listen Time-out noise 8 */
218  IfxEray_ListenTimeOutNoise_9, /**< \brief listen Time-out noise 9 */
219  IfxEray_ListenTimeOutNoise_10, /**< \brief listen Time-out noise 10 */
220  IfxEray_ListenTimeOutNoise_11, /**< \brief listen Time-out noise 11 */
221  IfxEray_ListenTimeOutNoise_12, /**< \brief listen Time-out noise 12 */
222  IfxEray_ListenTimeOutNoise_13, /**< \brief listen Time-out noise 13 */
223  IfxEray_ListenTimeOutNoise_14, /**< \brief listen Time-out noise 14 */
224  IfxEray_ListenTimeOutNoise_15, /**< \brief listen Time-out noise 15 */
225  IfxEray_ListenTimeOutNoise_16, /**< \brief listen Time-out noise 16 */
227 
228 /** \brief Maximum number of sync frames in a cluster defined in MODULE_ERAY0.GTU02.B.SNM.
229  */
230 typedef enum
231 {
232  IfxEray_MaxSynchFrames_2 = 2, /**< \brief Maximum number of sync frames in a cluster are 2 */
233  IfxEray_MaxSynchFrames_3, /**< \brief Maximum number of sync frames in a cluster are 3 */
234  IfxEray_MaxSynchFrames_4, /**< \brief Maximum number of sync frames in a cluster are 4 */
235  IfxEray_MaxSynchFrames_5, /**< \brief Maximum number of sync frames in a cluster are 5 */
236  IfxEray_MaxSynchFrames_6, /**< \brief Maximum number of sync frames in a cluster are 6 */
237  IfxEray_MaxSynchFrames_7, /**< \brief Maximum number of sync frames in a cluster are 7 */
238  IfxEray_MaxSynchFrames_8, /**< \brief Maximum number of sync frames in a cluster are 8 */
239  IfxEray_MaxSynchFrames_9, /**< \brief Maximum number of sync frames in a cluster are 9 */
240  IfxEray_MaxSynchFrames_10, /**< \brief Maximum number of sync frames in a cluster are 10 */
241  IfxEray_MaxSynchFrames_11, /**< \brief Maximum number of sync frames in a cluster are 11 */
242  IfxEray_MaxSynchFrames_12, /**< \brief Maximum number of sync frames in a cluster are 12 */
243  IfxEray_MaxSynchFrames_13, /**< \brief Maximum number of sync frames in a cluster are 13 */
244  IfxEray_MaxSynchFrames_14, /**< \brief Maximum number of sync frames in a cluster are 14 */
245  IfxEray_MaxSynchFrames_15, /**< \brief Maximum number of sync frames in a cluster are 15 */
247 
248 /** \brief Commmand to control the Communication, defined in MODULE_ERAY0.SUCC1.B.CMD.
249  */
250 typedef enum
251 {
252  IfxEray_PocCommand_notAccepted = 0, /**< \brief command not accepted. */
253  IfxEray_PocCommand_config = 1, /**< \brief command to controller to enter CONFIG */
254  IfxEray_PocCommand_ready = 2, /**< \brief command to controller to enter READY. */
255  IfxEray_PocCommand_wakeup = 3, /**< \brief command to controller to enter WAKEUP */
256  IfxEray_PocCommand_run = 4, /**< \brief command to controller to enter RUN */
257  IfxEray_PocCommand_allSlots = 5, /**< \brief command to controller to enter ALL_SLOTS */
258  IfxEray_PocCommand_halt = 6, /**< \brief command to controller to enter HALT */
259  IfxEray_PocCommand_freeze = 7, /**< \brief command to controller to enter FREEZE */
260  IfxEray_PocCommand_sendMts = 8, /**< \brief command to controller to enter SEND_MTS */
261  IfxEray_PocCommand_coldStart = 9, /**< \brief command to controller to enter COLD_START */
262  IfxEray_PocCommand_reset = 10, /**< \brief command to controller to enter RESET */
263  IfxEray_PocCommand_monitor = 11, /**< \brief command to controller to enter MONITOR */
264  IfxEray_PocCommand_clearRam = 12 /**< \brief command to controller to enter CLEAR_RAM */
266 
267 /** \brief State of Communication Controller Protocol operation control, defined in MODULE_ERAY0.CCSV.B.POCS.
268  */
269 typedef enum
270 {
271  IfxEray_PocState_defaultConfig = 0, /**< \brief controller entered default config state */
272  IfxEray_PocState_ready = 1, /**< \brief controller entered ready state */
273  IfxEray_PocState_normalActive = 2, /**< \brief controller entered normal-active state */
274  IfxEray_PocState_normalPassive = 3, /**< \brief controller entered normal-passive state */
275  IfxEray_PocState_halt = 4, /**< \brief controller entered halt state */
276  IfxEray_PocState_monitor = 5, /**< \brief controller entered monitor state */
277  IfxEray_PocState_config = 15, /**< \brief controller entered config state */
278  IfxEray_PocState_wakeupStandby = 16, /**< \brief controller entered wakeup standby state */
279  IfxEray_PocState_wakeupListen = 17, /**< \brief controller entered wakeup-listen state */
280  IfxEray_PocState_wakeupSend = 18, /**< \brief controller entered wakeup-send state */
281  IfxEray_PocState_wakeupDetect = 19, /**< \brief controller entered wakeup-detection state */
282  IfxEray_PocState_startup = 32, /**< \brief controller entered startup state */
283  IfxEray_PocState_coldStartListen = 33, /**< \brief controller entered clod-start listen state */
284  IfxEray_PocState_collisionResolution = 34, /**< \brief controller entered collission-resolution state. */
285  IfxEray_PocState_consistencyCheck = 35, /**< \brief controller entered consistency-check. */
286  IfxEray_PocState_gap = 36, /**< \brief controller entered gap state. */
287  IfxEray_PocState_join = 37, /**< \brief controller entered join state. */
288  IfxEray_PocState_integrationCheck = 38, /**< \brief controller entered integration-check. */
289  IfxEray_PocState_integrationListen = 39, /**< \brief controller entered integration-listen state. */
290  IfxEray_PocState_integrationConsistencyCheck = 40, /**< \brief controller entered integration consistency check state */
291  IfxEray_PocState_initializeSchedule = 41, /**< \brief controller entered initialise schedule state */
292  IfxEray_PocState_staruAborted = 42, /**< \brief controller entered startup-abort state */
293  IfxEray_PocState_startupSucced = 43 /**< \brief controller entered startup succeed state. */
295 
296 /** \brief Receiving channel, defined in MODULE_ERAY0.FRF.B.CH.
297  */
298 typedef enum
299 {
300  IfxEray_ReceiveChannel_both = 0, /**< \brief both channels for reception */
301  IfxEray_ReceiveChannel_b = 1, /**< \brief channel A for reception */
302  IfxEray_ReceiveChannel_a = 2, /**< \brief channel B for reception */
303  IfxEray_ReceiveChannel_none = 3 /**< \brief none channels for reception */
305 
306 /** \brief Sample count value for strobing, defined in MODULE_ERAY0.PRTC1.B.SPP.
307  */
308 typedef enum
309 {
310  IfxEray_StrobePosition_5 = 0, /**< \brief Sample count 5 for strobing */
311  IfxEray_StrobePosition_4 = 1, /**< \brief Sample count 4 for strobing */
312  IfxEray_StrobePosition_6 = 2 /**< \brief Sample count 6 for strobing */
314 
315 /** \brief Transmission mode of Header, defined in MODULE_ERAY0.WRHS1.B.TXM.
316  */
317 typedef enum
318 {
319  IfxEray_TransmissionMode_continuous = 0, /**< \brief continuos transmission mode */
320  IfxEray_TransmissionMode_singleShot = 1 /**< \brief single transmission mode */
322 
323 /** \brief Initial transmission mode, defined in MODULE_ERAY0.SUCC1.B.TSM.
324  */
325 typedef enum
326 {
327  IfxEray_TransmissionSlotMode_all = 0, /**< \brief transmission in all slots. */
328  IfxEray_TransmissionSlotMode_single = 1 /**< \brief transmission in key slot. */
330 
331 /** \brief Wakeup pattern carry channel, defined in MODULE_ERAY0.SUCC1.B.WUCS.
332  */
333 typedef enum
334 {
335  IfxEray_WakeupChannel_a = 0, /**< \brief send wakeup channel pattern on channel A */
336  IfxEray_WakeupChannel_b = 1 /**< \brief send wakeup channel pattern on channel B */
338 
339 /** \} */
340 
341 /******************************************************************************/
342 /*-----------------------------Data Structures--------------------------------*/
343 /******************************************************************************/
344 
345 /** \addtogroup IfxLld_Eray_Std_Structures
346  * \{ */
347 /** \brief Header section in a frame.
348  */
349 typedef struct
350 {
351  uint16 frameId; /**< \brief slot ID of the selected Message Buffer. */
352  uint8 cycleCode; /**< \brief the cycle set used for cycle counter filtering. */
353  boolean channelAFiltered; /**< \brief channel A serves as a control for transmit and filter for receive buffers. */
354  boolean channelBFiltered; /**< \brief channel B serves as a control for transmit and filter for receive buffers. */
355  IfxEray_BufferDirection bufferDirection; /**< \brief selects buffer as a transmit buffer or as a receive buffer. */
356  boolean transmitPayloadIndicatior; /**< \brief weather payload indicator is set or not. */
357  IfxEray_TransmissionMode transmissionMode; /**< \brief transmission mode of Header. */
358  boolean bufferServiceEnabled; /**< \brief wether buffer service request is enabled or not. */
359  uint8 payloadLength; /**< \brief length of data section. */
360  uint16 dataPointer; /**< \brief pointer to the data section of message buffer in RAM. */
361  boolean startupFrameIndicator; /**< \brief whether startup frame is indicated or not. */
362  boolean syncFrameIndicator; /**< \brief whether sync frame is indicated or not. */
364 
365 /** \brief Received header in a frame.
366  */
367 typedef struct
368 {
369  uint16 frameId : 11; /**< \brief received frame id. */
370  uint8 payloadLength : 7; /**< \brief received payload length. */
371  uint16 headerCrc : 11; /**< \brief received header crc. */
372  uint8 reservedBit : 1; /**< \brief state of the received reserved bit. */
373  uint8 nullFrameIndicator : 1; /**< \brief 0 : no data frame received; 1: atleast one data frame received. */
374  uint8 syncFrame : 1; /**< \brief 0 : received frame is not a synch frame ; 1 : receive frame is a synch frame. */
375  uint8 startupFrame : 1; /**< \brief 0 : received frame is not a startup frame ; 1 : receive frame is a startup frame. */
376  uint8 cycleNumber : 7; /**< \brief cycle number in which frame is received. */
377  uint8 payloadPreambleIndicator : 1; /**< \brief 1 : received payload segment has network management and message id or not; 0 : It hasn't. */
379 
380 /** \brief Transmit control structure.
381  */
382 typedef struct
383 {
384  boolean headerTransfered; /**< \brief whether header is transfered from input buffers to Message RAM or not. */
385  boolean dataTransfered; /**< \brief whether data is transfered from input buffers to Message RAM or not. */
386  boolean transferRequested; /**< \brief transmit buffer released for transmission or not. */
387  uint8 bufferIndex; /**< \brief buffer index in the Message RAM. */
389 
390 /** \} */
391 
392 /** \addtogroup IfxLld_Eray_Std_Interrupt
393  * \{ */
394 
395 /******************************************************************************/
396 /*-------------------------Inline Function Prototypes-------------------------*/
397 /******************************************************************************/
398 
399 /** \brief Clears the error flag requested.
400  * \param eray pointer to ERAY module registers.
401  * \param errorFlag error flag to be cleared.
402  * \return None
403  */
404 IFX_INLINE void IfxEray_clearErrorFlag(Ifx_ERAY *eray, IfxEray_ClearErrorFlag errorFlag);
405 
406 /** \brief Clears the status flag requested.
407  * \param eray pointer to ERAY module registers.
408  * \param statusFlag status flag to be cleared.
409  * \return None
410  */
411 IFX_INLINE void IfxEray_clearStatusFlag(Ifx_ERAY *eray, IfxEray_ClearStatusFlag statusFlag);
412 
413 /** \brief Gets the error interrupt flags.
414  * \param eray pointer to ERAY module registers.
415  * \return error interrupt flags.
416  */
417 IFX_INLINE Ifx_ERAY_EIR IfxEray_getErrorInterrupts(Ifx_ERAY *eray);
418 
419 /** \brief Gets the IBUSY service request.
420  * \param eray pointer to ERAY module registers.
421  * \return address of IBUSY service request value.
422  */
423 IFX_INLINE volatile Ifx_SRC_SRCR *IfxEray_getInputBufferBusySrcPtr(Ifx_ERAY *eray);
424 
425 /** \brief Gets the INT0 service request.
426  * \param eray pointer to ERAY module registers.
427  * \return address of INT0 service request value.
428  */
429 IFX_INLINE volatile Ifx_SRC_SRCR *IfxEray_getInterruptLine0SrcPtr(Ifx_ERAY *eray);
430 
431 /** \brief Gets the INT1 service request.
432  * \param eray pointer to ERAY module registers.
433  * \return address of INT1 service request value.
434  */
435 IFX_INLINE volatile Ifx_SRC_SRCR *IfxEray_getInterruptLine1SrcPtr(Ifx_ERAY *eray);
436 
437 /** \brief Gets the message buffers interrupt status.
438  * \param eray pointer to ERAY module registers.
439  * \param messageBuffer message buffer to which interrupt status be checked.
440  * \return message buffer interrupt status.
441  */
442 IFX_INLINE boolean IfxEray_getMessageBufferInterruptStatus(Ifx_ERAY *eray, uint8 messageBuffer);
443 
444 /** \brief Gets the MBSC0 service request.
445  * \param eray pointer to ERAY module registers.
446  * \return address of MBSC0 service request value.
447  */
448 IFX_INLINE volatile Ifx_SRC_SRCR *IfxEray_getMessageBufferStatus0SrcPtr(Ifx_ERAY *eray);
449 
450 /** \brief Gets the MBSC1 service request.
451  * \param eray pointer to ERAY module registers.
452  * \return address of MBSC1 service request value.
453  */
454 IFX_INLINE volatile Ifx_SRC_SRCR *IfxEray_getMessageBufferStatus1SrcPtr(Ifx_ERAY *eray);
455 
456 /** \brief Gets the NDAT0 service request.
457  * \param eray pointer to ERAY module registers.
458  * \return address of NDAT0 service request value.
459  */
460 IFX_INLINE volatile Ifx_SRC_SRCR *IfxEray_getNewDataInterrupt0SrcPtr(Ifx_ERAY *eray);
461 
462 /** \brief Gets the NDAT1 service request.
463  * \param eray pointer to ERAY module registers.
464  * \return address of NDAT1 service request value.
465  */
466 IFX_INLINE volatile Ifx_SRC_SRCR *IfxEray_getNewDataInterrupt1SrcPtr(Ifx_ERAY *eray);
467 
468 /** \brief Gets the new data interrupt buffers status.
469  * \param eray pointer to ERAY module registers.
470  * \param ndat message buffer number configured to which ndat occurs.
471  * \return ndat interrupt buffer.
472  */
473 IFX_INLINE boolean IfxEray_getNewDataInterruptStatus(Ifx_ERAY *eray, uint8 ndat);
474 
475 /** \brief Gets the OBUSY service request.
476  * \param eray pointer to ERAY module registers.
477  * \return address of OBUSY service request value.
478  */
479 IFX_INLINE volatile Ifx_SRC_SRCR *IfxEray_getOutputBufferBusySrcPtr(Ifx_ERAY *eray);
480 
481 /** \brief Gets the status interrupt flags.
482  * \param eray pointer to ERAY module registers.
483  * \return status interrupt flags.
484  */
485 IFX_INLINE Ifx_ERAY_SIR IfxEray_getStatusInterrupts(Ifx_ERAY *eray);
486 
487 /** \brief Gets the TINT0 service request.
488  * \param eray pointer to ERAY module registers.
489  * \return address of TINT0 service request value.
490  */
491 IFX_INLINE volatile Ifx_SRC_SRCR *IfxEray_getTimerInterrupt0SrcPtr(Ifx_ERAY *eray);
492 
493 /** \brief Gets the TINT1 service request.
494  * \param eray pointer to ERAY module registers.
495  * \return address of TINT1 service request value.
496  */
497 IFX_INLINE volatile Ifx_SRC_SRCR *IfxEray_getTimerInterrupt1SrcPtr(Ifx_ERAY *eray);
498 
499 /******************************************************************************/
500 /*-------------------------Global Function Prototypes-------------------------*/
501 /******************************************************************************/
502 
503 /** \brief Clears all the error flags.
504  * \param eray pointer to ERAY module registers.
505  * \return None
506  */
507 IFX_EXTERN void IfxEray_clearAllFlags(Ifx_ERAY *eray);
508 
509 /** \brief Enables all the Interrupt lines.
510  * \param eray pointer to ERAY module registers.
511  * \return None
512  */
513 IFX_EXTERN void IfxEray_enableInterruptLines(Ifx_ERAY *eray);
514 
515 /** \brief Selects between MBSC0 and MBSC1 interrupt destination
516  * \param eray pointer to ERAY module registers.
517  * \param messageBuffer message buffer interrupt which should be configured
518  * \param messageBufferDestination selects MBSC0 or MBSC1 interrupt output
519  * \return None
520  */
521 IFX_EXTERN void IfxEray_setMessageBufferInterruptDestination(Ifx_ERAY *eray, uint8 messageBuffer, uint8 messageBufferDestination);
522 
523 /** \brief Selects between NDAT0 and NDAT1 interrupt destination
524  * \param eray pointer to ERAY module registers.
525  * \param ndat NDAT interrupt which should be configured
526  * \param ndatDestination selects NDAT0 or NDAT1 interrupt output
527  * \return None
528  */
529 IFX_EXTERN void IfxEray_setNewDataInterruptDestination(Ifx_ERAY *eray, uint8 ndat, uint8 ndatDestination);
530 
531 /** \} */
532 
533 /** \addtogroup IfxLld_Eray_Std_IO
534  * \{ */
535 
536 /******************************************************************************/
537 /*-------------------------Inline Function Prototypes-------------------------*/
538 /******************************************************************************/
539 
540 /** \brief Initialises a RX pin.
541  * \param rx the RX Pin which should be configured.
542  * \param rxMode the pin input mode which should be configured.
543  * \return None
544  */
546 
547 /** \brief Initializes a TX Enable output.
548  * \param txEn the TX Enable Pin which should be configured.
549  * \param txEnMode the pin output mode which should be configured.
550  * \param padDriver the pad driver mode which should be configured.
551  * \return None
552  */
554 
555 /** \brief Initializes a TX output.
556  * \param tx the TX Pin which should be configured.
557  * \param txMode the pin output mode which should be configured.
558  * \param padDriver the pad driver mode which should be configured.
559  * \return None
560  */
562 
563 /** \} */
564 
565 /** \addtogroup IfxLld_Eray_Std_Module
566  * \{ */
567 
568 /******************************************************************************/
569 /*-------------------------Inline Function Prototypes-------------------------*/
570 /******************************************************************************/
571 
572 /** \brief Enables the ERAY module.
573  * \param eray pointer to ERAY module registers.
574  * \return None
575  */
576 IFX_INLINE void IfxEray_enableModule(Ifx_ERAY *eray);
577 
578 /******************************************************************************/
579 /*-------------------------Global Function Prototypes-------------------------*/
580 /******************************************************************************/
581 
582 /** \brief Resets the ERAY kernel.
583  * \param eray pointer to ERAY module registers.
584  * \return None
585  */
586 IFX_EXTERN void IfxEray_resetModule(Ifx_ERAY *eray);
587 
588 /** \} */
589 
590 /** \addtogroup IfxLld_Eray_Std_Status
591  * \{ */
592 
593 /******************************************************************************/
594 /*-------------------------Inline Function Prototypes-------------------------*/
595 /******************************************************************************/
596 
597 /** \brief Gets the FIFO status.
598  * \param eray pointer to ERAY module registers.
599  * \return FIFO status.
600  */
601 IFX_INLINE Ifx_ERAY_FSR IfxEray_getFifoStatus(Ifx_ERAY *eray);
602 
603 /** \brief Gets the Input Buffer Host Busy status.
604  * \param eray pointer to ERAY module registers.
605  * \return TRUE if Host is Busy otherwise FALSE.
606  */
607 IFX_INLINE boolean IfxEray_getInputBufferBusyHostStatus(Ifx_ERAY *eray);
608 
609 /** \brief Gets the Input Buffer Shadow status.
610  * \param eray pointer to ERAY module registers.
611  * \return TRUE if busy otherwise FALSE
612  */
614 
615 /** \brief Gets the output buffer index.
616  * \param eray pointer to ERAY module registers.
617  * \return output buffer index.
618  */
620 
621 /** \brief Gets the Output Buffer Shadow status.
622  * \param eray pointer to ERAY module registers.
623  * \return TRUE if busy otherwise FALSE
624  */
626 
627 /** \brief Gets the current POC state.
628  * \param eray pointer to ERAY module registers.
629  * \return current POC state.
630  */
632 
633 /** \brief Gets the received wakeup pattern channel.
634  * \param eray pointer to ERAY module registers.
635  * \return received wakeup pattern channel.
636  */
638 
639 /** \brief Waits until the controller enters required POC state.
640  * \param eray pointer to ERAY module registers.
641  * \param pocState POC state upto which controller waits.
642  * \return None
643  */
644 IFX_INLINE void IfxEray_waitForPocState(Ifx_ERAY *eray, IfxEray_PocState pocState);
645 
646 /******************************************************************************/
647 /*-------------------------Global Function Prototypes-------------------------*/
648 /******************************************************************************/
649 
650 /** \brief Changes the Commmunication Controller state.
651  * \param eray pointer to ERAY module registers.
652  * \param pocCommand POC command which triggers the Controller state.
653  * \return TRUE if command accepted otherwise FALSE.
654  */
655 IFX_EXTERN boolean IfxEray_changePocState(Ifx_ERAY *eray, IfxEray_PocCommand pocCommand);
656 
657 /** \brief Sets the POC state to Ready state.
658  * \param eray pointer to ERAY module registers.
659  * \return None
660  */
661 IFX_EXTERN void IfxEray_setPocReady(Ifx_ERAY *eray);
662 
663 /** \} */
664 
665 /** \addtogroup IfxLld_Eray_Std_Configuration
666  * \{ */
667 
668 /******************************************************************************/
669 /*-------------------------Inline Function Prototypes-------------------------*/
670 /******************************************************************************/
671 
672 /** \brief request to receive header section from message buffer.
673  * \param eray pointer to ERAY module registers.
674  * \param headerReceived whether header is received or not.
675  * \return None
676  */
677 IFX_INLINE void IfxEray_receiveHeader(Ifx_ERAY *eray, boolean headerReceived);
678 
679 /** \brief sets the bit to send header in frame.
680  * \param eray pointer to ERAY module registers.
681  * \param headerTransfered whether header transfered or not.
682  * \return None
683  */
684 IFX_INLINE void IfxEray_sendHeader(Ifx_ERAY *eray, boolean headerTransfered);
685 
686 /** \brief Sets number of cycle pairs for Active state.
687  * \param eray pointer to ERAY module registers.
688  * \param numberOfCyclePairsForActive number of cycle pairs for Active state.
689  * \return None
690  */
691 IFX_INLINE void IfxEray_setActiveCyclePairs(Ifx_ERAY *eray, uint8 numberOfCyclePairsForActive);
692 
693 /** \brief Sets auto delays between input, output buffers and message RAM
694  * \param eray pointer to ERAY module registers.
695  * \return None
696  */
697 IFX_INLINE void IfxEray_setAutoDelayBuffers(Ifx_ERAY *eray);
698 
699 /** \brief Sets baudrate on Flexray bus.
700  * \param eray pointer to ERAY module registers.
701  * \param baudrate baudrate on flexray bus.
702  * \return None
703  */
704 IFX_INLINE void IfxEray_setBaudrate(Ifx_ERAY *eray, IfxEray_Baudrate baudrate);
705 
706 /** \brief Sets secured buffers in message RAM.
707  * \param eray pointer to ERAY module registers.
708  * \param secureValue secure value.
709  * \return None
710  */
711 IFX_INLINE void IfxEray_setBufferReconfigSecure(Ifx_ERAY *eray, uint8 secureValue);
712 
713 /** \brief Sets channel A initial offstes.
714  * \param eray pointer to ERAY module registers.
715  * \param channelAMicrotickInitialOffset difference between reference points on channel A in microticks.
716  * \param channelAMacrotickInitialOffset difference between reference points on channel A in macroticks.
717  * \return None
718  */
719 IFX_INLINE void IfxEray_setChannelAInitialOffsets(Ifx_ERAY *eray, uint8 channelAMicrotickInitialOffset, uint8 channelAMacrotickInitialOffset);
720 
721 /** \brief Sets channel B initial offstes.
722  * \param eray pointer to ERAY module registers.
723  * \param channelBMicrotickInitialOffset difference between reference points on channel B in microticks.
724  * \param channelBMacrotickInitialOffset difference between reference points on channel B in macroticks.
725  * \return None
726  */
727 IFX_INLINE void IfxEray_setChannelBInitialOffsets(Ifx_ERAY *eray, uint8 channelBMicrotickInitialOffset, uint8 channelBMacrotickInitialOffset);
728 
729 /** \brief Sets receive delays on channels.
730  * \param eray pointer to ERAY module registers.
731  * \param channelAReceptionDelay reception delay on channel A.
732  * \param channelBReceptionDelay reception delay on channel B.
733  * \return None
734  */
735 IFX_INLINE void IfxEray_setChannelsReceiveDelay(Ifx_ERAY *eray, uint8 channelAReceptionDelay, uint8 channelBReceptionDelay);
736 
737 /** \brief Sets clock correction cycles for Passive and Halt.
738  * \param eray pointer to ERAY module registers.
739  * \param clockCorrectionCyclesPassive maximum number of cycles missing clock correction leading for passive state.
740  * \param clockCorrectionCyclesHalt maximum number of cycles missing clock correction leading for halt state.
741  * \return None
742  */
743 IFX_INLINE void IfxEray_setClockCorrectionCycles(Ifx_ERAY *eray, uint8 clockCorrectionCyclesPassive, uint8 clockCorrectionCyclesHalt);
744 
745 /** \brief lead to halt state in clock synch error.
746  * \param eray pointer to ERAY module registers.
747  * \param clockSyncErrorHalt whether to enter halt in clock synch error or not.
748  * \return None
749  */
750 IFX_INLINE void IfxEray_setClockSynchErrorHalt(Ifx_ERAY *eray, boolean clockSyncErrorHalt);
751 
752 /** \brief Sets cluster drift values.
753  * \param eray pointer to ERAY module registers.
754  * \param clusterDrift cluster drift damping value used in clock synchronization.
755  * \param maxDriftOffset maximum drift offset between two nodes.
756  * \return None
757  */
758 IFX_INLINE void IfxEray_setClusterDriftValues(Ifx_ERAY *eray, uint8 clusterDrift, uint16 maxDriftOffset);
759 
760 /** \brief Sets cluster startup deviation.
761  * \param eray pointer to ERAY module registers.
762  * \param acceptedStartupDeviation deviation for startup Frames during integration.
763  * \return None
764  */
765 IFX_INLINE void IfxEray_setClusterStartupDeviation(Ifx_ERAY *eray, uint16 acceptedStartupDeviation);
766 
767 /** \brief Sets CAS symbol window duration.
768  * \param eray pointer to ERAY module registers.
769  * \param collisionAvoidanceDuration accepted duration of CAS symbol.
770  * \return None
771  */
772 IFX_INLINE void IfxEray_setCollisionAvoidanceDuration(Ifx_ERAY *eray, uint8 collisionAvoidanceDuration);
773 
774 /** \brief sets duration of the communication cycle in Macroticks.
775  * \param eray pointer to ERAY module registers.
776  * \param macroticks duration of the communication cycle in Macroticks.
777  * \return None
778  */
779 IFX_INLINE void IfxEray_setCycleDurationMacroticks(Ifx_ERAY *eray, uint16 macroticks);
780 
781 /** \brief sets duration of the communication cycle in Microticks.
782  * \param eray pointer to ERAY module registers.
783  * \param microticks duration of the communication cycle in Microticks.
784  * \return None
785  */
786 IFX_INLINE void IfxEray_setCycleDurationMicroticks(Ifx_ERAY *eray, uint32 microticks);
787 
788 /** \brief Sets decoding correction value.
789  * \param eray pointer to ERAY module registers.
790  * \param decodingCorrection decoding correction value.
791  * \return None
792  */
793 IFX_INLINE void IfxEray_setDecodingCorrectionValue(Ifx_ERAY *eray, uint8 decodingCorrection);
794 
795 /** \brief Sets dynamic slots count and length.
796  * \param eray pointer to ERAY module registers.
797  * \param dynamicSlotLength duration of dynamic slot in macroticks.
798  * \param dynamicSlotCount number of dynamic slots in a communication cycle.
799  * \param idleDynamicSlots duration of dynamic slot idle phase.
800  * \return None
801  */
802 IFX_INLINE void IfxEray_setDynamicSlots(Ifx_ERAY *eray, uint8 dynamicSlotLength, uint16 dynamicSlotCount, IfxEray_IdleDynamicSlots idleDynamicSlots);
803 
804 /** \brief Sets external correction controls.
805  * \param eray pointer to ERAY module registers.
806  * \param externalOffset External offset correction control.
807  * \param externalRate External rate correction control.
808  * \return None
809  */
810 IFX_INLINE void IfxEray_setExternalCorrectionControl(Ifx_ERAY *eray, IfxEray_ExternalOffset externalOffset, IfxEray_ExternalRate externalRate);
811 
812 /** \brief Sets external correction values.
813  * \param eray pointer to ERAY module registers.
814  * \param externalOffsetCorrection external clock offset correction value.
815  * \param externalRateCorrection external clock rate correction value.
816  * \return None
817  */
818 IFX_INLINE void IfxEray_setExternalCorrectionValues(Ifx_ERAY *eray, IfxEray_ExternalOffsetCorrection externalOffsetCorrection, IfxEray_ExternalRateCorrection externalRateCorrection);
819 
820 /** \brief Sets FIFO buffer start idex.
821  * \param eray pointer to ERAY module registers.
822  * \param fifoBufferStartIndex FIFO buffer start idex.
823  * \return None
824  */
825 IFX_INLINE void IfxEray_setFifoBufferStartIndex(Ifx_ERAY *eray, uint8 fifoBufferStartIndex);
826 
827 /** \brief Sets FIFO filter configurations.
828  * \param eray pointer to ERAY module registers.
829  * \param rejectedFrameId rejected frameId by FIFO.
830  * \param filteredCycleNumber filtered cycle number.
831  * \param fifoNullFramesRejected null frames rejection selection.
832  * \param frameIdFilter filtered frameid by FIFO.
833  * \return None
834  */
835 IFX_INLINE void IfxEray_setFifoFilterConfigurations(Ifx_ERAY *eray, uint16 rejectedFrameId, uint8 filteredCycleNumber, boolean fifoNullFramesRejected, uint16 frameIdFilter);
836 
837 /** \brief Sets FIFO configurations.
838  * \param eray pointer to ERAY module registers.
839  * \param receiveChannel FIFO receive channel.
840  * \param staticFifoDisabled static FIFO selection.
841  * \param fifoDepth FIFO depth.
842  * \return None
843  */
844 IFX_INLINE void IfxEray_setFifoMessageBufferConfigurations(Ifx_ERAY *eray, IfxEray_ReceiveChannel receiveChannel, boolean staticFifoDisabled, uint8 fifoDepth);
845 
846 /** \brief Sets first dynamic buffer.
847  * \param eray pointer to ERAY module registers.
848  * \param firstDynamicBuffer first dynamic buffer.
849  * \return None
850  */
851 IFX_INLINE void IfxEray_setFirstDynamicBuffer(Ifx_ERAY *eray, uint8 firstDynamicBuffer);
852 
853 /** \brief Sets startup or wakeup listen timeouts.
854  * \param eray pointer to ERAY module registers.
855  * \param listenTimeOut wakeup or startup listen timeout in microticks.
856  * \param listenTimeOutNoise upper limit for startup or wakeup listen timeout in presence of noise.
857  * \return None
858  */
859 IFX_INLINE void IfxEray_setListenTimeOuts(Ifx_ERAY *eray, uint32 listenTimeOut, IfxEray_ListenTimeOutNoise listenTimeOutNoise);
860 
861 /** \brief Sets the maximum cold start attempts for active state.
862  * \param eray pointer to ERAY module registers.
863  * \param maxColdStartAttempts maximum number of attempts that a cold start node allows.
864  * \return None
865  */
866 IFX_INLINE void IfxEray_setMaxColdStartAttempts(Ifx_ERAY *eray, uint8 maxColdStartAttempts);
867 
868 /** \brief Sets max limit correction values.
869  * \param eray pointer to ERAY module registers.
870  * \param maxOffsetCorrection maximum offset correction.
871  * \param maxRateCorrection maximum rate correction.
872  * \return None
873  */
874 IFX_INLINE void IfxEray_setMaxCorrectionValues(Ifx_ERAY *eray, uint16 maxOffsetCorrection, uint16 maxRateCorrection);
875 
876 /** \brief Sets maximum synch frames in a cluster.
877  * \param eray pointer to ERAY module registers.
878  * \param maxSyncFrames maximum synch frames in a cluster.
879  * \return None
880  */
881 IFX_INLINE void IfxEray_setMaxSynchFrames(Ifx_ERAY *eray, IfxEray_MaxSynchFrames maxSyncFrames);
882 
883 /** \brief Sets number of message buffers.
884  * \param eray pointer to ERAY module registers.
885  * \param numberOfMessageBuffers number of message buffers.
886  * \return None
887  */
888 IFX_INLINE void IfxEray_setMessageBufferCount(Ifx_ERAY *eray, uint8 numberOfMessageBuffers);
889 
890 /** \brief Sets Message Handler configurations.
891  * \param eray pointer to ERAY module registers.
892  * \param staticFramepayload payload length of static frames in double bytes.
893  * \param latestTransmissionStart dynamic slots befor transmission of inhibit frame in dynamic segment.
894  * \return None
895  */
896 IFX_INLINE void IfxEray_setMessageHandlerConfigurations(Ifx_ERAY *eray, uint8 staticFramepayload, uint8 latestTransmissionStart);
897 
898 /** \brief Sets network start Idle time.
899  * \param eray pointer to ERAY module registers.
900  * \param networkStartIdleTime starting point of Network Idle Time Phase.
901  * \return None
902  */
903 IFX_INLINE void IfxEray_setNetworkStartIdleTime(Ifx_ERAY *eray, uint16 networkStartIdleTime);
904 
905 /** \brief Sets network management vector length.
906  * \param eray pointer to ERAY module registers.
907  * \param networkVectorLength length of network management vector.
908  * \return None
909  */
910 IFX_INLINE void IfxEray_setNetworkVectorLength(Ifx_ERAY *eray, uint32 networkVectorLength);
911 
912 /** \brief Sets channels connected to node.
913  * \param eray pointer to ERAY module registers.
914  * \param channelAConnectedNode whether node connected to channel A or not.
915  * \param channelBConnectedNode whether node connected to channel B or not.
916  * \return None
917  */
918 IFX_INLINE void IfxEray_setNodeChannels(Ifx_ERAY *eray, boolean channelAConnectedNode, boolean channelBConnectedNode);
919 
920 /** \brief Sets offset correction starting point.
921  * \param eray pointer to ERAY module registers.
922  * \param correctionOffset offset correction start point.
923  * \return None
924  */
925 IFX_INLINE void IfxEray_setOffsetCorrection(Ifx_ERAY *eray, uint16 correctionOffset);
926 
927 /** \brief requests to receive the frame.
928  * \param eray pointer to ERAY module registers.
929  * \param receiveRequested whether frame to be received or not.
930  * \return None
931  */
932 IFX_INLINE void IfxEray_setReceiveRequest(Ifx_ERAY *eray, boolean receiveRequested);
933 
934 /** \brief Sets receive wakeup times.
935  * \param eray pointer to ERAY module registers.
936  * \param receiveWakeupTestDuration duration of receive wakeup pattern.
937  * \param receiveWakeupIdleTime duration of receive wakeup idle time.
938  * \param receiveWakeupLowTime duration of receive wakeup low time.
939  * \return None
940  */
941 IFX_INLINE void IfxEray_setReceiveWakeupTimes(Ifx_ERAY *eray, uint8 receiveWakeupTestDuration, uint8 receiveWakeupIdleTime, uint8 receiveWakeupLowTime);
942 
943 /** \brief sets buffer number in which frame is received.
944  * \param eray pointer to ERAY module registers.
945  * \param bufferIndex buffer number in which frame is received.
946  * \return None
947  */
948 IFX_INLINE void IfxEray_setRxBufferNumber(Ifx_ERAY *eray, uint8 bufferIndex);
949 
950 /** \brief Sets slots action points.
951  * \param eray pointer to ERAY module registers.
952  * \param staticActionPoint static slots and symbol window action point.
953  * \param dynamicActionPoint dynamic slots action point.
954  * \return None
955  */
956 IFX_INLINE void IfxEray_setSlotActionPoints(Ifx_ERAY *eray, uint8 staticActionPoint, uint8 dynamicActionPoint);
957 
958 /** \brief Sets static slots count and length.
959  * \param eray pointer to ERAY module registers.
960  * \param staticSlotLength duration of static slot in macroticks.
961  * \param staticSlotsCount number of static slots in a communication cycle.
962  * \return None
963  */
964 IFX_INLINE void IfxEray_setStaticSlots(Ifx_ERAY *eray, uint16 staticSlotLength, uint16 staticSlotsCount);
965 
966 /** \brief Sets sample point for strobing.
967  * \param eray pointer to ERAY module registers.
968  * \param strobePosition strobing sample count.
969  * \return None
970  */
971 IFX_INLINE void IfxEray_setStrobePosition(Ifx_ERAY *eray, IfxEray_StrobePosition strobePosition);
972 
973 /** \brief Sets channels which transmits symbols.
974  * \param eray pointer to ERAY module registers.
975  * \param channelASymbolTransmitted whether symbol is transmitted in Channel A or not.
976  * \param channelBSymbolTransmitted whether symbol is transmitted in Channel B or not.
977  * \return None
978  */
979 IFX_INLINE void IfxEray_setSymbolChannels(Ifx_ERAY *eray, boolean channelASymbolTransmitted, boolean channelBSymbolTransmitted);
980 
981 /** \brief Sets the transmit slot mode.
982  * \param eray pointer to ERAY module registers.
983  * \param transmissionSlotMode transmission slot mode.
984  * \return None
985  */
986 IFX_INLINE void IfxEray_setTransmissionSlotMode(Ifx_ERAY *eray, IfxEray_TransmissionSlotMode transmissionSlotMode);
987 
988 /** \brief Sets transmission start time duration.
989  * \param eray pointer to ERAY module registers.
990  * \param transmissionStartTime transmission start time.
991  * \return None
992  */
993 IFX_INLINE void IfxEray_setTransmissionStartTime(Ifx_ERAY *eray, uint16 transmissionStartTime);
994 
995 /** \brief Sets transfer request to send frame.
996  * \param eray pointer to ERAY module registers.
997  * \param transferRequested whether transfer requested or not.
998  * \return None
999  */
1000 IFX_INLINE void IfxEray_setTransmitRequest(Ifx_ERAY *eray, boolean transferRequested);
1001 
1002 /** \brief Sets transmit wakeup times.
1003  * \param eray pointer to ERAY module registers.
1004  * \param transmitWakeupRepetitions transmission wakeup repetitions.
1005  * \param transmitWakeupIdleTime duration of transmit wakeup idle time.
1006  * \param transmitWakeupLowTime duration of transmit wakeup low time.
1007  * \return None
1008  */
1009 IFX_INLINE void IfxEray_setTransmitWakeupTimes(Ifx_ERAY *eray, uint8 transmitWakeupRepetitions, uint8 transmitWakeupIdleTime, uint8 transmitWakeupLowTime);
1010 
1011 /** \brief Configures transmitted frames for startup and synchronization.
1012  * \param eray pointer to ERAY module registers.
1013  * \param startupFrameTransmitted whether startup Frame transmitted or not.
1014  * \param synchFrameTransmitted whether synch Frame transmitted or not.
1015  * \return None
1016  */
1017 IFX_INLINE void IfxEray_setTransmittedFrames(Ifx_ERAY *eray, boolean startupFrameTransmitted, boolean synchFrameTransmitted);
1018 
1019 /** \brief Sets the transmit buffer number.
1020  * \param eray pointer to ERAY module registers.
1021  * \param bufferIndex buffer number in which frame is sent.
1022  * \return None
1023  */
1024 IFX_INLINE void IfxEray_setTxBufferNumber(Ifx_ERAY *eray, uint8 bufferIndex);
1025 
1026 /** \brief Swaps the shadow and Host output registers.
1027  * \param eray pointer to ERAY module registers.
1028  * \param swapRequested whether swap is requested or not.
1029  * \return None
1030  */
1031 IFX_INLINE void IfxEray_setViewData(Ifx_ERAY *eray, boolean swapRequested);
1032 
1033 /** \brief Sets the cluster wakeup channel.
1034  * \param eray pointer to ERAY module registers.
1035  * \param wakeupPatternChannel cluster wakeup pattern channel.
1036  * \return None
1037  */
1038 IFX_INLINE void IfxEray_setWakeupPatternChannel(Ifx_ERAY *eray, IfxEray_WakeupChannel wakeupPatternChannel);
1039 
1040 /** \} */
1041 
1042 /** \addtogroup IfxLld_Eray_Std_Operative
1043  * \{ */
1044 
1045 /******************************************************************************/
1046 /*-------------------------Inline Function Prototypes-------------------------*/
1047 /******************************************************************************/
1048 
1049 /** \brief requests to receive data from message buffer.
1050  * \param eray pointer to ERAY module registers.
1051  * \param dataReceived whether data to be received or not.
1052  * \return None
1053  */
1054 IFX_INLINE void IfxEray_receiveData(Ifx_ERAY *eray, boolean dataReceived);
1055 
1056 /** \brief sets the bit to send data in frame.
1057  * \param eray pointer to ERAY module registers.
1058  * \param dataTransfered whether data transfered or not.
1059  * \return None
1060  */
1061 IFX_INLINE void IfxEray_sendData(Ifx_ERAY *eray, boolean dataTransfered);
1062 
1063 /******************************************************************************/
1064 /*-------------------------Global Function Prototypes-------------------------*/
1065 /******************************************************************************/
1066 
1067 /** \brief Calculate and returns the CRC for frame.
1068  * \param payloadLength payload length configured for frame.
1069  * \param frameId slot id
1070  * \param startupFrameIndicator whether startup frame is indicated or not.
1071  * \param syncFrameIndicator whether sync frame is indicated or not.
1072  * \return calculated CRC value.
1073  */
1074 IFX_EXTERN uint16 IfxEray_calcHeaderCrc(uint8 payloadLength, uint16 frameId, boolean startupFrameIndicator, boolean syncFrameIndicator);
1075 
1076 /** \brief Reads the received data from output registers.
1077  * \param eray pointer to ERAY module registers.
1078  * \param data pointer to received data buffer.
1079  * \param payloadLength payload length received in a frame.
1080  * \return None
1081  */
1082 IFX_EXTERN void IfxEray_readData(Ifx_ERAY *eray, uint32 *data, uint8 payloadLength);
1083 
1084 /** \brief Reads header and data from output buffers.
1085  * \param eray pointer to ERAY module registers.
1086  * \param header header received in a frame.
1087  * \param data data received in a frame.
1088  * \param maxPayloadLength maximum payload length received in a frame.
1089  * \return None
1090  */
1091 IFX_EXTERN void IfxEray_readFrame(Ifx_ERAY *eray, IfxEray_ReceivedHeader *header, uint32 *data, Ifx_SizeT maxPayloadLength);
1092 
1093 /** \brief Writes header and data to Input buffers and set the slots.
1094  * \param eray pointer to ERAY module registers.
1095  * \param header Header section of message buffer.
1096  * \param data data section of message buffer.
1097  * \param slotConfig pointer slot allocation configuration structure.
1098  * \return None
1099  */
1100 IFX_EXTERN void IfxEray_setSlot(Ifx_ERAY *eray, IfxEray_Header *header, uint32 *data, IfxEray_SlotConfig *slotConfig);
1101 
1102 /** \brief Writes data section of a frame to input data registers.
1103  * \param eray pointer to ERAY module registers.
1104  * \param data data segment in a frame.
1105  * \param payloadLength payload length configured for slot buffer.
1106  * \return None
1107  */
1108 IFX_EXTERN void IfxEray_writeData(Ifx_ERAY *eray, uint32 *data, uint8 payloadLength);
1109 
1110 /** \} */
1111 
1112 /******************************************************************************/
1113 /*-------------------------Inline Function Prototypes-------------------------*/
1114 /******************************************************************************/
1115 
1116 /** \brief Gets the FIFO index.
1117  * \param eray pointer to ERAY module registers.
1118  * \return FIFO buffer index.
1119  */
1120 IFX_INLINE uint8 IfxEray_getFifoIndex(Ifx_ERAY *eray);
1121 
1122 /******************************************************************************/
1123 /*---------------------Inline Function Implementations------------------------*/
1124 /******************************************************************************/
1125 
1127 {
1128  eray->EIR.U = errorFlag;
1129 }
1130 
1131 
1133 {
1134  eray->SIR.U = statusFlag;
1135 }
1136 
1137 
1138 IFX_INLINE Ifx_ERAY_EIR IfxEray_getErrorInterrupts(Ifx_ERAY *eray)
1139 {
1140  Ifx_ERAY_EIR interruptFlags;
1141  interruptFlags.U = eray->EIR.U;
1142  return interruptFlags;
1143 }
1144 
1145 
1146 IFX_INLINE volatile Ifx_SRC_SRCR *IfxEray_getInputBufferBusySrcPtr(Ifx_ERAY *eray)
1147 {
1148  return &MODULE_SRC.ERAY.ERAY[0].IBUSY;
1149 }
1150 
1151 
1152 IFX_INLINE volatile Ifx_SRC_SRCR *IfxEray_getInterruptLine0SrcPtr(Ifx_ERAY *eray)
1153 {
1154  return &MODULE_SRC.ERAY.ERAY[0].INT[0];
1155 }
1156 
1157 
1158 IFX_INLINE volatile Ifx_SRC_SRCR *IfxEray_getInterruptLine1SrcPtr(Ifx_ERAY *eray)
1159 {
1160  return &MODULE_SRC.ERAY.ERAY[0].INT[1];
1161 }
1162 
1163 
1164 IFX_INLINE boolean IfxEray_getMessageBufferInterruptStatus(Ifx_ERAY *eray, uint8 messageBuffer)
1165 {
1166  uint8 ix = messageBuffer / 32;
1167  uint32 mask = 1 << (messageBuffer % 32);
1168  Ifx_ERAY_MBSC1 *mbscSFR = (Ifx_ERAY_MBSC1 *)((uint32)&eray->MBSC1 + 4 * ix);
1169  boolean messageBufferInterrupt = (mbscSFR->U & mask) ? TRUE : FALSE;
1170 
1171  return messageBufferInterrupt;
1172 }
1173 
1174 
1175 IFX_INLINE volatile Ifx_SRC_SRCR *IfxEray_getMessageBufferStatus0SrcPtr(Ifx_ERAY *eray)
1176 {
1177  return &MODULE_SRC.ERAY.ERAY[0].MBSC[0];
1178 }
1179 
1180 
1181 IFX_INLINE volatile Ifx_SRC_SRCR *IfxEray_getMessageBufferStatus1SrcPtr(Ifx_ERAY *eray)
1182 {
1183  return &MODULE_SRC.ERAY.ERAY[0].MBSC[1];
1184 }
1185 
1186 
1187 IFX_INLINE volatile Ifx_SRC_SRCR *IfxEray_getNewDataInterrupt0SrcPtr(Ifx_ERAY *eray)
1188 {
1189  return &MODULE_SRC.ERAY.ERAY[0].NDAT[0];
1190 }
1191 
1192 
1193 IFX_INLINE volatile Ifx_SRC_SRCR *IfxEray_getNewDataInterrupt1SrcPtr(Ifx_ERAY *eray)
1194 {
1195  return &MODULE_SRC.ERAY.ERAY[0].NDAT[1];
1196 }
1197 
1198 
1200 {
1201  uint8 ix = ndat / 32;
1202  uint32 mask = 1 << (ndat % 32);
1203  Ifx_ERAY_NDAT1 *ndatSFR = (Ifx_ERAY_NDAT1 *)((uint32)&eray->NDAT1 + 4 * ix);
1204  boolean ndatInterrupt = (ndatSFR->U & mask) ? TRUE : FALSE;
1205 
1206  return ndatInterrupt;
1207 }
1208 
1209 
1210 IFX_INLINE volatile Ifx_SRC_SRCR *IfxEray_getOutputBufferBusySrcPtr(Ifx_ERAY *eray)
1211 {
1212  return &MODULE_SRC.ERAY.ERAY[0].OBUSY;
1213 }
1214 
1215 
1216 IFX_INLINE Ifx_ERAY_SIR IfxEray_getStatusInterrupts(Ifx_ERAY *eray)
1217 {
1218  Ifx_ERAY_SIR interruptFlags;
1219  interruptFlags.U = eray->SIR.U;
1220  return interruptFlags;
1221 }
1222 
1223 
1224 IFX_INLINE volatile Ifx_SRC_SRCR *IfxEray_getTimerInterrupt0SrcPtr(Ifx_ERAY *eray)
1225 {
1226  return &MODULE_SRC.ERAY.ERAY[0].TINT[0];
1227 }
1228 
1229 
1230 IFX_INLINE volatile Ifx_SRC_SRCR *IfxEray_getTimerInterrupt1SrcPtr(Ifx_ERAY *eray)
1231 {
1232  return &MODULE_SRC.ERAY.ERAY[0].TINT[1];
1233 }
1234 
1235 
1237 {
1238  IfxPort_setPinModeInput(rx->pin.port, rx->pin.pinIndex, rxMode);
1239 
1240  if (rx->nodeId == IfxEray_NodeId_a)
1241  {
1242  rx->module->CUST1.B.RISA = rx->select;
1243  }
1244  else
1245  {
1246  rx->module->CUST1.B.RISB = rx->select;
1247  }
1248 }
1249 
1250 
1252 {
1253  IfxPort_setPinModeOutput(txEn->pin.port, txEn->pin.pinIndex, txEnMode, txEn->select);
1254  IfxPort_setPinPadDriver(txEn->pin.port, txEn->pin.pinIndex, padDriver);
1255 }
1256 
1257 
1259 {
1260  IfxPort_setPinModeOutput(tx->pin.port, tx->pin.pinIndex, txMode, tx->select);
1261  IfxPort_setPinPadDriver(tx->pin.port, tx->pin.pinIndex, padDriver);
1262 }
1263 
1264 
1265 IFX_INLINE void IfxEray_enableModule(Ifx_ERAY *eray)
1266 {
1267  // Run Mode Clock divider to 1
1268  eray->CLC.U = 0x00000100;
1269 
1270  // ensure that write access finished before leaving this function
1271  if (eray->CLC.U)
1272  {}
1273 }
1274 
1275 
1276 IFX_INLINE Ifx_ERAY_FSR IfxEray_getFifoStatus(Ifx_ERAY *eray)
1277 {
1278  Ifx_ERAY_FSR fifoStatus;
1279  fifoStatus.U = eray->FSR.U;
1280  return fifoStatus;
1281 }
1282 
1283 
1285 {
1286  return (eray->IBCR.B.IBSYH == 1) ? TRUE : FALSE;
1287 }
1288 
1289 
1291 {
1292  return (eray->IBCR.B.IBSYS == 1) ? TRUE : FALSE;
1293 }
1294 
1295 
1297 {
1298  return eray->OBCR.B.OBRH;
1299 }
1300 
1301 
1303 {
1304  return (eray->OBCR.B.OBSYS == 1) ? TRUE : FALSE;
1305 }
1306 
1307 
1309 {
1310  return (IfxEray_PocState)eray->CCSV.B.POCS;
1311 }
1312 
1313 
1315 {
1316  IfxEray_WakeupChannel wakeupChannel;
1317 
1318  if (eray->SIR.B.WUPA == 1)
1319  {
1320  wakeupChannel = IfxEray_WakeupChannel_a;
1321  }
1322  else if (eray->SIR.B.WUPB == 1)
1323  {
1324  wakeupChannel = IfxEray_WakeupChannel_b;
1325  }
1326 
1327  return wakeupChannel;
1328 }
1329 
1330 
1332 {
1333  while (eray->CCSV.B.POCS != (uint8)pocState)
1334  {}
1335 }
1336 
1337 
1338 IFX_INLINE void IfxEray_receiveHeader(Ifx_ERAY *eray, boolean headerReceived)
1339 {
1340  eray->OBCM.B.RHSS = headerReceived;
1341 }
1342 
1343 
1344 IFX_INLINE void IfxEray_sendHeader(Ifx_ERAY *eray, boolean headerTransfered)
1345 {
1346  eray->IBCM.B.LHSH = headerTransfered;
1347 }
1348 
1349 
1350 IFX_INLINE void IfxEray_setActiveCyclePairs(Ifx_ERAY *eray, uint8 numberOfCyclePairsForActive)
1351 {
1352  eray->SUCC1.B.PTA = numberOfCyclePairsForActive;
1353 }
1354 
1355 
1357 {
1358  eray->CUST1.B.IEN = 1;
1359  eray->CUST1.B.OEN = 1;
1360  eray->CUST3.U = 0xFFFFFFFF;
1361 }
1362 
1363 
1364 IFX_INLINE void IfxEray_setBaudrate(Ifx_ERAY *eray, IfxEray_Baudrate baudrate)
1365 {
1366  eray->PRTC1.B.BRP = baudrate;
1367 }
1368 
1369 
1370 IFX_INLINE void IfxEray_setBufferReconfigSecure(Ifx_ERAY *eray, uint8 secureValue)
1371 {
1372  eray->MRC.B.SEC = secureValue;
1373 }
1374 
1375 
1376 IFX_INLINE void IfxEray_setChannelAInitialOffsets(Ifx_ERAY *eray, uint8 channelAMicrotickInitialOffset, uint8 channelAMacrotickInitialOffset)
1377 {
1378  eray->GTUC03.B.UIOA = channelAMicrotickInitialOffset;
1379  eray->GTUC03.B.MIOA = channelAMacrotickInitialOffset;
1380 }
1381 
1382 
1383 IFX_INLINE void IfxEray_setChannelBInitialOffsets(Ifx_ERAY *eray, uint8 channelBMicrotickInitialOffset, uint8 channelBMacrotickInitialOffset)
1384 {
1385  eray->GTUC03.B.UIOB = channelBMicrotickInitialOffset;
1386  eray->GTUC03.B.MIOB = channelBMacrotickInitialOffset;
1387 }
1388 
1389 
1390 IFX_INLINE void IfxEray_setChannelsReceiveDelay(Ifx_ERAY *eray, uint8 channelAReceptionDelay, uint8 channelBReceptionDelay)
1391 {
1392  eray->GTUC05.B.DCA = channelAReceptionDelay;
1393  eray->GTUC05.B.DCB = channelBReceptionDelay;
1394 }
1395 
1396 
1397 IFX_INLINE void IfxEray_setClockCorrectionCycles(Ifx_ERAY *eray, uint8 clockCorrectionCyclesPassive, uint8 clockCorrectionCyclesHalt)
1398 {
1399  Ifx_ERAY_SUCC3 succ3;
1400  succ3.U = 0;
1401  succ3.B.WCP = clockCorrectionCyclesPassive;
1402  succ3.B.WCF = clockCorrectionCyclesHalt;
1403  eray->SUCC3.U = succ3.U;
1404 }
1405 
1406 
1407 IFX_INLINE void IfxEray_setClockSynchErrorHalt(Ifx_ERAY *eray, boolean clockSyncErrorHalt)
1408 {
1409  eray->SUCC1.B.HCSE = clockSyncErrorHalt;
1410 }
1411 
1412 
1413 IFX_INLINE void IfxEray_setClusterDriftValues(Ifx_ERAY *eray, uint8 clusterDrift, uint16 maxDriftOffset)
1414 {
1415  eray->GTUC05.B.CDD = clusterDrift;
1416  eray->GTUC06.B.MOD = maxDriftOffset;
1417 }
1418 
1419 
1420 IFX_INLINE void IfxEray_setClusterStartupDeviation(Ifx_ERAY *eray, uint16 acceptedStartupDeviation)
1421 {
1422  eray->GTUC06.B.ASR = acceptedStartupDeviation;
1423 }
1424 
1425 
1426 IFX_INLINE void IfxEray_setCollisionAvoidanceDuration(Ifx_ERAY *eray, uint8 collisionAvoidanceDuration)
1427 {
1428  eray->PRTC1.B.CASM = collisionAvoidanceDuration;
1429 }
1430 
1431 
1432 IFX_INLINE void IfxEray_setCycleDurationMacroticks(Ifx_ERAY *eray, uint16 macroticks)
1433 {
1434  eray->GTUC02.B.MPC = macroticks;
1435 }
1436 
1437 
1438 IFX_INLINE void IfxEray_setCycleDurationMicroticks(Ifx_ERAY *eray, uint32 microticks)
1439 {
1440  eray->GTUC01.U = microticks;
1441 }
1442 
1443 
1444 IFX_INLINE void IfxEray_setDecodingCorrectionValue(Ifx_ERAY *eray, uint8 decodingCorrection)
1445 {
1446  eray->GTUC05.B.DEC = decodingCorrection;
1447 }
1448 
1449 
1450 IFX_INLINE void IfxEray_setDynamicSlots(Ifx_ERAY *eray, uint8 dynamicSlotLength, uint16 dynamicSlotCount, IfxEray_IdleDynamicSlots idleDynamicSlots)
1451 {
1452  eray->GTUC08.B.MSL = dynamicSlotLength;
1453  eray->GTUC08.B.NMS = dynamicSlotCount;
1454  eray->GTUC09.B.DSI = idleDynamicSlots;
1455 }
1456 
1457 
1459 {
1460  eray->GTUC11.B.EOCC = externalOffset;
1461  eray->GTUC11.B.ERCC = externalRate;
1462 }
1463 
1464 
1465 IFX_INLINE void IfxEray_setExternalCorrectionValues(Ifx_ERAY *eray, IfxEray_ExternalOffsetCorrection externalOffsetCorrection, IfxEray_ExternalRateCorrection externalRateCorrection)
1466 {
1467  eray->GTUC11.B.EOC = externalOffsetCorrection;
1468  eray->GTUC11.B.ERC = externalRateCorrection;
1469 }
1470 
1471 
1472 IFX_INLINE void IfxEray_setFifoBufferStartIndex(Ifx_ERAY *eray, uint8 fifoBufferStartIndex)
1473 {
1474  // Buffers from MRC.B.FFB to MRC.B.LCB are assigned FIFO
1475  eray->MRC.B.FFB = fifoBufferStartIndex;
1476 }
1477 
1478 
1479 IFX_INLINE void IfxEray_setFifoFilterConfigurations(Ifx_ERAY *eray, uint16 rejectedFrameId, uint8 filteredCycleNumber, boolean fifoNullFramesRejected, uint16 frameIdFilter)
1480 {
1481  eray->FRF.B.FID = rejectedFrameId;
1482  eray->FRF.B.CYF = filteredCycleNumber;
1483  eray->FRF.B.RNF = fifoNullFramesRejected;
1484  eray->FRFM.B.MFID = frameIdFilter;
1485 }
1486 
1487 
1488 IFX_INLINE void IfxEray_setFifoMessageBufferConfigurations(Ifx_ERAY *eray, IfxEray_ReceiveChannel receiveChannel, boolean staticFifoDisabled, uint8 fifoDepth)
1489 {
1490  eray->FRF.B.CH = receiveChannel;
1491  eray->FRF.B.RSS = staticFifoDisabled;
1492  eray->FCL.U = fifoDepth;
1493 }
1494 
1495 
1496 IFX_INLINE void IfxEray_setFirstDynamicBuffer(Ifx_ERAY *eray, uint8 firstDynamicBuffer)
1497 {
1498  // 0: No static bufers, 0x01...0x7F: 0 to (MRC.B.FDB - 1) are static buffers, 0x80...0xFF:No dynamic buffers
1499  eray->MRC.B.FDB = firstDynamicBuffer;
1500 }
1501 
1502 
1503 IFX_INLINE void IfxEray_setListenTimeOuts(Ifx_ERAY *eray, uint32 listenTimeOut, IfxEray_ListenTimeOutNoise listenTimeOutNoise)
1504 {
1505  Ifx_ERAY_SUCC2 succ2;
1506  succ2.U = 0;
1507  succ2.B.LT = listenTimeOut;
1508  succ2.B.LTN = listenTimeOutNoise;
1509  eray->SUCC2.U = succ2.U;
1510 }
1511 
1512 
1513 IFX_INLINE void IfxEray_setMaxColdStartAttempts(Ifx_ERAY *eray, uint8 maxColdStartAttempts)
1514 {
1515  eray->SUCC1.B.CSA = maxColdStartAttempts;
1516 }
1517 
1518 
1519 IFX_INLINE void IfxEray_setMaxCorrectionValues(Ifx_ERAY *eray, uint16 maxOffsetCorrection, uint16 maxRateCorrection)
1520 {
1521  eray->GTUC10.B.MOC = maxOffsetCorrection;
1522  eray->GTUC10.B.MRC = maxRateCorrection;
1523 }
1524 
1525 
1527 {
1528  eray->GTUC02.B.SNM = maxSyncFrames;
1529 }
1530 
1531 
1532 IFX_INLINE void IfxEray_setMessageBufferCount(Ifx_ERAY *eray, uint8 numberOfMessageBuffers)
1533 {
1534  eray->MRC.B.LCB = numberOfMessageBuffers - 1;
1535 }
1536 
1537 
1538 IFX_INLINE void IfxEray_setMessageHandlerConfigurations(Ifx_ERAY *eray, uint8 staticFramepayload, uint8 latestTransmissionStart)
1539 {
1540  Ifx_ERAY_MHDC mhdc;
1541  mhdc.U = 0;
1542  mhdc.B.SFDL = staticFramepayload;
1543  mhdc.B.SLT = latestTransmissionStart;
1544  eray->MHDC.U = mhdc.U;
1545 }
1546 
1547 
1548 IFX_INLINE void IfxEray_setNetworkStartIdleTime(Ifx_ERAY *eray, uint16 networkStartIdleTime)
1549 {
1550  eray->GTUC04.B.NIT = networkStartIdleTime;
1551 }
1552 
1553 
1554 IFX_INLINE void IfxEray_setNetworkVectorLength(Ifx_ERAY *eray, uint32 networkVectorLength)
1555 {
1556  eray->NEMC.U = networkVectorLength;
1557 }
1558 
1559 
1560 IFX_INLINE void IfxEray_setNodeChannels(Ifx_ERAY *eray, boolean channelAConnectedNode, boolean channelBConnectedNode)
1561 {
1562  eray->SUCC1.B.CCHA = channelAConnectedNode;
1563  eray->SUCC1.B.CCHB = channelBConnectedNode;
1564 }
1565 
1566 
1567 IFX_INLINE void IfxEray_setOffsetCorrection(Ifx_ERAY *eray, uint16 correctionOffset)
1568 {
1569  eray->GTUC04.B.OCS = correctionOffset;
1570 }
1571 
1572 
1573 IFX_INLINE void IfxEray_setReceiveRequest(Ifx_ERAY *eray, boolean receiveRequested)
1574 {
1575  eray->OBCR.B.REQ = receiveRequested;
1576 }
1577 
1578 
1579 IFX_INLINE void IfxEray_setReceiveWakeupTimes(Ifx_ERAY *eray, uint8 receiveWakeupTestDuration, uint8 receiveWakeupIdleTime, uint8 receiveWakeupLowTime)
1580 {
1581  eray->PRTC1.B.RXW = receiveWakeupTestDuration;
1582  eray->PRTC2.B.RXI = receiveWakeupIdleTime;
1583  eray->PRTC2.B.RXL = receiveWakeupLowTime;
1584 }
1585 
1586 
1587 IFX_INLINE void IfxEray_setRxBufferNumber(Ifx_ERAY *eray, uint8 bufferIndex)
1588 {
1589  eray->OBCR.B.OBRS = bufferIndex;
1590 }
1591 
1592 
1593 IFX_INLINE void IfxEray_setSlotActionPoints(Ifx_ERAY *eray, uint8 staticActionPoint, uint8 dynamicActionPoint)
1594 {
1595  eray->GTUC09.B.MAPO = dynamicActionPoint;
1596  eray->GTUC09.B.APO = staticActionPoint;
1597 }
1598 
1599 
1600 IFX_INLINE void IfxEray_setStaticSlots(Ifx_ERAY *eray, uint16 staticSlotLength, uint16 staticSlotsCount)
1601 {
1602  eray->GTUC07.B.SSL = staticSlotLength;
1603  eray->GTUC07.B.NSS = staticSlotsCount;
1604 }
1605 
1606 
1608 {
1609  eray->PRTC1.B.SPP = strobePosition;
1610 }
1611 
1612 
1613 IFX_INLINE void IfxEray_setSymbolChannels(Ifx_ERAY *eray, boolean channelASymbolTransmitted, boolean channelBSymbolTransmitted)
1614 {
1615  eray->SUCC1.B.MTSA = channelASymbolTransmitted;
1616  eray->SUCC1.B.MTSB = channelBSymbolTransmitted;
1617 }
1618 
1619 
1621 {
1622  eray->SUCC1.B.TSM = transmissionSlotMode;
1623 }
1624 
1625 
1626 IFX_INLINE void IfxEray_setTransmissionStartTime(Ifx_ERAY *eray, uint16 transmissionStartTime)
1627 {
1628  eray->PRTC1.B.TSST = transmissionStartTime;
1629 }
1630 
1631 
1632 IFX_INLINE void IfxEray_setTransmitRequest(Ifx_ERAY *eray, boolean transferRequested)
1633 {
1634  eray->IBCM.B.STXRH = transferRequested;
1635 }
1636 
1637 
1638 IFX_INLINE void IfxEray_setTransmitWakeupTimes(Ifx_ERAY *eray, uint8 transmitWakeupRepetitions, uint8 transmitWakeupIdleTime, uint8 transmitWakeupLowTime)
1639 {
1640  eray->PRTC1.B.RWP = transmitWakeupRepetitions;
1641  eray->PRTC2.B.TXI = transmitWakeupIdleTime;
1642  eray->PRTC2.B.TXL = transmitWakeupLowTime;
1643 }
1644 
1645 
1646 IFX_INLINE void IfxEray_setTransmittedFrames(Ifx_ERAY *eray, boolean startupFrameTransmitted, boolean synchFrameTransmitted)
1647 {
1648  eray->SUCC1.B.TXST = startupFrameTransmitted;
1649  eray->SUCC1.B.TXSY = synchFrameTransmitted;
1650 }
1651 
1652 
1653 IFX_INLINE void IfxEray_setTxBufferNumber(Ifx_ERAY *eray, uint8 bufferIndex)
1654 {
1655  eray->IBCR.B.IBRH = bufferIndex;
1656 }
1657 
1658 
1659 IFX_INLINE void IfxEray_setViewData(Ifx_ERAY *eray, boolean swapRequested)
1660 {
1661  eray->OBCR.B.VIEW = swapRequested;
1662 }
1663 
1664 
1665 IFX_INLINE void IfxEray_setWakeupPatternChannel(Ifx_ERAY *eray, IfxEray_WakeupChannel wakeupPatternChannel)
1666 {
1667  eray->SUCC1.B.WUCS = wakeupPatternChannel;
1668 }
1669 
1670 
1671 IFX_INLINE void IfxEray_receiveData(Ifx_ERAY *eray, boolean dataReceived)
1672 {
1673  eray->OBCM.B.RDSS = dataReceived;
1674 }
1675 
1676 
1677 IFX_INLINE void IfxEray_sendData(Ifx_ERAY *eray, boolean dataTransfered)
1678 {
1679  eray->IBCM.B.LDSH = dataTransfered;
1680 }
1681 
1682 
1684 {
1685  return eray->MRC.B.FFB;
1686 }
1687 
1688 
1689 #endif /* IFXERAY_H */