Port_Ipw_RefreshPortDirection (const struct Port_ConfigType * pConfigPtr) { uint16 PinPad; uint16 u16PinIndex; uint16 u16NumPins; : u16NumPins = pConfigPtr->u16NumPins; u16PinIndex = 0; goto ; [INV] : _1 = pConfigPtr->pUsedPadConfig; _2 = (unsigned int) u16PinIndex; _3 = _2 * 20; _4 = _1 + _3; _5 = _4->bDC; _6 = ~_5; if (_6 != 0) goto ; [INV] else goto ; [INV] : _7 = pConfigPtr->pUsedPadConfig; _8 = (unsigned int) u16PinIndex; _9 = _8 * 20; _10 = _7 + _9; _11 = _10->bGPIO; if (_11 != 0) goto ; [INV] else goto ; [INV] : _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 ; [INV] else goto ; [INV] : _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 ; [INV] : _27 = pConfigPtr->pUsedPadConfig; _28 = (unsigned int) u16PinIndex; _29 = _28 * 20; _30 = _27 + _29; _31 = _30->ePadDir; if (_31 == 1) goto ; [INV] else goto ; [INV] : _32 = pConfigPtr->pUsedPadConfig; _33 = (unsigned int) u16PinIndex; _34 = _33 * 20; _35 = _32 + _34; _36 = _35->ePadDir; if (_36 == 3) goto ; [INV] else goto ; [INV] : _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 ; [INV] else goto ; [INV] : _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); : u16PinIndex.3_54 = u16PinIndex; u16PinIndex = u16PinIndex.3_54 + 1; : if (u16PinIndex < u16NumPins) goto ; [INV] else goto ; [INV] : return; } Port_Ipw_SetGpioPadOutput (Port_PinType PinIndex, const struct Port_ConfigType * pConfigPtr) { uint8 u8LocalPDO; uint16 Pin; : _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 ; [INV] else goto ; [INV] : _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 ; [INV] : if (u8LocalPDO == 0) goto ; [INV] else goto ; [INV] : _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); : return; } Port_Ipw_SetGpioDirChangeability (uint16 PadID, boolean bStatus) { uint16 u16PinDirFlagWord; uint8 u8PinBitOffset; : 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 ; [INV] else goto ; [INV] : _5 = (int) u8PinBitOffset; _6 = 1 << _5; _7 = (short unsigned int) _6; u16PinDirFlagWord = u16PinDirFlagWord | _7; goto ; [INV] : _8 = (int) u8PinBitOffset; _9 = 1 << _8; _10 = (short unsigned int) _9; _11 = ~_10; u16PinDirFlagWord = u16PinDirFlagWord & _11; : _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; : PinModeError = 0; _1 = pConfigPtr->pUsedPadConfig; _2 = PinIndex * 20; _3 = _1 + _2; PinPad = _3->Pin; PinCfgRegValue = PinMode; if (PinMode > 7) goto ; [INV] else goto ; [INV] : PinModeError = 13; goto ; [INV] : 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 ; [INV] else goto ; [INV] : _11 = (int) PinMode; if (_11 == 1) goto ; [INV] else goto ; [INV] : : Port_Ipw_SetGpioDirChangeability (PinPad, 1); _12 = pConfigPtr->pUsedPadConfig; _13 = PinIndex * 20; _14 = _12 + _13; ePadDirection = _14->ePadDir; if (ePadDirection != 1) goto ; [INV] else goto ; [INV] : if (ePadDirection != 3) goto ; [INV] else goto ; [INV] : Port_Ipw_SetGpioPadOutput (PinIndex, pConfigPtr); : Port_Ipw_SetPinDirection (PinIndex, ePadDirection, pConfigPtr); goto ; [INV] : : Port_Ipw_SetGpioDirChangeability (PinPad, 0); : _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 ; [INV] : PinModeError = 13; : D.5867 = PinModeError; : : 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; : _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 ; [INV] else goto ; [INV] : _12 = (int) u8PinDescBitOffset; _13 = 1 << _12; _14 = (short unsigned int) _13; _15 = u16PinChangeDirFlagWord & _14; if (_15 != 0) goto ; [INV] else goto ; [INV] : if (eDirection == 2) goto ; [INV] else goto ; [INV] : _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 ; [INV] : if (eDirection == 1) goto ; [INV] else goto ; [INV] : if (eDirection == 3) goto ; [INV] else goto ; [INV] : _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 ; [INV] else goto ; [INV] : _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); : goto ; [INV] : PinDirError = 1; : D.5855 = PinDirError; : : return D.5855; } Port_Ipw_Init (const struct Port_ConfigType * pConfigPtr) { uint8 u8Port; uint8 u8NumDigFilterPorts; uint16 u16PinIndex; : u8NumDigFilterPorts = pConfigPtr->u8NumDigitalFilterPorts; u16PinIndex = 0; goto ; [INV] : _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; : _19 = (short unsigned int) u8NumDigFilterPorts; if (u16PinIndex < _19) goto ; [INV] else goto ; [INV] : _20 = pConfigPtr->IpConfigPtr; Port_Ci_Port_Ip_Init (13, _20); Port_Ipw_Init_UnusedPins (pConfigPtr); u16PinIndex = 0; goto ; [INV] : _21 = (int) u16PinIndex; Port_Ipw_au16GpioDirChangeability[_21] = 0; u16PinIndex.1_22 = u16PinIndex; u16PinIndex = u16PinIndex.1_22 + 1; : if (u16PinIndex <= 8) goto ; [INV] else goto ; [INV] : return; } Port_Ipw_Init_UnusedPins (const struct Port_ConfigType * pConfigPtr) { Port_PinDirectionType eLocalPDDIR; uint32 u32LocalPCR; uint8 u8LocalPDO; uint16 u16NumUnusedPins; uint16 u16PinIndex; : u16NumUnusedPins = pConfigPtr->u16NumUnusedPins; _1 = pConfigPtr->pUnusedPadConfig; u8LocalPDO = _1->u8PDO; _2 = pConfigPtr->pUnusedPadConfig; u32LocalPCR = _2->u32PCR; _3 = pConfigPtr->pUnusedPadConfig; eLocalPDDIR = _3->ePadDir; u16PinIndex = 0; goto ; [INV] : if (eLocalPDDIR == 2) goto ; [INV] else goto ; [INV] : if (u8LocalPDO == 1) goto ; [INV] else goto ; [INV] : _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 ; [INV] : if (u8LocalPDO == 0) goto ; [INV] else goto ; [INV] : _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); : _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 ; [INV] : _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 ; [INV] else goto ; [INV] : _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); : _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; : if (u16PinIndex < u16NumUnusedPins) goto ; [INV] else goto ; [INV] : return; }