Loading...
Searching...
No Matches

Peripheral MCU configuration for the bluepill/blackpill boards. More...

Detailed Description

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

Go to the source code of this file.

Macros

#define USBDEV_ISR   isr_usb_lp_can1_rx0
 Interrupt function name mapping.
 
#define USBDEV_NUMOF   ARRAY_SIZE(stm32_usbdev_fs_config)
 Number of available USB device FS peripherals.
 

Variables

static const stm32_usbdev_fs_config_t stm32_usbdev_fs_config []
 USB device FS configuration.
 
#define CONFIG_BOARD_HAS_LSE   1
 
#define CONFIG_BOARD_HAS_HSE   1
 

Real time counter configuration

#define RTT_FREQUENCY   (16384) /* in Hz */
 

ADC configuration

#define ADC_NUMOF   ARRAY_SIZE(adc_config)
 
static const adc_conf_t adc_config []
 

DMA streams configuration

#define DMA_0_ISR   isr_dma1_channel2
 
#define DMA_1_ISR   isr_dma1_channel3
 
#define DMA_2_ISR   isr_dma1_channel4
 
#define DMA_3_ISR   isr_dma1_channel5
 
#define DMA_4_ISR   isr_dma1_channel7
 
#define DMA_NUMOF   ARRAY_SIZE(dma_config)
 
static const dma_conf_t dma_config []
 

Timer configuration

#define TIMER_0_ISR   isr_tim2
 
#define TIMER_1_ISR   isr_tim3
 
#define TIMER_2_ISR   isr_tim4
 
#define TIMER_NUMOF   ARRAY_SIZE(timer_config)
 
static const timer_conf_t timer_config []
 

QDEC configuration

#define QDEC_NUMOF   ARRAY_SIZE(qdec_config)
 
static const qdec_conf_t qdec_config []
 

UART configuration

#define UART_0_ISR   (isr_usart1)
 
#define UART_1_ISR   (isr_usart2)
 
#define UART_2_ISR   (isr_usart3)
 
#define UART_NUMOF   ARRAY_SIZE(uart_config)
 
static const uart_conf_t uart_config []
 

I2C configuration

Note
This board may require external pullup resistors for i2c operation.
#define I2C_0_ISR   isr_i2c1_ev
 
#define I2C_1_ISR   isr_i2c2_ev
 
#define I2C_NUMOF   ARRAY_SIZE(i2c_config)
 
static const i2c_conf_t i2c_config []
 

PWM configuration

#define PWM_NUMOF   ARRAY_SIZE(pwm_config)
 
static const pwm_conf_t pwm_config []
 

SPI configuration

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

Macro Definition Documentation

◆ ADC_NUMOF

#define ADC_NUMOF   ARRAY_SIZE(adc_config)

Definition at line 82 of file periph_conf.h.

◆ CONFIG_BOARD_HAS_HSE

#define CONFIG_BOARD_HAS_HSE   1

Definition at line 34 of file periph_conf.h.

◆ CONFIG_BOARD_HAS_LSE

#define CONFIG_BOARD_HAS_LSE   1

Definition at line 29 of file periph_conf.h.

◆ DMA_0_ISR

#define DMA_0_ISR   isr_dma1_channel2

Definition at line 97 of file periph_conf.h.

◆ DMA_1_ISR

#define DMA_1_ISR   isr_dma1_channel3

Definition at line 98 of file periph_conf.h.

◆ DMA_2_ISR

#define DMA_2_ISR   isr_dma1_channel4

Definition at line 99 of file periph_conf.h.

◆ DMA_3_ISR

#define DMA_3_ISR   isr_dma1_channel5

Definition at line 100 of file periph_conf.h.

◆ DMA_4_ISR

#define DMA_4_ISR   isr_dma1_channel7

Definition at line 101 of file periph_conf.h.

◆ DMA_NUMOF

#define DMA_NUMOF   ARRAY_SIZE(dma_config)

Definition at line 103 of file periph_conf.h.

