Skip to main content

Clk Lib API

danger

this is a legacy library and thus not supported by Toradex anymore. We recommend that you use the new libraries for all Toradex modules. Please see the Toradex CE Libraries and Code Samples for up-to-date information.


Library to manange clock settings. More...

Macros

##define CLKLIB_VERSION_MAJOR   3 Version Info. More...
 #define CLKLIB_VERSION_MINOR   3 #define CLKLIB_VERSION_BUILD   0 #define USE_DEFAULT_CLOCK_SOURCE   255 #define USE_DEFAULT_CLOCK_DIVIDER   4294967295 

Enumerations

Tegra T20 defines
enum  tClockOptimise ClockOptimiseForPrecision
 

Functions

void ClkLibGetLibVersion (DWORD *VersionMajor, DWORD *VersionMinor, DWORD *Build)
 
void ClkLibInit (void)
 Initialises the library, call before calling any other functions. More...
 
void ClkLibDeInit (void)
 Releases the library resources, call when finsihed with the library. More...
 
BOOL ClkLibSetClock (DWORD clockID, BOOL status)
 
BOOL ClkLibSetClockEx (DWORD clockID, BOOL status, DWORD ClockDivider)
 
DWORD ClkLibSetClockFrequency (DWORD clockID, DWORD minimumFrequency, DWORD maximumFrequency, tClockOptimise optimiseTarget)
 
BOOL ClkLibGetClockEnableStatus (DWORD clockID)
 
DWORD ClkLibGetClockFrequency (DWORD clockID)
 
void ClkLibWaitus (UINT32 uSec)
 
Deprecated legacy declarations
void InitClkLib (void)
 
void DeInitClkLib (void)
 
BOOL SetClk (DWORD clkID, BOOL value)
 
BOOL SetClkEx (DWORD clkID, BOOL value, DWORD ClkDivider)
 
BOOL GetClkEn (DWORD clkID)
 
void Waitus (UINT32 uSec)
 
void CLKGetLibVersion (DWORD *pVerMaj, DWORD *pVerMin, DWORD *pBuild)
 

Detailed Description

Library to manange clock settings.
Author:
kia
Rev:
2101
Date:
2014-03-10 14:27:38 +0100 (Mo, 10 Mrz 2014)
Target Platforms:
PXAxxx / T20 / T30

Macro Definition Documentation

#define CLKLIB_VERSION_BUILD   0
 
#define CLKLIB_VERSION_MAJOR   3
Version Info.
#define CLKLIB_VERSION_MINOR   3
 
#define USE_DEFAULT_CLOCK_DIVIDER   4294967295
 
#define USE_DEFAULT_CLOCK_SOURCE   255
 

Enumeration Type Documentation

Enumerator
ClockOptimiseForPower Optimise clock source selection for lowest power consumption.
ClockOptimiseForPrecision Optimise clock source selection to be the closest frequency.

Function Documentation

void CLKGetLibVersion(DWORD * pVerMaj,
  DWORD * pVerMin,
  DWORD * pBuild 
 )  
Returns the library Version.
Deprecated:
Please use ClkLibGetLibVersion()
Parameters
[out]pVerMajReturns the major version number. Set this parameter to NULL if not required.
[out]pVerMinReturns the minor version number. Set this parameter to NULL if not required.
[out]pBuildReturns the build number. Set this parameter to NULL if not required.
void ClkLibDeInit(void  ) 
Releases the library resources, call when finsihed with the library.
BOOL ClkLibGetClockEnableStatus(DWORD clockID) 
Returns the clock enable status for a specific peripheral
Parameters
[in]clockIDClock ID (refer to ClkLib.h)
Return values
TRUE,:Success, FALSE: Error
DWORD ClkLibGetClockFrequency(DWORD clockID) 
Gets the current frequency of the given clock. Tegra 2 Only
Parameters
[in]clockIDClock ID (refer to ClkLib.h)
Return values
ActualFrequency configured, 0 = function failed
void ClkLibGetLibVersion(DWORD * VersionMajor,
  DWORD * VersionMinor,
  DWORD * Build 
 )  
