Module Clock Driver for the AVR32 UC3 microcontrollers. More...
Enumerations | |
enum | UC3_Extern_OSC_ClockStartup_t { EXOSC_START_0CLK = AVR32_PM_OSCCTRL0_STARTUP_0_RCOSC, EXOSC_START_64CLK = AVR32_PM_OSCCTRL0_STARTUP_64_RCOSC, EXOSC_START_128CLK = AVR32_PM_OSCCTRL0_STARTUP_128_RCOSC, EXOSC_START_2048CLK = AVR32_PM_OSCCTRL0_STARTUP_2048_RCOSC, EXOSC_START_4096CLK = AVR32_PM_OSCCTRL0_STARTUP_4096_RCOSC, EXOSC_START_8192CLK = AVR32_PM_OSCCTRL0_STARTUP_8192_RCOSC, EXOSC_START_16384CLK = AVR32_PM_OSCCTRL0_STARTUP_16384_RCOSC } |
enum | UC3_Extern_OSC_ClockTypes_t { EXOSC_MODE_CLOCK = AVR32_PM_OSCCTRL0_MODE_EXT_CLOCK, EXOSC_MODE_900KHZ_MAX = AVR32_PM_OSCCTRL0_MODE_CRYSTAL_G0, EXOSC_MODE_3MHZ_MAX = AVR32_PM_OSCCTRL0_MODE_CRYSTAL_G1, EXOSC_MODE_8MHZ_MAX = AVR32_PM_OSCCTRL0_MODE_CRYSTAL_G2, EXOSC_MODE_8MHZ_OR_MORE = AVR32_PM_OSCCTRL0_MODE_CRYSTAL_G3 } |
enum | UC3_System_ClockSource_t { CLOCK_SRC_SLOW_CLK = 0, CLOCK_SRC_OSC0 = 1, CLOCK_SRC_OSC1 = 2, CLOCK_SRC_PLL0 = 3, CLOCK_SRC_PLL1 = 4 } |
Functions | |
static bool | UC3CLK_SetCPUClockSource (const uint8_t Source, const uint32_t SourceFreq) ATTR_ALWAYS_INLINE |
static bool | UC3CLK_StartExternalOscillator (const uint8_t Channel, const uint8_t Type, const uint8_t Startup) ATTR_ALWAYS_INLINE |
static bool | UC3CLK_StartGenericClock (const uint8_t Channel, const uint8_t Source, const uint32_t SourceFreq, const uint32_t Frequency) ATTR_ALWAYS_INLINE |
static bool | UC3CLK_StartPLL (const uint8_t Channel, const uint8_t Source, const uint32_t SourceFreq, const uint32_t Frequency) ATTR_ALWAYS_INLINE |
static void | UC3CLK_StopExternalOscillator (const uint8_t Channel) ATTR_ALWAYS_INLINE |
static bool | UC3CLK_StopGenericClock (const uint8_t Channel) ATTR_ALWAYS_INLINE |
static void | UC3CLK_StopPLL (const uint8_t Channel) ATTR_ALWAYS_INLINE |
The following files must be built with any user project that uses this module:
Clock management driver for the AVR32 UC3 microcontrollers. This driver allows for the configuration of the various clocks within the device to clock the various peripherals.
Usage Example:
Enum for the possible external oscillator startup times.
Enum for the possible external oscillator types.
Enum for the possible module clock sources.
|
inlinestatic |
Sets the clock source for the main microcontroller core. The given clock source should be configured and ready for use before this function is called.
This function will configure the FLASH controller's wait states automatically to suit the given clock source.
[in] | Source | Clock source for the CPU core, a value from UC3_System_ClockSource_t. |
[in] | SourceFreq | Frequency of the CPU core's clock source, in Hz. |
true
if the CPU core clock was successfully altered, false
if invalid parameters specified.
|
inlinestatic |
Starts the given external oscillator of the UC3 microcontroller, with the given options. This routine blocks until the oscillator is ready for use.
[in] | Channel | Index of the external oscillator to start. |
[in] | Type | Type of clock attached to the given oscillator channel, a value from UC3_Extern_OSC_ClockTypes_t. |
[in] | Startup | Startup time of the external oscillator, a value from UC3_Extern_OSC_ClockStartup_t. |
true
if the external oscillator was successfully started, false
if invalid parameters specified.
|
inlinestatic |
Starts the given Generic Clock of the UC3 microcontroller, with the given options.
[in] | Channel | Index of the Generic Clock to start. |
[in] | Source | Clock source for the Generic Clock, a value from UC3_System_ClockSource_t. |
[in] | SourceFreq | Frequency of the Generic Clock's clock source, in Hz. |
[in] | Frequency | Target frequency of the Generic Clock's output. |
true
if the Generic Clock was successfully started, false
if invalid parameters specified.
|
inlinestatic |
Starts the given PLL of the UC3 microcontroller, with the given options. This routine blocks until the PLL is ready for use.
[in] | Channel | Index of the PLL to start. |
[in] | Source | Clock source for the PLL, a value from UC3_System_ClockSource_t. |
[in] | SourceFreq | Frequency of the PLL's clock source, in Hz. |
[in] | Frequency | Target frequency of the PLL's output. |
true
if the PLL was successfully started, false
if invalid parameters specified.
|
inlinestatic |
Stops the given external oscillator of the UC3 microcontroller.
[in] | Channel | Index of the external oscillator to stop. |
|
inlinestatic |
Stops the given generic clock of the UC3 microcontroller.
[in] | Channel | Index of the generic clock to stop. |
true
if the generic clock was successfully stopped, false
if invalid parameters specified.
|
inlinestatic |
Stops the given PLL of the UC3 microcontroller.
[in] | Channel | Index of the PLL to stop. |