GLOBAL_CCU4: GLOBAL_CCU4.h Source File

GLOBAL_CCU4

GLOBAL_CCU4
GLOBAL_CCU4.h
Go to the documentation of this file.
00001 
00065 #ifndef GLOBAL_CCU4_H
00066 #define GLOBAL_CCU4_H
00067 
00068 /***********************************************************************************************************************
00069  * HEADER FILES
00070  **********************************************************************************************************************/
00071 #include <xmc_ccu4.h>
00072 #include <xmc_scu.h>
00073 #include <DAVE_Common.h>
00074 #include "global_ccu4_conf.h"
00075 
00076 #if (UC_FAMILY == XMC4)
00077 #include "../CLOCK_XMC4/clock_xmc4.h"
00078 
00079 #ifndef CLOCK_XMC4_CCUCLK_ENABLED
00080 #error "Error: GLOBAL_CCU4 APP missing clock settings. Please review CLOCK_XMC4 settings"
00081 #endif
00082 
00083 #endif
00084 
00085 /**********************************************************************************************************************
00086  * MACROS
00087  **********************************************************************************************************************/
00088 #if (!((XMC_LIB_MAJOR_VERSION == 2U) && \
00089        (XMC_LIB_MINOR_VERSION >= 0U) && \
00090        (XMC_LIB_PATCH_VERSION >= 0U)))
00091 #error "GLOBAL_CCU4 requires XMC Peripheral Library v2.0.0 or higher"
00092 #endif
00093 
00094 /**********************************************************************************************************************
00095  * ENUMS
00096  **********************************************************************************************************************/
00104 typedef enum GLOBAL_CCU4_STATUS
00105 {
00106   GLOBAL_CCU4_STATUS_SUCCESS = 0U, 
00107   GLOBAL_CCU4_STATUS_FAILURE 
00108 } GLOBAL_CCU4_STATUS_t;
00112 /***********************************************************************************************************************
00113 * DATA STRUCTURES
00114 ***********************************************************************************************************************/
00115 
00124 typedef struct GLOBAL_CCU4
00125 {
00126   const uint32_t module_frequency; 
00127   const XMC_SCU_CCU_TRIGGER_t syncstart_trigger_msk; 
00128   XMC_CCU4_MODULE_t* const module_ptr;   
00129   XMC_CCU4_SLICE_MCMS_ACTION_t const mcs_action; 
00130   bool  is_initialized; 
00131 } GLOBAL_CCU4_t;
00132 
00136 /***********************************************************************************************************************
00137 * API Prototypes
00138 ***********************************************************************************************************************/
00139 #ifdef __cplusplus
00140 extern "C" {
00141 #endif
00142 
00179 DAVE_APP_VERSION_t GLOBAL_CCU4_GetAppVersion(void);
00180 
00209 GLOBAL_CCU4_STATUS_t GLOBAL_CCU4_Init(GLOBAL_CCU4_t* handle);
00210 
00245 __STATIC_INLINE void GLOBAL_CCU4_SyncStartTriggerHigh(uint32_t ccucon_msk)
00246 {
00247   XMC_SCU_SetCcuTriggerHigh(ccucon_msk);
00248 }
00249 
00284 __STATIC_INLINE void GLOBAL_CCU4_SyncStartTriggerLow(uint32_t ccucon_msk)
00285 {
00286   XMC_SCU_SetCcuTriggerLow(ccucon_msk);
00287 }
00288 
00294 #include "global_ccu4_extern.h"
00295 
00296 #ifdef __cplusplus
00297 }
00298 #endif
00299 
00300 #endif /*CCUGLOBAL_H*/