periph_conf.h File Reference

Peripheral specific definitions for the HiFive1b RISC-V board. More...

Detailed Description

Peripheral specific definitions for the HiFive1b RISC-V board.

Author
Ken Rabold
Alexandre Abadie alexa.nosp@m.ndre.nosp@m..abad.nosp@m.ie@i.nosp@m.nria..nosp@m.fr

Definition in file periph_conf.h.

#include "periph_cpu.h"
+ Include dependency graph for periph_conf.h:

Go to the source code of this file.

Core Clock configuration

#define CONFIG_USE_CLOCK_HFXOSC_PLL   1 /* Use PLL clocked by HFXOSC by default */
 
#define CONFIG_USE_CLOCK_HFXOSC   0
 
#define CONFIG_USE_CLOCK_HFROSC_PLL   0
 
#define CONFIG_USE_CLOCK_HFROSC   0
 
#define CONFIG_CLOCK_PLL_R   (1) /* Divide input clock by 2, mandatory with HFXOSC */
 
#define CONFIG_CLOCK_PLL_F   (39) /* Multiply REFR by 80, e.g 2 * (39 + 1) */
 
#define CONFIG_CLOCK_PLL_Q   (1) /* Divide VCO by 2, e.g 2^1 */
 
#define CLOCK_PLL_INPUT_CLOCK   MHZ(16)
 
#define CLOCK_PLL_REFR   (CLOCK_PLL_INPUT_CLOCK / (CONFIG_CLOCK_PLL_R + 1))
 
#define CLOCK_PLL_VCO   (CLOCK_PLL_REFR * (2 * (CONFIG_CLOCK_PLL_F + 1)))
 
#define CLOCK_PLL_OUT   (CLOCK_PLL_VCO / (1 << CONFIG_CLOCK_PLL_Q))
 
#define CLOCK_CORECLOCK   (CLOCK_PLL_OUT) /* 320000000Hz with the values used above */
 
#define CONFIG_CLOCK_DESIRED_FREQUENCY   MHZ(320)
 
#define CONFIG_CLOCK_HFROSC_TRIM   (6) /* ~72000000Hz input freq */
 
#define CONFIG_CLOCK_HFROSC_DIV   (1) /* Divide by 2 */
 

Timer configuration

#define TIMER_NUMOF   (1)
 

UART configuration

#define UART_NUMOF   ARRAY_SIZE(uart_config)
 
static const uart_conf_t uart_config []
 

SPI device configuration

#define SPI_NUMOF   ARRAY_SIZE(spi_config)
 
static const spi_conf_t spi_config []
 

PWM configuration

#define PWM_NUMOF   (3)
 

I2C configuration

#define I2C_NUMOF   ARRAY_SIZE(i2c_config)
 
static const i2c_conf_t i2c_config []
 

Variable Documentation

◆ i2c_config

const i2c_conf_t i2c_config[]
static
Initial value:
= {
{
.addr = I2C0_CTRL_ADDR,
.scl = GPIO_PIN(0, 13),
.sda = GPIO_PIN(0, 12),
.speed = I2C_SPEED_NORMAL,
},
}

Definition at line 180 of file periph_conf.h.

◆ spi_config

const spi_conf_t spi_config[]
static
Initial value:
= {
{
.addr = SPI1_CTRL_ADDR,
.mosi = GPIO_PIN(0, 3),
.miso = GPIO_PIN(0, 4),
.sclk = GPIO_PIN(0, 5),
},
}

Definition at line 156 of file periph_conf.h.

◆ uart_config

const uart_conf_t uart_config[]
static
Initial value:
= {
{
.addr = UART0_CTRL_ADDR,
.rx = GPIO_PIN(0, 16),
.tx = GPIO_PIN(0, 17),
.isr_num = INT_UART0_BASE,
},
{
.addr = UART1_CTRL_ADDR,
.rx = GPIO_PIN(0, 18),
.tx = GPIO_PIN(0, 23),
.isr_num = INT_UART1_BASE,
},
}

Definition at line 133 of file periph_conf.h.

I2C_SPEED_NORMAL
@ I2C_SPEED_NORMAL
normal mode: ~100 kbit/s
Definition: i2c.h:177
GPIO_PIN
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition: periph_cpu.h:35