123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671 |
- Port_Ipw_RefreshPortDirection (const struct Port_ConfigType * pConfigPtr)
- {
- uint16 PinPad;
- uint16 u16PinIndex;
- uint16 u16NumPins;
- <bb 2> :
- u16NumPins = pConfigPtr->u16NumPins;
- u16PinIndex = 0;
- goto <bb 12>; [INV]
- <bb 3> :
- _1 = pConfigPtr->pUsedPadConfig;
- _2 = (unsigned int) u16PinIndex;
- _3 = _2 * 20;
- _4 = _1 + _3;
- _5 = _4->bDC;
- _6 = ~_5;
- if (_6 != 0)
- goto <bb 4>; [INV]
- else
- goto <bb 11>; [INV]
- <bb 4> :
- _7 = pConfigPtr->pUsedPadConfig;
- _8 = (unsigned int) u16PinIndex;
- _9 = _8 * 20;
- _10 = _7 + _9;
- _11 = _10->bGPIO;
- if (_11 != 0)
- goto <bb 5>; [INV]
- else
- goto <bb 11>; [INV]
- <bb 5> :
- _12 = pConfigPtr->pUsedPadConfig;
- _13 = (unsigned int) u16PinIndex;
- _14 = _13 * 20;
- _15 = _12 + _14;
- PinPad = _15->Pin;
- _16 = pConfigPtr->pUsedPadConfig;
- _17 = (unsigned int) u16PinIndex;
- _18 = _17 * 20;
- _19 = _16 + _18;
- _20 = _19->ePadDir;
- if (_20 == 2)
- goto <bb 6>; [INV]
- else
- goto <bb 7>; [INV]
- <bb 6> :
- _21 = PinPad >> 5;
- _22 = (long unsigned int) _21;
- _23 = Port_au32PortCiGpioBaseAddr[_22];
- _24 = (long unsigned int) PinPad;
- _25 = _24 & 31;
- _26 = 1 << _25;
- Port_Ci_Port_Ip_SetPDDR (_23, _26);
- goto <bb 11>; [INV]
- <bb 7> :
- _27 = pConfigPtr->pUsedPadConfig;
- _28 = (unsigned int) u16PinIndex;
- _29 = _28 * 20;
- _30 = _27 + _29;
- _31 = _30->ePadDir;
- if (_31 == 1)
- goto <bb 9>; [INV]
- else
- goto <bb 8>; [INV]
- <bb 8> :
- _32 = pConfigPtr->pUsedPadConfig;
- _33 = (unsigned int) u16PinIndex;
- _34 = _33 * 20;
- _35 = _32 + _34;
- _36 = _35->ePadDir;
- if (_36 == 3)
- goto <bb 9>; [INV]
- else
- goto <bb 11>; [INV]
- <bb 9> :
- _37 = PinPad >> 5;
- _38 = (long unsigned int) _37;
- _39 = Port_au32PortCiGpioBaseAddr[_38];
- _40 = (long unsigned int) PinPad;
- _41 = _40 & 31;
- _42 = 1 << _41;
- Port_Ci_Port_Ip_ClearPDDR (_39, _42);
- _43 = pConfigPtr->pUsedPadConfig;
- _44 = (unsigned int) u16PinIndex;
- _45 = _44 * 20;
- _46 = _43 + _45;
- _47 = _46->ePadDir;
- if (_47 == 3)
- goto <bb 10>; [INV]
- else
- goto <bb 11>; [INV]
- <bb 10> :
- _48 = PinPad >> 5;
- _49 = (long unsigned int) _48;
- _50 = Port_au32PortCiGpioBaseAddr[_49];
- _51 = (long unsigned int) PinPad;
- _52 = _51 & 31;
- _53 = 1 << _52;
- Port_Ci_Port_Ip_SetPIDR (_50, _53);
- <bb 11> :
- u16PinIndex.3_54 = u16PinIndex;
- u16PinIndex = u16PinIndex.3_54 + 1;
- <bb 12> :
- if (u16PinIndex < u16NumPins)
- goto <bb 3>; [INV]
- else
- goto <bb 13>; [INV]
- <bb 13> :
- return;
- }
- Port_Ipw_SetGpioPadOutput (Port_PinType PinIndex, const struct Port_ConfigType * pConfigPtr)
- {
- uint8 u8LocalPDO;
- uint16 Pin;
- <bb 2> :
- _1 = pConfigPtr->pUsedPadConfig;
- _2 = PinIndex * 20;
- _3 = _1 + _2;
- Pin = _3->Pin;
- _4 = pConfigPtr->pUsedPadConfig;
- _5 = PinIndex * 20;
- _6 = _4 + _5;
- u8LocalPDO = _6->u8PDO;
- if (u8LocalPDO == 1)
- goto <bb 3>; [INV]
- else
- goto <bb 4>; [INV]
- <bb 3> :
- _7 = Pin >> 5;
- _8 = (long unsigned int) _7;
- _9 = Port_au32PortCiGpioBaseAddr[_8];
- _10 = (long unsigned int) Pin;
- _11 = _10 & 31;
- _12 = 1 << _11;
- Port_Ci_Port_Ip_SetPSOR (_9, _12);
- goto <bb 6>; [INV]
- <bb 4> :
- if (u8LocalPDO == 0)
- goto <bb 5>; [INV]
- else
- goto <bb 6>; [INV]
- <bb 5> :
- _13 = Pin >> 5;
- _14 = (long unsigned int) _13;
- _15 = Port_au32PortCiGpioBaseAddr[_14];
- _16 = (long unsigned int) Pin;
- _17 = _16 & 31;
- _18 = 1 << _17;
- Port_Ci_Port_Ip_SetPCOR (_15, _18);
- <bb 6> :
- return;
- }
- Port_Ipw_SetGpioDirChangeability (uint16 PadID, boolean bStatus)
- {
- uint16 u16PinDirFlagWord;
- uint8 u8PinBitOffset;
- <bb 2> :
- SchM_Enter_Port_PORT_EXCLUSIVE_AREA_00 ();
- _1 = (unsigned char) PadID;
- u8PinBitOffset = _1 & 15;
- _2 = (unsigned char) PadID;
- _3 = _2 >> 4;
- _4 = (int) _3;
- u16PinDirFlagWord = Port_Ipw_au16GpioDirChangeability[_4];
- if (bStatus != 0)
- goto <bb 3>; [INV]
- else
- goto <bb 4>; [INV]
- <bb 3> :
- _5 = (int) u8PinBitOffset;
- _6 = 1 << _5;
- _7 = (short unsigned int) _6;
- u16PinDirFlagWord = u16PinDirFlagWord | _7;
- goto <bb 5>; [INV]
- <bb 4> :
- _8 = (int) u8PinBitOffset;
- _9 = 1 << _8;
- _10 = (short unsigned int) _9;
- _11 = ~_10;
- u16PinDirFlagWord = u16PinDirFlagWord & _11;
- <bb 5> :
- _12 = (unsigned char) PadID;
- _13 = _12 >> 4;
- _14 = (int) _13;
- Port_Ipw_au16GpioDirChangeability[_14] = u16PinDirFlagWord;
- SchM_Exit_Port_PORT_EXCLUSIVE_AREA_00 ();
- return;
- }
- Port_Ipw_SetPinMode (Port_PinType PinIndex, Port_PinModeType PinMode, const struct Port_ConfigType * pConfigPtr)
- {
- Port_PinDirectionType ePadDirection;
- uint32 u32LocalPCR;
- uint16 u16PinDescBitOffset;
- uint16 u16PinDescWord;
- Port_PinModeType PinCfgRegValue;
- uint16 PinPad;
- Std_ReturnType PinModeError;
- Std_ReturnType D.5867;
- <bb 2> :
- PinModeError = 0;
- _1 = pConfigPtr->pUsedPadConfig;
- _2 = PinIndex * 20;
- _3 = _1 + _2;
- PinPad = _3->Pin;
- PinCfgRegValue = PinMode;
- if (PinMode > 7)
- goto <bb 3>; [INV]
- else
- goto <bb 4>; [INV]
- <bb 3> :
- PinModeError = 13;
- goto <bb 13>; [INV]
- <bb 4> :
- ePadDirection = 0;
- u16PinDescBitOffset = PinPad & 15;
- _4 = (int) PinMode;
- _5 = PinPad >> 4;
- _6 = (int) _5;
- u16PinDescWord = Port_au16PinDescription[_4][_6];
- _7 = (int) u16PinDescWord;
- _8 = (int) u16PinDescBitOffset;
- _9 = _7 >> _8;
- _10 = _9 & 1;
- if (_10 != 0)
- goto <bb 5>; [INV]
- else
- goto <bb 12>; [INV]
- <bb 5> :
- _11 = (int) PinMode;
- if (_11 == 1)
- goto <bb 6>; [INV]
- else
- goto <bb 10>; [INV]
- <bb 6> :
- <L3>:
- Port_Ipw_SetGpioDirChangeability (PinPad, 1);
- _12 = pConfigPtr->pUsedPadConfig;
- _13 = PinIndex * 20;
- _14 = _12 + _13;
- ePadDirection = _14->ePadDir;
- if (ePadDirection != 1)
- goto <bb 7>; [INV]
- else
- goto <bb 9>; [INV]
- <bb 7> :
- if (ePadDirection != 3)
- goto <bb 8>; [INV]
- else
- goto <bb 9>; [INV]
- <bb 8> :
- Port_Ipw_SetGpioPadOutput (PinIndex, pConfigPtr);
- <bb 9> :
- Port_Ipw_SetPinDirection (PinIndex, ePadDirection, pConfigPtr);
- goto <bb 11>; [INV]
- <bb 10> :
- <L8>:
- Port_Ipw_SetGpioDirChangeability (PinPad, 0);
- <bb 11> :
- _15 = PinPad >> 5;
- _16 = (long unsigned int) _15;
- _17 = Port_au32PortCiPortBaseAddr[_16];
- _18 = (long unsigned int) PinPad;
- _19 = _18 & 31;
- u32LocalPCR = Port_Ci_Port_Ip_ReadPCR (_17, _19);
- u32LocalPCR = u32LocalPCR & 4294965503;
- _20 = (long unsigned int) PinCfgRegValue;
- _21 = _20 << 8;
- u32LocalPCR = u32LocalPCR | _21;
- _22 = PinPad >> 5;
- _23 = (long unsigned int) _22;
- _24 = Port_au32PortCiPortBaseAddr[_23];
- _25 = (long unsigned int) PinPad;
- _26 = _25 & 31;
- Port_Ci_Port_Ip_SetPCR (_24, _26, u32LocalPCR);
- goto <bb 13>; [INV]
- <bb 12> :
- PinModeError = 13;
- <bb 13> :
- D.5867 = PinModeError;
- <bb 14> :
- <L13>:
- return D.5867;
- }
- Port_Ipw_SetPinDirection (Port_PinType PinIndex, Port_PinDirectionType eDirection, const struct Port_ConfigType * pConfigPtr)
- {
- uint16 u16PinChangeDirFlagWord;
- uint8 u8PinDescBitOffset;
- Std_ReturnType PinDirError;
- uint16 Pin;
- Std_ReturnType D.5855;
- <bb 2> :
- _1 = pConfigPtr->pUsedPadConfig;
- _2 = PinIndex * 20;
- _3 = _1 + _2;
- Pin = _3->Pin;
- PinDirError = 0;
- _4 = (unsigned char) Pin;
- u8PinDescBitOffset = _4 & 15;
- _5 = Pin >> 4;
- _6 = (unsigned char) _5;
- _7 = (int) _6;
- u16PinChangeDirFlagWord = Port_Ipw_au16GpioDirChangeability[_7];
- _8 = pConfigPtr->pUsedPadConfig;
- _9 = PinIndex * 20;
- _10 = _8 + _9;
- _11 = _10->bDC;
- if (_11 != 0)
- goto <bb 4>; [INV]
- else
- goto <bb 3>; [INV]
- <bb 3> :
- _12 = (int) u8PinDescBitOffset;
- _13 = 1 << _12;
- _14 = (short unsigned int) _13;
- _15 = u16PinChangeDirFlagWord & _14;
- if (_15 != 0)
- goto <bb 4>; [INV]
- else
- goto <bb 11>; [INV]
- <bb 4> :
- if (eDirection == 2)
- goto <bb 5>; [INV]
- else
- goto <bb 6>; [INV]
- <bb 5> :
- _16 = Pin >> 5;
- _17 = (long unsigned int) _16;
- _18 = Port_au32PortCiGpioBaseAddr[_17];
- _19 = (long unsigned int) Pin;
- _20 = _19 & 31;
- _21 = 1 << _20;
- Port_Ci_Port_Ip_SetPDDR (_18, _21);
- goto <bb 10>; [INV]
- <bb 6> :
- if (eDirection == 1)
- goto <bb 8>; [INV]
- else
- goto <bb 7>; [INV]
- <bb 7> :
- if (eDirection == 3)
- goto <bb 8>; [INV]
- else
- goto <bb 10>; [INV]
- <bb 8> :
- _22 = Pin >> 5;
- _23 = (long unsigned int) _22;
- _24 = Port_au32PortCiGpioBaseAddr[_23];
- _25 = (long unsigned int) Pin;
- _26 = _25 & 31;
- _27 = 1 << _26;
- Port_Ci_Port_Ip_ClearPDDR (_24, _27);
- if (eDirection == 3)
- goto <bb 9>; [INV]
- else
- goto <bb 10>; [INV]
- <bb 9> :
- _28 = Pin >> 5;
- _29 = (long unsigned int) _28;
- _30 = Port_au32PortCiGpioBaseAddr[_29];
- _31 = (long unsigned int) Pin;
- _32 = _31 & 31;
- _33 = 1 << _32;
- Port_Ci_Port_Ip_SetPIDR (_30, _33);
- <bb 10> :
- goto <bb 12>; [INV]
- <bb 11> :
- PinDirError = 1;
- <bb 12> :
- D.5855 = PinDirError;
- <bb 13> :
- <L12>:
- return D.5855;
- }
- Port_Ipw_Init (const struct Port_ConfigType * pConfigPtr)
- {
- uint8 u8Port;
- uint8 u8NumDigFilterPorts;
- uint16 u16PinIndex;
- <bb 2> :
- u8NumDigFilterPorts = pConfigPtr->u8NumDigitalFilterPorts;
- u16PinIndex = 0;
- goto <bb 4>; [INV]
- <bb 3> :
- _1 = pConfigPtr->pDigitalFilterConfig;
- _2 = (unsigned int) u16PinIndex;
- _3 = _2 * 8;
- _4 = _1 + _3;
- u8Port = _4->u8Port;
- _5 = (int) u8Port;
- _6 = Port_au32PortCiPortBaseAddr[_5];
- _7 = pConfigPtr->pDigitalFilterConfig;
- _8 = (unsigned int) u16PinIndex;
- _9 = _8 * 8;
- _10 = _7 + _9;
- Port_Ci_Port_Ip_ConfigDigitalFilter (_6, _10);
- _11 = (int) u8Port;
- _12 = Port_au32PortCiPortBaseAddr[_11];
- _13 = pConfigPtr->pDigitalFilterConfig;
- _14 = (unsigned int) u16PinIndex;
- _15 = _14 * 8;
- _16 = _13 + _15;
- _17 = _16->u32PinMask;
- Port_Ci_Port_Ip_SetDFER (_12, _17);
- u16PinIndex.0_18 = u16PinIndex;
- u16PinIndex = u16PinIndex.0_18 + 1;
- <bb 4> :
- _19 = (short unsigned int) u8NumDigFilterPorts;
- if (u16PinIndex < _19)
- goto <bb 3>; [INV]
- else
- goto <bb 5>; [INV]
- <bb 5> :
- _20 = pConfigPtr->IpConfigPtr;
- Port_Ci_Port_Ip_Init (13, _20);
- Port_Ipw_Init_UnusedPins (pConfigPtr);
- u16PinIndex = 0;
- goto <bb 7>; [INV]
- <bb 6> :
- _21 = (int) u16PinIndex;
- Port_Ipw_au16GpioDirChangeability[_21] = 0;
- u16PinIndex.1_22 = u16PinIndex;
- u16PinIndex = u16PinIndex.1_22 + 1;
- <bb 7> :
- if (u16PinIndex <= 8)
- goto <bb 6>; [INV]
- else
- goto <bb 8>; [INV]
- <bb 8> :
- return;
- }
- Port_Ipw_Init_UnusedPins (const struct Port_ConfigType * pConfigPtr)
- {
- Port_PinDirectionType eLocalPDDIR;
- uint32 u32LocalPCR;
- uint8 u8LocalPDO;
- uint16 u16NumUnusedPins;
- uint16 u16PinIndex;
- <bb 2> :
- u16NumUnusedPins = pConfigPtr->u16NumUnusedPins;
- _1 = pConfigPtr->pUnusedPadConfig;
- u8LocalPDO = _1->u8PDO;
- _2 = pConfigPtr->pUnusedPadConfig;
- u32LocalPCR = _2->u32PCR;
- _3 = pConfigPtr->pUnusedPadConfig;
- eLocalPDDIR = _3->ePadDir;
- u16PinIndex = 0;
- goto <bb 12>; [INV]
- <bb 3> :
- if (eLocalPDDIR == 2)
- goto <bb 4>; [INV]
- else
- goto <bb 9>; [INV]
- <bb 4> :
- if (u8LocalPDO == 1)
- goto <bb 5>; [INV]
- else
- goto <bb 6>; [INV]
- <bb 5> :
- _4 = pConfigPtr->pUnusedPads;
- _5 = (unsigned int) u16PinIndex;
- _6 = _5 * 2;
- _7 = _4 + _6;
- _8 = *_7;
- _9 = _8 >> 5;
- _10 = (long unsigned int) _9;
- _11 = Port_au32PortCiGpioBaseAddr[_10];
- _12 = pConfigPtr->pUnusedPads;
- _13 = (unsigned int) u16PinIndex;
- _14 = _13 * 2;
- _15 = _12 + _14;
- _16 = *_15;
- _17 = (long unsigned int) _16;
- _18 = _17 & 31;
- _19 = 1 << _18;
- Port_Ci_Port_Ip_SetPSOR (_11, _19);
- goto <bb 8>; [INV]
- <bb 6> :
- if (u8LocalPDO == 0)
- goto <bb 7>; [INV]
- else
- goto <bb 8>; [INV]
- <bb 7> :
- _20 = pConfigPtr->pUnusedPads;
- _21 = (unsigned int) u16PinIndex;
- _22 = _21 * 2;
- _23 = _20 + _22;
- _24 = *_23;
- _25 = _24 >> 5;
- _26 = (long unsigned int) _25;
- _27 = Port_au32PortCiGpioBaseAddr[_26];
- _28 = pConfigPtr->pUnusedPads;
- _29 = (unsigned int) u16PinIndex;
- _30 = _29 * 2;
- _31 = _28 + _30;
- _32 = *_31;
- _33 = (long unsigned int) _32;
- _34 = _33 & 31;
- _35 = 1 << _34;
- Port_Ci_Port_Ip_SetPCOR (_27, _35);
- <bb 8> :
- _36 = pConfigPtr->pUnusedPads;
- _37 = (unsigned int) u16PinIndex;
- _38 = _37 * 2;
- _39 = _36 + _38;
- _40 = *_39;
- _41 = _40 >> 5;
- _42 = (long unsigned int) _41;
- _43 = Port_au32PortCiGpioBaseAddr[_42];
- _44 = pConfigPtr->pUnusedPads;
- _45 = (unsigned int) u16PinIndex;
- _46 = _45 * 2;
- _47 = _44 + _46;
- _48 = *_47;
- _49 = (long unsigned int) _48;
- _50 = _49 & 31;
- _51 = 1 << _50;
- Port_Ci_Port_Ip_SetPDDR (_43, _51);
- goto <bb 11>; [INV]
- <bb 9> :
- _52 = pConfigPtr->pUnusedPads;
- _53 = (unsigned int) u16PinIndex;
- _54 = _53 * 2;
- _55 = _52 + _54;
- _56 = *_55;
- _57 = _56 >> 5;
- _58 = (long unsigned int) _57;
- _59 = Port_au32PortCiGpioBaseAddr[_58];
- _60 = pConfigPtr->pUnusedPads;
- _61 = (unsigned int) u16PinIndex;
- _62 = _61 * 2;
- _63 = _60 + _62;
- _64 = *_63;
- _65 = (long unsigned int) _64;
- _66 = _65 & 31;
- _67 = 1 << _66;
- Port_Ci_Port_Ip_ClearPDDR (_59, _67);
- if (eLocalPDDIR == 3)
- goto <bb 10>; [INV]
- else
- goto <bb 11>; [INV]
- <bb 10> :
- _68 = pConfigPtr->pUnusedPads;
- _69 = (unsigned int) u16PinIndex;
- _70 = _69 * 2;
- _71 = _68 + _70;
- _72 = *_71;
- _73 = _72 >> 5;
- _74 = (long unsigned int) _73;
- _75 = Port_au32PortCiGpioBaseAddr[_74];
- _76 = pConfigPtr->pUnusedPads;
- _77 = (unsigned int) u16PinIndex;
- _78 = _77 * 2;
- _79 = _76 + _78;
- _80 = *_79;
- _81 = (long unsigned int) _80;
- _82 = _81 & 31;
- _83 = 1 << _82;
- Port_Ci_Port_Ip_SetPIDR (_75, _83);
- <bb 11> :
- _84 = pConfigPtr->pUnusedPads;
- _85 = (unsigned int) u16PinIndex;
- _86 = _85 * 2;
- _87 = _84 + _86;
- _88 = *_87;
- _89 = _88 >> 5;
- _90 = (long unsigned int) _89;
- _91 = Port_au32PortCiPortBaseAddr[_90];
- _92 = pConfigPtr->pUnusedPads;
- _93 = (unsigned int) u16PinIndex;
- _94 = _93 * 2;
- _95 = _92 + _94;
- _96 = *_95;
- _97 = (long unsigned int) _96;
- _98 = _97 & 31;
- Port_Ci_Port_Ip_SetPCR (_91, _98, u32LocalPCR);
- u16PinIndex.2_99 = u16PinIndex;
- u16PinIndex = u16PinIndex.2_99 + 1;
- <bb 12> :
- if (u16PinIndex < u16NumUnusedPins)
- goto <bb 3>; [INV]
- else
- goto <bb 13>; [INV]
- <bb 13> :
- return;
- }
|