nes-proj/examples/dev/gpio-hal
Yasuyuki Tanaka 61fba4dcde Rename srf06-cc26xx to cc26x0-cc13x0 2018-10-23 13:04:32 -07:00
..
cc26x0-cc13x0 Rename srf06-cc26xx to cc26x0-cc13x0 2018-10-23 13:04:32 -07:00
cc2538dk Add GPIO HAL example 2018-02-24 12:50:02 +00:00
native Add native support to the GPIO HAL example 2018-04-02 22:14:56 +01:00
openmote-cc2538 Add GPIO HAL example 2018-02-24 12:50:02 +00:00
simplelink Expanded travis builds with SimpleLink platform 2018-09-11 13:17:21 +02:00
zoul Migrate to LED HAL (GPIO HAL example) 2018-03-01 15:29:31 +00:00
Makefile Rename srf06-cc26xx to cc26x0-cc13x0 2018-10-23 13:04:32 -07:00
README.md Add GPIO HAL example 2018-02-24 12:50:02 +00:00
gpio-hal-example.c GPIO HAL example fix 64-bit support 2018-09-30 20:21:17 +01:00

README.md

GPIO HAL Example

This example demonstrates and tests the functionality of the GPIO HAL. You can use it to:

  • Understand the logic of the GPIO HAL.
  • Test your implementation of arch-specific GPIO HAL components if you are developing a new port.

This example assumes a device with:

  • 3 output pins (e.g. LEDs).
  • 1 button.

Supported devices

This example is expected to work off-the-shelf on the following boards:

  • All CC13xx/CC26xx devices
  • All CC2538 devices

Extending for other platforms

Create a sub-directory with the same name as your platform. For example, for platform my-new-platform create a subdirectory called my-new-platform. Source files in this directory will be compiled automatically. In the most simple case, all you will need is a source file called e.g. pins.c (it's OK to use a different filename). In this file, you will need to provide definitions of the variables used by the example to manipulate pins. These variables are:

  • out_pin1, out_pin2 and out_pin3 for output pins.
  • btn_pin for the button pin.

Assign to those variables a value that corresponds to the output pin in your board that you wish to test with the example. For example, if you have a LED connected to pin 20, then you will need to

gpio_hal_pin_t out_pin1 = 20;