clock.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00027 #ifndef CLOCK_H_
00028 #define CLOCK_H_
00029
00030 #include "SFBTypes.h"
00031
00032 #ifdef __cplusplus
00033 extern "C"{
00034 #endif
00035
00036 enum ClockSpeedCode {
00037 CSC_UNSET = 0,
00038 CSC_12MHZ = 1,
00039 CSC_24MHZ = 2,
00040 CSC_36MHZ = 3,
00041 CSC_48MHZ = 4,
00042 CSC_60MHZ = 5,
00043 CSC_72MHZ = 6,
00045 CSC_MAX = 7,
00046
00047 CSC_MIN_MHZ = CSC_12MHZ,
00048 CSC_MAX_MHZ = CSC_72MHZ,
00050 CSC_AUTO = 8
00051 };
00052
00055 typedef struct clockConfiguration {
00056 u8 pllMulM;
00057 u8 pllDivN;
00058 u8 clkDiv;
00059 u8 mamtim;
00060 u8 pclkDiv;
00061 u8 pclkMHz;
00062 } ClockConfiguration;
00063
00066 extern const ClockConfiguration * getCurrentClockConfiguration() ;
00067
00070 extern const ClockConfiguration * getClockConfigurationForCode(u32 code) ;
00071
00073 extern u32 getCCLK() ;
00074
00076 extern u8 getCCLKCode() ;
00077
00079 extern void setClockSpeed(u32 code) ;
00080
00082 typedef void (*ClockSpeedChangeCallback)(u32 newClockSpeed);
00083
00099 extern ClockSpeedChangeCallback setClockSpeedChangeCallback(ClockSpeedChangeCallback callback) ;
00100
00101 #ifdef __cplusplus
00102 }
00103 #endif
00104
00105 #endif