Returns the library version.
Parameters
[out]VersionMajorReturns the major version number. Set this parameter to NULL if not required.
[out]VersionMinorReturns the minor version number. Set this parameter to NULL if not required.
[out]BuildReturns the build number. Set this parameter to NULL if not required.
void ClkLibInit(void  ) 
Initialises the library, call before calling any other functions.
BOOL ClkLibSetClock(DWORD clockID,
  BOOL status 
 )  
Enables or disables the clock for a specific peripheral.
Parameters
[in]clockIDClock ID (refer to ClkLib.h)
[in]statusTRUE: Enable clock, FALSE: Disable clock
Return values
TRUE,:Success, FALSE: Error
BOOL ClkLibSetClockEx(DWORD clockID,
  BOOL status,
  DWORD ClockDivider 
 )  
Enables / disables clock for a specific peripheral - extended version.
Parameters
[in]clockIDClock ID (refer to ClkLib.h)
[in]statusTRUE for enable clock, FALSE for disable clock
[in]clockDividerClock Divisor, set to USE_DEFAULT_CLOCK_DIVIDER to use default (Tegra only)
Return values
TRUE,:Success, FALSE: Error
DWORD ClkLibSetClockFrequency(DWORD clockID,
  DWORD minimumFrequency,
  DWORD maximumFrequency,
  tClockOptimise optimiseTarget 
 )  
Sets the Clock Speed as close as possible to the provided frequency. Tegra 2 Only
Parameters
[in]clockIDClock ID (refer to ClkLib.h)
[in]minimumFrequencyLowest allowed frequency [Hz]
[in]maximumFrequencyHighest allowed frequency [Hz]
[in]optimiseTargetClkOptimiseForPower = select the slowest clock source which can be used to generate a frequency in the requested range
ClkOptimizeForPrecision = select the clock source which can generate a clock as close as possible to the average of minimumFrequency and maximumFrequency
Return values
ActualFrequency configured, 0 = function failed
void ClkLibWaitus(UINT32 uSec) 
Delay with microsecond resolution.
Parameters
[in]uSecNumber of microseconds.
void DeInitClkLib(void  ) 
Releases the library resources, call when finsihed with the library
Deprecated:
Please use ClkLibDeInit()
BOOL GetClkEn(DWORD clkID) 
Request clock enable status for a specific peripheral
Deprecated:
Please use ClkLibGetClockEnableStatus()
Parameters
[in]clkIDClock ID (refer to ClkLib.h)
Return values
TRUE,:Success, FALSE: Error
void InitClkLib(void  ) 
Initialises the library, call before calling any other functions
Deprecated:
Please use ClkLibInit()
BOOL SetClk(DWORD clkID,
  BOOL value 
 )  
Enables / disables clock for a specific peripheral.
Deprecated:
Please use ClkLibSetClock()
Parameters
[in]clkIDClock ID (refer to ClkLib.h)
[in]valueTRUE: Enable clock, FALSE: Disable clock
Return values
TRUE,:Success, FALSE: Error
BOOL SetClkEx(DWORD clkID,
  BOOL value,
  DWORD ClkDivider 
 )  
Enables / disables clock for a specific peripheral - extended version.
Deprecated:
Please use ClkLibSetClockEx()
Parameters
[in]clkIDClock ID (refer to ClkLib.h)
[in]valueTRUE for enable clock, FALSE for disable clock
[in]ClkDividerClock Divisor, set to USE_DEFAULT_CLOCK_DIVIDER to use default (Tegra only)
Return values
TRUE,:Success, FALSE: Error
void Waitus(UINT32 uSec) 
Delay with microsecond resolution.
Deprecated:
Please use ClkLibWaitus()
Parameters
[in]uSecNumber of microseconds.


Send Feedback!