![]() |
LPCOpen Platform for LPC112X microcontrollers
112X
LPCOpen Platform for the NXP LPC112X family of Microcontrollers
|
Macros | |
#define | SYSCON_IRC_FREQ (12000000) |
Functions | |
STATIC INLINE void | Chip_Clock_SetupSystemPLL (uint8_t msel, uint8_t psel) |
Set System PLL divider values. More... | |
STATIC INLINE bool | Chip_Clock_IsSystemPLLLocked (void) |
Read System PLL lock status. More... | |
void | Chip_Clock_SetSystemPLLSource (CHIP_SYSCON_PLLCLKSRC_T src) |
Set System PLL clock source. More... | |
void | Chip_Clock_SetPLLBypass (bool bypass, bool highfr) |
Bypass System Oscillator and set oscillator frequency range. More... | |
STATIC INLINE void | Chip_Clock_SetWDTOSC (CHIP_WDTLFO_OSC_T wdtclk, uint8_t div) |
Setup Watchdog oscillator rate and divider. More... | |
void | Chip_Clock_SetMainClockSource (CHIP_SYSCON_MAINCLKSRC_T src) |
Set main system clock source. More... | |
STATIC INLINE CHIP_SYSCON_MAINCLKSRC_T | Chip_Clock_GetMainClockSource (void) |
Returns the main clock source. More... | |
STATIC INLINE void | Chip_Clock_SetSysClockDiv (uint32_t div) |
Set system clock divider. More... | |
STATIC INLINE void | Chip_Clock_EnablePeriphClock (CHIP_SYSCON_CLOCK_T clk) |
Enable a system or peripheral clock. More... | |
STATIC INLINE void | Chip_Clock_DisablePeriphClock (CHIP_SYSCON_CLOCK_T clk) |
Disable a system or peripheral clock. More... | |
STATIC INLINE void | Chip_Clock_SetSSP0ClockDiv (uint32_t div) |
Set SSP0 divider. More... | |
STATIC INLINE uint32_t | Chip_Clock_GetSSP0ClockDiv (void) |
Return SSP0 divider. More... | |
STATIC INLINE void | Chip_Clock_SetUARTClockDiv (uint32_t div) |
Set UART divider clock. More... | |
STATIC INLINE uint32_t | Chip_Clock_GetUARTClockDiv (void) |
Return UART divider. More... | |
STATIC INLINE void | Chip_Clock_SetSSP1ClockDiv (uint32_t div) |
Set SSP1 divider clock. More... | |
STATIC INLINE uint32_t | Chip_Clock_GetSSP1ClockDiv (void) |
Return SSP1 divider. More... | |
void | Chip_Clock_SetWDTClockSource (CHIP_SYSCON_WDTCLKSRC_T src, uint32_t div) |
Set WDT clock source and divider. More... | |
void | Chip_Clock_SetCLKOUTSource (CHIP_SYSCON_CLKOUTSRC_T src, uint32_t div) |
Set CLKOUT clock source and divider. More... | |
STATIC INLINE uint32_t | Chip_Clock_GetMainOscRate (void) |
Returns the main oscillator clock rate. More... | |
STATIC INLINE uint32_t | Chip_Clock_GetIntOscRate (void) |
Returns the internal oscillator (IRC) clock rate. More... | |
uint32_t | Chip_Clock_GetWDTOSCRate (void) |
Return estimated watchdog oscillator rate. More... | |
uint32_t | Chip_Clock_GetSystemPLLInClockRate (void) |
Return System PLL input clock rate. More... | |
uint32_t | Chip_Clock_GetSystemPLLOutClockRate (void) |
Return System PLL output clock rate. More... | |
uint32_t | Chip_Clock_GetMainClockRate (void) |
Return main clock rate. More... | |
uint32_t | Chip_Clock_GetSystemClockRate (void) |
Return system clock rate. More... | |
#define SYSCON_IRC_FREQ (12000000) |
Internal oscillator frequency
Definition at line 45 of file clock_112x.h.
Clock sources for CLKOUT
Definition at line 308 of file clock_112x.h.
enum CHIP_SYSCON_CLOCK_T |
System and peripheral clocks
Definition at line 176 of file clock_112x.h.
Clock sources for main system clock
Definition at line 135 of file clock_112x.h.
Clock sources for system and USB PLLs
Enumerator | |
---|---|
SYSCON_PLLCLKSRC_IRC |
Internal oscillator in |
SYSCON_PLLCLKSRC_MAINOSC |
Crystal (main) oscillator in |
SYSCON_PLLCLKSRC_RESERVED1 |
Reserved |
SYSCON_PLLCLKSRC_RESERVED2 |
Reserved |
Definition at line 71 of file clock_112x.h.
Clock sources for WDT
Enumerator | |
---|---|
SYSCON_WDTCLKSRC_IRC |
Internal oscillator for watchdog clock |
SYSCON_WDTCLKSRC_MAINSYSCLK |
Main system clock for watchdog clock |
SYSCON_WDTCLKSRC_WDTOSC |
Watchdog oscillator for watchdog clock |
Definition at line 287 of file clock_112x.h.
enum CHIP_WDTLFO_OSC_T |
Watchdog and low frequency oscillator frequencies plus or minus 40%
Definition at line 101 of file clock_112x.h.
STATIC INLINE void Chip_Clock_DisablePeriphClock | ( | CHIP_SYSCON_CLOCK_T | clk | ) |
Disable a system or peripheral clock.
clk | : Clock to disable |
Definition at line 213 of file clock_112x.h.
STATIC INLINE void Chip_Clock_EnablePeriphClock | ( | CHIP_SYSCON_CLOCK_T | clk | ) |
Enable a system or peripheral clock.
clk | : Clock to enable |
Definition at line 203 of file clock_112x.h.
Returns the internal oscillator (IRC) clock rate.
Definition at line 341 of file clock_112x.h.
uint32_t Chip_Clock_GetMainClockRate | ( | void | ) |
STATIC INLINE CHIP_SYSCON_MAINCLKSRC_T Chip_Clock_GetMainClockSource | ( | void | ) |
Returns the main clock source.
Definition at line 156 of file clock_112x.h.
Returns the main oscillator clock rate.
Definition at line 332 of file clock_112x.h.
Return SSP0 divider.
Definition at line 235 of file clock_112x.h.
Return SSP1 divider.
Definition at line 279 of file clock_112x.h.
uint32_t Chip_Clock_GetSystemClockRate | ( | void | ) |
uint32_t Chip_Clock_GetSystemPLLInClockRate | ( | void | ) |
Return System PLL input clock rate.
Definition at line 146 of file clock_112x.c.
uint32_t Chip_Clock_GetSystemPLLOutClockRate | ( | void | ) |
Return System PLL output clock rate.
Definition at line 167 of file clock_112x.c.
Return UART divider.
Definition at line 257 of file clock_112x.h.
uint32_t Chip_Clock_GetWDTOSCRate | ( | void | ) |
Return estimated watchdog oscillator rate.
Definition at line 140 of file clock_112x.c.
Read System PLL lock status.
Definition at line 63 of file clock_112x.h.
void Chip_Clock_SetCLKOUTSource | ( | CHIP_SYSCON_CLKOUTSRC_T | src, |
uint32_t | div | ||
) |
Set CLKOUT clock source and divider.
src | : Clock source for CLKOUT |
div | : divider for CLKOUT clock |
Definition at line 130 of file clock_112x.c.
void Chip_Clock_SetMainClockSource | ( | CHIP_SYSCON_MAINCLKSRC_T | src | ) |
Set main system clock source.
src | : Clock source for main system |
Definition at line 113 of file clock_112x.c.
void Chip_Clock_SetPLLBypass | ( | bool | bypass, |
bool | highfr | ||
) |
Bypass System Oscillator and set oscillator frequency range.
bypass | : Flag to bypass oscillator |
highfr | : Flag to set oscillator range from 15-25 MHz |
Definition at line 98 of file clock_112x.c.
Set SSP0 divider.
div | : divider for SSP0 clock |
Definition at line 225 of file clock_112x.h.
Set SSP1 divider clock.
div | : divider for SSP1 clock |
Definition at line 269 of file clock_112x.h.
Set system clock divider.
div | : divider for system clock |
Definition at line 168 of file clock_112x.h.
void Chip_Clock_SetSystemPLLSource | ( | CHIP_SYSCON_PLLCLKSRC_T | src | ) |
Set System PLL clock source.
src | : Clock source for system PLL |
Definition at line 90 of file clock_112x.c.
Set UART divider clock.
div | : divider for UART clock |
Definition at line 247 of file clock_112x.h.
Set System PLL divider values.
msel | : PLL feedback divider value. M = msel + 1. |
psel | : PLL post divider value. P = (1<<psel). |
Definition at line 54 of file clock_112x.h.
void Chip_Clock_SetWDTClockSource | ( | CHIP_SYSCON_WDTCLKSRC_T | src, |
uint32_t | div | ||
) |
Set WDT clock source and divider.
src | : Clock source for WDT |
div | : divider for WDT clock |
Definition at line 121 of file clock_112x.c.
STATIC INLINE void Chip_Clock_SetWDTOSC | ( | CHIP_WDTLFO_OSC_T | wdtclk, |
uint8_t | div | ||
) |
Setup Watchdog oscillator rate and divider.
wdtclk | : Selected watchdog clock rate |
div | : Watchdog divider value, even value between 2 and 64 |
Definition at line 127 of file clock_112x.h.