libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
4l/pm.h File Reference
Include dependency graph for 4l/pm.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)
 

Enumerations

enum  mck_src {
  MCK_SRC_RCSYS = 0 , MCK_SRC_OSC0 , MCK_SRC_PLL , MCK_SRC_DFLL ,
  MCK_SRC_RC80M , MCK_SRC_RCFAST , MCK_SRC_RC1M
}
 
enum  pm_cksel {
  PM_CKSEL_CPU = 0 , PM_CKSEL_PBA = 2 , PM_CKSEL_PBB , PM_CKSEL_PBC ,
  PM_CKSEL_PBD
}
 
enum  pm_peripheral {
  PM_PERIPHERAL_OCD = 0 , PM_PERIPHERAL_PDCA = 32 , PM_PERIPHERAL_FLASHCALW , PM_PERIPHERAL_FLASHCALW_PICORAM ,
  PM_PERIPHERAL_USBC , PM_PERIPHERAL_CRCCU , PM_PERIPHERAL_APBA_BRIDGE , PM_PERIPHERAL_APBB_BRIDGE ,
  PM_PERIPHERAL_APBC_BRIDGE , PM_PERIPHERAL_APBD_BRIDGE , PM_PERIPHERAL_AESA , PM_PERIPHERAL_IISC = 64 ,
  PM_PERIPHERAL_SPI , PM_PERIPHERAL_TC0 , PM_PERIPHERAL_TC1 , PM_PERIPHERAL_TWIM0 ,
  PM_PERIPHERAL_TWIS0 , PM_PERIPHERAL_TWIM1 , PM_PERIPHERAL_TWIS1 , PM_PERIPHERAL_USART0 ,
  PM_PERIPHERAL_USART1 , PM_PERIPHERAL_USART2 , PM_PERIPHERAL_USART3 , PM_PERIPHERAL_ADCIFE ,
  PM_PERIPHERAL_DACC , PM_PERIPHERAL_ACIFC , PM_PERIPHERAL_GLOC , PM_PERIPHERAL_ABDACB ,
  PM_PERIPHERAL_TRNG , PM_PERIPHERAL_PARC , PM_PERIPHERAL_CATB , PM_PERIPHERAL_RESERVED1 ,
  PM_PERIPHERAL_TWIM2 , PM_PERIPHERAL_TWIM3 , PM_PERIPHERAL_LCDCA , PM_PERIPHERAL_FLASHCALW_ALT = 96 ,
  PM_PERIPHERAL_HRAMC1 , PM_PERIPHERAL_HMATRIX , PM_PERIPHERAL_PDCA_ALT , PM_PERIPHERAL_CRCCU_ALT ,
  PM_PERIPHERAL_USBC_ALT , PM_PERIPHERAL_PEVC , PM_PERIPHERAL_PM = 128 , PM_PERIPHERAL_CHIPID ,
  PM_PERIPHERAL_SCIF , PM_PERIPHERAL_FREQM , PM_PERIPHERAL_GPIO , PM_PERIPHERAL_BPM = 160 ,
  PM_PERIPHERAL_BSCIF , PM_PERIPHERAL_AST , PM_PERIPHERAL_WDT , PM_PERIPHERAL_EIC ,
  PM_PERIPHERAL_PICOUART
}
 

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)
 

Macro Definition Documentation

◆ PM_AWEN

#define PM_AWEN   MMIO32(PM_BASE + 0x188)

Definition at line 94 of file 4l/pm.h.

◆ PM_CFDCTRL

#define PM_CFDCTRL   MMIO32(PM_BASE + 0x054)

Definition at line 60 of file 4l/pm.h.

◆ PM_CKSEL

#define PM_CKSEL (   I)    MMIO32(PM_BASE + 0x004 + (0x004 * (I)))

Definition at line 30 of file 4l/pm.h.

◆ PM_CKSEL_DIV

