iLLD_TC27xC  1.0
IfxEray_Eray.h
Go to the documentation of this file.
1 /**
2  * \file IfxEray_Eray.h
3  * \brief ERAY ERAY details
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_Usage How to use the ERAY Interface driver?
25  * \ingroup IfxLld_Eray
26  *
27  * \section IfxLld_Eray_Eray_Preparation Preparation
28  * \subsection IfxLld_Eray_Eray_Include Include Files
29  *
30  * Include following header file into your C code:
31  *
32  * \code
33  * #include <Eray/Eray/IfxEray_Eray.h>
34  * #include <Scu/Std/IfxScuWdt.h>
35  * #include <eray_commands.h>
36  * \endcode
37  *
38  * \subsection IfxLld_Eray_Eray_Variables Variables
39  *
40  * \code
41  * // global variables
42  * static IfxEray_Eray eray;
43  * volatile unsigned receivedDataCounter;
44  * \endcode
45  *
46  * \subsection IfxLld_Eray_Eray_Defines Defines
47  * \code
48  *
49  * // Number of tested communication cycles
50  * #define NUMBER_ERAY_COMM_CYCLES 8
51  * \endcode
52  *
53  * \subsection IfxLld_Eray_Eray_Interrupt Interrupt Handler Installation
54  * Define priorities for the Interrrupt handler. This is normally done in the Ifx_IntPrioDef.h file:
55  * \code
56  * #define IFX_ERAY_INT0_PRIO 1
57  * #define IFX_ERAY_INT1_PRIO 2
58  * #define IFX_ERAY_NDAT0_PRIO 3
59  * #define IFX_ERAY_NDAT1_PRIO 4
60  * #define IFX_ERAY_MBSC0_PRIO 5
61  * #define IFX_ERAY_MBSC1_PRIO 6
62  * \endcode
63  *
64  * Add the interrupt service routine to your C code. It has to call the ERAY interrupt handler:
65  * \code
66  * // ISR routines for interrupt handling
67  * void ERAY_irqInt0Handler();
68  * void ERAY_irqInt1Handler();
69  * void ERAY_irqNdat0Handler();
70  * void ERAY_irqNdat1Handler();
71  * void ERAY_irqMbsc0Handler();
72  * void ERAY_irqMbsc1Handler();
73  *
74  * IFX_INTERRUPT(eray0Int0ISR, 0, IFX_ERAY_INT0_PRIO)
75  * {
76  * ERAY_irqInt0Handler();
77  * }
78  * IFX_INTERRUPT(eray0Int1ISR, 0, IFX_ERAY_INT1_PRIO)
79  * {
80  * ERAY_irqInt1Handler();
81  * }
82  * IFX_INTERRUPT(eray0Ndat0ISR, 0, IFX_ERAY_NDAT0_PRIO)
83  * {
84  * ERAY_irqNdat0Handler();
85  * }
86  * IFX_INTERRUPT(eray0Ndat1ISR, 0, IFX_ERAY_NDAT1_PRIO)
87  * {
88  * ERAY_irqNdat1Handler();
89  * }
90  * IFX_INTERRUPT(eray0Mbsc0ISR, 0, IFX_ERAY_MBSC0_PRIO)
91  * {
92  * ERAY_irqMbsc0Handler();
93  * }
94  * IFX_INTERRUPT(eray0Mbsc1ISR, 0, IFX_ERAY_MBSC1_PRIO)
95  * {
96  * ERAY_irqMbsc1Handler();
97  * }
98  * \endcode
99  *
100  * Finally install the interrupt handlers in your initialisation function:
101  * \code
102  * // install interrupt handler
103  * IfxCpu_Irq_installInterruptHandler(&eray0Int0ISR, IFX_ERAY_INT0_PRIO);
104  * IfxCpu_Irq_installInterruptHandler(&eray0Int1ISR, IFX_ERAY_INT1_PRIO);
105  * IfxCpu_Irq_installInterruptHandler(&eray0Ndat0ISR, IFX_ERAY_NDAT0_PRIO);
106  * IfxCpu_Irq_installInterruptHandler(&eray0Ndat1ISR, IFX_ERAY_NDAT1_PRIO);
107  * IfxCpu_Irq_installInterruptHandler(&eray0Mbsc0ISR, IFX_ERAY_MBSC0_PRIO);
108  * IfxCpu_Irq_installInterruptHandler(&eray0Mbsc1ISR, IFX_ERAY_MBSC1_PRIO);
109  *
110  * // enable all cpu0 interrupts
111  * IfxCpu_enableInterrupts();
112  * \endcode
113  *
114  *
115  * \subsection IfxLld_Eray_Eray_Init Module Initialisation
116  *
117  * First ensure that the ERAY PLL is configured to output a 80 MHz clock for the ERAY module:
118  * \code
119  * // initialize Eray PLL
120  * clib_ver_printf("Initialize ERAY PLL\n");
121  * {
122  * IfxScuCcu_ErayPllConfig ErayPllConfig;
123  * IfxScuCcu_initErayPllConfig(&ErayPllConfig);
124  * result |= IfxScuCcu_initErayPll(&ErayPllConfig);
125  * }
126  * \endcode
127  *
128  * Thereafter initialize the module:
129  * \code
130  * // create module config
131  * IfxEray_Eray_Config erayModuleConfig;
132  * #if TEST_ERAY1
133  * clib_ver_printf("Initialize ERAY1\n");
134  * IfxEray_Eray_initModuleConfig(&erayModuleConfig, &MODULE_ERAY1);
135  * #else
136  * clib_ver_printf("Initialize ERAY0\n");
137  * IfxEray_Eray_initModuleConfig(&erayModuleConfig, &MODULE_ERAY0);
138  * #endif
139  *
140  * // ISR priorities
141  * erayModuleConfig.interrupt.int0Priority = IFX_ERAY_INT0_PRIO;
142  * erayModuleConfig.interrupt.int1Priority = IFX_ERAY_INT1_PRIO;
143  * erayModuleConfig.interrupt.ndat0Priority = IFX_ERAY_NDAT0_PRIO;
144  * erayModuleConfig.interrupt.ndat1Priority = IFX_ERAY_NDAT1_PRIO;
145  * erayModuleConfig.interrupt.mbsc0Priority = IFX_ERAY_MBSC0_PRIO;
146  * erayModuleConfig.interrupt.mbsc1Priority = IFX_ERAY_MBSC1_PRIO;
147  *
148  * // init module
149  * IfxEray_Eray_initModule( &eray, &erayModuleConfig );
150  * \endcode
151  *
152  * \subsection IfxLld_Eray_Eray_Node_Init Node Initialisation
153  *
154  * The node initialisation can be done in the same function.
155  * \code
156  * // get ERAY node default configuration
157  * IfxEray_Eray_NodeConfig nodeConfig;
158  * IfxEray_Eray_Node_initConfig(&nodeConfig);
159  *
160  * // configuration changes for interaction with external testbench element
161  * {
162  * // only for simulation: start external ERAY node
163  * {
164  * TbeMessage reply;
165  *
166  * // start ERay Testbench Element
167  * sendMessage(MSG_ID_TESTBENCH_ERAY, CMD_ERAY_TBE_START, 0 );
168  * receiveMessageBlockingFrom(MSG_ID_TESTBENCH_ERAY, reply);
169  * }
170  *
171  * {
172  * // SUCC1
173  * IfxEray_Eray_Succ1Config *succ1 = &nodeConfig.controllerConfig.succ1Config;
174  *
175  * succ1->clockSyncErrorHalt = FALSE;
176  * }
177  *
178  * {
179  * // PRTC1
180  * IfxEray_Eray_Prtc1Control *prtc1 = &nodeConfig.controllerConfig.prtc1Control;
181  *
182  * prtc1->transmissionStartTime = 10;
183  * prtc1->collisionAvoidanceDuration = 0;
184  * prtc1->strobePosition = IfxEray_StrobePosition_5;
185  * prtc1->baudrate = IfxEray_Baudrate_10;
186  * prtc1->receiveWakeupTestDuration = 76;
187  * prtc1->transmitWakeupRepetitions = 2;
188  * }
189  *
190  * {
191  * // PRTC2
192  * IfxEray_Eray_Prtc2Control *prtc2 = &nodeConfig.controllerConfig.prtc2Control;
193  *
194  * prtc2->receiveWakeupIdleTime = 18;
195  * prtc2->receiveWakeupLowTime = 18;
196  * prtc2->transmitWakeupIdleTime = 180;
197  * prtc2->transmitWakeupLowTime = 60;
198  * }
199  *
200  * {
201  * // SUCC2
202  * IfxEray_Eray_Succ2Config *succ2 = &nodeConfig.controllerConfig.succ2Config;
203  * succ2->listenTimeOut = 2500;
204  * succ2->listenTimeOutNoise = IfxEray_ListenTimeOutNoise_16;
205  * }
206  *
207  * {
208  * // GTU
209  * IfxEray_Eray_GTUConfig *gtu = &nodeConfig.controllerConfig.gtuConfig;
210  *
211  * gtu->gtu01Config.microticksPerCycle = 3000;
212  * gtu->gtu02Config.macroticksPerCycle = 50;
213  * gtu->gtu02Config.maxSyncFrames = 15;
214  * gtu->gtu03Config.channelAMicrotickInitialOffset = 0;
215  * gtu->gtu03Config.channelBMicrotickInitialOffset = 0;
216  * gtu->gtu03Config.channelAMacrotickInitialOffset = 2;
217  * gtu->gtu03Config.channelBMacrotickInitialOffset = 2;
218  * gtu->gtu04Config.networkStartIdleTime = 0x2f;
219  * gtu->gtu04Config.correctionOffset = 0x30;
220  * gtu->gtu05Config.channelAReceptionDelay = 0x4;
221  * gtu->gtu05Config.channelBReceptionDelay = 0x4;
222  * gtu->gtu05Config.clusterDrift = 1;
223  * gtu->gtu05Config.decodingCorrection = 0x34;
224  * gtu->gtu06Config.acceptedStartupDeviation = 0x81;
225  * gtu->gtu06Config.maxDriftOffset = 0x31;
226  * gtu->gtu07Config.staticSlotLength = 0x10;
227  * gtu->gtu07Config.staticSlotsCount = 0x2;
228  * gtu->gtu08Config.dynamicSlotLength = 2;
229  * gtu->gtu08Config.dynamicSlotCount = 2;
230  * gtu->gtu09Config.idleDynamicSlots = IfxEray_IdleDynamicSlots_1; // bug: not set by IfxEray_setDynamicSlots
231  * gtu->gtu09Config.staticActionPoint = 1;
232  * gtu->gtu09Config.dynamicActionPoint = 1;
233  * gtu->gtu10Config.maxOffsetCorrection = 0xcd;
234  * gtu->gtu10Config.maxRateCorrection = 0x31;
235  * gtu->gtu11Config.externalOffsetCorrection = IfxEray_ExternalOffsetCorrection_0;
236  * gtu->gtu11Config.externalRateCorrection = IfxEray_ExternalRateCorrection_0;
237  * gtu->gtu11Config.externalOffset = IfxEray_ExternalOffset_noCorrection;
238  * gtu->gtu11Config.externalRate = IfxEray_ExternalRate_noCorrection;
239  * }
240  * }
241  *
242  * // Messages
243  * nodeConfig.messageRAMConfig.numberOfMessageBuffers = 2;
244  * nodeConfig.messageRAMConfig.firstDynamicBuffer = 0x40;
245  * nodeConfig.messageRAMConfig.fifoBufferStartIndex = 0x40;
246  *
247  * // Frame header
248  * IfxEray_Header header[2] = {
249  * // fid cyc cha chb buffer direction ppit transmission mode mbi pl dp startupfr syncfr
250  * { 1, 1, TRUE, TRUE, IfxEray_BufferDirection_transmit, TRUE, IfxEray_TransmissionMode_continuous, TRUE, 4, 0x30, TRUE, TRUE },
251  * { 2, 1, TRUE, TRUE, IfxEray_BufferDirection_receive, FALSE, IfxEray_TransmissionMode_continuous, TRUE, 4, 0x40, FALSE, FALSE },
252  * };
253  *
254  * // slot buffer
255  * IfxEray_SlotConfig slot[2] = {
256  * // header data stxrh buffNum
257  * { TRUE, TRUE, TRUE, 0 },
258  * { TRUE, FALSE, FALSE, 1 },
259  * };
260  *
261  * for(int i=0; i < 2; ++i) {
262  * nodeConfig.messageRAMConfig.header[i] = &header[i];
263  * nodeConfig.messageRAMConfig.slotControl[i] = &slot[i];
264  * nodeConfig.messageRAMConfig.data[i] = NULL_PTR;
265  * }
266  *
267  * #if TEST_ERAY1
268  * // channel A pins
269  * const IfxEray_Eray_NodeA nodeAPins = {
270  * IfxPort_InputMode_pullDown, IfxPort_OutputMode_pushPull,
271  * IfxPort_PadDriver_cmosAutomotiveSpeed3, IfxPort_OutputMode_pushPull,
272  * &IfxEray1_RXDA0_P14_8_IN, &IfxEray1_TXDA_P14_10_OUT,
273  * &IfxEray1_TXENA_P14_9_OUT
274  * };
275  *
276  * // channel B pins
277  * const IfxEray_Eray_NodeB nodeBPins = {
278  * IfxPort_InputMode_pullDown, IfxPort_OutputMode_pushPull,
279  * IfxPort_PadDriver_cmosAutomotiveSpeed3, IfxPort_OutputMode_pushPull,
280  * &IfxEray1_RXDB0_P14_7_IN, &IfxEray1_TXDB_P14_5_OUT,
281  * &IfxEray1_TXENB_P14_6_OUT
282  * };
283  * #else
284  * // channel A pins
285  * const IfxEray_Eray_NodeA nodeAPins = {
286  * IfxPort_InputMode_pullDown, IfxPort_OutputMode_pushPull,
287  * IfxPort_PadDriver_cmosAutomotiveSpeed3, IfxPort_OutputMode_pushPull,
288  * &IfxEray0_RXDA0_P14_8_IN, &IfxEray0_TXDA_P14_10_OUT,
289  * &IfxEray0_TXENA_P14_9_OUT
290  * };
291  *
292  * // channel B pins
293  * const IfxEray_Eray_NodeB nodeBPins = {
294  * IfxPort_InputMode_pullDown, IfxPort_OutputMode_pushPull,
295  * IfxPort_PadDriver_cmosAutomotiveSpeed3, IfxPort_OutputMode_pushPull,
296  * &IfxEray0_RXDB0_P14_7_IN, &IfxEray0_TXDB_P14_5_OUT,
297  * &IfxEray0_TXENB_P14_6_OUT
298  * };
299  * #endif
300  *
301  * const IfxEray_Eray_Pins pins = { (IfxEray_Eray_NodeA *)&nodeAPins, (IfxEray_Eray_NodeB *)&nodeBPins };
302  * nodeConfig.pins = (IfxEray_Eray_Pins *)&pins;
303  *
304  * // ERAY node initialisation with supplied configuration
305  * IfxEray_Eray_Node_init(&eray, &nodeConfig);
306  *
307  * // set interrupt outputs for data and message buffers
308  * IfxEray_Eray_setNewDataInterruptDestination(&eray, 0, 0); // New Data #0 -> NDAT0
309  * IfxEray_Eray_setNewDataInterruptDestination(&eray, 1, 1); // New Data #1 -> NDAT1
310  * IfxEray_Eray_setMessageBufferInterruptDestination(&eray, 0, 0); // Message Buffer #0 -> MBSC0
311  * IfxEray_Eray_setMessageBufferInterruptDestination(&eray, 1, 1); // Message Buffer #1 -> MBSC1
312  *
313  * clib_ver_printf("Send wakeup pattern\n");
314  *
315  * // send wakeup pattern on default configured channel ( IfxEray_Channel_a )
316  * IfxEray_PocState pocState;
317  * do {
318  * pocState = IfxEray_Eray_getPocState( &eray );
319  * if ( pocState != IfxEray_PocState_wakeupListen ) {
320  * while ( !IfxEray_Eray_changePocState( &eray, IfxEray_PocCommand_wakeup ));
321  * }
322  * } while ( pocState != IfxEray_PocState_wakeupListen );
323  *
324  * // allow node to cold-start and wait until cold-start is successful
325  * while( !IfxEray_Eray_allowColdStart(&eray) );
326  *
327  * // start the communication in cluster and wait until communication is successfull
328  * while( !IfxEray_Eray_startCommunication(&eray) );
329  *
330  * // wait until communication Controller enters NORMAL_ACTIVE or NORMAL_PASSIVE state, exit if communication Controller enters HALT state.
331  * do {
332  * pocState = IfxEray_Eray_getPocState( &eray );
333  * // if communication Controller enters HALT state, break the loop.
334  * if( pocState == IfxEray_PocState_halt) {
335  * break;
336  * }
337  * } while( !((pocState == IfxEray_PocState_normalActive) || (pocState == IfxEray_PocState_normalPassive)) );
338  *
339  * // enter ALL_SLOTS mode when Communication Controller is in NORMAL_ACTIVE or NORMAL_PASSIVE state only.
340  * if ( pocState == IfxEray_PocState_normalActive || pocState == IfxEray_PocState_normalPassive ) {
341  * while ( !IfxEray_Eray_setPocAllSlots(&eray) );
342  * }
343  * \endcode
344  *
345  * \subsection IfxLld_Eray_Eray_TxRx Transactions
346  *
347  * \code
348  * unsigned prevReceivedDataCounter = 0;
349  * while( 1 ) {
350  * if( receivedDataCounter != prevReceivedDataCounter ) {
351  * prevReceivedDataCounter = receivedDataCounter;
352  * clib_ver_printf("Received %d packets", receivedDataCounter);
353  *
354  * if( receivedDataCounter >= NUMBER_ERAY_COMM_CYCLES )
355  * break;
356  * }
357  * };
358  * \endcode
359  *
360  *
361  * \subsection IfxLld_Eray_Eray_ISR Interrupt Service Handlers
362  *
363  * The ISR has to be implemented in the application. Following templates can be used to react on the events:
364  *
365  * \code
366  * void ERAY_irqInt0Handler()
367  * {
368  * clib_ver_note(1); // for debugging in simulation: notify Int0
369  *
370  * Ifx_ERAY_EIR ErrIntStat = IfxEray_Eray_getErrorInterrupts( &eray );
371  * Ifx_ERAY_SIR StatusIntStat = IfxEray_Eray_getStatusInterrupts( &eray );
372  *
373  * if(StatusIntStat.B.SDS)
374  * {
375  * // SDS must be cleared for getting the next interrupt
376  * IfxEray_Eray_clearStatusFlag( &eray, IfxEray_ClearStatusFlag_sds );
377  * }
378  * if(StatusIntStat.B.CYCS)
379  * {
380  * // CYCS must be cleared for getting the next interrupt
381  * IfxEray_Eray_clearStatusFlag( &eray, IfxEray_ClearStatusFlag_cycs );
382  * }
383  * if(StatusIntStat.B.SUCS)
384  * {
385  * // SUCS must be cleared for getting the next interrupt
386  * IfxEray_Eray_clearStatusFlag( &eray, IfxEray_ClearStatusFlag_sucs );
387  * }
388  * if(StatusIntStat.B.TIBC)
389  * {
390  * // TIBC must be cleared for getting the next interrupt
391  * IfxEray_Eray_clearStatusFlag( &eray, IfxEray_ClearStatusFlag_tibc );
392  * }
393  * if(ErrIntStat.B.MHF)
394  * {
395  * // clear flag MHF
396  * IfxEray_Eray_clearErrorFlag( &eray, IfxEray_ClearErrorFlag_mhf );
397  * }
398  * }
399  *
400  * void ERAY_irqInt1Handler()
401  * {
402  * clib_ver_note(2); // for debugging in simulation: notify Int1
403  *
404  * // TOBC must be cleared for getting the next interrupt
405  * IfxEray_Eray_clearStatusFlag( &eray, IfxEray_ClearStatusFlag_tobc );
406  * }
407  *
408  * void ERAY_irqNdat0Handler()
409  * {
410  * clib_ver_note(3); // for debugging in simulation: notify Ndat0
411  * }
412  *
413  * void ERAY_irqNdat1Handler()
414  * {
415  * clib_ver_note(4); // for debugging in simulation: notify Ndat1
416  *
417  * // message received in slot1 buffer?
418  * if( IfxEray_Eray_getNewDataInterruptStatus(&eray, 1) == 1 )
419  * {
420  * // read data
421  * uint32 data[2];
422  *
423  * {
424  * IfxEray_Eray_ReceiveControl config;
425  * config.headerReceived = TRUE;
426  * config.dataReceived = TRUE;
427  * config.receiveRequested = TRUE;
428  * config.swapRequested = TRUE;
429  * config.bufferIndex = 1;
430  *
431  * IfxEray_Eray_receiveFrame(&eray, &config);
432  * IfxEray_Eray_readData(&eray, data, 2*2);
433  * }
434  *
435  * // display received data
436  * clib_ver_data(data[0]);
437  * clib_ver_data(data[1]);
438  *
439  * // store received data
440  * if( receivedDataCounter < NUMBER_ERAY_COMM_CYCLES ) {
441  * receivedData[receivedDataCounter][0] = data[0];
442  * receivedData[receivedDataCounter][1] = data[1];
443  * }
444  * ++receivedDataCounter;
445  *
446  * // put some new data into slot0
447  * ++data[0];
448  * ++data[1];
449  *
450  * {
451  * IfxEray_Eray_TransmitControl config;
452  * config.headerTransfered = FALSE;
453  * config.dataTransfered = TRUE;
454  * config.transferRequested = TRUE;
455  * config.bufferIndex = 0;
456  *
457  * IfxEray_Eray_writeData(&eray, data, 2*2);
458  * IfxEray_Eray_transmitFrame(&eray, &config);
459  * }
460  * }
461  * }
462  *
463  * void ERAY_irqMbsc0Handler()
464  * {
465  * clib_ver_note(5); // for debugging in simulation: notify Mbsc0
466  * }
467  *
468  * void ERAY_irqMbsc1Handler()
469  * {
470  * clib_ver_note(6); // for debugging in simulation: notify Mbsc1
471  * }
472  * \endcode
473  *
474  * \defgroup IfxLld_Eray_Eray Eray
475  * \ingroup IfxLld_Eray
476  * \defgroup IfxLld_Eray_Eray_Structures Data Structures
477  * \ingroup IfxLld_Eray_Eray
478  * \defgroup IfxLld_Eray_Eray_Module Module Initialisation Functions
479  * \ingroup IfxLld_Eray_Eray
480  * \defgroup IfxLld_Eray_Eray_Node Node Initialisation Functions
481  * \ingroup IfxLld_Eray_Eray
482  * \defgroup IfxLld_Eray_Eray_Operative Operative Functions
483  * \ingroup IfxLld_Eray_Eray
484  * \defgroup IfxLld_Eray_Eray_Status Status Functions
485  * \ingroup IfxLld_Eray_Eray
486  * \defgroup IfxLld_Eray_Eray_Interrupt Interrupt Functions
487  * \ingroup IfxLld_Eray_Eray
488  */
489 
490 #ifndef IFXERAY_ERAY_H
491 #define IFXERAY_ERAY_H 1
492 
493 /******************************************************************************/
494 /*----------------------------------Includes----------------------------------*/
495 /******************************************************************************/
496 
497 #include "Eray/Std/IfxEray.h"
498 
499 /******************************************************************************/
500 /*-----------------------------Data Structures--------------------------------*/
501 /******************************************************************************/
502 
503 /** \addtogroup IfxLld_Eray_Eray_Structures
504  * \{ */
505 /** \brief GTU01 configuration.
506  */
507 typedef struct
508 {
509  uint32 microticksPerCycle; /**< \brief Duration of the communication cycle in Microticks. */
511 
512 /** \brief GTU02 configuration.
513  */
514 typedef struct
515 {
516  uint16 macroticksPerCycle; /**< \brief Duration of the communication cycle in Macroticks. */
517  uint8 maxSyncFrames; /**< \brief Maximum number of sync frames in a cluster. */
519 
520 /** \brief GTU03 configuration.
521  */
522 typedef struct
523 {
524  uint8 channelAMicrotickInitialOffset; /**< \brief difference between adjacent time reference points on channel A in microticks. */
525  uint8 channelBMicrotickInitialOffset; /**< \brief difference between adjacent time reference points on channel B in microticks. */
526  uint8 channelAMacrotickInitialOffset; /**< \brief difference between two adjacent static slots on channel A in macroticks. */
527  uint8 channelBMacrotickInitialOffset; /**< \brief difference between two adjacent static slots on channel B in macroticks. */
529 
530 /** \brief GTU04 configuration.
531  */
532 typedef struct
533 {
534  uint16 networkStartIdleTime; /**< \brief starting point of Network Idle Time Phase. */
535  uint16 correctionOffset; /**< \brief offset correction start point. */
537 
538 /** \brief GTU05 configuration.
539  */
540 typedef struct
541 {
542  uint8 channelAReceptionDelay; /**< \brief reception delay on channel A. */
543  uint8 channelBReceptionDelay; /**< \brief reception delay on channel B. */
544  uint8 clusterDrift; /**< \brief cluster drift damping value used in clock synchronization. */
545  uint8 decodingCorrection; /**< \brief decoding correction to determine the primary time reference point. */
547 
548 /** \brief GTU06 configuration.
549  */
550 typedef struct
551 {
552  uint16 acceptedStartupDeviation; /**< \brief expanded range of measured deviation for startup Frames during integration. */
553  uint16 maxDriftOffset; /**< \brief maximum drift offset between two nodes. */
555 
556 /** \brief GTU07 configuration.
557  */
558 typedef struct
559 {
560  uint16 staticSlotLength; /**< \brief duration of static slot in macroticks. */
561  uint16 staticSlotsCount; /**< \brief number of static slots in a communication cycle. */
563 
564 /** \brief GTU08 configuration.
565  */
566 typedef struct
567 {
568  uint8 dynamicSlotLength; /**< \brief duration of dynamic slot in macroticks. */
569  uint16 dynamicSlotCount; /**< \brief number of dynamic slots in a communication cycle. */
571 
572 /** \brief GTU09 configuration.
573  */
574 typedef struct
575 {
576  uint8 staticActionPoint; /**< \brief static slots and symbol window action point. */
577  uint8 dynamicActionPoint; /**< \brief dynamic slots action point. */
578  IfxEray_IdleDynamicSlots idleDynamicSlots; /**< \brief duration of dynamic slot idle phase. */
580 
581 /** \brief GTU10 configuration.
582  */
583 typedef struct
584 {
585  uint16 maxOffsetCorrection; /**< \brief maximum offset correction to be applied by the internal clock synchronization algorithm. */
586  uint16 maxRateCorrection; /**< \brief maximum rate correction to be applied by the internal clock synchronization algorithm. */
588 
589 /** \brief GTU11 configuration.
590  */
591 typedef struct
592 {
593  IfxEray_ExternalOffsetCorrection externalOffsetCorrection; /**< \brief External clock offset correction value. */
594  IfxEray_ExternalRateCorrection externalRateCorrection; /**< \brief External clock rate correction value. */
595  IfxEray_ExternalOffset externalOffset; /**< \brief External offset correction control. */
596  IfxEray_ExternalRate externalRate; /**< \brief External rate correction control. */
598 
599 /** \} */
600 
601 /** \addtogroup IfxLld_Eray_Eray_Structures
602  * \{ */
603 /** \brief Gloabl Timing Unit configuration structure.
604  */
605 typedef struct
606 {
607  IfxEray_Eray_Gtu01Config gtu01Config; /**< \brief GTU01 configuration. */
608  IfxEray_Eray_Gtu02Config gtu02Config; /**< \brief GTU02 configuration. */
609  IfxEray_Eray_Gtu03Config gtu03Config; /**< \brief GTU03 configuration. */
610  IfxEray_Eray_Gtu04Config gtu04Config; /**< \brief GTU04 configuration. */
611  IfxEray_Eray_Gtu05Config gtu05Config; /**< \brief GTU05 configuration. */
612  IfxEray_Eray_Gtu06Config gtu06Config; /**< \brief GTU06 configuration. */
613  IfxEray_Eray_Gtu07Config gtu07Config; /**< \brief GTU07 configuration. */
614  IfxEray_Eray_Gtu08Config gtu08Config; /**< \brief GTU08 configuration. */
615  IfxEray_Eray_Gtu09Config gtu09Config; /**< \brief GTU09 configuration. */
616  IfxEray_Eray_Gtu10Config gtu10Config; /**< \brief GTU10 configuration. */
617  IfxEray_Eray_Gtu11Config gtu11Config; /**< \brief GTU11 configuration. */
619 
620 /** \brief Pins configuration structure for Node A.
621  */
622 typedef struct
623 {
624  IfxPort_InputMode rxInMode; /**< \brief the RX pin input mode which should be configured */
625  IfxPort_OutputMode txOutMode; /**< \brief the TX pin output mode which should be configured. */
626  IfxPort_PadDriver pinDriver; /**< \brief the pad driver mode which should be configured. */
627  IfxPort_OutputMode txEnOutMode; /**< \brief the TXEN pin output mode which should be configured. */
628  const IfxEray_Rxd_In *rxIn; /**< \brief the RX Pin which should be configured. */
629  const IfxEray_Txd_Out *txOut; /**< \brief the TX Pin which should be configured. */
630  const IfxEray_Txen_Out *txEnOut; /**< \brief the TXEN Pin which should be configured. */
632 
633 /** \brief Pins configuration structure for Node B.
634  */
635 typedef struct
636 {
637  IfxPort_InputMode rxInMode; /**< \brief the RX pin input mode which should be configured */
638  IfxPort_OutputMode txOutMode; /**< \brief the TX pin output mode which should be configured. */
639  IfxPort_PadDriver pinDriver; /**< \brief the pad driver mode which should be configured. */
640  IfxPort_OutputMode txEnOutMode; /**< \brief the TXEN pin output mode which should be configured. */
641  const IfxEray_Rxd_In *rxIn; /**< \brief the RX Pin which should be configured. */
642  const IfxEray_Txd_Out *txOut; /**< \brief the TX Pin which should be configured. */
643  const IfxEray_Txen_Out *txEnOut; /**< \brief the TXEN Pin which should be configured. */
645 
646 /** \brief Protocol operation control properties.
647  */
648 typedef struct
649 {
650  uint8 collisionAvoidanceDuration; /**< \brief accepted duration of collision avoidance symbol. */
651  IfxEray_StrobePosition strobePosition; /**< \brief sample count value for strobing. */
652  IfxEray_Baudrate baudrate; /**< \brief baud rate on the flexray bus. */
653  uint8 receiveWakeupTestDuration; /**< \brief duration of received wakeup pattern in bit times. */
654  uint8 transmitWakeupRepetitions; /**< \brief duration of transmitted wakeup pattern in bit times. */
655  uint16 transmissionStartTime; /**< \brief duration of transmission start time. */
657 
658 /** \brief Wakeup symbol control properties.
659  */
660 typedef struct
661 {
662  uint8 receiveWakeupIdleTime; /**< \brief duration of received wakeup symbol idle phase. */
663  uint8 receiveWakeupLowTime; /**< \brief duration of received wakeup symbol low phase. */
664  uint8 transmitWakeupIdleTime; /**< \brief duration of transmit wakeup symbol idle phase. */
665  uint8 transmitWakeupLowTime; /**< \brief duration of transmit wakeup symbol low phase. */
667 
668 /** \brief communication controller control properties.
669  */
670 typedef struct
671 {
672  boolean startupFrameTransmitted; /**< \brief whether the key slot is used to transmit startup Frames. */
673  boolean syncFrameTransmitted; /**< \brief whether the key slot is used to transmit SYNC Frames. */
674  uint8 maxColdStartAttempts; /**< \brief maximum number of attempts that a cold starting node is permitted. */
675  uint8 numberOfCyclePairsForActive; /**< \brief number of even / odd cycle pairs that must have valid clock correction terms. */
676  IfxEray_WakeupChannel wakeupPatternChannel; /**< \brief Wakeup pattern carry channel */
677  IfxEray_TransmissionSlotMode transmissionSlotMode; /**< \brief Initial transmission mode. */
678  boolean clockSyncErrorHalt; /**< \brief transition to HALT state due to a clock synchronization error. */
679  boolean channelASymbolTransmitted; /**< \brief selects channel A for MTS symbol transmission. */
680  boolean channelBSymbolTransmitted; /**< \brief selects channel B for MTS symbol transmission */
681  boolean channelAConnectedNode; /**< \brief whether the node is connected to channel A. */
682  boolean channelBConnectedNode; /**< \brief whether the node is connected to channel B. */
684 
685 /** \brief Communication listen timeout properties.
686  */
687 typedef struct
688 {
689  uint32 listenTimeOut; /**< \brief wakeup or startup listen timeout in microticks. */
690  IfxEray_ListenTimeOutNoise listenTimeOutNoise; /**< \brief upper limit for startup and wakeup listen timeout in the presence of noise. */
692 
693 /** \brief Clock correction fail properties.
694  */
695 typedef struct
696 {
697  uint8 clockCorrectionCyclesPassive; /**< \brief maximum number of cycles missing clock correction lead active to passive state. */
698  uint8 clockCorrectionCyclesHalt; /**< \brief maximum number of cycles missing clock correctionlead to active or passive to halt. */
700 
701 /** \} */
702 
703 /** \addtogroup IfxLld_Eray_Eray_Structures
704  * \{ */
705 /** \brief Communication Controller configuration structure.
706  */
707 typedef struct
708 {
709  uint32 networkVectorLength; /**< \brief length of network management vector. */
710  uint8 staticFramepayload; /**< \brief payload length of static frame in double bytes. */
711  uint8 latestTransmissionStart; /**< \brief number of dynamic slots before inhibit frame transmission in dynamic segment. */
712  IfxEray_Eray_GTUConfig gtuConfig; /**< \brief gloabl timing unit configuration structure. */
713  IfxEray_Eray_Succ1Config succ1Config; /**< \brief communication controller control properties. */
714  IfxEray_Eray_Succ2Config succ2Config; /**< \brief communication listen timeout properties. */
715  IfxEray_Eray_Succ3Config succ3Config; /**< \brief clock correction fail properties. */
716  IfxEray_Eray_Prtc1Control prtc1Control; /**< \brief protocol operation control properties. */
717  IfxEray_Eray_Prtc2Control prtc2Control; /**< \brief wakeup symbol control properties. */
719 
720 /** \brief Interrupt control properties.
721  */
722 typedef struct
723 {
724  uint16 int0Priority; /**< \brief the interrupt line 0 priority. Always 1 since all interrupts are handled at a time. */
725  uint16 int1Priority; /**< \brief the interrupt line 1 priority. Always 1 since all interrupts are handled at a time. */
726  uint16 tint0Priority; /**< \brief the timer interrupt 0 priority. Always 1 since all interrupts are handled at a time. */
727  uint16 tint1Priority; /**< \brief the timer interrupt 1 priority. Always 1 since all interrupts are handled at a time. */
728  uint16 ndat0Priority; /**< \brief the new data interrupt 0 priority. Always 1 since all interrupts are handled at a time. */
729  uint16 ndat1Priority; /**< \brief the new data interrupt 1 priority. Always 1 since all interrupts are handled at a time. */
730  uint16 mbsc0Priority; /**< \brief the message buffer status changed interrupt 0 priority. Always 1 since all interrupts are handled at a time. */
731  uint16 mbsc1Priority; /**< \brief the message buffer status changed interrupt 1 priority. Always 1 since all interrupts are handled at a time. */
732  uint16 ibusyPriority; /**< \brief the inputput buffer interrupt priority. Always 1 since all interrupts are handled at a time. */
733  uint16 obusyPriority; /**< \brief the output buffer interrupt priority. Always 1 since all interrupts are handled at a time. */
734  IfxSrc_Tos int0IsrProvider; /**< \brief the interrupt line 0 service provider. CPU or DMA. */
735  IfxSrc_Tos int1IsrProvider; /**< \brief the interrupt line 1 service provider. CPU or DMA. */
736  IfxSrc_Tos tint0IsrProvider; /**< \brief the timer interrupt line 0 service provider. CPU or DMA. */
737  IfxSrc_Tos tint1IsrProvider; /**< \brief the timer interrupt line 1 service provider. CPU or DMA. */
738  IfxSrc_Tos ndat0IsrProvider; /**< \brief the new data interrupt 0 service provider. CPU or DMA. */
739  IfxSrc_Tos ndat1IsrProvider; /**< \brief the new data interrupt 1 service provider. CPU or DMA. */
740  IfxSrc_Tos mbsc0IsrProvider; /**< \brief the message buffer status changed interrupt 0 service provider. CPU or DMA. */
741  IfxSrc_Tos mbsc1IsrProvider; /**< \brief the message buffer status changed interrupt 1 service provider. CPU or DMA. */
742  IfxSrc_Tos ibusyIsrProvider; /**< \brief the input buffer interrupt service provider. CPU or DMA. */
743  IfxSrc_Tos obusyIsrProvider; /**< \brief the output buffer interrupt service provider. CPU or DMA. */
745 
746 /** \brief Message RAM configuration structure.
747  */
748 typedef struct
749 {
750  uint8 firstDynamicBuffer; /**< \brief first dynamic buffer index. */
751  uint8 numberOfMessageBuffers; /**< \brief last configured buffer. */
752  uint32 fifoBufferStartIndex; /**< \brief message buffers assigned FIFO. */
753  uint8 fifoDepth; /**< \brief fifo critical level. */
754  uint16 frameIdFilter; /**< \brief Frame ID used for rejection filtering. */
755  IfxEray_ReceiveChannel receiveChannel; /**< \brief FIFO receive channel. */
756  uint16 rejectedFrameId; /**< \brief frame ID to be rejected by the FIFO. */
757  uint8 filteredCycleNumber; /**< \brief the cycle set to which Frame ID and channel rejection filter are applied. */
758  boolean staticFifoDisabled; /**< \brief fifo is not used in static segment. */
759  boolean fifoNullFramesRejected; /**< \brief whether null frames stored in fifo or not. */
760  boolean bufferReconfigEnabled; /**< \brief whether reconfiguration of message buffers is enabled or not. */
761  boolean fifoConfigured; /**< \brief Whether receive FIFO configured or not. */
762  IfxEray_Header *header[128]; /**< \brief Header section of message buffer. */
763  IfxEray_SlotConfig *slotControl[128]; /**< \brief Transmit control properties. */
764  uint32 *data[128]; /**< \brief data section of message buffer. */
766 
767 /** \brief Pins configuration structure.
768  */
769 typedef struct
770 {
771  const IfxEray_Eray_NodeA *nodeAPins; /**< \brief Pins configuration structure for Node A. */
772  const IfxEray_Eray_NodeB *nodeBPins; /**< \brief Pins configuration structure for Node B. */
774 
775 /** \} */
776 
777 /** \addtogroup IfxLld_Eray_Eray_Structures
778  * \{ */
779 /** \brief ERAY Module handle.
780  */
781 typedef struct
782 {
783  Ifx_ERAY *eray; /**< \brief pointer to ERAY module registers. */
784 } IfxEray_Eray;
785 
786 /** \brief Reconfigurable buffer structure.
787  */
788 typedef struct
789 {
790  IfxEray_Header *header; /**< \brief header of a reconfigurable buffer. */
791  uint32 data[64]; /**< \brief data section of a reconfigurable buffer. */
792  IfxEray_SlotConfig *slotControl; /**< \brief message buffer configuration in message RAM. */
794 
795 /** \brief Module configuration structure
796  */
797 typedef struct
798 {
799  Ifx_ERAY *module; /**< \brief pointer to ERAY module registers. */
800  IfxEray_Eray_Interrupt interrupt; /**< \brief Interrupt control properties. */
802 
803 /** \brief Node configuration structure.
804  */
805 typedef struct
806 {
807  IfxEray_Eray_MessageRAMConfig messageRAMConfig; /**< \brief Message RAM configuration structure. */
808  IfxEray_Eray_ControllerConfig controllerConfig; /**< \brief Communication Controller configuration structure. */
809  const IfxEray_Eray_Pins *pins; /**< \brief Pins configuration structure. */
811 
812 /** \brief Receive control properties structure.
813  */
814 typedef struct
815 {
816  boolean headerReceived; /**< \brief whether header selected for transfer from Message RAM to Output Buffer or not. */
817  boolean dataReceived; /**< \brief whether data selected for transfer from Message RAM to Output Buffer or not. */
818  boolean swapRequested; /**< \brief whether output buffer shadow and output buffer host are swapped or not. */
819  boolean receiveRequested; /**< \brief */
820  uint8 bufferIndex; /**< \brief buffer index in the Message RAM. */
822 
823 /** \brief Received Frame.
824  */
825 typedef struct
826 {
827  IfxEray_ReceivedHeader header; /**< \brief received header in a frame. */
828  uint32 data[64]; /**< \brief received data in a frame. */
830 
831 /** \brief Transfer control in a slot.
832  */
833 typedef struct
834 {
835  boolean headerTransfered; /**< \brief whether header section of frame is transfered or not. */
836  boolean dataTransfered; /**< \brief whether data section of message buffer is transfered or not. */
837  boolean transferRequested; /**< \brief whether frame in a slot is transfered or not. */
838  uint8 bufferIndex; /**< \brief buffer index which gives slot for transfers. */
840 
841 /** \} */
842 
843 /** \addtogroup IfxLld_Eray_Eray_Module
844  * \{ */
845 
846 /******************************************************************************/
847 /*-------------------------Inline Function Prototypes-------------------------*/
848 /******************************************************************************/
849 
850 /** \brief De-initialises the ERAY module.
851  * \param eray pointer to module handle.
852  * \return None
853  *
854  * For usage exapmle see : \ref IfxLld_Eray_Eray_Usage
855  *
856  */
858 
859 /******************************************************************************/
860 /*-------------------------Global Function Prototypes-------------------------*/
861 /******************************************************************************/
862 
863 /** \brief Initialises the ERAY module with supplied configuration.
864  * \param eray pointer to ERAY Module handle.
865  * \param config pointer to module configuration structure.
866  * \return None
867  *
868  * For usage exapmle see : \ref IfxLld_Eray_Eray_Usage
869  *
870  */
872 
873 /** \brief Inialises the default module configuration buffer.
874  * \param config pointer to module configuration structure.
875  * \param eray pointer ERAY module registers.
876  * \return None
877  *
878  * For usage exapmle see : \ref IfxLld_Eray_Eray_Usage
879  *
880  */
881 IFX_EXTERN void IfxEray_Eray_initModuleConfig(IfxEray_Eray_Config *config, Ifx_ERAY *eray);
882 
883 /** \} */
884 
885 /** \addtogroup IfxLld_Eray_Eray_Node
886  * \{ */
887 
888 /******************************************************************************/
889 /*-------------------------Global Function Prototypes-------------------------*/
890 /******************************************************************************/
891 
892 /** \brief Initialises the Node with supplied configuration.
893  * \param eray pointer to ERAY Module handle.
894  * \param config pointer to node configuration structure.
895  * \return None
896  *
897  * For usage exapmle see : \ref IfxLld_Eray_Eray_Usage
898  *
899  */
901 
902 /** \brief Initialises the default node configuration buffer.
903  * \param config pointer to node configuration structure.
904  * \return None
905  *
906  * For usage exapmle see : \ref IfxLld_Eray_Eray_Usage
907  *
908  */
910 
911 /** \} */
912 
913 /** \addtogroup IfxLld_Eray_Eray_Operative
914  * \{ */
915 
916 /******************************************************************************/
917 /*-------------------------Inline Function Prototypes-------------------------*/
918 /******************************************************************************/
919 
920 /** \brief Allows node to enter the cold startup state.
921  * \param eray pointer to ERAY Module handle.
922  * \return TRUE if cold start successful otherwise FALSE.
923  *
924  * For usage exapmle see : \ref IfxLld_Eray_Eray_Usage
925  *
926  */
928 
929 /** \brief Reconfiguring the buffer or changing the slot.
930  * \param eray pointer to module handle.
931  * \param reconfigBuffer pointer reconfigurable buffer structure.
932  * \return None
933  *
934  * For usage exapmle see : \ref IfxLld_Eray_Eray_Usage
935  *
936  */
938 
939 /** \brief Changes the POC state and return status.
940  * \param eray pointer to module handle.
941  * \param PocCommand POC command to change state.
942  * \return TRUE if command accepted.
943  */
945 
946 /** \brief Reads the received data from output registers.
947  * \param eray pointer to module handle.
948  * \param data pointer to received data buffer.
949  * \param payloadLength payload length received in a frame.
950  * \return None
951  */
952 IFX_INLINE void IfxEray_Eray_readData(IfxEray_Eray *eray, uint32 *data, uint8 payloadLength);
953 
954 /** \brief reads the frame received in a buffer.
955  * \param eray pointer to module handle.
956  * \param frame received frame in a buffer.
957  * \param maxPayloadLength maximum payload length received in a frame.
958  * \return None
959  *
960  * For usage exapmle see : \ref IfxLld_Eray_Eray_Usage
961  *
962  */
964 
965 /** \brief Sets the Controller state to ALL Slots mode.
966  * \param eray pointer to module handle.
967  * \return TRUE if All slots mode is successful otherwise FALSE.
968  *
969  * For usage exapmle see : \ref IfxLld_Eray_Eray_Usage
970  *
971  */
973 
974 /** \brief Runs the communication controller.
975  * \param eray pointer to ERAY Module handle.
976  * \return TRUE if communication started otherwise FALSE.
977  *
978  * For usage exapmle see : \ref IfxLld_Eray_Eray_Usage
979  *
980  */
982 
983 /** \brief Wakeups the channel in a cluster.
984  * \param eray pointer to ERAY Module handle.
985  * \param channel wakeup channel Id.
986  * \return None
987  *
988  * For usage exapmle see : \ref IfxLld_Eray_Eray_Usage
989  *
990  */
992 
993 /** \brief Wakeups the node in a cluster.
994  * \param eray pointer to ERAY Module handle.
995  * \return TRUE if cluster is wakeup otherwise FALSE.
996  *
997  * For usage exapmle see : \ref IfxLld_Eray_Eray_Usage
998  *
999  */
1001 
1002 /** \brief Writes data section of a frame to input data registers.
1003  * \param eray pointer to module handle.
1004  * \param data data section in frame.
1005  * \param payloadLength payload length configured for slot buffer.
1006  * \return None
1007  *
1008  * For usage exapmle see : \ref IfxLld_Eray_Eray_Usage
1009  *
1010  */
1011 IFX_INLINE void IfxEray_Eray_writeData(IfxEray_Eray *eray, uint32 *data, uint8 payloadLength);
1012 
1013 /******************************************************************************/
1014 /*-------------------------Global Function Prototypes-------------------------*/
1015 /******************************************************************************/
1016 
1017 /** \brief Transfers frame from fifo in message RAM to Output buffer.
1018  * \param eray pointer to ERAY Module handle.
1019  * \param config pointer to receive control structure.
1020  * \return None
1021  *
1022  * For usage exapmle see : \ref IfxLld_Eray_Eray_Usage
1023  *
1024  */
1026 
1027 /** \brief Transfers header and data from message buffer to output buffer.
1028  * \param eray pointer to ERAY Module handle.
1029  * \param config pointer to receive control structure.
1030  * \return None
1031  *
1032  * For usage exapmle see : \ref IfxLld_Eray_Eray_Usage
1033  *
1034  */
1036 
1037 /** \brief Transfers the frame in given slot.
1038  * \param eray pointer to module handle.
1039  * \param transmitControl transmits frame in a given slot.
1040  * \return None
1041  *
1042  * For usage exapmle see : \ref IfxLld_Eray_Eray_Usage
1043  *
1044  */
1046 
1047 /** \} */
1048 
1049 /** \addtogroup IfxLld_Eray_Eray_Status
1050  * \{ */
1051 
1052 /******************************************************************************/
1053 /*-------------------------Inline Function Prototypes-------------------------*/
1054 /******************************************************************************/
1055 
1056 /** \brief Gets the current node controller POC state.
1057  * \param eray pointer to module handle.
1058  * \return current POC state.
1059  */
1061 
1062 /** \brief Gets the received wakeup pattern channel.
1063  * \param eray pointer to module handle.
1064  * \return received wakeup pattern channel.
1065  *
1066  * For usage exapmle see : \ref IfxLld_Eray_Eray_Usage
1067  *
1068  */
1070 
1071 /** \} */
1072 
1073 /** \addtogroup IfxLld_Eray_Eray_Interrupt
1074  * \{ */
1075 
1076 /******************************************************************************/
1077 /*-------------------------Inline Function Prototypes-------------------------*/
1078 /******************************************************************************/
1079 
1080 /** \brief clears the error interrupt flag requested.
1081  * \param eray pointer to module handle.
1082  * \param errorFlag error flag to be cleared.
1083  * \return None
1084  */
1086 
1087 /** \brief Clears the status interrupt flag requested.
1088  * \param eray pointer to module handle.
1089  * \param statusFlag status flag to be cleared.
1090  * \return None
1091  */
1093 
1094 /** \brief Gets the error interrupt status.
1095  * \param eray pointer to module handle.
1096  * \return error interrupt status.
1097  */
1099 
1100 /** \brief Gets the message buffer interrupt status.
1101  * \param eray pointer to module handle.
1102  * \param messageBuffer message buffer to which interrupt status be checked.
1103  * \return message buffer interrupt status.
1104  */
1106 
1107 /** \brief Gets the new data interrupt buffers status.
1108  * \param eray pointer to module handle.
1109  * \param ndat ndat buffer to which interrupt status be checked.
1110  * \return ndat buffer interrupt status.
1111  */
1113 
1114 /** \brief Gets the node status interrupts.
1115  * \param eray pointer to module handle.
1116  * \return node status interrupts.
1117  */
1119 
1120 /** \brief Enables the message buffer interrupt line.
1121  * \param eray pointer to module handle.
1122  * \param messageBuffer message buffer interrupt which should be configured
1123  * \param messageBufferDestination selects MBSC0 or MBSC1 interrupt output
1124  * \return None
1125  *
1126  * For usage exapmle see : \ref IfxLld_Eray_Eray_Usage
1127  *
1128  */
1129 IFX_INLINE void IfxEray_Eray_setMessageBufferInterruptDestination(IfxEray_Eray *eray, uint8 messageBuffer, uint8 messageBufferDestination);
1130 
1131 /** \brief Enables the NDAT buffer interrupt line.
1132  * \param eray pointer to module handle.
1133  * \param ndat message buffer number configured to which ndat interrupt line to be set.
1134  * \param ndatDestination selects NDAT0 or NDAT1 interrupt output
1135  * \return None
1136  *
1137  * For usage exapmle see : \ref IfxLld_Eray_Eray_Usage
1138  *
1139  */
1141 
1142 /** \} */
1143 
1144 /******************************************************************************/
1145 /*---------------------Inline Function Implementations------------------------*/
1146 /******************************************************************************/
1147 
1149 {
1150  //resets the kernel
1151  IfxEray_resetModule(eray->eray);
1152 }
1153 
1154 
1156 {
1158 }
1159 
1160 
1162 {
1163  IfxEray_setSlot(eray->eray, reconfigBuffer->header, reconfigBuffer->data, reconfigBuffer->slotControl);
1164 }
1165 
1166 
1168 {
1169  boolean status = IfxEray_changePocState(eray->eray, PocCommand);
1170  return status;
1171 }
1172 
1173 
1174 IFX_INLINE void IfxEray_Eray_readData(IfxEray_Eray *eray, uint32 *data, uint8 payloadLength)
1175 {
1176  IfxEray_readData(eray->eray, data, payloadLength);
1177 }
1178 
1179 
1181 {
1182  IfxEray_readFrame(eray->eray, &(frame->header), frame->data, maxPayloadLength);
1183 }
1184 
1185 
1187 {
1189 }
1190 
1191 
1193 {
1195 }
1196 
1197 
1199 {
1200  Ifx_ERAY *eraySFR = eray->eray;
1201  boolean result = IfxEray_changePocState(eraySFR, IfxEray_PocCommand_config);
1202 
1203  if (result == TRUE)
1204  {
1205  eraySFR->SUCC1.B.WUCS = channel;
1206  IfxEray_setPocReady(eray->eray);
1207  }
1208 }
1209 
1210 
1212 {
1214 }
1215 
1216 
1217 IFX_INLINE void IfxEray_Eray_writeData(IfxEray_Eray *eray, uint32 *data, uint8 payloadLength)
1218 {
1219  IfxEray_writeData(eray->eray, data, payloadLength);
1220 }
1221 
1222 
1224 {
1225  return IfxEray_getPocState(eray->eray);
1226 }
1227 
1228 
1230 {
1231  IfxEray_WakeupChannel rxWakeupChannel;
1232  rxWakeupChannel = IfxEray_getWakeupPatternReceivedChannel(eray->eray);
1233 
1234  return rxWakeupChannel;
1235 }
1236 
1237 
1239 {
1240  IfxEray_clearErrorFlag(eray->eray, errorFlag);
1241 }
1242 
1243 
1245 {
1246  IfxEray_clearStatusFlag(eray->eray, statusFlag);
1247 }
1248 
1249 
1251 {
1252  Ifx_ERAY_EIR interruptFlags;
1253  interruptFlags = IfxEray_getErrorInterrupts(eray->eray);
1254  return interruptFlags;
1255 }
1256 
1257 
1259 {
1260  uint8 messageBufferInterrupt = IfxEray_getMessageBufferInterruptStatus(eray->eray, messageBuffer);
1261  return messageBufferInterrupt;
1262 }
1263 
1264 
1266 {
1267  uint8 ndatInterrupt = IfxEray_getNewDataInterruptStatus(eray->eray, ndat);
1268  return ndatInterrupt;
1269 }
1270 
1271 
1273 {
1274  Ifx_ERAY_SIR statusInterrupts = IfxEray_getStatusInterrupts(eray->eray);
1275  return statusInterrupts;
1276 }
1277 
1278 
1279 IFX_INLINE void IfxEray_Eray_setMessageBufferInterruptDestination(IfxEray_Eray *eray, uint8 messageBuffer, uint8 messageBufferDestination)
1280 {
1281  IfxEray_setMessageBufferInterruptDestination(eray->eray, messageBuffer, messageBufferDestination);
1282 }
1283 
1284 
1286 {
1287  IfxEray_setNewDataInterruptDestination(eray->eray, ndat, ndatDestination);
1288 }
1289 
1290 
1291 #endif /* IFXERAY_ERAY_H */