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

Configuration of CPU peripherals for the SODAQ ONE board. More...

Detailed Description

Configuration of CPU peripherals for the SODAQ ONE board.

Author
Kees Bakker kees@.nosp@m.soda.nosp@m.q.com

Definition in file periph_conf.h.

#include <stdint.h>
#include "cpu.h"
#include "periph_cpu.h"
#include "cfg_clock_default.h"
#include "cfg_rtc_default.h"
#include "cfg_rtt_default.h"
#include "cfg_timer_default.h"
#include "cfg_usbdev_default.h"
+ Include dependency graph for periph_conf.h:

Go to the source code of this file.

UART configuration

See Table 6.1 of the SAM D21 Datasheet

#define UART_0_ISR   isr_sercom5
 
#define UART_1_ISR   isr_sercom2
 
#define UART_NUMOF   ARRAY_SIZE(uart_config)
 
static const uart_conf_t uart_config []
 

ADC configuration

#define ADC_PRESCALER   ADC_CTRLB_PRESCALER_DIV512
 
#define ADC_NEG_INPUT   ADC_INPUTCTRL_MUXNEG_GND
 
#define ADC_GAIN_FACTOR_DEFAULT   ADC_INPUTCTRL_GAIN_DIV2
 
#define ADC_REF_DEFAULT   ADC_REFCTRL_REFSEL_INTVCC1
 
#define ADC_NUMOF   ARRAY_SIZE(adc_channels)
 
static const adc_conf_chan_t adc_channels []
 

SPI configuration

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

I2C configuration

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

Macro Definition Documentation

◆ ADC_GAIN_FACTOR_DEFAULT

#define ADC_GAIN_FACTOR_DEFAULT   ADC_INPUTCTRL_GAIN_DIV2

Definition at line 88 of file periph_conf.h.

◆ ADC_NEG_INPUT

#define ADC_NEG_INPUT   ADC_INPUTCTRL_MUXNEG_GND

Definition at line 87 of file periph_conf.h.

◆ ADC_NUMOF

#define ADC_NUMOF   ARRAY_SIZE(adc_channels)

Definition at line 112 of file periph_conf.h.

◆ ADC_PRESCALER

#define ADC_PRESCALER   ADC_CTRLB_PRESCALER_DIV512

Definition at line 85 of file periph_conf.h.

◆ ADC_REF_DEFAULT

#define ADC_REF_DEFAULT   ADC_REFCTRL_REFSEL_INTVCC1

Definition at line 89 of file periph_conf.h.

◆ I2C_NUMOF

#define I2C_NUMOF   ARRAY_SIZE(i2c_config)

Definition at line 156 of file periph_conf.h.

◆ SPI_NUMOF

#define SPI_NUMOF   ARRAY_SIZE(spi_config)

Definition at line 138 of file periph_conf.h.

◆ UART_0_ISR

#define UART_0_ISR   isr_sercom5

Definition at line 73 of file periph_conf.h.

◆ UART_1_ISR

#define UART_1_ISR   isr_sercom2

Definition at line 74 of file periph_conf.h.

◆ UART_NUMOF

#define UART_NUMOF   ARRAY_SIZE(uart_config)

Definition at line 76 of file periph_conf.h.

Variable Documentation

◆ adc_channels

