Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: UAVCAN UAVCAN_Subscriber
CHIP: LPC11xx Clock Control block driver
Typedef Documentation
typedef enum CHIP_SYSCTL_CLKOUTSRC CHIP_SYSCTL_CLKOUTSRC_T |
Clock sources for CLKOUT.
typedef enum CHIP_SYSCTL_CLOCK CHIP_SYSCTL_CLOCK_T |
System and peripheral clocks.
typedef enum CHIP_SYSCTL_MAINCLKSRC CHIP_SYSCTL_MAINCLKSRC_T |
Clock sources for main system clock.
typedef enum CHIP_SYSCTL_PLLCLKSRC CHIP_SYSCTL_PLLCLKSRC_T |
Clock sources for system and USB PLLs.
typedef enum CHIP_SYSCTL_USBCLKSRC CHIP_SYSCTL_USBCLKSRC_T |
Clock sources for USB.
typedef enum CHIP_SYSCTL_WDTCLKSRC CHIP_SYSCTL_WDTCLKSRC_T |
Clock sources for WDT.
typedef enum CHIP_WDTLFO_OSC CHIP_WDTLFO_OSC_T |
Watchdog and low frequency oscillator frequencies plus or minus 40%.
Enumeration Type Documentation
Clock sources for CLKOUT.
- Enumerator:
Definition at line 430 of file clock_11xx.h.
enum CHIP_SYSCTL_CLOCK |
System and peripheral clocks.
- Enumerator:
Definition at line 228 of file clock_11xx.h.
Clock sources for main system clock.
- Enumerator:
Definition at line 187 of file clock_11xx.h.
Clock sources for system and USB PLLs.
- Enumerator:
Definition at line 71 of file clock_11xx.h.
Clock sources for USB.
Definition at line 383 of file clock_11xx.h.
Clock sources for WDT.
- Enumerator:
SYSCTL_WDTCLKSRC_IRC Internal oscillator for watchdog clock
SYSCTL_WDTCLKSRC_MAINSYSCLK Main system clock for watchdog clock
SYSCTL_WDTCLKSRC_WDTOSC Watchdog oscillator for watchdog clock
Definition at line 406 of file clock_11xx.h.
enum CHIP_WDTLFO_OSC |
Watchdog and low frequency oscillator frequencies plus or minus 40%.
- Enumerator:
Definition at line 138 of file clock_11xx.h.
Function Documentation
STATIC INLINE void Chip_Clock_DisablePeriphClock | ( | CHIP_SYSCTL_CLOCK_T | clk ) |
Disable a system or peripheral clock.
- Parameters:
-
clk : Clock to disable
- Returns:
- Nothing
Definition at line 305 of file clock_11xx.h.
STATIC INLINE void Chip_Clock_EnablePeriphClock | ( | CHIP_SYSCTL_CLOCK_T | clk ) |
Enable a system or peripheral clock.
- Parameters:
-
clk : Clock to enable
- Returns:
- Nothing
Definition at line 295 of file clock_11xx.h.
STATIC INLINE uint32_t Chip_Clock_GetExtClockInRate | ( | void | ) |
Returns the external clock input rate.
- Returns:
- internal external clock input rate
- Note:
- LPC11Axx devices only
Definition at line 476 of file clock_11xx.h.
STATIC INLINE uint32_t Chip_Clock_GetIntOscRate | ( | void | ) |
Returns the internal oscillator (IRC) clock rate.
- Returns:
- internal oscillator (IRC) clock rate
Definition at line 465 of file clock_11xx.h.
uint32_t Chip_Clock_GetLFOOSCRate | ( | void | ) |
Return estimated low frequency oscillator rate.
- Returns:
- Estimated low frequency oscillator rate
- Note:
- This rate is accurate to plus or minus 40%.
Definition at line 175 of file clock_11xx.c.
uint32_t Chip_Clock_GetMainClockRate | ( | void | ) |
STATIC INLINE CHIP_SYSCTL_MAINCLKSRC_T Chip_Clock_GetMainClockSource | ( | void | ) |
Returns the main clock source.
- Returns:
- Which clock is used for the core clock source?
Definition at line 208 of file clock_11xx.h.
STATIC INLINE uint32_t Chip_Clock_GetMainOscRate | ( | void | ) |
Returns the main oscillator clock rate.
- Returns:
- main oscillator clock rate
Definition at line 456 of file clock_11xx.h.
STATIC INLINE uint32_t Chip_Clock_GetSSP0ClockDiv | ( | void | ) |
Return SSP0 divider.
- Returns:
- divider for SSP0 clock
- Note:
- A value of 0 means the clock is disabled.
Definition at line 327 of file clock_11xx.h.
STATIC INLINE uint32_t Chip_Clock_GetSSP1ClockDiv | ( | void | ) |
Return SSP1 divider.
- Returns:
- divider for SSP1 clock
- Note:
- A value of 0 means the clock is disabled.
Definition at line 372 of file clock_11xx.h.
uint32_t Chip_Clock_GetSystemClockRate | ( | void | ) |
uint32_t Chip_Clock_GetSystemPLLInClockRate | ( | void | ) |
Return System PLL input clock rate.
- Returns:
- System PLL input clock rate
Definition at line 183 of file clock_11xx.c.
uint32_t Chip_Clock_GetSystemPLLOutClockRate | ( | void | ) |
Return System PLL output clock rate.
- Returns:
- System PLL output clock rate
Definition at line 210 of file clock_11xx.c.
STATIC INLINE uint32_t Chip_Clock_GetUARTClockDiv | ( | void | ) |
Return UART divider.
- Returns:
- divider for UART clock
- Note:
- A value of 0 means the clock is disabled.
Definition at line 349 of file clock_11xx.h.
uint32_t Chip_Clock_GetUSBPLLInClockRate | ( | void | ) |
Return USB PLL input clock rate.
- Returns:
- USB PLL input clock rate
Definition at line 218 of file clock_11xx.c.
uint32_t Chip_Clock_GetUSBPLLOutClockRate | ( | void | ) |
Return USB PLL output clock rate.
- Returns:
- USB PLL output clock rate
Definition at line 239 of file clock_11xx.c.
uint32_t Chip_Clock_GetWDTOSCRate | ( | void | ) |
Return estimated watchdog oscillator rate.
- Returns:
- Estimated watchdog oscillator rate
- Note:
- This rate is accurate to plus or minus 40%.
Definition at line 168 of file clock_11xx.c.
STATIC INLINE bool Chip_Clock_IsSystemPLLLocked | ( | void | ) |
Read System PLL lock status.
- Returns:
- true of the PLL is locked. false if not locked
Definition at line 63 of file clock_11xx.h.
STATIC INLINE bool Chip_Clock_IsUSBPLLLocked | ( | void | ) |
Read USB PLL lock status.
- Returns:
- true of the PLL is locked. false if not locked
Definition at line 108 of file clock_11xx.h.
void Chip_Clock_SetCLKOUTSource | ( | CHIP_SYSCTL_CLKOUTSRC_T | src, |
uint32_t | div | ||
) |
Set CLKOUT clock source and divider.
- Parameters:
-
src : Clock source for CLKOUT div : divider for CLKOUT clock
- Returns:
- Nothing
- Note:
- Use 0 to disable, or a divider value of 1 to 255. The CLKOUT clock rate is the clock source divided by the divider. This function will also toggle the clock source update register to update the clock source.
Definition at line 157 of file clock_11xx.c.
STATIC INLINE void Chip_Clock_SetLFOSC | ( | CHIP_WDTLFO_OSC_T | lfoclk, |
uint8_t | div | ||
) |
Setup low frequency oscillator rate and divider.
- Parameters:
-
lfoclk : Selected low frequency clock rate div : Low frequency divider value, even value between 2 and 64
- Returns:
- Nothing
- Note:
- Low frequency oscillator rate = selected rate divided by divider rate
Definition at line 177 of file clock_11xx.h.
void Chip_Clock_SetMainClockSource | ( | CHIP_SYSCTL_MAINCLKSRC_T | src ) |
Set main system clock source.
- Parameters:
-
src : Clock source for main system
- Returns:
- Nothing
- Note:
- This function will also toggle the clock source update register to update the clock source.
Definition at line 124 of file clock_11xx.c.
void Chip_Clock_SetPLLBypass | ( | bool | bypass, |
bool | highfr | ||
) |
Bypass System Oscillator and set oscillator frequency range.
- Parameters:
-
bypass : Flag to bypass oscillator highfr : Flag to set oscillator range from 15-25 MHz
- Returns:
- Nothing
- Note:
- Sets the PLL input to bypass the oscillator. This would be used if an external clock that is not an oscillator is attached to the XTALIN pin.
Definition at line 98 of file clock_11xx.c.
STATIC INLINE void Chip_Clock_SetSSP0ClockDiv | ( | uint32_t | div ) |
Set SSP0 divider.
- Parameters:
-
div : divider for SSP0 clock
- Returns:
- Nothing
- Note:
- Use 0 to disable, or a divider value of 1 to 255. The SSP0 clock rate is the main system clock divided by this value.
Definition at line 317 of file clock_11xx.h.
STATIC INLINE void Chip_Clock_SetSSP1ClockDiv | ( | uint32_t | div ) |
Set SSP1 divider clock.
- Parameters:
-
div : divider for SSP1 clock
- Returns:
- Nothing
- Note:
- Use 0 to disable, or a divider value of 1 to 255. The SSP1 clock rate is the main system clock divided by this value.
Definition at line 362 of file clock_11xx.h.
STATIC INLINE void Chip_Clock_SetSysClockDiv | ( | uint32_t | div ) |
Set system clock divider.
- Parameters:
-
div : divider for system clock
- Returns:
- Nothing
- Note:
- Use 0 to disable, or a divider value of 1 to 255. The system clock rate is the main system clock divided by this value.
Definition at line 220 of file clock_11xx.h.
void Chip_Clock_SetSystemPLLSource | ( | CHIP_SYSCTL_PLLCLKSRC_T | src ) |
Set System PLL clock source.
- Parameters:
-
src : Clock source for system PLL
- Returns:
- Nothing
- Note:
- This function will also toggle the clock source update register to update the clock source.
Definition at line 90 of file clock_11xx.c.
STATIC INLINE void Chip_Clock_SetUARTClockDiv | ( | uint32_t | div ) |
Set UART divider clock.
- Parameters:
-
div : divider for UART clock
- Returns:
- Nothing
- Note:
- Use 0 to disable, or a divider value of 1 to 255. The UART clock rate is the main system clock divided by this value.
Definition at line 339 of file clock_11xx.h.
STATIC INLINE void Chip_Clock_SetupSystemPLL | ( | uint8_t | msel, |
uint8_t | psel | ||
) |
Set System PLL divider values.
- Parameters:
-
msel : PLL feedback divider value. M = msel + 1. psel : PLL post divider value. P = (1<<psel).
- Returns:
- Nothing
- Note:
- See the user manual for how to setup the PLL.
Definition at line 54 of file clock_11xx.h.
STATIC INLINE void Chip_Clock_SetupUSBPLL | ( | uint8_t | msel, |
uint8_t | psel | ||
) |
Set USB PLL divider values.
- Parameters:
-
msel : PLL feedback divider value. M = msel + 1. psel : PLL post divider value. P = (1<<psel).
- Returns:
- Nothing
- Note:
- See the user manual for how to setup the PLL.
Definition at line 99 of file clock_11xx.h.
void Chip_Clock_SetUSBClockSource | ( | CHIP_SYSCTL_USBCLKSRC_T | src, |
uint32_t | div | ||
) |
Set USB clock source and divider.
- Parameters:
-
src : Clock source for USB div : divider for USB clock
- Returns:
- Nothing
- Note:
- Use 0 to disable, or a divider value of 1 to 255. The USB clock rate is either the main system clock or USB PLL output clock divided by this value. This function will also toggle the clock source update register to update the clock source.
Definition at line 133 of file clock_11xx.c.
void Chip_Clock_SetUSBPLLSource | ( | CHIP_SYSCTL_PLLCLKSRC_T | src ) |
Set USB PLL clock source.
- Parameters:
-
src : Clock source for USB PLL
- Returns:
- Nothing
- Note:
- This function will also toggle the clock source update register to update the clock source.
Definition at line 114 of file clock_11xx.c.
void Chip_Clock_SetWDTClockSource | ( | CHIP_SYSCTL_WDTCLKSRC_T | src, |
uint32_t | div | ||
) |
Set WDT clock source and divider.
- Parameters:
-
src : Clock source for WDT div : divider for WDT clock
- Returns:
- Nothing
- Note:
- Use 0 to disable, or a divider value of 1 to 255. The WDT clock rate is the clock source divided by the divider. This function will also toggle the clock source update register to update the clock source.
Definition at line 145 of file clock_11xx.c.
STATIC INLINE void Chip_Clock_SetWDTOSC | ( | CHIP_WDTLFO_OSC_T | wdtclk, |
uint8_t | div | ||
) |
Setup Watchdog oscillator rate and divider.
- Parameters:
-
wdtclk : Selected watchdog clock rate div : Watchdog divider value, even value between 2 and 64
- Returns:
- Nothing
- Note:
- Watchdog rate = selected rate divided by divider rate
Definition at line 164 of file clock_11xx.h.
Generated on Tue Jul 12 2022 17:17:35 by
