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

Configuration of CPU peripherals for the Raspberry Pi Pico. More...

Detailed Description

Configuration of CPU peripherals for the Raspberry Pi Pico.

Author
Marian Buschsieweke maria.nosp@m.n.bu.nosp@m.schsi.nosp@m.ewek.nosp@m.e@ovg.nosp@m.u.de

Definition in file periph_conf.h.

#include <stdint.h>
#include "kernel_defines.h"
#include "cpu.h"
#include "periph_cpu.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 UART_0_ISR   (isr_uart0)
 
#define UART_1_ISR   (isr_uart1)
 
#define UART_NUMOF   ARRAY_SIZE(uart_config)
 
#define SPI_NUMOF   ARRAY_SIZE(spi_config)
 
#define TIMER_0_ISRA   isr_timer0
 
#define TIMER_0_ISRB   isr_timer1
 
#define TIMER_0_ISRC   isr_timer2
 
#define TIMER_0_ISRD   isr_timer3
 
#define TIMER_NUMOF   ARRAY_SIZE(timer_config)
 
static const uart_conf_t uart_config []
 
static const spi_conf_t spi_config []
 
static const timer_channel_conf_t timer0_channel_config []
 
static const timer_conf_t timer_config []
 
static unsigned _periph_numof_is_unsigned_0 (void)
 Silences the warning when an unsigned value is compared to 0.
 

ADC configuration

The configuration consists simply of a list of channels that should be used

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

I2C configuration

#define I2C_NUMOF   _periph_numof_is_unsigned_0()
 Number of I2C interfaces.
 

PIO configuration

#define PIO_0_ISR0   isr_pio00
 ISR name of PIO 0 IRQ 0.
 
#define PIO_0_ISR1   isr_pio01
 ISR name of PIO 0 IRQ 1.
 
#define PIO_1_ISR0   isr_pio10
 ISR name of PIO 1 IRQ 0.
 
#define PIO_1_ISR1   isr_pio11
 ISR name of PIO 1 IRQ 1.
 
#define PIO_NUMOF   ARRAY_SIZE(pio_config)
 Number of PIOs.
 
#define PIO_I2C_NUMOF   ARRAY_SIZE(pio_i2c_config)
 Number of PIO I2C configurations.
 
static const pio_conf_t pio_config []
 Array of PIO configurations.
 
static const pio_i2c_conf_t pio_i2c_config []
 PIO I2C configuration.
 

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 120 of file periph_conf.h.

◆ I2C_NUMOF

#define I2C_NUMOF   _periph_numof_is_unsigned_0()

Number of I2C interfaces.

Definition at line 130 of file periph_conf.h.

◆ PIO_0_ISR0

#define PIO_0_ISR0   isr_pio00

ISR name of PIO 0 IRQ 0.

Definition at line 153 of file periph_conf.h.

◆ PIO_0_ISR1

#define PIO_0_ISR1   isr_pio01

ISR name of PIO 0 IRQ 1.

Definition at line 154 of file periph_conf.h.

◆ PIO_1_ISR0

#define PIO_1_ISR0   isr_pio10

ISR name of PIO 1 IRQ 0.

Definition at line 155 of file periph_conf.h.

◆ PIO_1_ISR1

#define PIO_1_ISR1   isr_pio11

ISR name of PIO 1 IRQ 1.

Definition at line 156 of file periph_conf.h.

◆ PIO_I2C_NUMOF

#define PIO_I2C_NUMOF   ARRAY_SIZE(pio_i2c_config)

Number of PIO I2C configurations.

Definition at line 173 of file periph_conf.h.

◆ PIO_NUMOF

#define PIO_NUMOF   ARRAY_SIZE(pio_config)

Number of PIOs.

Definition at line 158 of file periph_conf.h.

◆ PWM_NUMOF

#define PWM_NUMOF   ARRAY_SIZE(pwm_config)

Definition at line 193 of file periph_conf.h.

◆ SPI_NUMOF

#define SPI_NUMOF   ARRAY_SIZE(spi_config)

Definition at line 76 of file periph_conf.h.

◆ TIMER_0_ISRA

#define TIMER_0_ISRA   isr_timer0

Definition at line 101 of file periph_conf.h.

◆ TIMER_0_ISRB

#define TIMER_0_ISRB   isr_timer1

Definition at line 102 of file periph_conf.h.

◆ TIMER_0_ISRC

#define TIMER_0_ISRC   isr_timer2

Definition at line 103 of file periph_conf.h.

◆ TIMER_0_ISRD

