Added support for Adafruit NRF52832 Feather

Used this pr as a reference:
https://github.com/felis/USB_Host_Shield_2.0/pull/614
This commit is contained in:
Anthony Rios 2021-05-27 21:34:49 -04:00 committed by GitHub
parent b6511306f1
commit e8358763b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 61 additions and 0 deletions

View file

@ -1295,6 +1295,65 @@ MAKE_PIN(P19, GPIOC, GPIO_PIN_0); // A5
#undef MAKE_PIN
#elif defined(ARDUINO_NRF52832_FEATHER)
#define MAKE_PIN(className, pin) \
class className { \
public: \
static void Set() { \
nrf_gpio_pin_set(pin); \
} \
static void Clear() { \
nrf_gpio_pin_clear(pin); \
} \
static void SetDirRead() { \
nrf_gpio_cfg_input(pin, NRF_GPIO_PIN_NOPULL); \
} \
static void SetDirWrite() { \
nrf_gpio_cfg_output(pin); \
} \
static uint8_t IsSet() { \
return (uint8_t)nrf_gpio_pin_read(pin); \
} \
};
// Based on variants/feather_nrf52832/variant.cpp
// g_ADigitalPinMap could be used directly, but it would be slower
MAKE_PIN(P0, (0));
MAKE_PIN(P1, (1));
MAKE_PIN(P2, (2));
MAKE_PIN(P3, (3));
MAKE_PIN(P4, (4));
MAKE_PIN(P5, (5));
MAKE_PIN(P6, (6));
MAKE_PIN(P7, (7));
MAKE_PIN(P8, (8));
MAKE_PIN(P9, (9));
MAKE_PIN(P10, (10));
MAKE_PIN(P11, (11));
MAKE_PIN(P12, (12));
MAKE_PIN(P13, (13));
MAKE_PIN(P14, (14));
MAKE_PIN(P15, (15));
MAKE_PIN(P17, (16));
MAKE_PIN(P18, (17));
MAKE_PIN(P16, (18));
MAKE_PIN(P19, (19));
MAKE_PIN(P20, (20));
MAKE_PIN(P21, (21));
MAKE_PIN(P22, (22));
MAKE_PIN(P23, (23));
MAKE_PIN(P24, (24));
MAKE_PIN(P25, (25));
MAKE_PIN(P26, (26));
MAKE_PIN(P27, (27));
MAKE_PIN(P28, (28));
MAKE_PIN(P29, (29));
MAKE_PIN(P30, (30));
MAKE_PIN(P31, (31));
#undef MAKE_PIN
#elif defined(ARDUINO_NRF52840_FEATHER)
#define MAKE_PIN(className, pin) \

View file

@ -120,6 +120,8 @@ typedef SPi< P16, P18, P17, P10 > spi;
typedef SPi< P14, P13, P12, P15 > spi;
#elif defined(ESP32)
typedef SPi< P18, P23, P19, P5 > spi;
#elif defined(ARDUINO_NRF52832_FEATHER)
typedef SPi< P14, P13, P12, P11 > spi;
#elif defined(ARDUINO_NRF52840_FEATHER)
typedef SPi< P26, P25, P24, P5 > spi;
#else