boards/nrf9160dk: add TWI and SPI configuration
This commit is contained in:
parent
1beda0f1e4
commit
0c60a2a600
@ -11,5 +11,7 @@ config BOARD_NRF9160DK
|
|||||||
bool
|
bool
|
||||||
default y
|
default y
|
||||||
select CPU_MODEL_NRF9160
|
select CPU_MODEL_NRF9160
|
||||||
|
select HAS_PERIPH_I2C
|
||||||
|
select HAS_PERIPH_SPI
|
||||||
select HAS_PERIPH_TIMER
|
select HAS_PERIPH_TIMER
|
||||||
select HAS_PERIPH_UART
|
select HAS_PERIPH_UART
|
||||||
|
|||||||
@ -2,5 +2,7 @@ CPU_MODEL = nrf9160
|
|||||||
CPU = nrf9160
|
CPU = nrf9160
|
||||||
|
|
||||||
# Put defined MCU peripherals here (in alphabetical order)
|
# Put defined MCU peripherals here (in alphabetical order)
|
||||||
|
FEATURES_PROVIDED += periph_i2c
|
||||||
|
FEATURES_PROVIDED += periph_spi
|
||||||
FEATURES_PROVIDED += periph_timer
|
FEATURES_PROVIDED += periph_timer
|
||||||
FEATURES_PROVIDED += periph_uart
|
FEATURES_PROVIDED += periph_uart
|
||||||
|
|||||||
@ -28,6 +28,37 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name I2C configuration
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
static const i2c_conf_t i2c_config[] = {
|
||||||
|
{
|
||||||
|
.dev = NRF_TWIM3_S,
|
||||||
|
.scl = GPIO_PIN(0, 31),
|
||||||
|
.sda = GPIO_PIN(0, 30),
|
||||||
|
.speed = I2C_SPEED_NORMAL
|
||||||
|
}
|
||||||
|
};
|
||||||
|
#define I2C_NUMOF ARRAY_SIZE(i2c_config)
|
||||||
|
/** @} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name SPI configuration
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
static const spi_conf_t spi_config[] = {
|
||||||
|
{
|
||||||
|
.dev = NRF_SPIM2_S,
|
||||||
|
.sclk = GPIO_PIN(0, 13),
|
||||||
|
.mosi = GPIO_PIN(0, 11),
|
||||||
|
.miso = GPIO_PIN(0, 12),
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#define SPI_NUMOF ARRAY_SIZE(spi_config)
|
||||||
|
/** @} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Timer configuration
|
* @name Timer configuration
|
||||||
* @{
|
* @{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user