Docs

You are here:
CLK module

Classes

struct  ClockControllerDesc
 Clock controller descriptor. More...
 

Macros

#define CC_DEFAULT_CLOCK   0
 Identifier of a default system clock (usually main clock of the CPU)
 
#define CC_Init(cc)   (cc)->Init(cc)
 
#define CC_Deinit(cc)   (cc)->Deinit(cc)
 
#define CC_SetClockSource(cc, clk, clk_src, freq)   (cc)->SetClockSource((cc), (clk), (clk_src), (freq))
 
#define CC_GetClockSource(cc, clk)   (cc)->GetClockSource((cc), (clk))
 
#define CC_GetClockSourceFreq(cc, clk)   (cc)->GetClockSourceFreq((cc), (clk))
 
#define CC_SetClockFreq(cc, clk, freq)   (cc)->SetClockFreq((cc), (clk), (freq))
 
#define CC_GetClockFreq(cc, clk)   (cc)->GetClockFrequency((cc), (clk))
 

Typedefs

typedef struct ClockControllerDescClockController
 Clock controller handler.
 

Detailed Description

Introduction.

This module handles clock generation, configuration and distribution through a concept of ClockController.

Macro Definition Documentation

#define CC_Deinit (   cc)    (cc)->Deinit(cc)

Deinitializes the clock controller.

Parameters
cchandle of the clock controller
#define CC_GetClockFreq (   cc,
  clk 
)    (cc)->GetClockFrequency((cc), (clk))

Gets frequency of a given clock

Parameters
cchandle of the clock controller
clkclock (CORE_DEFAULT_CLOCK for default clock)
Returns
frequency of the clock (0 means that the clock is not enabled or not available)
#define CC_GetClockSource (   cc,
  clk 
)    (cc)->GetClockSource((cc), (clk))

Gets the clock source that is currently used for a given clock

Parameters
cchandle of the clock controller
clkclock (CORE_DEFAULT_CLOCK for default clock)
Returns
currently used clock source number
#define CC_GetClockSourceFreq (   cc,
  clk 
)    (cc)->GetClockSourceFreq((cc), (clk))

Gets the frequency of the clock source, that is currently used for a given clock

Parameters
cchandle of the clock controller
clkclock (CORE_DEFAULT_CLOCK for default clock)
Returns
clock source frequency (0 means that the clock is not enabled or not available)
#define CC_Init (   cc)    (cc)->Init(cc)

Initializes the clock controller.

Parameters
cchandle of the clock controller
#define CC_SetClockFreq (   cc,
  clk,
  freq 
)    (cc)->SetClockFreq((cc), (clk), (freq))

Sets frequency of a given clock

Parameters
cchandle of the clock controller
clkclock to set (CORE_DEFAULT_CLOCK for default clock)
freqfrequency that we want to set (depending on the port capabilities, value of 0 may switch off the clock)
Returns
HALRESULT_OK if the operation was successful, HALRESULT_ERROR otherwise
#define CC_SetClockSource (   cc,
  clk,
  clk_src,
  freq 
)    (cc)->SetClockSource((cc), (clk), (clk_src), (freq))

Sets a clock source for a given clock

Parameters
cchandle of the clock controller
clkclock (CORE_DEFAULT_CLOCK for default clock)
clk_srcclock source
freqfrequency of the clock source (in ex. XTAL frequency) or 0 if default frequency should be used
Returns
HALRESULT_OK if the operation was successful, HALRESULT_ERROR otherwise
Go to Top