|
Mesh4all
May the mesh be with you
|
Configuration of CPU peripherals for the m4a-24g board. More...
#include <stdint.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.
Variables | |
| static const tc32_conf_t | timer_config [] |
| Timer peripheral configuration. More... | |
| static const uart_conf_t | uart_config [] |
| UART config. | |
| static const pwm_conf_chan_t | pwm_chan0_config [] |
| IF PWM_0 is enabled then the following values are configured: More... | |
| static const pwm_conf_chan_t | pwm_chan1_config [] |
| IF PWM_1 is enabled then the following values are configured: More... | |
| static const pwm_conf_t | pwm_config [] |
| PWM device configuration. More... | |
| static const spi_conf_t | spi_config [] |
| SPI config. | |
| static const i2c_conf_t | i2c_config [] |
| I2C devices configuration. More... | |
| static const adc_conf_chan_t | adc_channels [] |
| ADC configuration. More... | |
| static const sam0_common_usb_config_t | sam_usbdev_config [] |
| USB peripheral configuration. More... | |
External oscillator and clock configuration | |
There are three choices for selection of CORECLOCK:
The PLL option allows for the usage of a wider frequency range and a more stable clock with less jitter. This is why this option is default. The target frequency is computed from the PLL multiplier and the PLL divisor. Use the following formula to compute your values: CORECLOCK = ((PLL_MUL + 1) * 1MHz) / PLL_DIV
The internal Oscillator used directly can lead to a slightly better power efficiency to the cost of a less stable clock. Use this option when you know what you are doing! The actual core frequency is adjusted as follows: CORECLOCK = 8MHz / DIV
Default parameters are the following:
| |
| #define | CLOCK_USE_PLL (1) |
| Use Phase-Locked Loop [PLL] as reference clock: True. | |
| #define | CLOCK_USE_XOSC32_DFLL (0) |
| Use External OScillator [XOSC32] as reference clock: False. | |
| #define | GEN2_ULP32K (0) |
| OSCULP32K is factory calibrated to be around 32.768kHz but this values can be of by a couple off % points, so prefer XOSC32K as default configuration. More... | |
| #define | CLOCK_PLL_MUL (47U) |
| Set [MUL] to 47U if we are using [PLL]. More... | |
| #define | CLOCK_PLL_DIV (1U) |
| Clock [DIV] 1U if we are using [PLL] This don't need to be changed by now, but it can be adjusted for our requirements. | |
| #define | CLOCK_CORECLOCK (((CLOCK_PLL_MUL + 1) * 1000000U) / CLOCK_PLL_DIV) |
| Definition for core clock if we are using [PLL] as reference. More... | |
name defined settings for TIMERs | |
| #define | TIMER_0_MAX_VALUE 0xffff |
| #define | TIMER_0_ISR isr_tc3 |
| #define | TIMER_1_ISR isr_tc4 |
| #define | TIMER_NUMOF ARRAY_SIZE(timer_config) |
interrupt function name mapping and number of UART peripherals defined | |
| #define | UART_0_ISR isr_sercom0 |
| #define | UART_1_ISR isr_sercom5 |
| #define | UART_NUMOF ARRAY_SIZE(uart_config) |
PWM configuration | |
| #define | PWM_0_EN 1 |
| #define | PWM_1_EN 1 |
Number of PWM devices defined | |
| #define | PWM_NUMOF ARRAY_SIZE(pwm_config) |
Number of SPI devices defined | |
| #define | SPI_NUMOF ARRAY_SIZE(spi_config) |
Number of I2C devices defined, default is 1 | |
| #define | I2C_NUMOF ARRAY_SIZE(i2c_config) |
RTT configuration | |
| #define | RTT_FREQUENCY (32768U) |
| The desired frequency for the Real Time Timer peripheral in Hz. More... | |
| #define | RTT_MIN_OFFSET (10U) |
Default ADC values | |
| #define | ADC_PRESCALER ADC_CTRLB_PRESCALER_DIV512 |
| #define | ADC_NEG_INPUT ADC_INPUTCTRL_MUXNEG_GND |
| #define | ADC_GAIN_FACTOR_DEFAULT ADC_INPUTCTRL_GAIN_1X |
| #define | ADC_REF_DEFAULT ADC_REFCTRL_REFSEL_INT1V |
Number of ADCs available | |
| #define | ADC_NUMOF ARRAY_SIZE(adc_channels) |
Configuration of CPU peripherals for the m4a-24g board.
Definition in file periph_conf.h.
| #define ADC_GAIN_FACTOR_DEFAULT ADC_INPUTCTRL_GAIN_1X |
Gain Factor: 1x
Definition at line 369 of file periph_conf.h.
| #define ADC_NEG_INPUT ADC_INPUTCTRL_MUXNEG_GND |
Neg. Input: GND
Definition at line 368 of file periph_conf.h.
| #define ADC_NUMOF ARRAY_SIZE(adc_channels) |
Number of ADCs available
Definition at line 406 of file periph_conf.h.
| #define ADC_PRESCALER ADC_CTRLB_PRESCALER_DIV512 |
Prescaler: 512
Definition at line 367 of file periph_conf.h.
| #define ADC_REF_DEFAULT ADC_REFCTRL_REFSEL_INT1V |
Reference: Internal 1.0 Volt
Definition at line 370 of file periph_conf.h.
| #define CLOCK_CORECLOCK (((CLOCK_PLL_MUL + 1) * 1000000U) / CLOCK_PLL_DIV) |
Definition for core clock if we are using [PLL] as reference.
Definition at line 105 of file periph_conf.h.
| #define CLOCK_PLL_MUL (47U) |
Set [MUL] to 47U if we are using [PLL].
Definition at line 95 of file periph_conf.h.
| #define GEN2_ULP32K (0) |
OSCULP32K is factory calibrated to be around 32.768kHz but this values can be of by a couple off % points, so prefer XOSC32K as default configuration.
0: use XOSC32K (always 32.768kHz) to clock GCLK2 1: use OSCULP32K factory calibrated (~32.768kHz) to clock GCLK2
Definition at line 88 of file periph_conf.h.
| #define I2C_NUMOF ARRAY_SIZE(i2c_config) |
1 I2C peripheral is available
Definition at line 345 of file periph_conf.h.
| #define PWM_0_EN 1 |
PWM_0 is enabled by default
Definition at line 222 of file periph_conf.h.
| #define PWM_1_EN 1 |
PWM_1 is enabled by default
Definition at line 223 of file periph_conf.h.
| #define PWM_NUMOF ARRAY_SIZE(pwm_config) |
Number of SPI peripheral available
Definition at line 278 of file periph_conf.h.
| #define RTT_FREQUENCY (32768U) |
The desired frequency for the Real Time Timer peripheral in Hz.
Definition at line 358 of file periph_conf.h.
| #define RTT_MIN_OFFSET (10U) |
??
Definition at line 360 of file periph_conf.h.
| #define SPI_NUMOF ARRAY_SIZE(spi_config) |
SPI available
Definition at line 323 of file periph_conf.h.
| #define TIMER_0_ISR isr_tc3 |
Internal function name
Definition at line 163 of file periph_conf.h.
| #define TIMER_0_MAX_VALUE 0xffff |
Max. value for TIMER 0
Definition at line 162 of file periph_conf.h.
| #define TIMER_1_ISR isr_tc4 |
Internal function name
Definition at line 164 of file periph_conf.h.
| #define TIMER_NUMOF ARRAY_SIZE(timer_config) |
Number of TIMER peripherals, 2
Definition at line 165 of file periph_conf.h.
| #define UART_0_ISR isr_sercom0 |
Internal function name
Definition at line 213 of file periph_conf.h.
| #define UART_1_ISR isr_sercom5 |
Internal function name
Definition at line 214 of file periph_conf.h.
| #define UART_NUMOF ARRAY_SIZE(uart_config) |
Number of UARTs available
Definition at line 215 of file periph_conf.h.
|
static |
ADC configuration.
Definition at line 397 of file periph_conf.h.
|
static |
I2C devices configuration.
| I2C | SCL pin | SDA pin |
|---|---|---|
| 0 | PA17 | PA16 |
Definition at line 333 of file periph_conf.h.
|
static |
IF PWM_0 is enabled then the following values are configured:
| PWM | GPIO pin | MUX value | Channel |
|---|---|---|---|
| 0 | PA6 | GPIO_MUX_E | 0 |
| 1 | PA7 | GPIO_MUX_E | 1 |
Definition at line 237 of file periph_conf.h.
|
static |
IF PWM_1 is enabled then the following values are configured:
| PWM | GPIO pin | MUX value | Channel |
|---|---|---|---|
| 0 | PA16 | GPIO_MUX_F | 0 |
| 1 | PA18 | GPIO_MUX_F | 2 |
| 2 | PA19 | GPIO_MUX_F | 3 |
Definition at line 255 of file periph_conf.h.
|
static |
PWM device configuration.
Definition at line 265 of file periph_conf.h.
|
static |
USB peripheral configuration.
Definition at line 412 of file periph_conf.h.
|
static |
Timer peripheral configuration.
Definition at line 131 of file periph_conf.h.