3.3kW Totem-pole PFC with CoolMOS and XMC1402
ADC configuration

Files

file  adc.c
 ADC peripheral configuration.
 
file  adc.h
 ADC peripheral configuration header.
 

Functions

void VADC_Init (void)
 Configuration and initialization of the ADC peripheral.
Global, group, channels and results are configured. Queue is configured and initialize. Scan is configured and load event generated. Pointer to the ADC measurements are defined. More...
 

Global ADC configuration

const XMC_VADC_GLOBAL_CONFIG_t g_global_config
 
const XMC_VADC_GLOBAL_SHS_CONFIG_t adc_sh_config
 

Group ADC configuration

const XMC_VADC_GROUP_CONFIG_t g_group_config
 

Channel ADC configuration

const XMC_VADC_CHANNEL_CONFIG_t g1_channel3_config
 
const XMC_VADC_CHANNEL_CONFIG_t g1_channel2_config
 
const XMC_VADC_CHANNEL_CONFIG_t g1_channel7_config
 
const XMC_VADC_CHANNEL_CONFIG_t g1_channel5_config
 

Result ADC configuration

const XMC_VADC_RESULT_CONFIG_t g_result0_handle
 
const XMC_VADC_RESULT_CONFIG_t g_result7_handle
 
const XMC_VADC_RESULT_CONFIG_t g_result15_handle
 
const XMC_VADC_RESULT_CONFIG_t g_result1_handle
 

Queue ADC configuration

const XMC_VADC_QUEUE_CONFIG_t g_queue_config
 
const XMC_VADC_QUEUE_ENTRY_t g_queue_entry1
 
const XMC_VADC_QUEUE_ENTRY_t g_queue_entry2
 

Scan ADC configuration

const XMC_VADC_SCAN_CONFIG_t g_scan_config
 

Detailed Description

Function Documentation

◆ VADC_Init()

void VADC_Init ( void  )

Configuration and initialization of the ADC peripheral.
Global, group, channels and results are configured. Queue is configured and initialize. Scan is configured and load event generated. Pointer to the ADC measurements are defined.

Returns
None

PFC_ADC_concept.png
3300W Bidirectional CCM Totem-pole ADC strategy

Variable Documentation

◆ adc_sh_config

const XMC_VADC_GLOBAL_SHS_CONFIG_t adc_sh_config
Initial value:
=
{
.shs_clock_divider = 0,
.analog_reference_select = 2,
.calibration_order = XMC_VADC_GLOBAL_SHS_CALIBRATION_ORDER_POST_CONV,
}

◆ g1_channel2_config

const XMC_VADC_CHANNEL_CONFIG_t g1_channel2_config
Initial value:
=
{
.input_class = XMC_VADC_CHANNEL_CONV_GROUP_CLASS0,
.result_reg_number = RES15_CH2,
.channel_priority = true,
.alias_channel = XMC_VADC_CHANNEL_ALIAS_DISABLED
}

◆ g1_channel3_config

const XMC_VADC_CHANNEL_CONFIG_t g1_channel3_config
Initial value:
=
{
.input_class = XMC_VADC_CHANNEL_CONV_GROUP_CLASS0,
.result_reg_number = RES0_CH3,
.channel_priority = true,
.alias_channel = XMC_VADC_CHANNEL_ALIAS_DISABLED
}

◆ g1_channel5_config

const XMC_VADC_CHANNEL_CONFIG_t g1_channel5_config
Initial value:
=
{
.input_class = XMC_VADC_CHANNEL_CONV_GROUP_CLASS0,
.result_reg_number = RES1_CH5,
.channel_priority = true,
.alias_channel = XMC_VADC_CHANNEL_ALIAS_DISABLED,
}

◆ g1_channel7_config

const XMC_VADC_CHANNEL_CONFIG_t g1_channel7_config
Initial value:
=
{
.input_class = XMC_VADC_CHANNEL_CONV_GROUP_CLASS0,
.result_reg_number = RES7_CH7,
.channel_priority = true,
.alias_channel = XMC_VADC_CHANNEL_ALIAS_DISABLED,
}

◆ g_global_config

