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