31 static void set_PinFunc ( uint8_t portnum, uint8_t pinnum, uint8_t funcnum);
32 static void set_ResistorMode ( uint8_t portnum, uint8_t pinnum, uint8_t modenum);
33 static void set_OpenDrainMode( uint8_t portnum, uint8_t pinnum, uint8_t modenum);
88 static void set_PinFunc ( uint8_t portnum, uint8_t pinnum, uint8_t funcnum)
90 uint32_t pinnum_t = pinnum;
91 uint32_t pinselreg_idx = 2 * portnum;
92 uint32_t *pPinCon = (uint32_t *)&
LPC_PINCON->PINSEL0;
98 *(uint32_t *)(pPinCon + pinselreg_idx) &= ~(0x03UL << (pinnum_t * 2));
99 *(uint32_t *)(pPinCon + pinselreg_idx) |= ((uint32_t)funcnum) << (pinnum_t * 2);
153 void set_ResistorMode ( uint8_t portnum, uint8_t pinnum, uint8_t modenum)
155 uint32_t pinnum_t = pinnum;
156 uint32_t pinmodereg_idx = 2 * portnum;
157 uint32_t *pPinCon = (uint32_t *)&
LPC_PINCON->PINMODE0;
159 if (pinnum_t >= 16) {
164 *(uint32_t *)(pPinCon + pinmodereg_idx) &= ~(0x03UL << (pinnum_t * 2));
165 *(uint32_t *)(pPinCon + pinmodereg_idx) |= ((uint32_t)modenum) << (pinnum_t * 2);
219 void set_OpenDrainMode( uint8_t portnum, uint8_t pinnum, uint8_t modenum)
221 uint32_t *pPinCon = (uint32_t *)&
LPC_PINCON->PINMODE_OD0;
224 *(uint32_t *)(pPinCon + portnum) |= (0x01UL << pinnum);
226 *(uint32_t *)(pPinCon + portnum) &= ~(0x01UL << pinnum);
249 }
else if (NewState ==
DISABLE) {
275 if (filterSlewRateEnable ==
DISABLE){