Reputation: 127
in my blinking LED operation i am using the following functions shown in the code bellow.
when i send a command by UART to turn on an LED i want to know if its turned on or turned off in order to switch its state.
I tried to look in the reference manual for GPIO properties,but this periphery is tricky i cant have some thing like "LED_PORT_A->STATE"
to see if its turned on or off.
Is there some thing i could do?
Thanks.
https://www.silabs.com/documents/public/reference-manuals/EFM32LG-RM.pdf
GPIO_PinModeSet(LED_PORT_A,15,gpioModePushPull,0);
GPIO_PinOutSet(LED_PORT_E,15);
GPIO_PinOutClear(LED_PORT_A,15);
Upvotes: 0
Views: 245
Reputation: 764
To get the current output level you can use unsigned int GPIO_PinOutGet(GPIO_Port_TypeDef port, unsigned int pin);
To toggle the current output level you can use void GPIO_PinOutToggle(GPIO_Port_TypeDef port, unsigned int pin);
.
i.e GPIO_PinOutToggle(LED_PORT_A,15);
For more information, the GPIO API documentation for the EFM32-LG is here.
Upvotes: 1