GLOBAL_ADC: GLOBAL_ADC.h Source File

GLOBAL ADC

GLOBAL_ADC
GLOBAL_ADC.h
Go to the documentation of this file.
00001 
00072 #ifndef GLOBAL_ADC_H
00073 #define GLOBAL_ADC_H
00074 
00075 /***********************************************************************************************************************
00076  * HEADER FILES
00077  **********************************************************************************************************************/
00078 #include <xmc_vadc.h>
00079 #include "global_adc_conf.h"
00080 #include <DAVE_common.h>
00081 
00082  /**********************************************************************************************************************
00083  * MACROS
00084  **********************************************************************************************************************/
00085 #if (!((XMC_LIB_MAJOR_VERSION == 2U) && \
00086        (XMC_LIB_MINOR_VERSION >= 0U) && \
00087        (XMC_LIB_PATCH_VERSION >= 0U)))
00088 #error "GLOBAL_ADC requires XMC Peripheral Library v2.0.0 or higher"
00089 #endif
00090  /**********************************************************************************************************************
00091  * ENUMS
00092  **********************************************************************************************************************/
00101 typedef enum GLOBAL_ADC_STATUS
00102 {
00103   GLOBAL_ADC_SUCCESS = 0, 
00104   GLOBAL_ADC_FAILURE,            
00105   GLOBAL_ADC_UNINITIALIZED       
00106 } GLOBAL_ADC_STATUS_t;
00107 
00111 /**********************************************************************************************************************
00112 * DATA STRUCTURES
00113 **********************************************************************************************************************/
00121 #if XMC_VADC_GROUP_AVAILABLE == 1U
00122 typedef struct GLOBAL_ADC_GROUP
00123 {
00124   XMC_VADC_GROUP_t *const group_handle;                                                 
00126   const XMC_VADC_GROUP_CONFIG_t* const group_config_handle; 
00128   const bool post_calibration;                              
00130   GLOBAL_ADC_STATUS_t state;                                                                    
00131 } GLOBAL_ADC_GROUP_t;
00132 #endif
00133 
00136 typedef struct GLOBAL_ADC
00137 {
00138 #if XMC_VADC_GROUP_AVAILABLE == 1U
00139   GLOBAL_ADC_GROUP_t* const group_ptrs_array[XMC_VADC_MAXIMUM_NUM_GROUPS]; 
00140 #endif
00141   const XMC_VADC_GLOBAL_CONFIG_t* const global_config_handle;      
00143   XMC_VADC_GLOBAL_t* const module_ptr; 
00145 #if(XMC_VADC_SHS_AVAILABLE == 1U)
00146   XMC_VADC_GLOBAL_SHS_t* const global_shs_ptr; 
00147 #endif
00148   GLOBAL_ADC_STATUS_t init_state;                
00150   const bool enable_startup_calibration;       
00151 } GLOBAL_ADC_t;
00152 
00162 #ifdef __cplusplus
00163 extern "C" {
00164 #endif
00165 /***********************************************************************************************************************
00166  * API Prototypes
00167  **********************************************************************************************************************/
00168 
00203 DAVE_APP_VERSION_t GLOBAL_ADC_GetAppVersion(void);
00204 
00227 GLOBAL_ADC_STATUS_t GLOBAL_ADC_Init(GLOBAL_ADC_t *const handle_ptr);
00228 
00229 #include "global_adc_extern.h"
00230 
00235 #ifdef __cplusplus
00236 }
00237 #endif
00238   
00239 #endif /* GLOBAL_ADC_H_ */