periph_conf.h File Reference

Peripheral MCU configuration for the Ublox C030-U201 board. More...

Detailed Description

Peripheral MCU configuration for the Ublox C030-U201 board.

Author
Vincent Dupont vince.nosp@m.nt@o.nosp@m.takey.nosp@m.s.co.nosp@m.m

Definition in file periph_conf.h.

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

Go to the source code of this file.

Clock settings

Note
This is auto-generated from cpu/stm32_common/dist/clk_conf/clk_conf.c
#define CLOCK_CORECLOCK   (168000000U)
 
#define CLOCK_HSE   (12000000U)
 
#define CLOCK_LSE   (1U)
 
#define CLOCK_AHB_DIV   RCC_CFGR_HPRE_DIV1
 
#define CLOCK_AHB   (CLOCK_CORECLOCK / 1)
 
#define CLOCK_APB1_DIV   RCC_CFGR_PPRE1_DIV4 /* max 45MHz */
 
#define CLOCK_APB1   (CLOCK_CORECLOCK / 4)
 
#define CLOCK_APB2_DIV   RCC_CFGR_PPRE2_DIV2 /* max 90MHz */
 
#define CLOCK_APB2   (CLOCK_CORECLOCK / 2)
 
#define CLOCK_PLL_M   (6)
 
#define CLOCK_PLL_N   (168)
 
#define CLOCK_PLL_P   (2)
 
#define CLOCK_PLL_Q   (7)
 

UART configuration

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

SPI configuration

Note
The spi_divtable is auto-generated from cpu/stm32_common/dist/spi_divtable/spi_divtable.c
#define SPI_NUMOF   ARRAY_SIZE(spi_config)
 
static const uint8_t spi_divtable [2][5]
 
static const spi_conf_t spi_config []
 

I2C configuration

#define I2C_0_ISR   isr_i2c1_ev
 
#define I2C_1_ISR   isr_i2c3_ev
 
#define I2C_NUMOF   ARRAY_SIZE(i2c_config)
 
static const i2c_conf_t i2c_config []
 

ADC configuration

Note that we do not configure all ADC channels, and not in the STM32F437 order.

Instead, we just define 6 ADC channels, for the Arduino header pins A0-A5

#define ADC_NUMOF   (6U)
 
#define ADC_CONFIG
 

Macro Definition Documentation

◆ ADC_CONFIG

#define ADC_CONFIG
Value:
{ \
{GPIO_PIN(PORT_A, 3), 0, 3}, \
{GPIO_PIN(PORT_C, 0), 0, 10}, \
{GPIO_PIN(PORT_C, 3), 0, 4}, \
{GPIO_PIN(PORT_A, 4), 0, 14}, \
{GPIO_PIN(PORT_B, 7), 0, 7}, \
{GPIO_PIN(PORT_B, 6), 0, 6}, \
}
port C
Definition: periph_cpu.h:38
port A
Definition: periph_cpu.h:36
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition: periph_cpu.h:35
port B
Definition: periph_cpu.h:37

Definition at line 227 of file periph_conf.h.

Variable Documentation

◆ i2c_config

const i2c_conf_t i2c_config[]
static
Initial value:
= {
{
.dev = I2C1,
.speed = I2C_SPEED_NORMAL,
.scl_pin = GPIO_PIN(PORT_B, 6),
.sda_pin = GPIO_PIN(PORT_B, 7),
.scl_af = GPIO_AF4,
.sda_af = GPIO_AF4,
.bus = APB1,
.rcc_mask = RCC_APB1ENR_I2C1EN,
.clk = CLOCK_APB1,
.irqn = I2C1_EV_IRQn
},
{
.dev = I2C3,
.speed = I2C_SPEED_NORMAL,
.scl_pin = GPIO_PIN(PORT_A, 8),
.sda_pin = GPIO_PIN(PORT_C, 9),
.scl_af = GPIO_AF4,
.sda_af = GPIO_AF4,
.bus = APB1,
.rcc_mask = RCC_APB1ENR_I2C3EN,
.clk = CLOCK_APB1,
.irqn = I2C3_EV_IRQn
}
}
use alternate function 4
port C
Definition: periph_cpu.h:38
APB1 bus.
port A
Definition: periph_cpu.h:36
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition: periph_cpu.h:35
normal mode: ~100kbit/s
Definition: periph_cpu.h:116
port B
Definition: periph_cpu.h:37

Definition at line 183 of file periph_conf.h.

◆ spi_config

const spi_conf_t spi_config[]
static
Initial value:
= {
{
.dev = SPI4,
.mosi_pin = GPIO_PIN(PORT_E, 6),
.miso_pin = GPIO_PIN(PORT_E, 5),
.sclk_pin = GPIO_PIN(PORT_E, 2),
.cs_pin = GPIO_PIN(PORT_E, 11),
.af = GPIO_AF5,
.rccmask = RCC_APB2ENR_SPI4EN,
.apbbus = APB2
},
}
port E
Definition: periph_cpu.h:40
APB2 bus.
use alternate function 5
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition: periph_cpu.h:35

Definition at line 163 of file periph_conf.h.

◆ spi_divtable

const uint8_t spi_divtable[2][5]
static
Initial value:
= {
{
7,
6,
4,
2,
1
},
{
7,
7,
5,
3,
2
}
}

Definition at line 146 of file periph_conf.h.