From a174b7644a3f3e40942e60d114979149f739c9c2 Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Wed, 3 Jun 2015 18:27:05 +0200 Subject: [PATCH] boards: adjusted peripheral confs to GPIO changes --- boards/airfy-beacon/include/periph_conf.h | 43 ------ boards/arduino-due/include/periph_conf.h | 3 +- boards/arduino-mega2560/include/periph_conf.h | 1 - boards/cc2538dk/include/periph_conf.h | 2 - boards/fox/include/periph_conf.h | 1 - boards/iot-lab_M3/include/periph_conf.h | 1 - boards/msbiot/include/board.h | 8 +- boards/msbiot/include/periph_conf.h | 139 ------------------ boards/mulle/board.c | 12 +- boards/mulle/include/periph_conf.h | 1 - boards/nucleo-f091/include/periph_conf.h | 1 - boards/nucleo-f334/include/periph_conf.h | 1 - boards/nucleo-l1/include/periph_conf.h | 1 - boards/openmote/include/periph_conf.h | 1 - boards/pba-d-01-kw2x/include/periph_conf.h | 1 - boards/saml21-xpro/board.c | 2 +- boards/saml21-xpro/include/periph_conf.h | 73 --------- boards/samr21-xpro/include/board.h | 17 ++- boards/samr21-xpro/include/periph_conf.h | 90 ------------ boards/spark-core/include/periph_conf.h | 1 - boards/stm32f0discovery/include/periph_conf.h | 1 - boards/stm32f3discovery/include/periph_conf.h | 1 + boards/stm32f4discovery/include/periph_conf.h | 113 +------------- boards/udoo/include/periph_conf.h | 1 - 24 files changed, 25 insertions(+), 490 deletions(-) diff --git a/boards/airfy-beacon/include/periph_conf.h b/boards/airfy-beacon/include/periph_conf.h index 8ae3cfaa47..ac21ed602b 100644 --- a/boards/airfy-beacon/include/periph_conf.h +++ b/boards/airfy-beacon/include/periph_conf.h @@ -133,49 +133,6 @@ #define RADIO_IRQ_PRIO 1 /** @} */ -/** - * @name GPIO configuration - * @{ - */ -#define GPIO_NUMOF (16U) -#define GPIO_0_EN 1 -#define GPIO_1_EN 1 -#define GPIO_2_EN 1 -#define GPIO_3_EN 1 -#define GPIO_4_EN 1 -#define GPIO_5_EN 1 -#define GPIO_6_EN 0 /* not usable */ -#define GPIO_7_EN 1 -#define GPIO_8_EN 1 -#define GPIO_9_EN 1 -#define GPIO_10_EN 1 -#define GPIO_11_EN 1 -#define GPIO_12_EN 1 -#define GPIO_13_EN 1 -#define GPIO_14_EN 1 -#define GPIO_15_EN 1 -#define GPIO_IRQ_PRIO 1 - -/* GPIO pin configuration */ -#define GPIO_0_PIN 0 -#define GPIO_1_PIN 1 -#define GPIO_2_PIN 2 -#define GPIO_3_PIN 3 -#define GPIO_4_PIN 4 -#define GPIO_5_PIN 5 -#define GPIO_6_PIN 6 /* not usable */ -#define GPIO_7_PIN 7 -#define GPIO_8_PIN 8 -#define GPIO_9_PIN 9 -#define GPIO_10_PIN 10 -#define GPIO_11_PIN 11 -#define GPIO_12_PIN 12 -#define GPIO_13_PIN 13 -#define GPIO_14_PIN 14 -#define GPIO_15_PIN 15 - -/** @} */ - #ifdef __cplusplus } /* end extern "C" */ #endif diff --git a/boards/arduino-due/include/periph_conf.h b/boards/arduino-due/include/periph_conf.h index 6d1fa45f28..dfb053c067 100644 --- a/boards/arduino-due/include/periph_conf.h +++ b/boards/arduino-due/include/periph_conf.h @@ -146,7 +146,6 @@ extern "C" { * @name GPIO configuration * @{ */ -#define GPIO_NUMOF (32U) #define GPIO_0_EN 1 #define GPIO_1_EN 1 #define GPIO_2_EN 1 @@ -179,6 +178,8 @@ extern "C" { #define GPIO_29_EN 1 #define GPIO_30_EN 1 #define GPIO_31_EN 1 + +/* interrupt priority */ #define GPIO_IRQ_PRIO 1 /* GPIO channel 0 config */ diff --git a/boards/arduino-mega2560/include/periph_conf.h b/boards/arduino-mega2560/include/periph_conf.h index 351e59f602..c41b33273f 100644 --- a/boards/arduino-mega2560/include/periph_conf.h +++ b/boards/arduino-mega2560/include/periph_conf.h @@ -264,7 +264,6 @@ extern "C" { /** * @brief GPIO configuration */ -#define GPIO_NUMOF (0U) #define GPIO_0_EN 0 #define GPIO_1_EN 0 #define GPIO_2_EN 0 diff --git a/boards/cc2538dk/include/periph_conf.h b/boards/cc2538dk/include/periph_conf.h index e6d341b516..3e8e8dbc8c 100644 --- a/boards/cc2538dk/include/periph_conf.h +++ b/boards/cc2538dk/include/periph_conf.h @@ -116,8 +116,6 @@ extern "C" { * @name GPIO configuration * @{ */ -#define GPIO_NUMOF 32 - #define GPIO_IRQ_PRIO 1 #define GPIO_0_EN 1 diff --git a/boards/fox/include/periph_conf.h b/boards/fox/include/periph_conf.h index b20edddd46..e60df5d80c 100644 --- a/boards/fox/include/periph_conf.h +++ b/boards/fox/include/periph_conf.h @@ -115,7 +115,6 @@ extern "C" { /** * @brief GPIO configuration */ -#define GPIO_NUMOF 13 #define GPIO_0_EN 1 #define GPIO_1_EN 1 #define GPIO_2_EN 1 diff --git a/boards/iot-lab_M3/include/periph_conf.h b/boards/iot-lab_M3/include/periph_conf.h index 8bb4912c1c..78ca6696f6 100644 --- a/boards/iot-lab_M3/include/periph_conf.h +++ b/boards/iot-lab_M3/include/periph_conf.h @@ -116,7 +116,6 @@ extern "C" { /** * @brief GPIO configuration */ -#define GPIO_NUMOF 16 #define GPIO_0_EN 1 #define GPIO_1_EN 1 #define GPIO_2_EN 1 diff --git a/boards/msbiot/include/board.h b/boards/msbiot/include/board.h index 843aa75164..49df2dc985 100644 --- a/boards/msbiot/include/board.h +++ b/boards/msbiot/include/board.h @@ -45,10 +45,10 @@ extern "C" { * @{ */ #define CC110X_SPI SPI_0 -#define CC110X_CS GPIO_7 -#define CC110X_GDO0 GPIO_11 -#define CC110X_GDO1 GPIO_2 -#define CC110X_GDO2 GPIO_12 +#define CC110X_CS GPIO(PORT_B, 12) +#define CC110X_GDO0 GPIO(PORT_C, 4) +#define CC110X_GDO1 GPIO(PORT_A, 6) +#define CC110X_GDO2 GPIO(PORT_C, 5) typedef uint8_t radio_packet_length_t; /** @} */ diff --git a/boards/msbiot/include/periph_conf.h b/boards/msbiot/include/periph_conf.h index 6135a7f3b8..5b1a321a05 100644 --- a/boards/msbiot/include/periph_conf.h +++ b/boards/msbiot/include/periph_conf.h @@ -252,145 +252,6 @@ extern "C" { #define I2C_0_SDA_AF 4 #define I2C_0_SDA_CLKEN() (RCC->AHB1ENR |= RCC_AHB1ENR_GPIOBEN) -/** - * @name GPIO configuration - * @{ - */ -#define GPIO_NUMOF 16 -#define GPIO_0_EN 1 -#define GPIO_1_EN 1 -#define GPIO_2_EN 1 -#define GPIO_3_EN 1 -#define GPIO_4_EN 1 -#define GPIO_5_EN 1 -#define GPIO_6_EN 1 -#define GPIO_7_EN 1 -#define GPIO_8_EN 1 -#define GPIO_9_EN 1 -#define GPIO_10_EN 1 -#define GPIO_11_EN 1 -#define GPIO_12_EN 1 -#define GPIO_13_EN 1 -#define GPIO_14_EN 1 -#define GPIO_15_EN 1 -#define GPIO_IRQ_PRIO 1 - -/* IRQ config */ -#define GPIO_IRQ_0 GPIO_0 /* alternatively GPIO_4 or GPIO_9 could be used here */ -#define GPIO_IRQ_1 GPIO_1 /* alternatively GPIO_10 could be used here */ -#define GPIO_IRQ_2 GPIO_15 -#define GPIO_IRQ_3 -1/* not configured */ -#define GPIO_IRQ_4 GPIO_11 -#define GPIO_IRQ_5 GPIO_12 -#define GPIO_IRQ_6 GPIO_2 -#define GPIO_IRQ_7 -1/* not configured */ -#define GPIO_IRQ_8 GPIO_13 -#define GPIO_IRQ_9 GPIO_5 -#define GPIO_IRQ_10 GPIO_3 -#define GPIO_IRQ_11 GPIO_6 -#define GPIO_IRQ_12 GPIO_7 -#define GPIO_IRQ_13 GPIO_8 /* alternatively GPIO_14 could be used here */ -#define GPIO_IRQ_14 -1/* not configured */ -#define GPIO_IRQ_15 -1/* not configured */ - -/* GPIO channel 0 config */ -#define GPIO_0_PORT GPIOA /* User Button 2 */ -#define GPIO_0_PIN 0 -#define GPIO_0_CLK 0 /* 0: PORT A, 1: B ... */ -#define GPIO_0_EXTI_CFG() (SYSCFG->EXTICR[0] |= SYSCFG_EXTICR1_EXTI0_PA) -#define GPIO_0_IRQ EXTI0_IRQn -/* GPIO channel 1 config */ -#define GPIO_1_PORT GPIOA -#define GPIO_1_PIN 1 -#define GPIO_1_CLK 0 -#define GPIO_1_EXTI_CFG() (SYSCFG->EXTICR[0] |= SYSCFG_EXTICR1_EXTI1_PA) -#define GPIO_1_IRQ EXTI1_IRQn -/* GPIO channel 2 config */ -#define GPIO_2_PORT GPIOA /* CC1101 GDO1 */ -#define GPIO_2_PIN 6 -#define GPIO_2_CLK 0 -#define GPIO_2_EXTI_CFG() (SYSCFG->EXTICR[1] |= SYSCFG_EXTICR2_EXTI6_PA) -#define GPIO_2_IRQ EXTI9_5_IRQn -/* GPIO channel 3 config */ -#define GPIO_3_PORT GPIOA /* CC3000 SPI_IRQ */ -#define GPIO_3_PIN 10 -#define GPIO_3_CLK 0 -#define GPIO_3_EXTI_CFG() (SYSCFG->EXTICR[2] |= SYSCFG_EXTICR3_EXTI10_PA) -#define GPIO_3_IRQ EXTI15_10_IRQn -/* GPIO channel 4 config */ -#define GPIO_4_PORT GPIOB -#define GPIO_4_PIN 0 -#define GPIO_4_CLK 1 -#define GPIO_4_EXTI_CFG() (SYSCFG->EXTICR[0] |= SYSCFG_EXTICR1_EXTI0_PB) -#define GPIO_4_IRQ EXTI0_IRQn -/* GPIO channel 5 config */ -#define GPIO_5_PORT GPIOB /* BEEPER Input */ -#define GPIO_5_PIN 9 -#define GPIO_5_CLK 1 -#define GPIO_5_EXTI_CFG() (SYSCFG->EXTICR[2] |= SYSCFG_EXTICR3_EXTI9_PB) -#define GPIO_5_IRQ EXTI9_5_IRQn -/* GPIO channel 6 config */ -#define GPIO_6_PORT GPIOB /* IMU-9150 INT */ -#define GPIO_6_PIN 11 -#define GPIO_6_CLK 1 -#define GPIO_6_EXTI_CFG() (SYSCFG->EXTICR[2] |= SYSCFG_EXTICR3_EXTI11_PB) -#define GPIO_6_IRQ EXTI15_10_IRQn -/* GPIO channel 7 config */ -#define GPIO_7_PORT GPIOB /* CC1101 CS */ -#define GPIO_7_PIN 12 -#define GPIO_7_CLK 1 -#define GPIO_7_EXTI_CFG() (SYSCFG->EXTICR[3] |= SYSCFG_EXTICR4_EXTI12_PB) -#define GPIO_7_IRQ EXTI15_10_IRQn -/* GPIO channel 8 config */ -#define GPIO_8_PORT GPIOB /* User Button 1 */ -#define GPIO_8_PIN 13 -#define GPIO_8_CLK 1 -#define GPIO_8_EXTI_CFG() (SYSCFG->EXTICR[3] |= SYSCFG_EXTICR4_EXTI13_PB) -#define GPIO_8_IRQ EXTI15_10_IRQn -/* GPIO channel 9 config */ -#define GPIO_9_PORT GPIOC /* TCA6416 Reset */ -#define GPIO_9_PIN 0 -#define GPIO_9_CLK 2 -#define GPIO_9_EXTI_CFG() (SYSCFG->EXTICR[0] |= SYSCFG_EXTICR1_EXTI0_PC) -#define GPIO_9_IRQ EXTI0_IRQn -/* GPIO channel 10 config */ -#define GPIO_10_PORT GPIOC /* CC3000 CS */ -#define GPIO_10_PIN 1 -#define GPIO_10_CLK 2 -#define GPIO_10_EXTI_CFG() (SYSCFG->EXTICR[0] |= SYSCFG_EXTICR1_EXTI1_PC) -#define GPIO_10_IRQ EXTI1_IRQn -/* GPIO channel 11 config */ -#define GPIO_11_PORT GPIOC /* CC1101 GDO 0 */ -#define GPIO_11_PIN 4 -#define GPIO_11_CLK 2 -#define GPIO_11_EXTI_CFG() (SYSCFG->EXTICR[1] |= SYSCFG_EXTICR2_EXTI4_PC) -#define GPIO_11_IRQ EXTI4_IRQn -/* GPIO channel 12 config */ -#define GPIO_12_PORT GPIOC /* CC1101 GDO 2 */ -#define GPIO_12_PIN 5 -#define GPIO_12_CLK 2 -#define GPIO_12_EXTI_CFG() (SYSCFG->EXTICR[1] |= SYSCFG_EXTICR2_EXTI5_PC) -#define GPIO_12_IRQ EXTI9_5_IRQn -/* GPIO channel 13 config */ -#define GPIO_13_PORT GPIOC /* TCA6416 INT */ -#define GPIO_13_PIN 8 -#define GPIO_13_CLK 2 -#define GPIO_13_EXTI_CFG() (SYSCFG->EXTICR[2] |= SYSCFG_EXTICR3_EXTI8_PC) -#define GPIO_13_IRQ EXTI9_5_IRQn -/* GPIO channel 14 config */ -#define GPIO_14_PORT GPIOC /* CC3000 VBAT_SW_EN */ -#define GPIO_14_PIN 13 -#define GPIO_14_CLK 2 -#define GPIO_14_EXTI_CFG() (SYSCFG->EXTICR[3] |= SYSCFG_EXTICR4_EXTI13_PC) -#define GPIO_14_IRQ EXTI15_10_IRQn -/* GPIO channel 15 config */ -#define GPIO_15_PORT GPIOD /* Micro SD Sockel CS */ -#define GPIO_15_PIN 2 -#define GPIO_15_CLK 3 -#define GPIO_15_EXTI_CFG() (SYSCFG->EXTICR[0] |= SYSCFG_EXTICR1_EXTI2_PD) -#define GPIO_15_IRQ EXTI2_IRQn -/** @} */ - #ifdef __cplusplus } #endif diff --git a/boards/mulle/board.c b/boards/mulle/board.c index dbec6acf4a..bec2290ff8 100644 --- a/boards/mulle/board.c +++ b/boards/mulle/board.c @@ -108,16 +108,16 @@ void board_init(void) static inline void leds_init(void) { /* The pin configuration can be found in board.h and periph_conf.h */ - gpio_init_out(LED_RED_GPIO, GPIO_NOPULL); - gpio_init_out(LED_YELLOW_GPIO, GPIO_NOPULL); - gpio_init_out(LED_GREEN_GPIO, GPIO_NOPULL); + gpio_init(LED_RED_GPIO, GPIO_DIR_OUT, GPIO_NOPULL); + gpio_init(LED_YELLOW_GPIO, GPIO_DIR_OUT, GPIO_NOPULL); + gpio_init(LED_GREEN_GPIO, GPIO_DIR_OUT, GPIO_NOPULL); } static inline void power_pins_init(void) { - gpio_init_out(MULLE_POWER_AVDD, GPIO_NOPULL); - gpio_init_out(MULLE_POWER_VPERIPH, GPIO_NOPULL); - gpio_init_out(MULLE_POWER_VSEC, GPIO_NOPULL); + gpio_init(MULLE_POWER_AVDD, GPIO_DIR_OUT, GPIO_NOPULL); + gpio_init(MULLE_POWER_VPERIPH, GPIO_DIR_OUT, GPIO_NOPULL); + gpio_init(MULLE_POWER_VSEC, GPIO_DIR_OUT, GPIO_NOPULL); gpio_clear(MULLE_POWER_AVDD); gpio_clear(MULLE_POWER_VPERIPH); gpio_clear(MULLE_POWER_VSEC); diff --git a/boards/mulle/include/periph_conf.h b/boards/mulle/include/periph_conf.h index 8b54f45882..f79e240f52 100644 --- a/boards/mulle/include/periph_conf.h +++ b/boards/mulle/include/periph_conf.h @@ -468,7 +468,6 @@ extern "C" * @name GPIO configuration * @{ */ -#define GPIO_NUMOF 27 #define GPIO_0_EN 1 #define GPIO_1_EN 1 #define GPIO_2_EN 1 diff --git a/boards/nucleo-f091/include/periph_conf.h b/boards/nucleo-f091/include/periph_conf.h index f059424907..7163198442 100644 --- a/boards/nucleo-f091/include/periph_conf.h +++ b/boards/nucleo-f091/include/periph_conf.h @@ -92,7 +92,6 @@ extern "C" { * @name GPIO configuration * @{ */ -#define GPIO_NUMOF (6U) #define GPIO_0_EN 1 #define GPIO_1_EN 1 #define GPIO_2_EN 1 diff --git a/boards/nucleo-f334/include/periph_conf.h b/boards/nucleo-f334/include/periph_conf.h index 9168aaf099..b8609d9a5e 100644 --- a/boards/nucleo-f334/include/periph_conf.h +++ b/boards/nucleo-f334/include/periph_conf.h @@ -112,7 +112,6 @@ extern "C" { * @brief GPIO configuration * @{ */ -#define GPIO_NUMOF 3 #define GPIO_0_EN 1 #define GPIO_1_EN 1 #define GPIO_2_EN 1 diff --git a/boards/nucleo-l1/include/periph_conf.h b/boards/nucleo-l1/include/periph_conf.h index 3b25c8f8d5..bcfb064d7f 100644 --- a/boards/nucleo-l1/include/periph_conf.h +++ b/boards/nucleo-l1/include/periph_conf.h @@ -102,7 +102,6 @@ extern "C" { /** * @brief GPIO configuration */ -#define GPIO_NUMOF 16 #define GPIO_0_EN 1 #define GPIO_1_EN 1 #define GPIO_2_EN 1 diff --git a/boards/openmote/include/periph_conf.h b/boards/openmote/include/periph_conf.h index 6dc5ab8344..22a751dc67 100644 --- a/boards/openmote/include/periph_conf.h +++ b/boards/openmote/include/periph_conf.h @@ -106,7 +106,6 @@ * @name GPIO configuration * @{ */ -#define GPIO_NUMOF 12 #define GPIO_0_EN 1 #define GPIO_1_EN 1 #define GPIO_2_EN 1 diff --git a/boards/pba-d-01-kw2x/include/periph_conf.h b/boards/pba-d-01-kw2x/include/periph_conf.h index 11ca5db40f..ef7a00bc0a 100644 --- a/boards/pba-d-01-kw2x/include/periph_conf.h +++ b/boards/pba-d-01-kw2x/include/periph_conf.h @@ -303,7 +303,6 @@ extern "C" * @name GPIO configuration * @{ */ -#define GPIO_NUMOF 8 #define GPIO_0_EN 1 #define GPIO_1_EN 1 #define GPIO_2_EN 1 diff --git a/boards/saml21-xpro/board.c b/boards/saml21-xpro/board.c index 326b17aaa4..e20b6d35f2 100644 --- a/boards/saml21-xpro/board.c +++ b/boards/saml21-xpro/board.c @@ -44,5 +44,5 @@ void board_init(void) */ void led_init(void) { - gpio_init_out(PB10, GPIO_NOPULL); + gpio_init(GPIO(PB,10), GPIO_DIR_OUT, GPIO_NOPULL); } diff --git a/boards/saml21-xpro/include/periph_conf.h b/boards/saml21-xpro/include/periph_conf.h index 37a902d578..08317f22cb 100644 --- a/boards/saml21-xpro/include/periph_conf.h +++ b/boards/saml21-xpro/include/periph_conf.h @@ -103,79 +103,6 @@ extern "C" { #define RTT_NUMOF (1) /** @} */ -/** - * @name GPIO configuration - * @{ - */ - -/* GPIO pin mapping */ -enum { - PA2, /* EXT1 P10, SW0 */ - PB10, /* orange LED */ - PB6, /* EXT1 P05 */ - PA12, /* EXT1 P07 */ - PB4, /* EXT1 P09 */ - PA5, /* EXT1 P15 SPI_SS */ - PA6, /* EXT1 P16 SPI_MOSI */ - PA4, /* EXT1 P17 SPI_MISO */ - PA7, /* EXT1 P18 SPI_SCK */ - GPIO_UNUSED, - PB5, - PA3, - PB7, - PB9, - PA13, -}; - -/* define this to the value of GPIO_UNNUSED. - * Unfortunately the preprocessor can't access the enum's value.*/ -#define GPIO_NUMOF 9 /* same as GPIO_UNUSED */ - -enum { - EXT1_SPI, /* EXT1 -> SPI0 */ -}; - -enum { - EXT1_P07 = PA12, - EXT1_P09 = PB4, - EXT1_P10 = PA2, - EXT1_SPI_SS = PA5, - EXT1_SPI_MOSI = PA6, - EXT1_SPI_MISO = PA4, - EXT1_SPI_SCK = PA7, -}; - -#define GPIO_EXTI0_EN 0 -#define GPIO_EXTI1_EN 0 -#define GPIO_EXTI2_EN 1 /* for PA02/BUTTON0 */ -#define GPIO_EXTI3_EN 0 -#define GPIO_EXTI4_EN 1 /* for PB04 */ -#define GPIO_EXTI5_EN 0 -#define GPIO_EXTI6_EN 0 -#define GPIO_EXTI7_EN 0 -#define GPIO_EXTI8_EN 0 -#define GPIO_EXTI9_EN 0 -#define GPIO_EXTI10_EN 0 -#define GPIO_EXTI11_EN 0 -#define GPIO_EXTI12_EN 1 -#define GPIO_EXTI13_EN 0 -#define GPIO_EXTI14_EN 0 -#define GPIO_EXTI15_EN 0 - -/* defines to satisfy periph/gpio.h - * In order to support GPIO_0..n in applications, you have to define these here. - */ -#define GPIO_0_EN 1 -#define GPIO_1_EN 1 -#define GPIO_2_EN 1 -#define GPIO_3_EN 1 -#define GPIO_4_EN 1 -#define GPIO_5_EN 1 -#define GPIO_6_EN 1 -#define GPIO_7_EN 1 -#define GPIO_8_EN 1 -/** @} */ - #ifdef __cplusplus } #endif diff --git a/boards/samr21-xpro/include/board.h b/boards/samr21-xpro/include/board.h index 782f446977..c7cf676d02 100644 --- a/boards/samr21-xpro/include/board.h +++ b/boards/samr21-xpro/include/board.h @@ -24,6 +24,7 @@ #include "cpu.h" #include "periph_conf.h" +#include "periph_cpu.h" #ifdef __cplusplus extern "C" { @@ -44,10 +45,10 @@ extern "C" { * @{ */ #define NG_AT86RF233_SPI (SPI_0) -#define NG_AT86RF233_CS (GPIO_4) -#define NG_AT86RF233_INT (GPIO_5) -#define NG_AT86RF233_RESET (GPIO_6) -#define NG_AT86RF233_SLEEP (GPIO_7) +#define NG_AT86RF233_CS GPIO(PB, 31) +#define NG_AT86RF233_INT GPIO(PB, 0) +#define NG_AT86RF233_RESET GPIO(PB, 15) +#define NG_AT86RF233_SLEEP GPIO(PA, 20) #define NG_AT86RF233_SPI_CLK (SPI_SPEED_1MHZ) /** @}*/ @@ -56,10 +57,10 @@ extern "C" { * @{ */ #define AT86RF231_SPI SPI_0 -#define AT86RF231_CS GPIO_4 -#define AT86RF231_INT GPIO_5 -#define AT86RF231_RESET GPIO_6 -#define AT86RF231_SLEEP GPIO_7 +#define AT86RF231_CS GPIO(PB, 31) +#define AT86RF231_INT GPIO(PB, 0) +#define AT86RF231_RESET GPIO(PB, 15) +#define AT86RF231_SLEEP GPIO(PA, 20) #define AT86RF231_SPI_SPEED SPI_SPEED_1MHZ /** @} */ diff --git a/boards/samr21-xpro/include/periph_conf.h b/boards/samr21-xpro/include/periph_conf.h index ef2daf0bcc..414e0a5c38 100644 --- a/boards/samr21-xpro/include/periph_conf.h +++ b/boards/samr21-xpro/include/periph_conf.h @@ -259,96 +259,6 @@ static const pwm_conf_t pwm_config[] = { #define RTT_RUNSTDBY (1) /* Keep RTT running in sleep states */ /** @} */ - -/** - * @name GPIO configuration - * @{ - */ -#define GPIO_NUMOF (9U) -#define GPIO_0_EN 1 -#define GPIO_1_EN 1 -#define GPIO_2_EN 1 -#define GPIO_3_EN 1 -/*4-7 -> internal */ -#define GPIO_4_EN 1 -#define GPIO_5_EN 1 -#define GPIO_6_EN 1 -#define GPIO_7_EN 1 -#define GPIO_8_EN 1 -#define GPIO_9_EN 0 -#define GPIO_10_EN 0 -#define GPIO_11_EN 0 - -#define GPIO_12_EN 0 -#define GPIO_13_EN 0 -#define GPIO_14_EN 0 -#define GPIO_15_EN 0 - -#define GPIO_NO_EXTINT (18) - -/* GPIO channel 0 config */ -#define GPIO_0_DEV PORT->Group[0] -#define GPIO_0_PIN (13) -#define GPIO_0_EXTINT (13) -/* GPIO channel 1 config */ -#define GPIO_1_DEV PORT->Group[0] -#define GPIO_1_PIN (28) -#define GPIO_1_EXTINT (8) -/* GPIO channel 2 config */ -#define GPIO_2_DEV PORT->Group[0] -#define GPIO_2_PIN (15) -#define GPIO_2_EXTINT (15) -/* GPIO channel 3 config */ -#define GPIO_3_DEV PORT->Group[1] -#define GPIO_3_PIN (3) -#define GPIO_3_EXTINT (3) -/* GPIO 4-7 Internal radio pins*/ -/* GPIO channel 4 config radio CS*/ -#define GPIO_4_DEV PORT->Group[1] -#define GPIO_4_PIN (31) -#define GPIO_4_EXTINT GPIO_NO_EXTINT -/* GPIO channel 5 config radio IRQ0*/ -#define GPIO_5_DEV PORT->Group[1] -#define GPIO_5_PIN (0) -#define GPIO_5_EXTINT (0) -/* GPIO channel 6 config radio reset*/ -#define GPIO_6_DEV PORT->Group[1] -#define GPIO_6_PIN (15) -#define GPIO_6_EXTINT GPIO_NO_EXTINT -/* GPIO channel 7 config radio sleep*/ -#define GPIO_7_DEV PORT->Group[0] -#define GPIO_7_PIN (20) -#define GPIO_7_EXTINT GPIO_NO_EXTINT -/* GPIO channel 8 config */ -#define GPIO_8_DEV PORT->Group[0] -#define GPIO_8_PIN (27) -#define GPIO_8_EXTINT GPIO_NO_EXTINT -/* GPIO channel 9 config */ -#define GPIO_9_DEV -#define GPIO_9_PIN -#define GPIO_9_EXTINT -/* GPIO channel 10 config */ -#define GPIO_10_DEV -#define GPIO_10_PIN -#define GPIO_10_EXTINT -/* GPIO channel 11 config */ -#define GPIO_11_DEV -#define GPIO_11_PIN -#define GPIO_11_EXTINT -/* GPIO channel 12 config */ -#define GPIO_12_PIN -#define GPIO_12_EXTINT -/* GPIO channel 13 config */ -#define GPIO_13_PIN -#define GPIO_13_EXTINT -/* GPIO channel 14 config */ -#define GPIO_14_PIN -#define GPIO_14_EXTINT -/* GPIO channel 15 config */ -#define GPIO_15_PIN -#define GPIO_15_EXTINT -/** @} */ - #ifdef __cplusplus } #endif diff --git a/boards/spark-core/include/periph_conf.h b/boards/spark-core/include/periph_conf.h index a77a1abe80..2be755e89e 100644 --- a/boards/spark-core/include/periph_conf.h +++ b/boards/spark-core/include/periph_conf.h @@ -99,7 +99,6 @@ /** * @brief GPIO configuration */ -#define GPIO_NUMOF (13U) #define GPIO_0_EN 1 #define GPIO_1_EN 1 #define GPIO_2_EN 1 diff --git a/boards/stm32f0discovery/include/periph_conf.h b/boards/stm32f0discovery/include/periph_conf.h index b9fdc988ec..57e42657df 100644 --- a/boards/stm32f0discovery/include/periph_conf.h +++ b/boards/stm32f0discovery/include/periph_conf.h @@ -165,7 +165,6 @@ extern "C" { * @name GPIO configuration * @{ */ -#define GPIO_NUMOF 12 #define GPIO_0_EN 1 #define GPIO_1_EN 1 #define GPIO_2_EN 1 diff --git a/boards/stm32f3discovery/include/periph_conf.h b/boards/stm32f3discovery/include/periph_conf.h index 8120902dfa..2c346c5ba9 100644 --- a/boards/stm32f3discovery/include/periph_conf.h +++ b/boards/stm32f3discovery/include/periph_conf.h @@ -248,6 +248,7 @@ extern "C" { * @brief GPIO configuration * @{ */ + #define GPIO_NUMOF 12 #define GPIO_0_EN 1 #define GPIO_1_EN 1 diff --git a/boards/stm32f4discovery/include/periph_conf.h b/boards/stm32f4discovery/include/periph_conf.h index 7e29a06864..ed7ddb29cd 100644 --- a/boards/stm32f4discovery/include/periph_conf.h +++ b/boards/stm32f4discovery/include/periph_conf.h @@ -80,6 +80,8 @@ extern "C" { #define UART_IRQ_PRIO 1 #define UART_CLK (14000000U) /* UART clock runs with 14MHz */ + + /* UART 0 device configuration */ #define UART_0_DEV USART2 #define UART_0_CLKEN() (RCC->APB1ENR |= RCC_APB1ENR_USART2EN) @@ -294,117 +296,6 @@ extern "C" { #define I2C_0_SDA_CLKEN() (RCC->AHB1ENR |= RCC_AHB1ENR_GPIOBEN) /** @} */ -/** - * @name GPIO configuration - * @{ - */ -#define GPIO_NUMOF 12 -#define GPIO_0_EN 1 -#define GPIO_1_EN 1 -#define GPIO_2_EN 1 -#define GPIO_3_EN 1 -#define GPIO_4_EN 1 -#define GPIO_5_EN 1 -#define GPIO_6_EN 1 -#define GPIO_7_EN 1 -#define GPIO_8_EN 1 -#define GPIO_9_EN 1 -#define GPIO_10_EN 1 -#define GPIO_11_EN 1 -#define GPIO_IRQ_PRIO 1 - -/* IRQ config */ -#define GPIO_IRQ_0 GPIO_0 /* alternatively GPIO_1 could be used here */ -#define GPIO_IRQ_1 GPIO_2 -#define GPIO_IRQ_2 GPIO_3 -#define GPIO_IRQ_3 GPIO_4 -#define GPIO_IRQ_4 GPIO_5 -#define GPIO_IRQ_5 GPIO_6 -#define GPIO_IRQ_6 GPIO_7 -#define GPIO_IRQ_7 GPIO_8 -#define GPIO_IRQ_8 GPIO_9 -#define GPIO_IRQ_9 GPIO_10 -#define GPIO_IRQ_10 GPIO_11 -#define GPIO_IRQ_11 -1/* not configured */ -#define GPIO_IRQ_12 -1/* not configured */ -#define GPIO_IRQ_13 -1/* not configured */ -#define GPIO_IRQ_14 -1/* not configured */ -#define GPIO_IRQ_15 -1/* not configured */ - -/* GPIO channel 0 config */ -#define GPIO_0_PORT GPIOA /* Used for user button 1 */ -#define GPIO_0_PIN 0 -#define GPIO_0_CLK 0 /* 0: PORT A, 1: B ... */ -#define GPIO_0_EXTI_CFG() (SYSCFG->EXTICR[0] |= SYSCFG_EXTICR1_EXTI0_PA) -#define GPIO_0_IRQ EXTI0_IRQn -/* GPIO channel 1 config */ -#define GPIO_1_PORT GPIOE /* LIS302DL INT1 */ -#define GPIO_1_PIN 0 -#define GPIO_1_CLK 4 -#define GPIO_1_EXTI_CFG() (SYSCFG->EXTICR[0] |= SYSCFG_EXTICR1_EXTI0_PE) -#define GPIO_1_IRQ EXTI0_IRQn -/* GPIO channel 2 config */ -#define GPIO_2_PORT GPIOE /* LIS302DL INT2 */ -#define GPIO_2_PIN 1 -#define GPIO_2_CLK 4 -#define GPIO_2_EXTI_CFG() (SYSCFG->EXTICR[0] |= SYSCFG_EXTICR1_EXTI1_PE) -#define GPIO_2_IRQ EXTI1_IRQn -/* GPIO channel 3 config */ -#define GPIO_3_PORT GPIOE -#define GPIO_3_PIN 2 -#define GPIO_3_CLK 4 -#define GPIO_3_EXTI_CFG() (SYSCFG->EXTICR[0] |= SYSCFG_EXTICR1_EXTI2_PE) -#define GPIO_3_IRQ EXTI2_IRQn -/* GPIO channel 4 config */ -#define GPIO_4_PORT GPIOE /* LIS302DL CS */ -#define GPIO_4_PIN 3 -#define GPIO_4_CLK 4 -#define GPIO_4_EXTI_CFG() (SYSCFG->EXTICR[0] |= SYSCFG_EXTICR1_EXTI3_PE) -#define GPIO_4_IRQ EXTI3_IRQn -/* GPIO channel 5 config */ -#define GPIO_5_PORT GPIOD /* CS43L22 RESET */ -#define GPIO_5_PIN 4 -#define GPIO_5_CLK 3 -#define GPIO_5_EXTI_CFG() (SYSCFG->EXTICR[1] |= SYSCFG_EXTICR2_EXTI4_PD) -#define GPIO_5_IRQ EXTI4_IRQn -/* GPIO channel 6 config */ -#define GPIO_6_PORT GPIOD /* LD8 */ -#define GPIO_6_PIN 5 -#define GPIO_6_CLK 3 -#define GPIO_6_EXTI_CFG() (SYSCFG->EXTICR[1] |= SYSCFG_EXTICR2_EXTI5_PD) -#define GPIO_6_IRQ EXTI9_5_IRQn -/* GPIO channel 7 config */ -#define GPIO_7_PORT GPIOD -#define GPIO_7_PIN 6 -#define GPIO_7_CLK 3 -#define GPIO_7_EXTI_CFG() (SYSCFG->EXTICR[1] |= SYSCFG_EXTICR2_EXTI6_PD) -#define GPIO_7_IRQ EXTI9_5_IRQn -/* GPIO channel 8 config */ -#define GPIO_8_PORT GPIOD -#define GPIO_8_PIN 7 -#define GPIO_8_CLK 3 -#define GPIO_8_EXTI_CFG() (SYSCFG->EXTICR[1] |= SYSCFG_EXTICR2_EXTI7_PD) -#define GPIO_8_IRQ EXTI9_5_IRQn -/* GPIO channel 9 config */ -#define GPIO_9_PORT GPIOA -#define GPIO_9_PIN 8 -#define GPIO_9_CLK 0 -#define GPIO_9_EXTI_CFG() (SYSCFG->EXTICR[2] |= SYSCFG_EXTICR3_EXTI8_PA) -#define GPIO_9_IRQ EXTI9_5_IRQn -/* GPIO channel 10 config */ -#define GPIO_10_PORT GPIOA /* LD7 */ -#define GPIO_10_PIN 9 -#define GPIO_10_CLK 0 -#define GPIO_10_EXTI_CFG() (SYSCFG->EXTICR[2] |= SYSCFG_EXTICR3_EXTI9_PA) -#define GPIO_10_IRQ EXTI9_5_IRQn -/* GPIO channel 11 config */ -#define GPIO_11_PORT GPIOD -#define GPIO_11_PIN 10 -#define GPIO_11_CLK 3 -#define GPIO_11_EXTI_CFG() (SYSCFG->EXTICR[2] |= SYSCFG_EXTICR3_EXTI10_PD) -#define GPIO_11_IRQ EXTI15_10_IRQn -/** @} */ - #ifdef __cplusplus } #endif diff --git a/boards/udoo/include/periph_conf.h b/boards/udoo/include/periph_conf.h index 5c49bf3adc..bd80fefcfd 100644 --- a/boards/udoo/include/periph_conf.h +++ b/boards/udoo/include/periph_conf.h @@ -146,7 +146,6 @@ extern "C" { * @name GPIO configuration * @{ */ -#define GPIO_NUMOF (32U) #define GPIO_0_EN 1 #define GPIO_1_EN 1 #define GPIO_2_EN 1