periph_conf.h File Reference

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

Detailed Description

Configuration of CPU peripherals for the SODAQ Autonomo 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_spi_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_sercom0
 
#define UART_1_ISR   isr_sercom5
 
#define UART_2_ISR   isr_sercom4
 
#define UART_3_ISR   isr_sercom1
 
#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 []
 

PWM configuration

#define PWM_0_EN   1
 
#define PWM_1_EN   1
 
#define PWM_NUMOF   ARRAY_SIZE(pwm_config)
 
static const pwm_conf_chan_t pwm_chan0_config []
 
static const pwm_conf_chan_t pwm_chan1_config []
 
static const pwm_conf_t pwm_config []
 

I2C configuration

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

Variable Documentation

◆ adc_channels

const adc_conf_chan_t adc_channels[]
static
Initial value:
= {
{GPIO_PIN(PA, 2), ADC_INPUTCTRL_MUXPOS_PIN0},
{GPIO_PIN(PA, 6), ADC_INPUTCTRL_MUXPOS_PIN6},
{GPIO_PIN(PA, 5), ADC_INPUTCTRL_MUXPOS_PIN5},
{GPIO_PIN(PA, 4), ADC_INPUTCTRL_MUXPOS_PIN4},
{GPIO_PIN(PB, 9), ADC_INPUTCTRL_MUXPOS_PIN3},
{GPIO_PIN(PB, 8), ADC_INPUTCTRL_MUXPOS_PIN2},
{GPIO_PIN(PB, 7), ADC_INPUTCTRL_MUXPOS_PIN15},
{GPIO_PIN(PB, 6), ADC_INPUTCTRL_MUXPOS_PIN14},
{GPIO_PIN(PB, 5), ADC_INPUTCTRL_MUXPOS_PIN13},
{GPIO_PIN(PB, 4), ADC_INPUTCTRL_MUXPOS_PIN12},
{GPIO_PIN(PA, 7), ADC_INPUTCTRL_MUXPOS_PIN7},
{GPIO_PIN(PB, 3), ADC_INPUTCTRL_MUXPOS_PIN11},
{GPIO_PIN(PB, 2), ADC_INPUTCTRL_MUXPOS_PIN10},
{GPIO_PIN(PB, 1), ADC_INPUTCTRL_MUXPOS_PIN9},
{GPIO_PIN(PB, 0), ADC_INPUTCTRL_MUXPOS_PIN8},
}

Definition at line 122 of file periph_conf.h.

◆ i2c_config

const i2c_conf_t i2c_config[]
static
Initial value:
= {
{
.dev = &(SERCOM2->I2CM),
.speed = I2C_SPEED_NORMAL,
.scl_pin = GPIO_PIN(PA, 13),
.sda_pin = GPIO_PIN(PA, 12),
.mux = GPIO_MUX_C,
.gclk_src = SAM0_GCLK_MAIN,
.flags = I2C_FLAG_NONE
}
}

Definition at line 189 of file periph_conf.h.

◆ pwm_chan0_config

const pwm_conf_chan_t pwm_chan0_config[]
static
Initial value:
= {
{ GPIO_PIN(PA, 6), GPIO_MUX_E, 0 },
{ GPIO_PIN(PA, 7), GPIO_MUX_E, 1 },
}

Definition at line 155 of file periph_conf.h.

◆ pwm_chan1_config

const pwm_conf_chan_t pwm_chan1_config[]
static
Initial value:
= {
{ GPIO_PIN(PA, 16), GPIO_MUX_F, 0 },
{ GPIO_PIN(PA, 18), GPIO_MUX_F, 2 },
{ GPIO_PIN(PA, 19), GPIO_MUX_F, 3 }
}

Definition at line 163 of file periph_conf.h.

◆ pwm_config

const pwm_conf_t pwm_config[]
static
Initial value:
= {
{TCC_CONFIG(TCC1), pwm_chan0_config, ARRAY_SIZE(pwm_chan0_config), SAM0_GCLK_MAIN},
{TCC_CONFIG(TCC0), pwm_chan1_config, ARRAY_SIZE(pwm_chan1_config), SAM0_GCLK_MAIN},
}

Definition at line 172 of file periph_conf.h.

GPIO_MUX_F
@ GPIO_MUX_F
select peripheral function F
Definition: periph_cpu_common.h:141
SAM0_GCLK_MAIN
@ SAM0_GCLK_MAIN
48 MHz main clock
Definition: periph_cpu.h:59
GPIO_MUX_E
@ GPIO_MUX_E
select peripheral function E
Definition: periph_cpu_common.h:140
I2C_SPEED_NORMAL
@ I2C_SPEED_NORMAL
normal mode: ~100 kbit/s
Definition: i2c.h:177
I2C_FLAG_NONE
@ I2C_FLAG_NONE
No flags set.
Definition: periph_cpu_common.h:407
PB
@ PB
port B
Definition: periph_cpu_common.h:89
ARRAY_SIZE
#define ARRAY_SIZE(a)
Calculate the number of elements in a static array.
Definition: kernel_defines.h:122
GPIO_MUX_C
@ GPIO_MUX_C
select peripheral function C
Definition: periph_cpu_common.h:138
GPIO_PIN
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition: periph_cpu.h:35
PA
@ PA
port A
Definition: periph_cpu_common.h:88
TCC_CONFIG
#define TCC_CONFIG(tim)
Static initializer for TCC timer configuration.
Definition: periph_cpu_common.h:297