51 #include "IfxEray_reg.h"
1141 eray->EIR.U = errorFlag;
1147 eray->SIR.U = statusFlag;
1154 eray->CLC.U = 0x00000100;
1164 Ifx_ERAY_EIR interruptFlags;
1165 interruptFlags.U = eray->EIR.U;
1166 return interruptFlags;
1172 return eray->MRC.B.FFB;
1178 Ifx_ERAY_FSR fifoStatus;
1179 fifoStatus.U = eray->FSR.U;
1186 return (eray->IBCR.B.IBSYH == 1) ?
TRUE :
FALSE;
1192 return (eray->IBCR.B.IBSYS == 1) ?
TRUE :
FALSE;
1198 if (eray == &MODULE_ERAY0)
1200 return &MODULE_SRC.ERAY.ERAY[0].IBUSY;
1204 return &MODULE_SRC.ERAY.ERAY[1].IBUSY;
1211 if (eray == &MODULE_ERAY0)
1213 return &MODULE_SRC.ERAY.ERAY[0].INT[0];
1217 return &MODULE_SRC.ERAY.ERAY[1].INT[0];
1224 if (eray == &MODULE_ERAY0)
1226 return &MODULE_SRC.ERAY.ERAY[0].INT[1];
1230 return &MODULE_SRC.ERAY.ERAY[1].INT[1];
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;
1242 return messageBufferInterrupt;
1248 if (eray == &MODULE_ERAY0)
1250 return &MODULE_SRC.ERAY.ERAY[0].MBSC[0];
1254 return &MODULE_SRC.ERAY.ERAY[1].MBSC[0];
1261 if (eray == &MODULE_ERAY0)
1263 return &MODULE_SRC.ERAY.ERAY[0].MBSC[1];
1267 return &MODULE_SRC.ERAY.ERAY[1].MBSC[1];
1274 if (eray == &MODULE_ERAY0)
1276 return &MODULE_SRC.ERAY.ERAY[0].NDAT[0];
1280 return &MODULE_SRC.ERAY.ERAY[1].NDAT[0];
1287 if (eray == &MODULE_ERAY0)
1289 return &MODULE_SRC.ERAY.ERAY[0].NDAT[1];
1293 return &MODULE_SRC.ERAY.ERAY[1].NDAT[1];
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;
1305 return ndatInterrupt;
1311 return eray->OBCR.B.OBRH;
1317 return (eray->OBCR.B.OBSYS == 1) ?
TRUE :
FALSE;
1323 if (eray == &MODULE_ERAY0)
1325 return &MODULE_SRC.ERAY.ERAY[0].OBUSY;
1329 return &MODULE_SRC.ERAY.ERAY[1].OBUSY;
1342 Ifx_ERAY_SIR interruptFlags;
1343 interruptFlags.U = eray->SIR.U;
1344 return interruptFlags;
1350 if (eray == &MODULE_ERAY0)
1352 return &MODULE_SRC.ERAY.ERAY[0].TINT[0];
1356 return &MODULE_SRC.ERAY.ERAY[1].TINT[0];
1363 if (eray == &MODULE_ERAY0)
1365 return &MODULE_SRC.ERAY.ERAY[0].TINT[1];
1369 return &MODULE_SRC.ERAY.ERAY[1].TINT[1];
1378 if (eray->SIR.B.WUPA == 1)
1382 else if (eray->SIR.B.WUPB == 1)
1387 return wakeupChannel;
1422 eray->OBCM.B.RDSS = dataReceived;
1428 eray->OBCM.B.RHSS = headerReceived;
1434 eray->IBCM.B.LDSH = dataTransfered;
1440 eray->IBCM.B.LHSH = headerTransfered;
1446 eray->SUCC1.B.PTA = numberOfCyclePairsForActive;
1452 eray->CUST1.B.IEN = 1;
1453 eray->CUST1.B.OEN = 1;
1454 eray->CUST3.U = 0xFFFFFFFF;
1460 eray->PRTC1.B.BRP = baudrate;
1466 eray->MRC.B.SEC = secureValue;
1472 eray->GTUC03.B.UIOA = channelAMicrotickInitialOffset;
1473 eray->GTUC03.B.MIOA = channelAMacrotickInitialOffset;
1479 eray->GTUC03.B.UIOB = channelBMicrotickInitialOffset;
1480 eray->GTUC03.B.MIOB = channelBMacrotickInitialOffset;
1486 eray->GTUC05.B.DCA = channelAReceptionDelay;
1487 eray->GTUC05.B.DCB = channelBReceptionDelay;
1493 Ifx_ERAY_SUCC3 succ3;
1495 succ3.B.WCP = clockCorrectionCyclesPassive;
1496 succ3.B.WCF = clockCorrectionCyclesHalt;
1497 eray->SUCC3.U = succ3.U;
1503 eray->SUCC1.B.HCSE = clockSyncErrorHalt;
1509 eray->GTUC05.B.CDD = clusterDrift;
1510 eray->GTUC06.B.MOD = maxDriftOffset;
1516 eray->GTUC06.B.ASR = acceptedStartupDeviation;
1522 eray->PRTC1.B.CASM = collisionAvoidanceDuration;
1528 eray->GTUC02.B.MPC = macroticks;
1534 eray->GTUC01.U = microticks;
1540 eray->GTUC05.B.DEC = decodingCorrection;
1546 eray->GTUC08.B.MSL = dynamicSlotLength;
1547 eray->GTUC08.B.NMS = dynamicSlotCount;
1548 eray->GTUC09.B.DSI = idleDynamicSlots;
1554 eray->GTUC11.B.EOCC = externalOffset;
1555 eray->GTUC11.B.ERCC = externalRate;
1561 eray->GTUC11.B.EOC = externalOffsetCorrection;
1562 eray->GTUC11.B.ERC = externalRateCorrection;
1569 eray->MRC.B.FFB = fifoBufferStartIndex;
1575 eray->FRF.B.FID = rejectedFrameId;
1576 eray->FRF.B.CYF = filteredCycleNumber;
1577 eray->FRF.B.RNF = fifoNullFramesRejected;
1578 eray->FRFM.B.MFID = frameIdFilter;
1584 eray->FRF.B.CH = receiveChannel;
1585 eray->FRF.B.RSS = staticFifoDisabled;
1586 eray->FCL.U = fifoDepth;
1593 eray->MRC.B.FDB = firstDynamicBuffer;
1599 Ifx_ERAY_SUCC2 succ2;
1601 succ2.B.LT = listenTimeOut;
1602 succ2.B.LTN = listenTimeOutNoise;
1603 eray->SUCC2.U = succ2.U;
1609 eray->SUCC1.B.CSA = maxColdStartAttempts;
1615 eray->GTUC10.B.MOC = maxOffsetCorrection;
1616 eray->GTUC10.B.MRC = maxRateCorrection;
1622 eray->GTUC02.B.SNM = maxSyncFrames;
1628 eray->MRC.B.LCB = numberOfMessageBuffers - 1;
1636 mhdc.B.SFDL = staticFramepayload;
1637 mhdc.B.SLT = latestTransmissionStart;
1638 eray->MHDC.U = mhdc.U;
1644 eray->GTUC04.B.NIT = networkStartIdleTime;
1650 eray->NEMC.U = networkVectorLength;
1656 eray->SUCC1.B.CCHA = channelAConnectedNode;
1657 eray->SUCC1.B.CCHB = channelBConnectedNode;
1663 eray->GTUC04.B.OCS = correctionOffset;
1669 eray->OBCR.B.REQ = receiveRequested;
1675 eray->PRTC1.B.RXW = receiveWakeupTestDuration;
1676 eray->PRTC2.B.RXI = receiveWakeupIdleTime;
1677 eray->PRTC2.B.RXL = receiveWakeupLowTime;
1683 eray->OBCR.B.OBRS = bufferIndex;
1691 eray->CLC.B.EDIS = mode;
1698 eray->GTUC09.B.MAPO = dynamicActionPoint;
1699 eray->GTUC09.B.APO = staticActionPoint;
1705 eray->GTUC07.B.SSL = staticSlotLength;
1706 eray->GTUC07.B.NSS = staticSlotsCount;
1712 eray->PRTC1.B.SPP = strobePosition;
1718 eray->SUCC1.B.MTSA = channelASymbolTransmitted;
1719 eray->SUCC1.B.MTSB = channelBSymbolTransmitted;
1725 eray->SUCC1.B.TSM = transmissionSlotMode;
1731 eray->PRTC1.B.TSST = transmissionStartTime;
1737 eray->IBCM.B.STXRH = transferRequested;
1743 eray->PRTC1.B.RWP = transmitWakeupRepetitions;
1744 eray->PRTC2.B.TXI = transmitWakeupIdleTime;
1745 eray->PRTC2.B.TXL = transmitWakeupLowTime;
1751 eray->SUCC1.B.TXST = startupFrameTransmitted;
1752 eray->SUCC1.B.TXSY = synchFrameTransmitted;
1758 eray->IBCR.B.IBRH = bufferIndex;
1764 eray->OBCR.B.VIEW = swapRequested;
1770 eray->SUCC1.B.WUCS = wakeupPatternChannel;
1776 while (eray->CCSV.B.POCS != (
uint8)pocState)