#define TIMER_0_ISRD   isr_timer3

Definition at line 104 of file periph_conf.h.

◆ TIMER_NUMOF

#define TIMER_NUMOF   ARRAY_SIZE(timer_config)

Definition at line 106 of file periph_conf.h.

◆ UART_0_ISR

#define UART_0_ISR   (isr_uart0)

Definition at line 56 of file periph_conf.h.

◆ UART_1_ISR

#define UART_1_ISR   (isr_uart1)

Definition at line 57 of file periph_conf.h.

◆ UART_NUMOF

#define UART_NUMOF   ARRAY_SIZE(uart_config)

Definition at line 59 of file periph_conf.h.

Function Documentation

◆ _periph_numof_is_unsigned_0()

static unsigned _periph_numof_is_unsigned_0 ( void  )
inlinestatic

Silences the warning when an unsigned value is compared to 0.

This can be deleted when I2C is properly implemented.

Definition at line 36 of file periph_conf.h.

Variable Documentation

◆ adc_config

const adc_conf_t adc_config[]
static
Initial value:
= {
{ .pin = GPIO_PIN(0, 26), .chan = 0},
{ .pin = GPIO_PIN(0, 27), .chan = 1},
{ .pin = GPIO_PIN(0, 28), .chan = 2},
}
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition periph_cpu.h:46

Definition at line 114 of file periph_conf.h.

◆ pio_config

const pio_conf_t pio_config[]
static
Initial value:
= {
{
.dev = PIO0,
.irqn0 = PIO0_IRQ_0_IRQn,
.irqn1 = PIO0_IRQ_1_IRQn
},
{
.dev = PIO1,
.irqn0 = PIO1_IRQ_0_IRQn,
.irqn1 = PIO1_IRQ_1_IRQn
}
}

Array of PIO configurations.

Definition at line 140 of file periph_conf.h.

◆ pio_i2c_config

const pio_i2c_conf_t pio_i2c_config[]
static
Initial value:
= {
PIO_I2C_CONFIG
}

PIO I2C configuration.

PIO_I2C_CONFIG should be defined during the build process to fit the users pin selection.

Definition at line 167 of file periph_conf.h.

◆ pwm_config

const pwm_conf_t pwm_config[]
static
Initial value:
= {
{
.pwm_slice = 4,
.chan = {
{ .pin = GPIO_PIN(0, 25), .cc_chan = 1 },
{ .pin = GPIO_UNDEF, .cc_chan = 0 },
},
},
}
#define GPIO_UNDEF
Definition of a fitting UNDEF value.

Definition at line 183 of file periph_conf.h.

◆ spi_config

const spi_conf_t spi_config[]
static
Initial value:
= {
{
.dev = SPI0,
.miso_pin = GPIO_PIN(0, 4),
.mosi_pin = GPIO_PIN(0, 3),
.clk_pin = GPIO_PIN(0, 2)
},
{
.dev = SPI1,
.miso_pin = GPIO_PIN(0, 12),
.mosi_pin = GPIO_PIN(0, 11),
.clk_pin = GPIO_PIN(0, 10)
}
}

Definition at line 61 of file periph_conf.h.

◆ timer0_channel_config

const timer_channel_conf_t timer0_channel_config[]
static
Initial value:
= {
{
.irqn = TIMER_IRQ_0_IRQn
},
{
.irqn = TIMER_IRQ_1_IRQn
},
{
.irqn = TIMER_IRQ_2_IRQn
},
{
.irqn = TIMER_IRQ_3_IRQn
}
}

Definition at line 78 of file periph_conf.h.

◆ timer_config

const timer_conf_t timer_config[]
static
Initial value:
= {
{
.dev = TIMER,
.ch = timer0_channel_config,
.ch_numof = ARRAY_SIZE(timer0_channel_config)
}
}
#define ARRAY_SIZE(a)
Calculate the number of elements in a static array.
Definition container.h:83

Definition at line 93 of file periph_conf.h.

◆ uart_config

const uart_conf_t uart_config[]
static
Initial value:
= {
{
.dev = UART0,
.rx_pin = GPIO_PIN(0, 1),
.tx_pin = GPIO_PIN(0, 0),
.irqn = UART0_IRQ_IRQn
},
{
.dev = UART1,
.rx_pin = GPIO_PIN(0, 9),
.tx_pin = GPIO_PIN(0, 8),
.irqn = UART1_IRQ_IRQn
}
}
#define UART0
UART0 register bank.
#define UART1
UART1 register bank.

Definition at line 41 of file periph_conf.h.