lpcware

Chip_GPIO_GetPinState(LPC_GPIO_PORT, port, bit) -- return FALSE

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by mrabbasi61 on Sat Jul 05 21:45:00 MST 2014
Hi,
I'm using Blinky example from LPCOpen for LPC4357.

There is one function to get state of a GPIO Pin, defined as below, but this function always returns false in my tests!
currently I use Board_LED_Set(LEDNumber, false) and Board_LED_Set(LEDNumber, false) in order to turn LED On/Off.
sharing any similar experiences would be appreciated.


/* Returns the current state of a board LED */
bool Board_LED_Test(uint8_t LEDNumber)
{
if (LEDNumber <= 7) {
return (bool) Chip_GPIO_GetPinState(LPC_GPIO_PORT, ledports[LEDNumber], ledbits[LEDNumber]);
}
return false;
}

Outcomes