BT_GpioSetDirection()

Sets the 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 configured.

eDirection

ENUM: specifying the direction/mode to configure.

Returns

BT_ERR_NONE on success.

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