PFC:800WPSUC7-4pin
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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
 

Group ADC configuration

const XMC_VADC_GROUP_CONFIG_t g_group_config
 

Channel ADC configuration

const XMC_VADC_CHANNEL_CONFIG_t g0_channel4_config
 
const XMC_VADC_CHANNEL_CONFIG_t g0_channel5_config
 
const XMC_VADC_CHANNEL_CONFIG_t g0_channel6_config
 
const XMC_VADC_CHANNEL_CONFIG_t g0_channel7_config
 
const XMC_VADC_CHANNEL_CONFIG_t g0_channel0_alias6_config
 

Result ADC configuration

const XMC_VADC_RESULT_CONFIG_t g_result0_handle
 
const XMC_VADC_RESULT_CONFIG_t g_result1_handle
 
const XMC_VADC_RESULT_CONFIG_t g_result7_handle
 
const XMC_VADC_RESULT_CONFIG_t g_result15_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
 

Background ADC configuration

const XMC_VADC_BACKGROUND_CONFIG_t g_backgnd_config
 

Detailed Description

Function Documentation

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
800W server power supply PFC ADC scheduling
Todo:
: Parallel trigger path counting the ADC result events. Implemented for twice switching frequency change in debugging phase. Path is ready but not used in the current implementation.

Variable Documentation

const XMC_VADC_CHANNEL_CONFIG_t g0_channel0_alias6_config
Initial value:
=
{
.input_class = XMC_VADC_CHANNEL_CONV_GROUP_CLASS1,
.lower_boundary_select = XMC_VADC_CHANNEL_BOUNDARY_GROUP_BOUND0,
.flag_output_condition_ch0 = XMC_VADC_CHANNEL_BOUNDARY_CONDITION_BELOW_BAND,
.boundary_flag_mode_ch0 = XMC_VADC_GROUP_BOUNDARY_FLAG_MODE_ENABLED,
.event_gen_criteria = XMC_VADC_CHANNEL_EVGEN_NEVER,
.result_reg_number = RES6_CH6,
.channel_priority = false,
.alias_channel = XMC_VADC_CHANNEL_ALIAS_CH6
}
Todo:
: Not used!!!!!!! Can be commented/deleted?

G0 Channel6 configuration data, Alias of CH0

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

G0 Channel4 (T) configuration data

const XMC_VADC_CHANNEL_CONFIG_t g0_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
}

G0 Channel5 (V_ac) configuration data

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

G0 Channel6 (iL) configuration data

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

G0 Channel7 (V_bulk) configuration data

const XMC_VADC_BACKGROUND_CONFIG_t g_backgnd_config
Initial value:
=
{
.conv_start_mode = XMC_VADC_STARTMODE_CIR,
.req_src_priority = XMC_VADC_GROUP_RS_PRIORITY_2,
.src_specific_result_reg = INDIVIDUAL_RESULT_REGISTERS,
.external_trigger = TRIGGER_ENABLE,
.trigger_signal = XMC_VADC_REQ_TR_J,
.trigger_edge = XMC_VADC_TRIGGER_EDGE_RISING
}
Todo:
: Not used!!!!!!! Can be commented/deleted?
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
},
}

Initialization data of VADC Global resources

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
},
.boundary0 = DCM_ZERO_UPDELTA,
.boundary1 = DCM_ZERO_LOWDELTA
}

Initialization data of a VADC group

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
}

Queue configuration

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

Queue Entry 1: Inductor current

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

Queue Entry 2: AC input voltage

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
}

Temperature Result configuration data

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
}

Bulk voltage Result configuration data

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
}

AC input voltage Result configuration data

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
}

Inductor current Result configuration data

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
}

Scan configuration