Loading...
Searching...
No Matches
periph_conf.h File Reference

Board specific definitions for the GD32VF103C-START board. More...

Detailed Description

Board specific definitions for the GD32VF103C-START board.

Author
Marian Buschsieweke maria.nosp@m.n.bu.nosp@m.schsi.nosp@m.ewek.nosp@m.e@pos.nosp@m.teo..nosp@m.net

Definition in file periph_conf.h.

#include "macros/units.h"
#include "periph_cpu.h"
#include "periph_common_conf.h"
#include "cfg_spi_default.h"
#include "cfg_uart_default.h"
#include "cfg_usbdev_default.h"
+ Include dependency graph for periph_conf.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

#define CONFIG_BOARD_HAS_HXTAL   1
 The board provides a high frequency oscillator.
 
#define CONFIG_BOARD_HAS_LXTAL   1
 The board provides a low frequency oscillator.
 
#define CONFIG_CLOCK_HXTAL   MHZ(8)
 HXTAL frequency.
 
#define I2C_DEV_1_USED   1
 Enable I2C_DEV(1) by default.
 

I2C configuration

Note
This board may require external pullup resistors for i2c operation.
#define I2C_NUMOF   ARRAY_SIZE(i2c_config)
 
static const i2c_conf_t i2c_config []
 PB10/PB11 (D15/D14) as I2C for Arduino UNO compatibility.
 

ADC configuration

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

Timer configuration

#define TIMER_0_IRQN   TIMER0_Channel_IRQn
 
#define TIMER_1_IRQN   TIMER1_IRQn
 
#define TIMER_2_IRQN   TIMER4_IRQn
 
#define TIMER_NUMOF   ARRAY_SIZE(timer_config)
 
static const timer_conf_t timer_config []
 

PWM configuration

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

Macro Definition Documentation

◆ ADC_NUMOF

#define ADC_NUMOF   ARRAY_SIZE(adc_config)

Definition at line 94 of file periph_conf.h.

◆ CONFIG_BOARD_HAS_HXTAL

#define CONFIG_BOARD_HAS_HXTAL   1

The board provides a high frequency oscillator.

Definition at line 25 of file periph_conf.h.

◆ CONFIG_BOARD_HAS_LXTAL

#define CONFIG_BOARD_HAS_LXTAL   1

The board provides a low frequency oscillator.

Definition at line 29 of file periph_conf.h.

◆ CONFIG_CLOCK_HXTAL

#define CONFIG_CLOCK_HXTAL   MHZ(8)

HXTAL frequency.

Definition at line 33 of file periph_conf.h.

◆ I2C_DEV_1_USED

#define I2C_DEV_1_USED   1

Enable I2C_DEV(1) by default.

Definition at line 37 of file periph_conf.h.

◆ I2C_NUMOF

#define I2C_NUMOF   ARRAY_SIZE(i2c_config)

Definition at line 74 of file periph_conf.h.

◆ PWM_NUMOF

#define PWM_NUMOF   ARRAY_SIZE(pwm_config)

Definition at line 166 of file periph_conf.h.

◆ TIMER_0_IRQN

#define TIMER_0_IRQN   TIMER0_Channel_IRQn

Definition at line 126 of file periph_conf.h.

◆ TIMER_1_IRQN

#define TIMER_1_IRQN   TIMER1_IRQn

Definition at line 127 of file periph_conf.h.

◆ TIMER_2_IRQN

#define TIMER_2_IRQN   TIMER4_IRQn

Definition at line 128 of file periph_conf.h.

◆ TIMER_NUMOF

#define TIMER_NUMOF   ARRAY_SIZE(timer_config)

Definition at line 130 of file periph_conf.h.

Variable Documentation

◆ adc_config

const adc_conf_t adc_config[]
static
Initial value:
= {
{ .pin = GPIO_PIN(PORT_A, 1), .dev = 0, .chan = 1 },
{ .pin = GPIO_PIN(PORT_A, 2), .dev = 0, .chan = 2 },
{ .pin = GPIO_PIN(PORT_A, 3), .dev = 0, .chan = 3 },
{ .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_UNDEF, .dev = 0, .chan = 16 },
{ .pin = GPIO_UNDEF, .dev = 0, .chan = 17 },
}
@ 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 81 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, 10),
.sda_pin = GPIO_PIN(PORT_B, 11),
.rcu_mask = RCU_APB1EN_I2C1EN_Msk,
.irqn = I2C1_EV_IRQn,
}
}
@ PORT_B
port B
Definition periph_cpu.h:48
@ I2C_SPEED_NORMAL
normal mode: ~100 kbit/s
Definition periph_cpu.h:278

PB10/PB11 (D15/D14) as I2C for Arduino UNO compatibility.

PB10/PB11 are located where Arduino UNO shields expect I2C.

Definition at line 63 of file periph_conf.h.

◆ pwm_config

const pwm_conf_t pwm_config[]
static
Initial value:
= {
{
.dev = TIMER2,
.rcu_mask = RCU_APB1EN_TIMER2EN_Msk,
.chan = {
{ .pin = GPIO_PIN(PORT_B, 5), .cc_chan = 1 },
{ .pin = GPIO_PIN(PORT_B, 0), .cc_chan = 2 },
{ .pin = GPIO_UNDEF, .cc_chan = 0 },
{ .pin = GPIO_UNDEF, .cc_chan = 3 },
},
.bus = APB1,
},
{
.dev = TIMER3,
.rcu_mask = RCU_APB1EN_TIMER3EN_Msk,
.chan = {
{ .pin = GPIO_PIN(PORT_B, 7), .cc_chan = 1 },
{ .pin = GPIO_PIN(PORT_B, 8), .cc_chan = 2 },
{ .pin = GPIO_UNDEF, .cc_chan = 0 },
{ .pin = GPIO_UNDEF, .cc_chan = 3 },
},
.bus = APB1,
},
}
@ GPIO_AF_OUT_PP
alternate function output - push-pull
Definition periph_cpu.h:167
@ APB1
Advanced Peripheral Bus 1
Definition periph_cpu.h:79

Definition at line 137 of file periph_conf.h.

◆ timer_config

const timer_conf_t timer_config[]
static
Initial value:
= {
{
.dev = TIMER0,
.max = 0x0000ffff,
.rcu_mask = RCU_APB2EN_TIMER0EN_Msk,
.bus = APB2,
.irqn = TIMER0_Channel_IRQn
},
{
.dev = TIMER1,
.max = 0x0000ffff,
.rcu_mask = RCU_APB1EN_TIMER1EN_Msk,
.bus = APB1,
.irqn = TIMER1_IRQn
},
{
.dev = TIMER4,
.max = 0x0000ffff,
.rcu_mask = RCU_APB1EN_TIMER4EN_Msk,
.bus = APB1,
.irqn = TIMER4_IRQn
}
}
@ APB2
Advanced Peripheral Bus 2
Definition periph_cpu.h:80

Definition at line 101 of file periph_conf.h.