|  | Dual Active Bridge Development Board (Part-No. ) |
Content |  |  |  |  |  |

Loading...
Searching...
No Matches
drv_custom_config_adc.h
Go to the documentation of this file.
1
8#ifndef DRV_CUSTOM_CONFIG_ADC_H
9#define DRV_CUSTOM_CONFIG_ADC_H
10
11
12#include "adc/adc1.h"
13#include "drv_mcc_extension_adc.h"
14
15
19// ADC channels numbers for shared ADC
20#define ADC_CHANNEL_VSEC (2)
21#define ADC_CHANNEL_IPRI_CT (7)
22#define ADC_CHANNEL_VPRI (10)
23#define ADC_CHANNEL_TEMP (14)
24#define ADC_CHANNEL_VRAIL_5V (19)
25
26// ADC channel numbers for dedicated ADC
27#define ADC_CHANNEL_ISEC_CT (0)
28#define ADC_CHANNEL_ISEC_AVG (1)
// end of group ~~~~~~~~~~~~~~~~~~~~
30
31
39 static __inline__ void DRV_Config_Custom_ADC(void)
40{
41
42 // use ADC filter 1 for primary voltage averaging
43 ADC_Filter_Mode(0, ADC_FILTER_MODE_AVERAGING);
44 ADC_Filter_Averaging(0, ADC_FILTER_OVRSAM_AVG_4x);
45 ADC_Filter_Input(0, ADC_CHANNEL_VPRI);
46 ADC_Filter_Enable(0, true);
47
48 // use ADC filter 1 for secondary voltage averaging
49 ADC_Filter_Mode(1, ADC_FILTER_MODE_AVERAGING);
50 ADC_Filter_Averaging(1, ADC_FILTER_OVRSAM_AVG_4x);
51 ADC_Filter_Input(1, ADC_CHANNEL_VSEC);
52 ADC_Filter_Enable(1, true);
53
54}
55
56
57#endif /* DRV_CUSTOM_CONFIG_ADC_H */
58
adc1.h
This is the generated driver header file for the ADC1 driver.
drv_mcc_extension_adc.h
Contains public functions and defines for the MCC code extension for ADC.
ADC_Filter_Input
static void ADC_Filter_Input(uint16_t filterIndex, uint16_t channelIndex)
Sets the ADC instance to be filtered.
Definition drv_mcc_extension_adc.h:146
ADC_CHANNEL_VSEC
#define ADC_CHANNEL_VSEC
ADC2 is routed to Secondary Voltage.
Definition drv_custom_config_adc.h:20
ADC_Filter_Mode
static void ADC_Filter_Mode(uint16_t filterIndex, ADC_FILTER_MODE_t mode)
Sets the ADC instance filter mode.
Definition drv_mcc_extension_adc.h:85
ADC_Filter_Enable
static void ADC_Filter_Enable(uint16_t filterIndex, bool enable)
Enables the ADC filter feature of the ADC.
Definition drv_mcc_extension_adc.h:54
ADC_Filter_Averaging
static void ADC_Filter_Averaging(uint16_t filterIndex, ADC_FILTER_OVRSAM_AVG_t averagingRatio)
Sets the ADC instance number of samples to average.
Definition drv_mcc_extension_adc.h:116
DRV_Config_Custom_ADC
static __inline__ void DRV_Config_Custom_ADC(void)
Customize configuration for ADC.
Definition drv_custom_config_adc.h:39
ADC_CHANNEL_VPRI
#define ADC_CHANNEL_VPRI
ADC10 is routed to Primary Voltage.
Definition drv_custom_config_adc.h:22
ADC_FILTER_MODE_AVERAGING
@ ADC_FILTER_MODE_AVERAGING
Definition drv_mcc_extension_adc.h:23
ADC_FILTER_OVRSAM_AVG_4x
@ ADC_FILTER_OVRSAM_AVG_4x
Definition drv_mcc_extension_adc.h:35