简体   繁体   中英

how to check for properties of GPIO ports

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);

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); .

ie GPIO_PinOutToggle(LED_PORT_A,15);

For more information, the GPIO API documentation for the EFM32-LG is here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM