From ce6b1d390a652834b881e34123f7d5da3a194bfe Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Wed, 2 Sep 2015 14:06:19 +0200 Subject: [PATCH] boards/z1: added SPI configuration --- boards/z1/Makefile.features | 1 + boards/z1/include/periph_conf.h | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/boards/z1/Makefile.features b/boards/z1/Makefile.features index 33f9b22ad3..e0a064248a 100644 --- a/boards/z1/Makefile.features +++ b/boards/z1/Makefile.features @@ -1,3 +1,4 @@ FEATURES_PROVIDED += periph_gpio +FEATURES_PROVIDED += periph_spi FEATURES_PROVIDED += periph_timer FEATURES_MCU_GROUP = msp430 diff --git a/boards/z1/include/periph_conf.h b/boards/z1/include/periph_conf.h index 9ce86c90f2..1ef7ee6f1a 100644 --- a/boards/z1/include/periph_conf.h +++ b/boards/z1/include/periph_conf.h @@ -64,6 +64,25 @@ extern "C" { #define UART_TX_PIN (1 << 1) #define UART_RX_ISR (USCIAB0RX_VECTOR) #define UART_TX_ISR (USCIAB0TX_VECTOR) +/** @} */ + + /** + * @brief SPI configuration + * @{ + */ +#define SPI_NUMOF (1U) +#define SPI_0_EN (1U) + +/* SPI configuration */ +#define SPI_USE_USIC +#define SPI_DEV (USCI_0_B_SPI) +#define SPI_IE (SFR->IE2) +#define SPI_IF (SFR->IFG2) +#define SPI_IE_RX_BIT (1 << 2) +#define SPI_IE_TX_BIT (1 << 3) +#define SPI_PIN_MISO GPIO(P3,2) +#define SPI_PIN_MOSI GPIO(P3,1) +#define SPI_PIN_CLK GPIO(P3,3) /** @} */ #ifdef __cplusplus