GPIO command equivalent to toggling state?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
MiCh_2098196
Level 2
Level 2
10 sign-ins 5 sign-ins First like given

Hello Cypress,

Referring to the GPIODriver section in the WICED Studio 5.0.1 API Reference Guide, is there a way to have a GPIO (set as an output) toggle it's current state?

I am looking to do something equivalent to something like this:

In Arduino: digitalWrite(11, !digitalRead(11));

In PIC X32: PORTCbits.RC13 = !PORTCbits.RC13;

In STM EFM 32: GPIO_PinOutToggle(MY_DATA_PORT, MY_DATA_PIN)

In NXP MCUXpresso: GPIO_PortToggle(BOARD_INITPINS_GPIO, 1u << BOARD_INITPINS_PIN);

If not, is there some macro I could use to set the pin to an input, read the state and save it to a variable, change the pin back to an output, and write the variable?

Thank you,

Michael

0 Likes
1 Solution

Hi Mike,

For using CYBT-343026-01 module, you will need to use WICED Studio 6.2 or later.

We do not have a 'GPIO toggle' function as such, you will have to manually toggle the pin with ON-OFF functions. Please check /20706-A2_Bluetooth/include/wiced_hal_gpio.h and also, /20706-A2_Bluetooth/apps/snip/hal/gpio demo app for more details.

View solution in original post

0 Likes
4 Replies
SheetalJ
Moderator
Moderator
Moderator
First comment on KBA 750 replies posted 500 likes received

Hi Michael,

Would you please let us know the Cypress product/chip you are using?

0 Likes

Hello Sheetalj_96,

I am using the CYBT-343026-01.

Thank you,

Mike

0 Likes

Hi Mike,

For using CYBT-343026-01 module, you will need to use WICED Studio 6.2 or later.

We do not have a 'GPIO toggle' function as such, you will have to manually toggle the pin with ON-OFF functions. Please check /20706-A2_Bluetooth/include/wiced_hal_gpio.h and also, /20706-A2_Bluetooth/apps/snip/hal/gpio demo app for more details.

0 Likes

Unfortunate news, but thank you for your reply.

Mike

0 Likes