BT_GpioGetDirection()

Gets the current mode / direction of the specified GPIO.

Notes

Depending on the actual physical hardware, and the GPIO driver implementation for your platform, some modes may not be possible / available.

Parameters

Parameter Description

ulGPIO

GPIO number of the GPIO line to be tested.

pError

Pointer to a BT_ERROR variable. Can be NULL.

Returns

BT_GPIO_DIR_UNKNOWN of failure, otherwise a valid direction ENUM value.

Valid Directions

Valid directions are:

  • BT_GPIO_DIR_HIGH_Z
  • BT_GPIO_DIR_INPUT
  • BT_GPIO_DIR_OUTPUT
  • BT_GPIO_DIR_OPEN_DRAIN
  • BT_GPIO_DIR_OPEN_SOURCE

Some may be act as aliases on some devices, e.g. HIGH_Z is usually the same configuration as INPUT.

Further Reading

The full API is defined under:

os/include/gpio/bt_gpio.h

See the implementation under:

os/src/gpio/bt_gpio.c

Back