4 Replies Latest reply on May 29, 2020 6:17 PM by MiCh_2098196

    GPIO command equivalent to toggling state?

    MiCh_2098196

      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