libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
|
#include <libopencm3/sam/memorymap.h>
Go to the source code of this file.
Macros | |
#define | PM_MCCTRL MMIO32(PM_BASE + 0x000) |
#define | PM_MCCTRL_KEY (PM_UNLOCK_KEY) |
#define | PM_CKSEL(I) MMIO32(PM_BASE + 0x004 + (0x004 * (I))) |
#define | PM_CKSEL_KEY(I) (PM_UNLOCK_KEY | (0x004 + (0x004 * (I)))) |
#define | PM_MASK(I) MMIO32(PM_BASE + 0x020 + (0x004) * (I)) |
#define | PM_MASK_KEY(I) (PM_UNLOCK_KEY | (0x020 + (0x004) * (I))) |
#define | PM_CPUMASK MMIO32(PM_BASE + 0x020) |
#define | PM_HSBMASK MMIO32(PM_BASE + 0x024) |
#define | PM_PBAMASK MMIO32(PM_BASE + 0x028) |
#define | PM_PBAMASK_KEY (PM_UNLOCK_KEY | 0x028) |
#define | PM_PBBMASK MMIO32(PM_BASE + 0x02C) |
#define | PM_PBCMASK MMIO32(PM_BASE + 0x030) |
#define | PM_PBDMASK MMIO32(PM_BASE + 0x034) |
#define | PM_PBADIVMASK MMIO32(PM_BASE + 0x040) |
#define | PM_PBADIVMASK_KEY (PM_UNLOCK_KEY | 0x040) |
#define | PM_CFDCTRL MMIO32(PM_BASE + 0x054) |
#define | PM_UNLOCK MMIO32(PM_BASE + 0x058) |
#define | PM_UNLOCK_KEY (0xAA << 24) |
#define | PM_IER MMIO32(PM_BASE + 0x0C0) |
#define | PM_IDR MMIO32(PM_BASE + 0x0C4) |
#define | PM_IMR MMIO32(PM_BASE + 0x0C8) |
#define | PM_ISR MMIO32(PM_BASE + 0x0CC) |
#define | PM_ICR MMIO32(PM_BASE + 0x0D0) |
#define | PM_SR MMIO32(PM_BASE + 0x0D4) |
#define | PM_PPCR MMIO32(PM_BASE + 0x160) |
#define | PM_RCAUSE MMIO32(PM_BASE + 0x180) |
#define | PM_WCAUSE MMIO32(PM_BASE + 0x184) |
#define | PM_AWEN MMIO32(PM_BASE + 0x188) |
#define | PM_PROTCTRL MMIO32(PM_BASE + 0x18C) |
#define | PM_FASTSLEEP MMIO32(PM_BASE + 0x194) |
#define | PM_CONFIG MMIO32(PM_BASE + 0x3F8) |
#define | PM_VERSION MMIO32(PM_BASE + 0x3FC) |
#define | PM_MCCTRL_MCSEL_SHIFT 0 |
#define | PM_MCCTRL_MCSEL_MASK 3 |
#define | PM_CKSEL_DIV (1 << 7) |
#define | PM_CKSEL_MASK (3) |
#define | PM_CPUMASK_OSC (1 << 0) |
#define | PM_HSBMASK_PDCA (1 << 0) |
#define | PM_HSBMASK_FLASHCALW (1 << 1) |
#define | PM_HSBMASK_FLASHCALW_PICO (1 << 2) |
#define | PM_HSBMASK_USBC (1 << 3) |
#define | PM_HSBMASK_CRCCU (1 << 4) |
#define | PM_HSBMASK_APBA (1 << 5) |
#define | PM_HSBMASK_APBB (1 << 6) |
#define | PM_HSBMASK_APBC (1 << 7) |
#define | PM_HSBMASK_APBD (1 << 8) |
#define | PM_HSBMASK_AESA (1 << 9) |
#define | PM_PBAMASK_IISC (1 << 0) |
#define | PM_PBAMASK_SPI (1 << 1) |
#define | PM_PBAMASK_TC0 (1 << 2) |
#define | PM_PBAMASK_TC1 (1 << 3) |
#define | PM_PBAMASK_TWIM0 (1 << 4) |
#define | PM_PBAMASK_TWIS0 (1 << 5) |
#define | PM_PBAMASK_TWIM1 (1 << 6) |
#define | PM_PBAMASK_TWIS1 (1 << 7) |
#define | PM_PBAMASK_USART0 (1 << 8) |
#define | PM_PBAMASK_USART1 (1 << 9) |
#define | PM_PBAMASK_USART2 (1 << 10) |
#define | PM_PBAMASK_USART3 (1 << 11) |
#define | PM_PBAMASK_ADCIFE (1 << 12) |
#define | PM_PBAMASK_DACC (1 << 13) |
#define | PM_PBAMASK_ACIFC (1 << 14) |
#define | PM_PBAMASK_GLOC (1 << 15) |
#define | PM_PBAMASK_ABDACB (1 << 16) |
#define | PM_PBAMASK_TRNG (1 << 17) |
#define | PM_PBAMASK_PARC (1 << 18) |
#define | PM_PBAMASK_CATB (1 << 19) |
#define | PM_PBAMASK_TWIM2 (1 << 21) |
#define | PM_PBAMASK_TWIM3 (1 << 22) |
#define | PM_PBAMASK_LCDCA (1 << 23) |
#define | PM_PBBMASK_FLASHCALW (1 << 0) |
#define | PM_PBBMASK_HRAMC1 (1 << 1) |
#define | PM_PBBMASK_HMATRIX (1 << 2) |
#define | PM_PBBMASK_PDCA (1 << 3) |
#define | PM_PBBMASK_CRCCU (1 << 4) |
#define | PM_PBBMASK_USBC (1 << 5) |
#define | PM_PBBMASK_PEVC (1 << 6) |
#define | PM_PBCMASK_PM (1 << 0) |
#define | PM_PBCMASK_CHIPID (1 << 1) |
#define | PM_PBCMASK_SCIF (1 << 2) |
#define | PM_PBCMASK_FREQM (1 << 3) |
#define | PM_PBCMASK_GPIO (1 << 4) |
#define | PM_PBDMASK_BPM (1 << 0) |
#define | PM_PBDMASK_BSCIF (1 << 1) |
#define | PM_PBDMASK_AST (1 << 2) |
#define | PM_PBDMASK_WDT (1 << 3) |
#define | PM_PBDMASK_EIC (1 << 4) |
#define | PM_PBDMASK_PICOUART (1 << 5) |
#define | PM_PBADIVMASK_TC2 (1 << 0) |
#define | PM_PBADIVMASK_USART0 (1 << 2) |
#define | PM_PBADIVMASK_USART1 (1 << 2) |
#define | PM_PBADIVMASK_USART2 (1 << 2) |
#define | PM_PBADIVMASK_USART3 (1 << 2) |
#define | PM_PBADIVMASK_TC3 (1 << 2) |
#define | PM_PBADIVMASK_TC4 (1 << 4) |
#define | PM_PBADIVMASK_TC5 (1 << 6) |
#define | PM_SR_CFD (1 << 0) |
#define | PM_SR_CKRDY (1 << 5) |
#define | PM_SR_WAKE (1 << 8) |
Functions | |
void | pm_select_main_clock (enum mck_src source_clock) |
void | pm_enable_clock_div (enum pm_cksel sel_target, uint8_t div) |
void | pm_set_divmask_clock (uint8_t mask) |
void | pm_enable_peripheral_clock (enum pm_peripheral periph) |
void | pm_disable_peripheral_clock (enum pm_peripheral periph) |
#define PM_CKSEL_KEY | ( | I | ) | (PM_UNLOCK_KEY | (0x004 + (0x004 * (I)))) |
#define PM_MASK_KEY | ( | I | ) | (PM_UNLOCK_KEY | (0x020 + (0x004) * (I))) |
#define PM_MCCTRL_KEY (PM_UNLOCK_KEY) |
#define PM_PBADIVMASK_KEY (PM_UNLOCK_KEY | 0x040) |
#define PM_PBAMASK_KEY (PM_UNLOCK_KEY | 0x028) |
enum mck_src |
enum pm_cksel |
enum pm_peripheral |
void pm_disable_peripheral_clock | ( | enum pm_peripheral | periph | ) |
Definition at line 72 of file pm.c.
References set_peripheral_clock_status().
void pm_enable_clock_div | ( | enum pm_cksel | sel_target, |
uint8_t | div | ||
) |
Definition at line 37 of file pm.c.
References PM_CKSEL, PM_CKSEL_DIV, PM_CKSEL_KEY, PM_CKSEL_MASK, PM_SR, PM_SR_CKRDY, and PM_UNLOCK.
void pm_enable_peripheral_clock | ( | enum pm_peripheral | periph | ) |
Definition at line 67 of file pm.c.
References set_peripheral_clock_status().
void pm_select_main_clock | ( | enum mck_src | source_clock | ) |
Definition at line 30 of file pm.c.
References PM_MCCTRL, PM_MCCTRL_KEY, PM_MCCTRL_MCSEL_MASK, PM_MCCTRL_MCSEL_SHIFT, PM_SR, PM_SR_CKRDY, and PM_UNLOCK.
void pm_set_divmask_clock | ( | uint8_t | mask | ) |
Definition at line 47 of file pm.c.
References PM_PBADIVMASK, PM_PBADIVMASK_KEY, and PM_UNLOCK.