2.15 Clock Generator (CLOCK)

This Plib implements software abstraction for CLOCK Peripheral.

Library Interface

Clock Generator peripheral library provides the following interfaces:

Functions
NameDescription
CLOCK_InitializeInitializes all the modules related to the system clock
SYSCTRL_CallbackRegisterRegister the function to be called when an SYSCTRL interrupt is generated
OSCCTRL_CallbackRegisterRegister the function to be called when an External Oscillator or DPLL event is generated
OSC32KCTRL_CallbackRegisterRegister the function to be called when the 32KHz External Oscillator has failed
MCLK_CallbackRegisterRegister the function to be called when the MCLK is ready
CLK_InitializeInitializes hardware of the System Clock and Peripheral Clock
CLK_TDSCLKSelectXTALSelects 32KHz Crystal Oscillator as Slow Clock (SLCK) source
CLK_EnableMainRCOscillatorEnables main RC oscillator
CLK_DisableMainRCOscillatorDisables main RC oscillator
CLK_EnableMainXTALOscillatorEnables main XTAL oscillator
CLK_DisableMainXTALOscillatorDisables main XTAL oscillator
CLK_MainOscillatorSelectXTALSelects XTAL as main oscillator source
CLK_MainOscillatorSelectRCSelects RC oscillator as main coscillator source
CLK_PLLEnableEnables PLL
CLK_PLLDisableDisbales PLL
CLK_PLLConfigConfigures given PLL parameters
CLK_UPLLInitStartStarts initialization of UPLL Clock
CLK_UPLLInitMiddleControls UPLL Voltage Regulator
CLK_UPLLInitEndEnds initialization of UPLL Clock
CLK_Core0ClkConfigConfigures core 0 clock parameters
CLK_Core1BusMasterClkEnableEnables core 1 master clock
CLK_Core1BusMasterClkDisableDisables core 1 master clock
CLK_Core1ClkConfigConfigures core 1 clock parameters
CLK_Core1ProcessorClkEnableEnables core 1 processor clock
CLK_Core1ProcessorClkDisableDisables core 1 processor clock
CLK_PCKConfigConfigures programmable clock parameters
CLK_PCKOutputEnableEnables PCK output
CLK_PCKOutputDisableDisables PCK output
CLK_PeripheralClockConfigGetReads peripheral clock parameters
CLK_PeripheralClockConfigSetConfigures peripheral clock parameters
CLOCK_GeneratorFrequencyGetReturns clock generator frequency in Hz
CLOCK_FailStatusGetReturns clock generator failure status
CLOCK_MonitorEnable

Enables clock monitor

CLOCK_MonitorDisableDisables clock monitor
CLOCK_MonitorIsReadyChecks if the clock monitor capture data is ready
CLOCK_MonitorAccumulatedCountGet

Returns the accumulated data after the capture

CLOCK_MonitorMonCallbackRegisterOverride default callback and to define custom callback for CLOCK Monitor Saturation event
CLOCK_MonitorWarnCallbackRegisterOverride default callback and to define custom callback for CLOCK Monitor Warning event
CLOCK_MonitorFailCallbackRegisterOverride default callback and to define custom callback for CLOCK Monitor Fail event
CLOCK_MonitorRdyCallbackRegisterOverride default callback and to define custom callback for CLOCK Monitor Data Ready event
CLOCK_CombinedClockFailCallbackRegisterOverride default callback and to define custom callback for CLOCK Combined Clock Fail event

Data types and constants

NameTypeDescription
OSCCTRL_CFD_CALLBACKTypedefDefines the data type and function signature for the External Oscillator callback function
OSC32KCTRL_CFD_CALLBACKTypedefDefines the data type and function signature for the External 32KHz Oscillator clock failure detection callback function
MCLK_CKRDY_CALLBACKTypedefDefines the data type and function signature for the Main Clock Ready callback function
SYSCTRL_CALLBACKTypedefDefines the data type and function signature for the System Control callback function
SYSCTRL_INTERRUPT_MASKEnumSystem Control Interrupt Mask
CLOCK_GENERATOREnumDefines the Clock Generators
CLOCK_FAIL_STATUS_MASKSEnumDefines fail status masks
CLOCK_MONITOREnumDefines Clock Monitors
CLOCK_MonitorMonCallbackTypedefDefines the Clock-Monitor Saturation callback function prototype
CLOCK_MonitorWarnCallbackTypedefDefines the Clock-Monitor Warning callback function prototype
CLOCK_MonitorFailCallbackTypedefDefines the Clock-Monitor Fail callback function prototype
CLOCK_MonitorRdyCallbackTypedefDefines the Clock-Monitor Data Ready callback function prototype
CLOCK_CombinedFailCallbackTypedef

Defines the Clock-Fail callback function prototype

Note: Not all APIs maybe implemented. See the specific device family section for available APIs.