CLOCK_XMC4
|
CLOCK_XMC4.c
Go to the documentation of this file.
00001 00062 /*********************************************************************************************************************** 00063 * HEADER FILES 00064 **********************************************************************************************************************/ 00065 #include "clock_xmc4.h" 00066 00067 /*********************************************************************************************************************** 00068 * MACROS 00069 **********************************************************************************************************************/ 00070 00071 /*********************************************************************************************************************** 00072 * LOCAL DATA 00073 **********************************************************************************************************************/ 00074 00075 /*********************************************************************************************************************** 00076 * LOCAL ROUTINES 00077 **********************************************************************************************************************/ 00078 00079 /*********************************************************************************************************************** 00080 * API IMPLEMENTATION 00081 ***********************************************************************************************************************/ 00082 /* API to retrieve version of the APP */ 00083 DAVE_APP_VERSION_t CLOCK_XMC4_GetAppVersion(void) 00084 { 00085 DAVE_APP_VERSION_t version; 00086 version.major = (uint8_t)CLOCK_XMC4_MAJOR_VERSION; 00087 version.minor = (uint8_t)CLOCK_XMC4_MINOR_VERSION; 00088 version.patch = (uint8_t)CLOCK_XMC4_PATCH_VERSION; 00089 00090 return (version); 00091 } 00092 00093 /* 00094 * API to initialize the CLOCK_XMC4 APP TRAP events 00095 */ 00096 CLOCK_XMC4_STATUS_t CLOCK_XMC4_Init(CLOCK_XMC4_t *handle) 00097 { 00098 CLOCK_XMC4_STATUS_t status = CLOCK_XMC4_STATUS_SUCCESS; 00099 00100 XMC_ASSERT("CLOCK_XMC4 APP handle function pointer uninitialized", (handle != NULL)); 00101 00102 handle->init_status = true; 00103 00104 return (status); 00105 } 00106 00107 #ifdef CLOCK_XMC4_OSCHP_ENABLED 00108 /* API to retrieve high precision external oscillator frequency */ 00109 uint32_t OSCHP_GetFrequency(void) 00110 { 00111 return (CLOCK_XMC4_OSCHP_FREQUENCY); 00112 } 00113 #endif 00114 00115 /* API for ramping down the system PLL clock frequency */ 00116 void CLOCK_XMC4_StepSystemPllFrequency(uint32_t kdiv) 00117 { 00118 XMC_ASSERT("Incorrect kdiv value", ((kdiv >= 1) && (kdiv >= 128))); 00119 XMC_SCU_CLOCK_StepSystemPllFrequency(kdiv); 00120 }