Skip to content

Commit

Permalink
boards/hifive1*: provide and configure SPI feature
Browse files Browse the repository at this point in the history
  • Loading branch information
aabadie committed Dec 16, 2019
1 parent e2266fd commit 298a1a3
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
2 changes: 1 addition & 1 deletion boards/hifive1/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ CPU_MODEL = fe310_g000
#FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_rtc
FEATURES_PROVIDED += periph_rtt
#FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart
17 changes: 17 additions & 0 deletions boards/hifive1/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,23 @@ static const uart_conf_t uart_config[] = {
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */

/**
* @name SPI device configuration
*
* @{
*/
static const spi_conf_t spi_config[] = {
{
.addr = SPI1_CTRL_ADDR,
.mosi = GPIO_PIN(0, 3), /* D11 */
.miso = GPIO_PIN(0, 4), /* D12 */
.sclk = GPIO_PIN(0, 5), /* D13 */
},
};

#define SPI_NUMOF ARRAY_SIZE(spi_config)
/** @} */

/**
* @name RTT/RTC configuration
*
Expand Down
2 changes: 1 addition & 1 deletion boards/hifive1b/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ CPU_MODEL = fe310_g002
#FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_rtc
FEATURES_PROVIDED += periph_rtt
#FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart
17 changes: 17 additions & 0 deletions boards/hifive1b/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,23 @@ static const uart_conf_t uart_config[] = {
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */

/**
* @name SPI device configuration
*
* @{
*/
static const spi_conf_t spi_config[] = {
{
.addr = SPI1_CTRL_ADDR,
.mosi = GPIO_PIN(0, 3), /* D11 */
.miso = GPIO_PIN(0, 4), /* D12 */
.sclk = GPIO_PIN(0, 5), /* D13 */
},
};

#define SPI_NUMOF ARRAY_SIZE(spi_config)
/** @} */

/**
* @name RTT/RTC configuration
*
Expand Down

0 comments on commit 298a1a3

Please sign in to comment.