132 lines
2.9 KiB
C
132 lines
2.9 KiB
C
#ifndef __PLATFORM_NARF52_NARF52_DK_H
|
|
#define __PLATFORM_NARF52_NARF52_DK_H
|
|
|
|
#include "gpio.h"
|
|
#include "narf52_gpio.h"
|
|
|
|
#include "driver.h"
|
|
|
|
// LEDs
|
|
const struct narf52_gpio narf_led_1 = {
|
|
.pin_number = 17,
|
|
.dir = NARF_GPIO_DIR_OUT,
|
|
.input = NARF_GPIO_PIN_INPUT_DISCONNECT,
|
|
.pull = NARF_GPIO_PIN_NOPULL,
|
|
.drive = NARF_GPIO_PIN_S0S1,
|
|
.sense = NARF_GPIO_PIN_NOSENSE,
|
|
};
|
|
|
|
const struct driver led_1 = {
|
|
.name = "LED_1",
|
|
.fp = &gpio_fp,
|
|
.dev = (void *)&narf_led_1,
|
|
};
|
|
|
|
const struct narf52_gpio narf_led_2 = {
|
|
.pin_number = 18,
|
|
.dir = NARF_GPIO_DIR_OUT,
|
|
.input = NARF_GPIO_PIN_INPUT_DISCONNECT,
|
|
.pull = NARF_GPIO_PIN_NOPULL,
|
|
.drive = NARF_GPIO_PIN_S0S1,
|
|
.sense = NARF_GPIO_PIN_NOSENSE,
|
|
};
|
|
|
|
const struct driver led_2 = {
|
|
.name = "LED_2",
|
|
.fp = &gpio_fp,
|
|
.dev = (void *)&narf_led_2,
|
|
};
|
|
|
|
const struct narf52_gpio narf_led_3 = {
|
|
.pin_number = 19,
|
|
.dir = NARF_GPIO_DIR_OUT,
|
|
.input = NARF_GPIO_PIN_INPUT_DISCONNECT,
|
|
.pull = NARF_GPIO_PIN_NOPULL,
|
|
.drive = NARF_GPIO_PIN_S0S1,
|
|
.sense = NARF_GPIO_PIN_NOSENSE,
|
|
};
|
|
|
|
const struct driver led_3 = {
|
|
.name = "LED_3",
|
|
.fp = &gpio_fp,
|
|
.dev = (void *)&narf_led_3,
|
|
};
|
|
|
|
const struct narf52_gpio narf_led_4 = {
|
|
.pin_number = 20,
|
|
.dir = NARF_GPIO_DIR_OUT,
|
|
.input = NARF_GPIO_PIN_INPUT_DISCONNECT,
|
|
.pull = NARF_GPIO_PIN_NOPULL,
|
|
.drive = NARF_GPIO_PIN_S0S1,
|
|
.sense = NARF_GPIO_PIN_NOSENSE,
|
|
};
|
|
|
|
const struct driver led_4 = {
|
|
.name = "LED_4",
|
|
.fp = &gpio_fp,
|
|
.dev = (void *)&narf_led_4,
|
|
};
|
|
|
|
// BUTTONs
|
|
const struct narf52_gpio narf_button_1 = {
|
|
.pin_number = 13,
|
|
.dir = NARF_GPIO_DIR_IN,
|
|
.input = NARF_GPIO_PIN_INPUT_CONNECT,
|
|
.pull = NARF_GPIO_PIN_PULLUP,
|
|
.drive = NARF_GPIO_PIN_S0S1,
|
|
.sense = NARF_GPIO_PIN_NOSENSE,
|
|
};
|
|
|
|
const struct driver button_1 = {
|
|
.name = "BUTTON_1",
|
|
.fp = &gpio_fp,
|
|
.dev = (void *)&narf_button_1,
|
|
};
|
|
|
|
const struct narf52_gpio narf_button_2 = {
|
|
.pin_number = 14,
|
|
.dir = NARF_GPIO_DIR_IN,
|
|
.input = NARF_GPIO_PIN_INPUT_CONNECT,
|
|
.pull = NARF_GPIO_PIN_PULLUP,
|
|
.drive = NARF_GPIO_PIN_S0S1,
|
|
.sense = NARF_GPIO_PIN_NOSENSE,
|
|
};
|
|
|
|
const struct driver button_2 = {
|
|
.name = "BUTTON_2",
|
|
.fp = &gpio_fp,
|
|
.dev = (void *)&narf_button_2,
|
|
};
|
|
|
|
const struct narf52_gpio narf_button_3 = {
|
|
.pin_number = 15,
|
|
.dir = NARF_GPIO_DIR_IN,
|
|
.input = NARF_GPIO_PIN_INPUT_CONNECT,
|
|
.pull = NARF_GPIO_PIN_PULLUP,
|
|
.drive = NARF_GPIO_PIN_S0S1,
|
|
.sense = NARF_GPIO_PIN_NOSENSE,
|
|
};
|
|
|
|
const struct driver button_3 = {
|
|
.name = "BUTTON_3",
|
|
.fp = &gpio_fp,
|
|
.dev = (void *)&narf_button_3,
|
|
};
|
|
|
|
const struct narf52_gpio narf_button_4 = {
|
|
.pin_number = 16,
|
|
.dir = NARF_GPIO_DIR_IN,
|
|
.input = NARF_GPIO_PIN_INPUT_CONNECT,
|
|
.pull = NARF_GPIO_PIN_PULLUP,
|
|
.drive = NARF_GPIO_PIN_S0S1,
|
|
.sense = NARF_GPIO_PIN_NOSENSE,
|
|
};
|
|
|
|
const struct driver button_4 = {
|
|
.name = "BUTTON_4",
|
|
.fp = &gpio_fp,
|
|
.dev = (void *)&narf_button_4,
|
|
};
|
|
|
|
#endif
|