periph_cpu.h File Reference

CPU specific definitions for internal peripheral handling. More...

Detailed Description

CPU specific definitions for internal peripheral handling.

CPU specific definitions for internal peripheral handling

Author
Hauke Petersen hauke.nosp@m..pet.nosp@m.ersen.nosp@m.@fu-.nosp@m.berli.nosp@m.n.de

Definition in file periph_cpu.h.

#include <limits.h>
#include "periph_cpu_common.h"
+ Include dependency graph for periph_cpu.h:

Go to the source code of this file.

Data Structures

struct  sam0_aux_cfg_mapping
 NVM User Row Mapping - Dedicated Entries Config values will be applied at power-on. More...
 

Macros

#define PM_BLOCKER_INITIAL   0x00000001
 Override the default initial PM blocker. More...
 
#define SPI_HWCS(x)   (UINT_MAX - 1)
 Override SPI hardware chip select macro. More...
 
#define DAC_RES_BITS   (10)
 The MCU has a 10 bit DAC.
 
#define DAC_NUMOF   (1)
 The MCU has one DAC Output.
 

Functions

static int _sercom_id (SercomUsart *sercom)
 Return the numeric id of a SERCOM device derived from its address. More...
 

Power mode configuration

#define PM_NUM_MODES   (3)
 

SAMD21 sleep modes for PM

#define SAMD21_PM_STANDBY   (0U)
 Standby mode (stops main clock)
 
#define SAMD21_PM_IDLE_2   (1U)
 Idle 2 (stops AHB, APB and CPU)
 
#define SAMD21_PM_IDLE_1   (2U)
 Idle 1 (stops AHB and CPU)

 
#define SAMD21_PM_IDLE_0   (3U)
 Idle 0 (stops CPU)

 

SAMD21 GCLK definitions

enum  {
  SAM0_GCLK_MAIN = 0, SAM0_GCLK_1MHZ, SAM0_GCLK_32KHZ, SAM0_GCLK_1KHZ,
  SAM0_GCLK_DISABLED = 0xF
}
 

Real time counter configuration

#define RTT_RUNSTDBY   (1) /* Keep RTT running in sleep states */
 
#define RTT_MAX_VALUE   (0xffffffff)
 
#define RTT_CLOCK_FREQUENCY   (32768U) /* in Hz */
 
#define RTT_MIN_FREQUENCY   (RTT_CLOCK_FREQUENCY / 1024U) /* in Hz */
 
#define RTT_MAX_FREQUENCY   (RTT_CLOCK_FREQUENCY) /* in Hz */
 

Macro Definition Documentation

◆ PM_BLOCKER_INITIAL

#define PM_BLOCKER_INITIAL   0x00000001

Override the default initial PM blocker.

Todo:
Idle modes are enabled by default, deep sleep mode blocked

Definition at line 42 of file periph_cpu.h.

◆ SPI_HWCS

#define SPI_HWCS (   x)    (UINT_MAX - 1)

Override SPI hardware chip select macro.

As of now, we do not support HW CS, so we always set it to a fixed value

Definition at line 72 of file periph_cpu.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SAM0_GCLK_MAIN 

48 MHz main clock

SAM0_GCLK_1MHZ 

1 MHz clock for xTimer

SAM0_GCLK_32KHZ 

32 kHz clock

SAM0_GCLK_1KHZ 

1 kHz clock

SAM0_GCLK_DISABLED 

disabled GCLK

Definition at line 58 of file periph_cpu.h.

Function Documentation

◆ _sercom_id()

static int _sercom_id ( SercomUsart *  sercom)
inlinestatic

Return the numeric id of a SERCOM device derived from its address.

Parameters
[in]sercomSERCOM device
Returns
numeric id of the given SERCOM device

Definition at line 81 of file periph_cpu.h.