GPIO in high impedance mode

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

cross mob
Anonymous
Not applicable

I would like to use:

void gpio_configurePin(BYTE port, BYTE pin, UINT16 config, BYTE outputVal);

to put a GPIO in high impedance mode.

Should I use this:

GPIO_INPUT_DISABLE           /*0x0600*/

as config ?

0 Likes
1 Solution
StBa_721356
Level 5
Level 5
50 likes received 25 likes received 10 likes received

In our firmware for a BCM20736S we use the following code to disable all GPIOs except the two for the peripheral UART:

      int    i;

    

      for (i=GPIO_PIN_P0;i<=GPIO_PIN_P39;i++)

      {

        if ((i != GPIO_PIN_P32) && (i != GPIO_PIN_P33))

          gpio_configurePin(i/16, i%16, GPIO_INPUT_DISABLE | GPIO_PULL_UP_DOWN_NONE, GPIO_PIN_INPUT_LOW);

      }

This sets all GPIOs except P32 (PUART_TX) and P33 (PUART_RX) to high impedance mode.

View solution in original post

1 Reply
StBa_721356
Level 5
Level 5
50 likes received 25 likes received 10 likes received

In our firmware for a BCM20736S we use the following code to disable all GPIOs except the two for the peripheral UART:

      int    i;

    

      for (i=GPIO_PIN_P0;i<=GPIO_PIN_P39;i++)

      {

        if ((i != GPIO_PIN_P32) && (i != GPIO_PIN_P33))

          gpio_configurePin(i/16, i%16, GPIO_INPUT_DISABLE | GPIO_PULL_UP_DOWN_NONE, GPIO_PIN_INPUT_LOW);

      }

This sets all GPIOs except P32 (PUART_TX) and P33 (PUART_RX) to high impedance mode.