diff --git a/cpu/nrf51/include/periph_cpu.h b/cpu/nrf51/include/periph_cpu.h index 44d80660f3..b4137a993b 100644 --- a/cpu/nrf51/include/periph_cpu.h +++ b/cpu/nrf51/include/periph_cpu.h @@ -88,8 +88,8 @@ typedef enum { */ typedef struct { NRF_TWI_Type *dev; /**< hardware device */ - uint8_t pin_scl; /**< SCL pin */ - uint8_t pin_sda; /**< SDA pin */ + gpio_t pin_scl; /**< SCL pin */ + gpio_t pin_sda; /**< SDA pin */ uint8_t ppi; /**< PPI channel to use */ i2c_speed_t speed; /**< bus speed */ } i2c_conf_t; diff --git a/cpu/nrf52/include/periph_cpu.h b/cpu/nrf52/include/periph_cpu.h index 5bc5f338bd..7499a45071 100644 --- a/cpu/nrf52/include/periph_cpu.h +++ b/cpu/nrf52/include/periph_cpu.h @@ -105,8 +105,8 @@ typedef enum { */ typedef struct { NRF_TWIM_Type *dev; /**< TWIM hardware device */ - uint8_t scl; /**< SCL pin */ - uint8_t sda; /**< SDA pin */ + gpio_t scl; /**< SCL pin */ + gpio_t sda; /**< SDA pin */ i2c_speed_t speed; /**< Bus speed */ } i2c_conf_t; /** @} */ @@ -158,7 +158,7 @@ typedef enum { */ typedef struct { NRF_PWM_Type *dev; /**< PWM device descriptor */ - uint32_t pin[PWM_CHANNELS]; /**< PWM out pins */ + gpio_t pin[PWM_CHANNELS]; /**< PWM out pins */ } pwm_conf_t; #ifdef CPU_MODEL_NRF52840XXAA @@ -167,10 +167,10 @@ typedef struct { */ typedef struct { NRF_UARTE_Type *dev; /**< UART with EasyDMA device base register address */ - uint8_t rx_pin; /**< RX pin */ - uint8_t tx_pin; /**< TX pin */ - uint8_t rts_pin; /**< RTS pin - set to GPIO_UNDEF when not using HW flow control */ - uint8_t cts_pin; /**< CTS pin - set to GPIO_UNDEF when not using HW flow control */ + gpio_t rx_pin; /**< RX pin */ + gpio_t tx_pin; /**< TX pin */ + gpio_t rts_pin; /**< RTS pin - set to GPIO_UNDEF when not using HW flow control */ + gpio_t cts_pin; /**< CTS pin - set to GPIO_UNDEF when not using HW flow control */ uint8_t irqn; /**< IRQ channel */ } uart_conf_t; #endif diff --git a/cpu/nrf5x_common/include/periph_cpu_common.h b/cpu/nrf5x_common/include/periph_cpu_common.h index e1a06856c8..1cbdb6f561 100644 --- a/cpu/nrf5x_common/include/periph_cpu_common.h +++ b/cpu/nrf5x_common/include/periph_cpu_common.h @@ -84,6 +84,14 @@ extern "C" { /** @} */ #ifndef DOXYGEN +/** + * @brief Overwrite the default gpio_t type definition + * @{ + */ +#define HAVE_GPIO_T +typedef uint8_t gpio_t; +/** @} */ + /** * @brief Override GPIO modes * @@ -162,9 +170,9 @@ typedef enum { */ typedef struct { NRF_SPI_Type *dev; /**< SPI device used */ - uint8_t sclk; /**< CLK pin */ - uint8_t mosi; /**< MOSI pin */ - uint8_t miso; /**< MISO pin */ + gpio_t sclk; /**< CLK pin */ + gpio_t mosi; /**< MOSI pin */ + gpio_t miso; /**< MISO pin */ } spi_conf_t; /**