#define PM_CKSEL_DIV   (1 << 7)

Definition at line 114 of file 4l/pm.h.

◆ PM_CKSEL_KEY

#define PM_CKSEL_KEY (   I)    (PM_UNLOCK_KEY | (0x004 + (0x004 * (I))))

Definition at line 31 of file 4l/pm.h.

◆ PM_CKSEL_MASK

#define PM_CKSEL_MASK   (3)

Definition at line 115 of file 4l/pm.h.

◆ PM_CONFIG

#define PM_CONFIG   MMIO32(PM_BASE + 0x3F8)

Definition at line 103 of file 4l/pm.h.

◆ PM_CPUMASK

#define PM_CPUMASK   MMIO32(PM_BASE + 0x020)

Definition at line 37 of file 4l/pm.h.

◆ PM_CPUMASK_OSC

#define PM_CPUMASK_OSC   (1 << 0)

Definition at line 117 of file 4l/pm.h.

◆ PM_FASTSLEEP

#define PM_FASTSLEEP   MMIO32(PM_BASE + 0x194)

Definition at line 100 of file 4l/pm.h.

◆ PM_HSBMASK

#define PM_HSBMASK   MMIO32(PM_BASE + 0x024)

Definition at line 40 of file 4l/pm.h.

◆ PM_HSBMASK_AESA

#define PM_HSBMASK_AESA   (1 << 9)

Definition at line 128 of file 4l/pm.h.

◆ PM_HSBMASK_APBA

#define PM_HSBMASK_APBA   (1 << 5)

Definition at line 124 of file 4l/pm.h.

◆ PM_HSBMASK_APBB

#define PM_HSBMASK_APBB   (1 << 6)

Definition at line 125 of file 4l/pm.h.

◆ PM_HSBMASK_APBC

#define PM_HSBMASK_APBC   (1 << 7)

Definition at line 126 of file 4l/pm.h.

◆ PM_HSBMASK_APBD

#define PM_HSBMASK_APBD   (1 << 8)

Definition at line 127 of file 4l/pm.h.

◆ PM_HSBMASK_CRCCU

#define PM_HSBMASK_CRCCU   (1 << 4)

Definition at line 123 of file 4l/pm.h.

◆ PM_HSBMASK_FLASHCALW

#define PM_HSBMASK_FLASHCALW   (1 << 1)

Definition at line 120 of file 4l/pm.h.

◆ PM_HSBMASK_FLASHCALW_PICO

#define PM_HSBMASK_FLASHCALW_PICO   (1 << 2)

Definition at line 121 of file 4l/pm.h.

◆ PM_HSBMASK_PDCA

#define PM_HSBMASK_PDCA   (1 << 0)

Definition at line 119 of file 4l/pm.h.

◆ PM_HSBMASK_USBC

#define PM_HSBMASK_USBC   (1 << 3)

Definition at line 122 of file 4l/pm.h.

◆ PM_ICR

#define PM_ICR   MMIO32(PM_BASE + 0x0D0)

Definition at line 79 of file 4l/pm.h.

◆ PM_IDR

#define PM_IDR   MMIO32(PM_BASE + 0x0C4)

Definition at line 70 of file 4l/pm.h.

◆ PM_IER

#define PM_IER   MMIO32(PM_BASE + 0x0C0)

Definition at line 67 of file 4l/pm.h.

◆ PM_IMR

#define PM_IMR   MMIO32(PM_BASE + 0x0C8)

Definition at line 73 of file 4l/pm.h.

◆ PM_ISR

#define PM_ISR   MMIO32(PM_BASE + 0x0CC)

Definition at line 76 of file 4l/pm.h.

◆ PM_MASK

#define PM_MASK (   I)    MMIO32(PM_BASE + 0x020 + (0x004) * (I))

Definition at line 33 of file 4l/pm.h.

◆ PM_MASK_KEY

