galileo: Add board-level abstraction layer for GPIO

This patch adds a HAL for GPIOs so that users of the API can specify
board-level IO pin numbers rather than CPU-level pin numbers.
This commit is contained in:
Michael LeMay 2016-08-22 16:28:58 -07:00
parent 2912559061
commit b17a936bf7
7 changed files with 132 additions and 18 deletions

View file

@ -33,9 +33,10 @@
#include "contiki.h"
#include "sys/ctimer.h"
#include "galileo-gpio.h"
#include "gpio.h"
#define PIN 5 /* IO2 */
#define PIN 2
static uint32_t value;
static struct ctimer timer;
@ -48,7 +49,7 @@ timeout(void *data)
{
/* toggle pin state */
value = !value;
quarkX1000_gpio_write(PIN, value);
galileo_gpio_write(PIN, value);
ctimer_reset(&timer);
}