◆ I2C_0_ISR

#define I2C_0_ISR   isr_i2c1_ev

Definition at line 265 of file periph_conf.h.

◆ I2C_1_ISR

#define I2C_1_ISR   isr_i2c2_ev

Definition at line 266 of file periph_conf.h.

◆ I2C_NUMOF

#define I2C_NUMOF   ARRAY_SIZE(i2c_config)

Definition at line 268 of file periph_conf.h.

◆ PWM_NUMOF

#define PWM_NUMOF   ARRAY_SIZE(pwm_config)

Definition at line 298 of file periph_conf.h.

◆ QDEC_NUMOF

#define QDEC_NUMOF   ARRAY_SIZE(qdec_config)

Definition at line 184 of file periph_conf.h.

◆ RTT_FREQUENCY

#define RTT_FREQUENCY   (16384) /* in Hz */

Definition at line 49 of file periph_conf.h.

◆ SPI_NUMOF

#define SPI_NUMOF   ARRAY_SIZE(spi_config)

Definition at line 340 of file periph_conf.h.

◆ TIMER_0_ISR

#define TIMER_0_ISR   isr_tim2

Definition at line 134 of file periph_conf.h.

◆ TIMER_1_ISR

#define TIMER_1_ISR   isr_tim3

Definition at line 135 of file periph_conf.h.

◆ TIMER_2_ISR

#define TIMER_2_ISR   isr_tim4

Definition at line 136 of file periph_conf.h.

◆ TIMER_NUMOF

#define TIMER_NUMOF   ARRAY_SIZE(timer_config)

Definition at line 138 of file periph_conf.h.

◆ UART_0_ISR

#define UART_0_ISR   (isr_usart1)

Definition at line 230 of file periph_conf.h.

◆ UART_1_ISR

#define UART_1_ISR   (isr_usart2)

Definition at line 231 of file periph_conf.h.

◆ UART_2_ISR

#define UART_2_ISR   (isr_usart3)

Definition at line 232 of file periph_conf.h.

◆ UART_NUMOF

#define UART_NUMOF   ARRAY_SIZE(uart_config)

Definition at line 234 of file periph_conf.h.

◆ USBDEV_ISR

#define USBDEV_ISR   isr_usb_lp_can1_rx0

Interrupt function name mapping.

Definition at line 362 of file periph_conf.h.

◆ USBDEV_NUMOF

#define USBDEV_NUMOF   ARRAY_SIZE(stm32_usbdev_fs_config)

Number of available USB device FS peripherals.

Definition at line 367 of file periph_conf.h.

Variable Documentation

◆ adc_config

const adc_conf_t adc_config[]
static
Initial value:
= {
{ .pin = GPIO_PIN(PORT_A, 0), .dev = 0, .chan = 0 },
{ .pin = GPIO_PIN(PORT_A, 1), .dev = 0, .chan = 1 },
{ .pin = GPIO_PIN(PORT_A, 4), .dev = 0, .chan = 4 },
{ .pin = GPIO_PIN(PORT_A, 5), .dev = 0, .chan = 5 },
{ .pin = GPIO_PIN(PORT_A, 6), .dev = 0, .chan = 6 },
{ .pin = GPIO_PIN(PORT_A, 7), .dev = 0, .chan = 7 },
{ .pin = GPIO_UNDEF, .dev = 0, .chan = 16 },
{ .pin = GPIO_UNDEF, .dev = 0, .chan = 17 },
{ .pin = GPIO_PIN(PORT_B, 0), .dev = 0, .chan = 8 },
{ .pin = GPIO_PIN(PORT_B, 1), .dev = 0, .chan = 9 },
}
@ PORT_B
port B
Definition periph_cpu.h:48
@ PORT_A
port A
Definition periph_cpu.h:47
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition periph_cpu.h:46
#define GPIO_UNDEF
Definition of a fitting UNDEF value.

Definition at line 57 of file periph_conf.h.

◆ dma_config