#define PM_MASK_KEY (   I)    (PM_UNLOCK_KEY | (0x020 + (0x004) * (I)))

Definition at line 34 of file 4l/pm.h.

◆ PM_MCCTRL

#define PM_MCCTRL   MMIO32(PM_BASE + 0x000)

Definition at line 26 of file 4l/pm.h.

◆ PM_MCCTRL_KEY

#define PM_MCCTRL_KEY   (PM_UNLOCK_KEY)

Definition at line 27 of file 4l/pm.h.

◆ PM_MCCTRL_MCSEL_MASK

#define PM_MCCTRL_MCSEL_MASK   3

Definition at line 111 of file 4l/pm.h.

◆ PM_MCCTRL_MCSEL_SHIFT

#define PM_MCCTRL_MCSEL_SHIFT   0

Definition at line 110 of file 4l/pm.h.

◆ PM_PBADIVMASK

#define PM_PBADIVMASK   MMIO32(PM_BASE + 0x040)

Definition at line 56 of file 4l/pm.h.

◆ PM_PBADIVMASK_KEY

#define PM_PBADIVMASK_KEY   (PM_UNLOCK_KEY | 0x040)

Definition at line 57 of file 4l/pm.h.

◆ PM_PBADIVMASK_TC2

#define PM_PBADIVMASK_TC2   (1 << 0)

Definition at line 176 of file 4l/pm.h.

◆ PM_PBADIVMASK_TC3

#define PM_PBADIVMASK_TC3   (1 << 2)

Definition at line 181 of file 4l/pm.h.

◆ PM_PBADIVMASK_TC4

#define PM_PBADIVMASK_TC4   (1 << 4)

Definition at line 182 of file 4l/pm.h.

◆ PM_PBADIVMASK_TC5

#define PM_PBADIVMASK_TC5   (1 << 6)

Definition at line 183 of file 4l/pm.h.

◆ PM_PBADIVMASK_USART0

#define PM_PBADIVMASK_USART0   (1 << 2)

Definition at line 177 of file 4l/pm.h.

◆ PM_PBADIVMASK_USART1

#define PM_PBADIVMASK_USART1   (1 << 2)

Definition at line 178 of file 4l/pm.h.

◆ PM_PBADIVMASK_USART2

#define PM_PBADIVMASK_USART2   (1 << 2)

Definition at line 179 of file 4l/pm.h.

◆ PM_PBADIVMASK_USART3

#define PM_PBADIVMASK_USART3   (1 << 2)

Definition at line 180 of file 4l/pm.h.

◆ PM_PBAMASK

#define PM_PBAMASK   MMIO32(PM_BASE + 0x028)

Definition at line 43 of file 4l/pm.h.

◆ PM_PBAMASK_ABDACB

#define PM_PBAMASK_ABDACB   (1 << 16)

Definition at line 146 of file 4l/pm.h.

◆ PM_PBAMASK_ACIFC

#define PM_PBAMASK_ACIFC   (1 << 14)

Definition at line 144 of file 4l/pm.h.

◆ PM_PBAMASK_ADCIFE

#define PM_PBAMASK_ADCIFE   (1 << 12)

Definition at line 142 of file 4l/pm.h.

◆ PM_PBAMASK_CATB

#define PM_PBAMASK_CATB   (1 << 19)

Definition at line 149 of file 4l/pm.h.

◆ PM_PBAMASK_DACC

#define PM_PBAMASK_DACC   (1 << 13)

Definition at line 143 of file 4l/pm.h.

◆ PM_PBAMASK_GLOC

#define PM_PBAMASK_GLOC   (1 << 15)

Definition at line 145 of file 4l/pm.h.

◆ PM_PBAMASK_IISC

#define PM_PBAMASK_IISC   (1 << 0)

Definition at line 130 of file 4l/pm.h.

◆ PM_PBAMASK_KEY

#define PM_PBAMASK_KEY   (PM_UNLOCK_KEY | 0x028)