const adc_conf_chan_t adc_channels[]
static
Initial value:
= {
{ .inputctrl = ADC_INPUTCTRL_MUXPOS_PA02 },
{ .inputctrl = ADC_INPUTCTRL_MUXPOS_PA03 },
{ .inputctrl = ADC_INPUTCTRL_MUXPOS_PB08 },
{ .inputctrl = ADC_INPUTCTRL_MUXPOS_PB09 },
{ .inputctrl = ADC_INPUTCTRL_MUXPOS_PA06 },
{ .inputctrl = ADC_INPUTCTRL_MUXPOS_PA07 },
{ .inputctrl = ADC_INPUTCTRL_MUXPOS_PA08 },
{ .inputctrl = ADC_INPUTCTRL_MUXPOS_PA09 },
{ .inputctrl = ADC_INPUTCTRL_MUXPOS_PA10 },
{ .inputctrl = ADC_INPUTCTRL_MUXPOS_PA11 },
{ .inputctrl = ADC_INPUTCTRL_MUXPOS_PA05 },
}
#define ADC_INPUTCTRL_MUXPOS_PA05
Alias for PIN5.
Definition periph_cpu.h:124
#define ADC_INPUTCTRL_MUXPOS_PB08
Alias for PIN2.
Definition periph_cpu.h:121
#define ADC_INPUTCTRL_MUXPOS_PA10
Alias for PIN18.
Definition periph_cpu.h:137
#define ADC_INPUTCTRL_MUXPOS_PA11
Alias for PIN19.
Definition periph_cpu.h:138
#define ADC_INPUTCTRL_MUXPOS_PA08
Alias for PIN16.
Definition periph_cpu.h:135
#define ADC_INPUTCTRL_MUXPOS_PB09
Alias for PIN3.
Definition periph_cpu.h:122
#define ADC_INPUTCTRL_MUXPOS_PA09
Alias for PIN17.
Definition periph_cpu.h:136
#define ADC_INPUTCTRL_MUXPOS_PA07
Alias for PIN7.
Definition periph_cpu.h:126
#define ADC_INPUTCTRL_MUXPOS_PA06
Alias for PIN6.
Definition periph_cpu.h:125
#define ADC_INPUTCTRL_MUXPOS_PA02
ADC pin aliases.
Definition periph_cpu.h:119
#define ADC_INPUTCTRL_MUXPOS_PA03
Alias for PIN1.
Definition periph_cpu.h:120

Definition at line 91 of file periph_conf.h.

◆ i2c_config

const i2c_conf_t i2c_config[]
static
Initial value:
= {
{
.dev = &(SERCOM3->I2CM),
.speed = I2C_SPEED_NORMAL,
.scl_pin = GPIO_PIN(PA, 23),
.sda_pin = GPIO_PIN(PA, 22),
.mux = GPIO_MUX_C,
.gclk_src = SAM0_GCLK_MAIN,
.flags = I2C_FLAG_NONE
}
}
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition periph_cpu.h:46
@ I2C_SPEED_NORMAL
normal mode: ~100 kbit/s
Definition periph_cpu.h:278
@ PA
port A
@ I2C_FLAG_NONE
No flags set.
@ GPIO_MUX_C
select peripheral function C
#define SAM0_GCLK_MAIN
120 MHz main clock
Definition periph_cpu.h:74

Definition at line 145 of file periph_conf.h.

◆ spi_config

const spi_conf_t spi_config[]
static
Initial value:
= {
{
.dev = &SERCOM0->SPI,
.miso_pin = GPIO_PIN(PA, 8),
.mosi_pin = GPIO_PIN(PA, 10),
.clk_pin = GPIO_PIN(PA, 11),
.miso_mux = GPIO_MUX_C,
.mosi_mux = GPIO_MUX_C,
.clk_mux = GPIO_MUX_C,
.miso_pad = SPI_PAD_MISO_0,
.mosi_pad = SPI_PAD_MOSI_2_SCK_3,
.gclk_src = SAM0_GCLK_MAIN,
}
}
@ SPI_PAD_MISO_0
use pad 0 for MISO line
@ SPI_PAD_MOSI_2_SCK_3
use pad 2 for MOSI, pad 3 for SCK

Definition at line 119 of file periph_conf.h.

◆ uart_config

const uart_conf_t uart_config[]
static
Initial value:
= {
{
.dev = &SERCOM5->USART,
.rx_pin = GPIO_PIN(PB,3),
.tx_pin = GPIO_PIN(PB,2),
.mux = GPIO_MUX_D,
.rx_pad = UART_PAD_RX_1,
.tx_pad = UART_PAD_TX_0,
.flags = UART_FLAG_NONE,
.gclk_src = SAM0_GCLK_MAIN,
},
{
.dev = &SERCOM2->USART,
.rx_pin = GPIO_PIN(PA,13),
.tx_pin = GPIO_PIN(PA,12),
.mux = GPIO_MUX_C,
.rx_pad = UART_PAD_RX_1,
.tx_pad = UART_PAD_TX_0,
.flags = UART_FLAG_NONE,
.gclk_src = SAM0_GCLK_MAIN,
},
}
@ UART_PAD_RX_1
select pad 1
@ PB
port B
@ UART_FLAG_NONE
No flags set.
@ UART_PAD_TX_0
select pad 0
@ GPIO_MUX_D
select peripheral function D

Definition at line 41 of file periph_conf.h.