49 CCSCTL &= ~CCS_CTL_SCLKMUXSEL;
58 CCSCTL &= ~CCS_CTL_CLKFAILEN;
61 CCSCTL &= ~CCS_CTL_CLKFAILMUXSEL;
88 CCSCTL &= ~CCS_CTL_ADCCLKEN;
94 CCSCTL &= ~CCS_CTL_STCLKSLPEN;
124 if (div <= 15 && div >= 1) {
131 if (div <= 16383 && div >= 4) {
static volatile uint32_t ccs_extclk_frequency
PAC55xxxx CCS Driver
static volatile uint32_t ccs_pclk_frequency
static volatile uint32_t ccs_frclk_frequency
static volatile uint32_t ccs_pll_clk_frequency
static volatile uint32_t ccs_sclk_frequency
static volatile uint32_t ccs_hclk_frequency
static volatile uint32_t ccs_aclk_frequency
void ccs_clkfail_disable(void)
Disable Clock Fail Detection.
void ccs_stclk_sleep_disable(void)
Disable SysTick clock gating in deep sleep mode.
void ccs_pll_bypass_enable(void)
Enable the PLL bypass.
void ccs_set_pclkdiv(uint32_t div)
Set the divisor for the Peripheral Clock.
bool ccs_pll_locked(void)
Check if the PLL is locked.
void ccs_aclk_disable(void)
Disable the Auxiliary Clock.
void ccs_configure_clocks(const struct ccs_clk_config *config)
Setup the PAC55xx clocks with the given struct.
void ccs_pll_set_indiv(uint32_t div)
Set the PLL input divisor.
void ccs_clkfail_enable(void)
Enable Clock Fail Detection.
void ccs_clkfailmux_select_pllclk(void)
Select PLLCLK for Clock Fail Detection.
void ccs_reset_clocks(void)
Restores CCSCTL and CCSPLLCTL registers to default/safe values.
void ccs_pll_set_fbdiv(uint32_t div)
Set the PLL feedback divisor.
void ccs_stclk_sleep_enable(void)
Enable SysTick clock gating in deep sleep mode.
void ccs_aclk_enable(void)
Enable the Auxiliary Clock.
void ccs_ldo_enable(void)
Enable the LDO.
void ccs_ldo_disable(void)
Disable the LDO.
void ccs_rosc_enable(void)
Enable the 16MHz Ring oscillator.
void ccs_frclkmux_select(uint32_t sel)
Select the source for FRCLK.
void ccs_pll_enable(void)
Enable the PLL.
void ccs_clkfailmux_select_frclk(void)
Select FRCLK for Clock Fail Detection.
void ccs_set_hclkdiv(uint32_t div)
Set the divisor for the AHB Clock.
void ccs_pll_set_outdiv(uint32_t div)
Set the output divisor.
void ccs_set_aclkdiv(uint32_t div)
Set the divisor for the Auxiliary Clock.
uint32_t ccs_get_peripheral_clk_freq(uint32_t periph, uint32_t select)
Get the clock rate (in Hz) of the specified peripheral.
void css_pll_config_enable(uint32_t indiv, uint32_t fbdiv, uint32_t outdiv)
Configure the CCS PLL, enable it, and wait for lock.
void ccs_pclk_disable(void)
Disable the Peripheral Clock.
void ccs_pclk_enable(void)
Enable the Peripheral Clock.
void ccs_pll_disable(void)
Disable the PLL.
void ccs_sclkmux_select_pllclk(void)
Select PLLCLK for SCLK.
void ccs_pll_bypass_disable(void)
Disable the PLL bypass.
void ccs_adcclk_enable(void)
Enable the ADC Clock.
void ccs_adcclk_disable(void)
Disable the ADC Clock.
void ccs_rosc_disable(void)
Disable the 16MHz Ring oscillator.
void ccs_sclkmux_select_frclk(void)
Select FRCLK for SCLK.
#define CCS_CTL_FRCLKMUXSEL(sel)
#define CCS_CTL_STCLKSLPEN
#define CCS_CTL_PCLKDIV(div)
#define CCS_CTL_FRCLKMUXSEL_MASK
#define CCS_CTL_CLKFAILMUXSEL
#define CCS_CTL_SCLKMUXSEL_PLLCLK
#define CCS_CTL_FRCLKMUXSEL_EXTCLK
#define CCS_CTL_SCLKMUXSEL
#define CCS_CTL_SCLKMUXSEL_FRCLK
#define CCS_CTL_FRCLKMUXSEL_ROSC
#define CCS_CTL_HCLKDIV(div)
#define CCS_CTL_ACLKDIV(div)
#define CCS_CTL_CLKFAILEN
#define CCS_CTL_FRCLKMUXSEL_CLKREF
#define CCS_EXTCLK_MAX_FREQ
Maximum external clock frequency.
#define CCS_ROSC_FREQ
Ring Oscillator Frequency.
#define CCS_CLKREF_FREQ
Internally generated and trimmed 4MHz clock.
#define CCS_PLLCTL_PLLINDIV_MASK
#define CCS_PLLCTL_PLLINDIV(div)
PLL Input Divisor.
#define CCS_PLLCTL_PLLFBDIV(div)
PLL Feedback Divisor.
#define CCS_PLLCTL_PLLOUTDIV_MASK
#define CCS_PLLCTL_PLLEN
PLL Enable.
#define CCS_PLLCTL_PLLFBDIV_MASK
#define CCS_PLLCTL_PLLOUTDIV(div)
PLL Output Divisor.
#define CCS_PLLCTL_PLLLOCK
PLL Lock.
#define CCS_PLLCTL_PLLBP
PLL Bypass.
#define cm3_assert_not_reached()
Check if unreachable code is reached.
#define MEMCTL_FLASHLOCK
Flash Lock Access Register.
#define MEMCTL_FLASHLOCK_CLEAR
#define MEMCTL_FLASHLOCK_ALLOW_MEMCTL_WRITE
void memctl_flash_select_mclk(void)
Select MCLK as input to Flash Memory Controller.
void memctl_flash_select_roscclk(void)
Select ROSCCLK as input to Flash Memory Controller.
void memctl_flash_cache_enable(void)
Enable Flash cache.
void memctl_flash_set_wstate(uint32_t wstate)
Set the number of wait states for Flash reads.
void memctl_flash_set_mclkdiv(uint32_t div)
Set the MCLK divisor.
void memctl_flash_cache_disable(void)
Disable Flash cache.
CCS Clock Configuration structure.
uint32_t pll_outdiv
PLL Output Divider.
uint32_t aclkdiv
Divisor from SCLK to ACLK.
uint32_t frclk_source
FRCLK source input selection.
bool mem_mclksel
false: ROSCLK, true: HCLK/MCLK
uint32_t hclkdiv
Divisor from SCLK to HCLK.
uint32_t mem_wstate
Number of Flash Read wait states.
uint32_t pll_indiv
PLL Input Divider 1-15.
uint32_t sclk_source
SCLK source selection.
uint32_t mem_mclkdiv
Divisor from HCLK to MCLK.
uint32_t extclk_frequency
EXTCLK frequency, 0 if none.
bool mem_enable_cache
false: disable cache, true: enable cache
uint32_t pll_fbdiv
PLL Feedback Divider 4-16383.
uint32_t pclkdiv
Divisor from HCLK to PCLK.