Definition at line 44 of file 4l/pm.h.

◆ PM_PBAMASK_LCDCA

#define PM_PBAMASK_LCDCA   (1 << 23)

Definition at line 153 of file 4l/pm.h.

◆ PM_PBAMASK_PARC

#define PM_PBAMASK_PARC   (1 << 18)

Definition at line 148 of file 4l/pm.h.

◆ PM_PBAMASK_SPI

#define PM_PBAMASK_SPI   (1 << 1)

Definition at line 131 of file 4l/pm.h.

◆ PM_PBAMASK_TC0

#define PM_PBAMASK_TC0   (1 << 2)

Definition at line 132 of file 4l/pm.h.

◆ PM_PBAMASK_TC1

#define PM_PBAMASK_TC1   (1 << 3)

Definition at line 133 of file 4l/pm.h.

◆ PM_PBAMASK_TRNG

#define PM_PBAMASK_TRNG   (1 << 17)

Definition at line 147 of file 4l/pm.h.

◆ PM_PBAMASK_TWIM0

#define PM_PBAMASK_TWIM0   (1 << 4)

Definition at line 134 of file 4l/pm.h.

◆ PM_PBAMASK_TWIM1

#define PM_PBAMASK_TWIM1   (1 << 6)

Definition at line 136 of file 4l/pm.h.

◆ PM_PBAMASK_TWIM2

#define PM_PBAMASK_TWIM2   (1 << 21)

Definition at line 151 of file 4l/pm.h.

◆ PM_PBAMASK_TWIM3

#define PM_PBAMASK_TWIM3   (1 << 22)

Definition at line 152 of file 4l/pm.h.

◆ PM_PBAMASK_TWIS0

#define PM_PBAMASK_TWIS0   (1 << 5)

Definition at line 135 of file 4l/pm.h.

◆ PM_PBAMASK_TWIS1

#define PM_PBAMASK_TWIS1   (1 << 7)

Definition at line 137 of file 4l/pm.h.

◆ PM_PBAMASK_USART0

#define PM_PBAMASK_USART0   (1 << 8)

Definition at line 138 of file 4l/pm.h.

◆ PM_PBAMASK_USART1

#define PM_PBAMASK_USART1   (1 << 9)

Definition at line 139 of file 4l/pm.h.

◆ PM_PBAMASK_USART2

#define PM_PBAMASK_USART2   (1 << 10)

Definition at line 140 of file 4l/pm.h.

◆ PM_PBAMASK_USART3

#define PM_PBAMASK_USART3   (1 << 11)

Definition at line 141 of file 4l/pm.h.

◆ PM_PBBMASK

#define PM_PBBMASK   MMIO32(PM_BASE + 0x02C)

Definition at line 47 of file 4l/pm.h.

◆ PM_PBBMASK_CRCCU

#define PM_PBBMASK_CRCCU   (1 << 4)

Definition at line 159 of file 4l/pm.h.

◆ PM_PBBMASK_FLASHCALW

#define PM_PBBMASK_FLASHCALW   (1 << 0)

Definition at line 155 of file 4l/pm.h.

◆ PM_PBBMASK_HMATRIX

#define PM_PBBMASK_HMATRIX   (1 << 2)

Definition at line 157 of file 4l/pm.h.

◆ PM_PBBMASK_HRAMC1

#define PM_PBBMASK_HRAMC1   (1 << 1)

Definition at line 156 of file 4l/pm.h.

◆ PM_PBBMASK_PDCA

#define PM_PBBMASK_PDCA   (1 << 3)

Definition at line 158 of file 4l/pm.h.

◆ PM_PBBMASK_PEVC

#define PM_PBBMASK_PEVC   (1 << 6)

Definition at line 161 of file 4l/pm.h.

◆ PM_PBBMASK_USBC

#define PM_PBBMASK_USBC   (1 << 5)

