CLOCK_XMC1
|
CLOCK_XMC1.h
Go to the documentation of this file.
00001 00059 #ifndef CLOCK_XMC1_H 00060 #define CLOCK_XMC1_H 00061 00062 /*********************************************************************************************************************** 00063 * HEADER FILES 00064 **********************************************************************************************************************/ 00065 #include <xmc_scu.h> 00066 #include <DAVE_common.h> 00067 #include "clock_xmc1_conf.h" 00068 #ifdef CLOCK_XMC1_INTERRUPT_ENABLED 00069 #include "../GLOBAL_SCU_XMC1/global_scu_xmc1.h" 00070 #endif 00071 /********************************************************************************************************************** 00072 * MACROS 00073 **********************************************************************************************************************/ 00074 #if (!((XMC_LIB_MAJOR_VERSION == 2U) && \ 00075 (XMC_LIB_MINOR_VERSION >= 0U) && \ 00076 (XMC_LIB_PATCH_VERSION >= 0U))) 00077 #error "CLOCK_XMC1 requires XMC Peripheral Library v2.0.0 or higher" 00078 #endif 00079 00092 /********************************************************************************************************************** 00093 * ENUMS 00094 **********************************************************************************************************************/ 00099 /* 00100 * @brief enumeration for CLOCK_XMC1 APP 00101 */ 00102 typedef enum CLOCK_XMC1_STATUS 00103 { 00104 CLOCK_XMC1_STATUS_SUCCESS = 0U, 00105 CLOCK_XMC1_STATUS_FAILURE = 1U 00106 } CLOCK_XMC1_STATUS_t; 00107 00112 /********************************************************************************************************************** 00113 * DATA STRUCTURES 00114 **********************************************************************************************************************/ 00123 typedef struct CLOCK_XMC1 00124 { 00125 #ifdef CLOCK_XMC1_INTERRUPT_ENABLED 00126 00127 GLOBAL_SCU_XMC1_t *const global_scu_handleptr; 00128 #ifdef CLOCK_XMC1_LOCI_EVENT_ENABLED 00129 void (*callback_function_loci)(void); 00130 #endif 00131 #ifdef CLOCK_XMC1_STDBYCLKFAIL_EVENT_ENABLED 00132 void (*callback_function_stdbyclkfail)(void); 00133 #endif 00134 00135 #if (UC_SERIES == XMC14) 00136 00137 #ifdef CLOCK_XMC1_LOSS_EXT_CLOCK_EVENT_ENABLED 00138 void (*callback_function_loss_ext_clock)(void); 00139 #endif 00140 #ifdef CLOCK_XMC1_DCO1_OUT_SYNC_EVENT_ENABLED 00141 void (*callback_function_dco1_out_sync)(void); 00142 #endif 00143 #endif 00144 00145 #endif 00146 bool init_status; 00147 } CLOCK_XMC1_t; 00148 00153 #ifdef __cplusplus 00154 extern "C" { 00155 #endif 00156 /*********************************************************************************************************************** 00157 * API Prototypes 00158 **********************************************************************************************************************/ 00199 DAVE_APP_VERSION_t CLOCK_XMC1_GetAppVersion(void); 00200 00236 CLOCK_XMC1_STATUS_t CLOCK_XMC1_Init(CLOCK_XMC1_t *handle); 00237 00270 void CLOCK_XMC1_SetMCLKFrequency(uint32_t freq_khz); 00271 00272 #if (CLOCK_XMC1_OSCHP_ENABLED) 00273 00285 uint32_t OSCHP_GetFrequency(void); 00286 #endif 00287 00288 #if (CLOCK_XMC1_DCO1_CALIBRATION_ENABLED) 00289 00337 bool CLOCK_XMC1_IsDCO1ExtRefCalibrationReady(void); 00338 #endif 00339 00343 #ifdef __cplusplus 00344 } 00345 #endif 00346 00347 #include"clock_xmc1_extern.h" 00348 00349 #endif /* End of _CLOCK_XMC1_H_ */