const dma_conf_t dma_config[]
static
Initial value:
= {
{ .stream = 1 },
{ .stream = 2 },
{ .stream = 3 },
{ .stream = 4 },
{ .stream = 6 },
}

Definition at line 89 of file periph_conf.h.

◆ i2c_config

const i2c_conf_t i2c_config[]
static
Initial value:
= {
{
.dev = I2C1,
.speed = I2C_SPEED_NORMAL,
.scl_pin = GPIO_PIN(PORT_B, 8),
.sda_pin = GPIO_PIN(PORT_B, 9),
.bus = APB1,
.rcc_mask = RCC_APB1ENR_I2C1EN,
.clk = CLOCK_APB1,
.irqn = I2C1_EV_IRQn
},
{
.dev = I2C2,
.speed = I2C_SPEED_NORMAL,
.scl_pin = GPIO_PIN(PORT_B, 10),
.sda_pin = GPIO_PIN(PORT_B, 11),
.bus = APB1,
.rcc_mask = RCC_APB1ENR_I2C2EN,
.clk = CLOCK_APB1,
.irqn = I2C2_EV_IRQn
}
}
@ I2C_SPEED_NORMAL
normal mode: ~100 kbit/s
Definition periph_cpu.h:278
@ APB1
Advanced Peripheral Bus 1
Definition periph_cpu.h:79

Definition at line 242 of file periph_conf.h.

◆ pwm_config

const pwm_conf_t pwm_config[]
static
Initial value:
= {
{
.dev = TIM3,
.rcc_mask = RCC_APB1ENR_TIM3EN,
.remap = AFIO_MAPR_TIM3_REMAP_1,
.chan = {
{ .pin = GPIO_PIN(PORT_B, 4), .cc_chan = 0 },
{ .pin = GPIO_PIN(PORT_B, 5), .cc_chan = 1 },
{ .pin = GPIO_PIN(PORT_B, 0), .cc_chan = 2 },
{ .pin = GPIO_PIN(PORT_B, 1), .cc_chan = 3 },
},
.bus = APB1,
},
}
@ GPIO_AF_OUT_PP
alternate function output - push-pull
Definition periph_cpu.h:167

Definition at line 275 of file periph_conf.h.

◆ qdec_config

const qdec_conf_t qdec_config[]
static

Definition at line 146 of file periph_conf.h.

◆ spi_config

const spi_conf_t spi_config[]
static

Definition at line 305 of file periph_conf.h.

◆ stm32_usbdev_fs_config

const stm32_usbdev_fs_config_t stm32_usbdev_fs_config[]
static
Initial value:
= {
{
.base_addr = (uintptr_t)USB,
.rcc_mask = RCC_APB1ENR_USBEN,
.irqn = USB_LP_CAN1_RX0_IRQn,
.apb = APB1,
.dm = GPIO_PIN(PORT_A, 11),
.dp = GPIO_PIN(PORT_A, 12),
.disconn = GPIO_UNDEF,
},
}
@ GPIO_AF_UNDEF
an UNDEF value definition, e.g.
Definition cpu_gpio.h:121

USB device FS configuration.

Definition at line 346 of file periph_conf.h.

◆ timer_config

const timer_conf_t timer_config[]
static
Initial value:
= {
{
.dev = TIM2,
.max = 0x0000ffff,
.rcc_mask = RCC_APB1ENR_TIM2EN,
.bus = APB1,
.irqn = TIM2_IRQn
},
{
.dev = TIM3,
.max = 0x0000ffff,
.rcc_mask = RCC_APB1ENR_TIM3EN,
.bus = APB1,
.irqn = TIM3_IRQn
},
{
.dev = TIM4,
.max = 0x0000ffff,
.rcc_mask = RCC_APB1ENR_TIM4EN,
.bus = APB1,
.irqn = TIM4_IRQn
}
}

Definition at line 110 of file periph_conf.h.

◆ uart_config

const uart_conf_t uart_config[]
static

Definition at line 191 of file periph_conf.h.