Definition at line 160 of file 4l/pm.h.

◆ PM_PBCMASK

#define PM_PBCMASK   MMIO32(PM_BASE + 0x030)

Definition at line 50 of file 4l/pm.h.

◆ PM_PBCMASK_CHIPID

#define PM_PBCMASK_CHIPID   (1 << 1)

Definition at line 164 of file 4l/pm.h.

◆ PM_PBCMASK_FREQM

#define PM_PBCMASK_FREQM   (1 << 3)

Definition at line 166 of file 4l/pm.h.

◆ PM_PBCMASK_GPIO

#define PM_PBCMASK_GPIO   (1 << 4)

Definition at line 167 of file 4l/pm.h.

◆ PM_PBCMASK_PM

#define PM_PBCMASK_PM   (1 << 0)

Definition at line 163 of file 4l/pm.h.

◆ PM_PBCMASK_SCIF

#define PM_PBCMASK_SCIF   (1 << 2)

Definition at line 165 of file 4l/pm.h.

◆ PM_PBDMASK

#define PM_PBDMASK   MMIO32(PM_BASE + 0x034)

Definition at line 53 of file 4l/pm.h.

◆ PM_PBDMASK_AST

#define PM_PBDMASK_AST   (1 << 2)

Definition at line 171 of file 4l/pm.h.

◆ PM_PBDMASK_BPM

#define PM_PBDMASK_BPM   (1 << 0)

Definition at line 169 of file 4l/pm.h.

◆ PM_PBDMASK_BSCIF

#define PM_PBDMASK_BSCIF   (1 << 1)

Definition at line 170 of file 4l/pm.h.

◆ PM_PBDMASK_EIC

#define PM_PBDMASK_EIC   (1 << 4)

Definition at line 173 of file 4l/pm.h.

◆ PM_PBDMASK_PICOUART

#define PM_PBDMASK_PICOUART   (1 << 5)

Definition at line 174 of file 4l/pm.h.

◆ PM_PBDMASK_WDT

#define PM_PBDMASK_WDT   (1 << 3)

Definition at line 172 of file 4l/pm.h.

◆ PM_PPCR

#define PM_PPCR   MMIO32(PM_BASE + 0x160)

Definition at line 85 of file 4l/pm.h.

◆ PM_PROTCTRL

#define PM_PROTCTRL   MMIO32(PM_BASE + 0x18C)

Definition at line 97 of file 4l/pm.h.

◆ PM_RCAUSE

#define PM_RCAUSE   MMIO32(PM_BASE + 0x180)

Definition at line 88 of file 4l/pm.h.

◆ PM_SR

#define PM_SR   MMIO32(PM_BASE + 0x0D4)

Definition at line 82 of file 4l/pm.h.

◆ PM_SR_CFD

#define PM_SR_CFD   (1 << 0)

Definition at line 185 of file 4l/pm.h.

◆ PM_SR_CKRDY

#define PM_SR_CKRDY   (1 << 5)

Definition at line 186 of file 4l/pm.h.

◆ PM_SR_WAKE

#define PM_SR_WAKE   (1 << 8)

Definition at line 187 of file 4l/pm.h.

◆ PM_UNLOCK

#define PM_UNLOCK   MMIO32(PM_BASE + 0x058)

Definition at line 63 of file 4l/pm.h.

◆ PM_UNLOCK_KEY

#define PM_UNLOCK_KEY   (0xAA << 24)

Definition at line 64 of file 4l/pm.h.

◆ PM_VERSION

#define PM_VERSION   MMIO32(PM_BASE + 0x3FC)

Definition at line 106 of file 4l/pm.h.

◆ PM_WCAUSE

#define PM_WCAUSE   MMIO32(PM_BASE + 0x184)

Definition at line 91 of file 4l/pm.h.

Enumeration Type Documentation

◆ mck_src

