Hi, David,
This is the api function GPIO_ReadPinInput() body:
static inline uint32_t GPIO_ReadPinInput(GPIO_Type *base, uint32_t pin)
{
return (((base->PDIR) >> pin) & 0x01U);
}
You see that the function only read the specified bit instead of all the bits in PDIR register.
If you want to read all the PDIR register, you can define a function yourself.
for example
static inline uint32_t GPIO_ReadInput(GPIO_Type *base)
{
return (base->PDIR);
}
Hope it can help you.
BR
XiangJun Rong