Note

This is the documentation for the latest development branch and may refer to features that are not available in released versions. If you are looking for the documentation for a specific release, use the drop-down menu on the left and select the desired version.

GPIO Example#

Overview#

This sample is a GPIO HAL regression test.

Source file:

src/rtsmart/examples/peripheral/gpio/test_gpio.c

Sample Behavior#

  • pin mapping

  • instance creation and destruction

  • mode switching

  • level read and write

  • toggle behavior

  • IRQ registration

Key APIs#

  • drv_fpioa_set_pin_func()

  • drv_gpio_inst_create() / drv_gpio_inst_destroy()

  • drv_gpio_mode_set() / drv_gpio_mode_get()

  • drv_gpio_value_set() / drv_gpio_value_get() / drv_gpio_toggle()

  • drv_gpio_register_irq() / drv_gpio_unregister_irq()

Build and Run#

cd src/rtsmart/examples/peripheral/gpio
make
./test_gpio
Comments list
Comments
Log in