enum mck_src
Enumerator
MCK_SRC_RCSYS 
MCK_SRC_OSC0 
MCK_SRC_PLL 
MCK_SRC_DFLL 
MCK_SRC_RC80M 
MCK_SRC_RCFAST 
MCK_SRC_RC1M 

Definition at line 189 of file 4l/pm.h.

◆ pm_cksel

enum pm_cksel
Enumerator
PM_CKSEL_CPU 
PM_CKSEL_PBA 
PM_CKSEL_PBB 
PM_CKSEL_PBC 
PM_CKSEL_PBD 

Definition at line 199 of file 4l/pm.h.

◆ pm_peripheral

Enumerator
PM_PERIPHERAL_OCD 
PM_PERIPHERAL_PDCA 
PM_PERIPHERAL_FLASHCALW 
PM_PERIPHERAL_FLASHCALW_PICORAM 
PM_PERIPHERAL_USBC 
PM_PERIPHERAL_CRCCU 
PM_PERIPHERAL_APBA_BRIDGE 
PM_PERIPHERAL_APBB_BRIDGE 
PM_PERIPHERAL_APBC_BRIDGE 
PM_PERIPHERAL_APBD_BRIDGE 
PM_PERIPHERAL_AESA 
PM_PERIPHERAL_IISC 
PM_PERIPHERAL_SPI 
PM_PERIPHERAL_TC0 
PM_PERIPHERAL_TC1 
PM_PERIPHERAL_TWIM0 
PM_PERIPHERAL_TWIS0 
PM_PERIPHERAL_TWIM1 
PM_PERIPHERAL_TWIS1 
PM_PERIPHERAL_USART0 
PM_PERIPHERAL_USART1 
PM_PERIPHERAL_USART2 
PM_PERIPHERAL_USART3 
PM_PERIPHERAL_ADCIFE 
PM_PERIPHERAL_DACC 
PM_PERIPHERAL_ACIFC 
PM_PERIPHERAL_GLOC 
PM_PERIPHERAL_ABDACB 
PM_PERIPHERAL_TRNG 
PM_PERIPHERAL_PARC 
PM_PERIPHERAL_CATB 
PM_PERIPHERAL_RESERVED1 
PM_PERIPHERAL_TWIM2 
PM_PERIPHERAL_TWIM3 
PM_PERIPHERAL_LCDCA 
PM_PERIPHERAL_FLASHCALW_ALT 
PM_PERIPHERAL_HRAMC1 
PM_PERIPHERAL_HMATRIX 
PM_PERIPHERAL_PDCA_ALT 
PM_PERIPHERAL_CRCCU_ALT 
PM_PERIPHERAL_USBC_ALT 
PM_PERIPHERAL_PEVC 
PM_PERIPHERAL_PM 
PM_PERIPHERAL_CHIPID 
PM_PERIPHERAL_SCIF 
PM_PERIPHERAL_FREQM 
PM_PERIPHERAL_GPIO 
PM_PERIPHERAL_BPM 
PM_PERIPHERAL_BSCIF 
PM_PERIPHERAL_AST 
PM_PERIPHERAL_WDT 
PM_PERIPHERAL_EIC 
PM_PERIPHERAL_PICOUART 

Definition at line 212 of file 4l/pm.h.

Function Documentation

◆ pm_disable_peripheral_clock()

void pm_disable_peripheral_clock ( enum pm_peripheral  periph)

Definition at line 72 of file pm.c.

References set_peripheral_clock_status().

Here is the call graph for this function:

◆ pm_enable_clock_div()

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.

◆ pm_enable_peripheral_clock()

void pm_enable_peripheral_clock ( enum pm_peripheral  periph)

Definition at line 67 of file pm.c.

References set_peripheral_clock_status().

Here is the call graph for this function:

◆ pm_select_main_clock()

void pm_select_main_clock ( enum mck_src  source_clock)

◆ pm_set_divmask_clock()

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.