const XMC_VADC_GLOBAL_CONFIG_t g_global_config
Initial value:
=
{
.disable_sleep_mode_control = true,
.module_disable = false,
.class0 =
{
.conversion_mode_standard = XMC_VADC_CONVMODE_12BIT,
.sample_time_std_conv = 0U,
.conversion_mode_emux = XMC_VADC_CONVMODE_12BIT,
.sampling_phase_emux_channel = 0U,
},
.class1 = {
.conversion_mode_standard = XMC_VADC_CONVMODE_12BIT,
.sample_time_std_conv = 0U,
.conversion_mode_emux = XMC_VADC_CONVMODE_12BIT,
.sampling_phase_emux_channel = 0U
},
.clock_config =
{
.analog_clock_divider = 1,
.msb_conversion_clock = 0,
.arbiter_clock_divider = 0
},
}

◆ g_group_config

const XMC_VADC_GROUP_CONFIG_t g_group_config
Initial value:
=
{
.class0 =
{
.conversion_mode_standard = XMC_VADC_CONVMODE_12BIT,
.sample_time_std_conv = 0U,
},
.class1 =
{
.conversion_mode_standard = XMC_VADC_CONVMODE_FASTCOMPARE,
.sample_time_std_conv = 0U
},
}

◆ g_queue_config

const XMC_VADC_QUEUE_CONFIG_t g_queue_config
Initial value:
=
{
.conv_start_mode = XMC_VADC_STARTMODE_CIR,
.req_src_priority = XMC_VADC_GROUP_RS_PRIORITY_3,
.src_specific_result_reg = INDIVIDUAL_RESULT_REGISTERS,
.trigger_signal = XMC_VADC_REQ_TR_I,
.trigger_edge = XMC_VADC_TRIGGER_EDGE_RISING,
.external_trigger = TRIGGER_ENABLE
}
#define INDIVIDUAL_RESULT_REGISTERS
Definition: adc.h:80
#define TRIGGER_ENABLE
Definition: adc.h:83

◆ g_queue_entry1

const XMC_VADC_QUEUE_ENTRY_t g_queue_entry1
Initial value:
=
{
.channel_num = CH7,
.refill_needed = true,
.generate_interrupt = true,
.external_trigger = true
}

◆ g_queue_entry2

const XMC_VADC_QUEUE_ENTRY_t g_queue_entry2
Initial value:
=
{
.channel_num = CH3,
.refill_needed = true,
.generate_interrupt = false,
.external_trigger = false
}

◆ g_result0_handle

const XMC_VADC_RESULT_CONFIG_t g_result0_handle
Initial value:
= {
.post_processing_mode = XMC_VADC_DMM_REDUCTION_MODE,
.data_reduction_control = 0,
.part_of_fifo = 0,
.wait_for_read_mode = (bool) false,
.event_gen_enable = (bool) false
}

◆ g_result15_handle

const XMC_VADC_RESULT_CONFIG_t g_result15_handle
Initial value:
= {
.post_processing_mode = XMC_VADC_DMM_REDUCTION_MODE,
.data_reduction_control = 0,
.part_of_fifo = 0,
.wait_for_read_mode = (bool) false,
.event_gen_enable = (bool) false
}

◆ g_result1_handle

const XMC_VADC_RESULT_CONFIG_t g_result1_handle
Initial value:
= {
.post_processing_mode = XMC_VADC_DMM_REDUCTION_MODE,
.data_reduction_control = 0,
.part_of_fifo = 0,
.wait_for_read_mode = (bool) false,
.event_gen_enable = (bool) false
}

◆ g_result7_handle

const XMC_VADC_RESULT_CONFIG_t g_result7_handle
Initial value:
= {
.post_processing_mode = XMC_VADC_DMM_REDUCTION_MODE,
.data_reduction_control = 0,
.part_of_fifo = 0,
.wait_for_read_mode = (bool) false,
.event_gen_enable = (bool) false
}

◆ g_scan_config

const XMC_VADC_SCAN_CONFIG_t g_scan_config
Initial value:
=
{
.conv_start_mode = XMC_VADC_STARTMODE_WFS,
.req_src_priority = XMC_VADC_GROUP_RS_PRIORITY_1,
.src_specific_result_reg = INDIVIDUAL_RESULT_REGISTERS,
.trigger_signal = XMC_VADC_REQ_TR_J,
.trigger_edge = XMC_VADC_TRIGGER_EDGE_RISING,
.external_trigger = TRIGGER_ENABLE
}
#define INDIVIDUAL_RESULT_REGISTERS
Definition: adc.h:80
#define TRIGGER_ENABLE
Definition: adc.h:83