diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..1fdf999
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "Arduino-FOC"]
+ path = Arduino-FOC
+ url = https://github.com/simplefoc/Arduino-FOC.git
diff --git a/2_Motor_Master/2_Motor_Master.atzip b/2_Motor_Master/2_Motor_Master.atzip
new file mode 100644
index 0000000..73072a2
Binary files /dev/null and b/2_Motor_Master/2_Motor_Master.atzip differ
diff --git a/2_Motor_Master/2_motor_master.atstart b/2_Motor_Master/2_motor_master.atstart
new file mode 100644
index 0000000..3303177
--- /dev/null
+++ b/2_Motor_Master/2_motor_master.atstart
@@ -0,0 +1,2431 @@
+format_version: '2'
+name: My Project
+versions:
+ api: '1.0'
+ backend: 1.8.580
+ commit: f3d8d96e294de8dee688333bbbe8d8458a4f6b4c
+ content: unknown
+ content_pack_name: unknown
+ format: '2'
+ frontend: 1.8.580
+ packs_version_avr8: 1.0.1463
+ packs_version_qtouch: unknown
+ packs_version_sam: 1.0.1726
+ version_backend: 1.8.580
+ version_frontend: ''
+board:
+ identifier: CustomBoard
+ device: SAME51J19A-MF
+details: null
+application: null
+middlewares: {}
+drivers:
+ ADC_0:
+ user_label: ADC_0
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::ADC0::driver_config_definition::ADC::HAL:Driver:ADC.Sync
+ functionality: ADC
+ api: HAL:Driver:ADC_Sync
+ configuration:
+ adc_advanced_settings: false
+ adc_arch_adjres: 0
+ adc_arch_corren: false
+ adc_arch_dbgrun: false
+ adc_arch_event_settings: false
+ adc_arch_flushei: false
+ adc_arch_flushinv: false
+ adc_arch_gaincorr: 0
+ adc_arch_leftadj: false
+ adc_arch_offcomp: false
+ adc_arch_offsetcorr: 0
+ adc_arch_ondemand: false
+ adc_arch_refcomp: false
+ adc_arch_resrdyeo: false
+ adc_arch_runstdby: false
+ adc_arch_samplen: 0
+ adc_arch_samplenum: 1 sample
+ adc_arch_seqen: 0
+ adc_arch_startei: false
+ adc_arch_startinv: false
+ adc_arch_winlt: 0
+ adc_arch_winmode: No window mode
+ adc_arch_winmoneo: false
+ adc_arch_winut: 0
+ adc_differential_mode: true
+ adc_freerunning_mode: false
+ adc_pinmux_negative: ADC AIN2 pin
+ adc_pinmux_positive: ADC AIN0 pin
+ adc_prescaler: Peripheral clock divided by 2
+ adc_reference: External reference A
+ adc_resolution: 12-bit
+ optional_signals:
+ - identifier: ADC_0:AIN/0
+ pad: PA02
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::ADC0.AIN.0
+ name: ADC0/AIN/0
+ label: AIN/0
+ - identifier: ADC_0:AIN/3
+ pad: PB09
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::ADC0.AIN.3
+ name: ADC0/AIN/3
+ label: AIN/3
+ variant: null
+ clocks:
+ domain_group:
+ nodes:
+ - name: ADC
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ configuration:
+ adc_gclk_selection: Generic clock generator 0
+ ADC_1:
+ user_label: ADC_1
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::ADC1::driver_config_definition::ADC::HAL:Driver:ADC.Sync
+ functionality: ADC
+ api: HAL:Driver:ADC_Sync
+ configuration:
+ adc_advanced_settings: false
+ adc_arch_adjres: 0
+ adc_arch_corren: false
+ adc_arch_dbgrun: false
+ adc_arch_event_settings: false
+ adc_arch_flushei: false
+ adc_arch_flushinv: false
+ adc_arch_gaincorr: 0
+ adc_arch_leftadj: false
+ adc_arch_offcomp: false
+ adc_arch_offsetcorr: 0
+ adc_arch_ondemand: false
+ adc_arch_refcomp: false
+ adc_arch_resrdyeo: false
+ adc_arch_runstdby: false
+ adc_arch_samplen: 0
+ adc_arch_samplenum: 1 sample
+ adc_arch_seqen: 0
+ adc_arch_startei: false
+ adc_arch_startinv: false
+ adc_arch_winlt: 0
+ adc_arch_winmode: No window mode
+ adc_arch_winmoneo: false
+ adc_arch_winut: 0
+ adc_differential_mode: true
+ adc_freerunning_mode: false
+ adc_pinmux_negative: ADC AIN0 pin
+ adc_pinmux_positive: ADC AIN1 pin
+ adc_prescaler: Peripheral clock divided by 2
+ adc_reference: External reference A
+ adc_resolution: 12-bit
+ optional_signals:
+ - identifier: ADC_1:AIN/6
+ pad: PB04
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::ADC1.AIN.6
+ name: ADC1/AIN/6
+ label: AIN/6
+ - identifier: ADC_1:AIN/7
+ pad: PB05
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::ADC1.AIN.7
+ name: ADC1/AIN/7
+ label: AIN/7
+ - identifier: ADC_1:AIN/8
+ pad: PB06
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::ADC1.AIN.8
+ name: ADC1/AIN/8
+ label: AIN/8
+ - identifier: ADC_1:AIN/9
+ pad: PB07
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::ADC1.AIN.9
+ name: ADC1/AIN/9
+ label: AIN/9
+ variant: null
+ clocks:
+ domain_group:
+ nodes:
+ - name: ADC
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ configuration:
+ adc_gclk_selection: Generic clock generator 0
+ DIGITAL_GLUE_LOGIC_0:
+ user_label: DIGITAL_GLUE_LOGIC_0
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::CCL::driver_config_definition::CCL::HAL:Driver:CCL
+ functionality: Digital_Glue_Logic
+ api: HAL:Driver:CCL
+ configuration:
+ ccl_arch_advanced_settings: false
+ ccl_arch_edgesel_0: false
+ ccl_arch_edgesel_1: false
+ ccl_arch_edgesel_2: false
+ ccl_arch_edgesel_3: false
+ ccl_arch_filtsel_0: Disabled
+ ccl_arch_filtsel_1: Disabled
+ ccl_arch_filtsel_2: Disabled
+ ccl_arch_filtsel_3: Disabled
+ ccl_arch_insel0_0: IO pin input source
+ ccl_arch_insel0_1: IO pin input source
+ ccl_arch_insel0_2: IO pin input source
+ ccl_arch_insel0_3: IO pin input source
+ ccl_arch_insel1_0: IO pin input source
+ ccl_arch_insel1_1: IO pin input source
+ ccl_arch_insel1_2: IO pin input source
+ ccl_arch_insel1_3: IO pin input source
+ ccl_arch_insel2_0: IO pin input source
+ ccl_arch_insel2_1: IO pin input source
+ ccl_arch_insel2_2: IO pin input source
+ ccl_arch_insel2_3: IO pin input source
+ ccl_arch_invei_0: false
+ ccl_arch_invei_1: false
+ ccl_arch_invei_2: false
+ ccl_arch_invei_3: false
+ ccl_arch_lutctrl0: false
+ ccl_arch_lutctrl1: false
+ ccl_arch_lutctrl2: false
+ ccl_arch_lutctrl3: false
+ ccl_arch_lutei_0: false
+ ccl_arch_lutei_1: false
+ ccl_arch_lutei_2: false
+ ccl_arch_lutei_3: false
+ ccl_arch_luteo_0: false
+ ccl_arch_luteo_1: false
+ ccl_arch_luteo_2: false
+ ccl_arch_luteo_3: false
+ ccl_arch_runstdby: false
+ ccl_arch_seqsel_0: Sequential logic is disabled
+ ccl_arch_seqsel_1: Sequential logic is disabled
+ ccl_arch_truth_0: 0
+ ccl_arch_truth_1: 0
+ ccl_arch_truth_2: 0
+ ccl_arch_truth_3: 0
+ ccl_e_persistance_0: ''
+ ccl_e_persistance_1: ''
+ ccl_e_persistance_2: ''
+ ccl_e_persistance_3: ''
+ ccl_l_persistance_0: ''
+ ccl_l_persistance_1: ''
+ ccl_l_persistance_2: ''
+ ccl_l_persistance_3: ''
+ optional_signals:
+ - identifier: DIGITAL_GLUE_LOGIC_0:IN/0
+ pad: PA04
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::CCL.IN.0
+ name: CCL/IN/0
+ label: IN/0
+ - identifier: DIGITAL_GLUE_LOGIC_0:IN/1
+ pad: PA05
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::CCL.IN.1
+ name: CCL/IN/1
+ label: IN/1
+ - identifier: DIGITAL_GLUE_LOGIC_0:IN/2
+ pad: PA06
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::CCL.IN.2
+ name: CCL/IN/2
+ label: IN/2
+ - identifier: DIGITAL_GLUE_LOGIC_0:IN/6
+ pad: PA22
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::CCL.IN.6
+ name: CCL/IN/6
+ label: IN/6
+ - identifier: DIGITAL_GLUE_LOGIC_0:IN/7
+ pad: PA23
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::CCL.IN.7
+ name: CCL/IN/7
+ label: IN/7
+ - identifier: DIGITAL_GLUE_LOGIC_0:IN/8
+ pad: PA24
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::CCL.IN.8
+ name: CCL/IN/8
+ label: IN/8
+ variant: null
+ clocks:
+ domain_group:
+ nodes:
+ - name: CCL
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ configuration:
+ ccl_gclk_selection: Generic clock generator 0
+ CMCC:
+ user_label: CMCC
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::CMCC::driver_config_definition::CMCC::HAL:HPL:CMCC
+ functionality: System
+ api: HAL:HPL:CMCC
+ configuration:
+ cache_size: 4 KB
+ cmcc_advanced_configuration: false
+ cmcc_clock_gating_disable: false
+ cmcc_data_cache_disable: false
+ cmcc_enable: false
+ cmcc_inst_cache_disable: false
+ optional_signals: []
+ variant: null
+ clocks:
+ domain_group: null
+ DMAC:
+ user_label: DMAC
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::DMAC::driver_config_definition::DMAC::HAL:HPL:DMAC
+ functionality: System
+ api: HAL:HPL:DMAC
+ configuration:
+ dmac_beatsize_0: 8-bit bus transfer
+ dmac_beatsize_1: 8-bit bus transfer
+ dmac_beatsize_10: 8-bit bus transfer
+ dmac_beatsize_11: 8-bit bus transfer
+ dmac_beatsize_12: 8-bit bus transfer
+ dmac_beatsize_13: 8-bit bus transfer
+ dmac_beatsize_14: 8-bit bus transfer
+ dmac_beatsize_15: 8-bit bus transfer
+ dmac_beatsize_16: 8-bit bus transfer
+ dmac_beatsize_17: 8-bit bus transfer
+ dmac_beatsize_18: 8-bit bus transfer
+ dmac_beatsize_19: 8-bit bus transfer
+ dmac_beatsize_2: 8-bit bus transfer
+ dmac_beatsize_20: 8-bit bus transfer
+ dmac_beatsize_21: 8-bit bus transfer
+ dmac_beatsize_22: 8-bit bus transfer
+ dmac_beatsize_23: 8-bit bus transfer
+ dmac_beatsize_24: 8-bit bus transfer
+ dmac_beatsize_25: 8-bit bus transfer
+ dmac_beatsize_26: 8-bit bus transfer
+ dmac_beatsize_27: 8-bit bus transfer
+ dmac_beatsize_28: 8-bit bus transfer
+ dmac_beatsize_29: 8-bit bus transfer
+ dmac_beatsize_3: 8-bit bus transfer
+ dmac_beatsize_30: 8-bit bus transfer
+ dmac_beatsize_31: 8-bit bus transfer
+ dmac_beatsize_4: 8-bit bus transfer
+ dmac_beatsize_5: 8-bit bus transfer
+ dmac_beatsize_6: 8-bit bus transfer
+ dmac_beatsize_7: 8-bit bus transfer
+ dmac_beatsize_8: 8-bit bus transfer
+ dmac_beatsize_9: 8-bit bus transfer
+ dmac_blockact_0: Channel will be disabled if it is the last block transfer in
+ the transaction
+ dmac_blockact_1: Channel will be disabled if it is the last block transfer in
+ the transaction
+ dmac_blockact_10: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_11: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_12: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_13: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_14: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_15: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_16: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_17: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_18: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_19: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_2: Channel will be disabled if it is the last block transfer in
+ the transaction
+ dmac_blockact_20: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_21: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_22: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_23: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_24: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_25: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_26: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_27: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_28: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_29: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_3: Channel will be disabled if it is the last block transfer in
+ the transaction
+ dmac_blockact_30: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_31: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_4: Channel will be disabled if it is the last block transfer in
+ the transaction
+ dmac_blockact_5: Channel will be disabled if it is the last block transfer in
+ the transaction
+ dmac_blockact_6: Channel will be disabled if it is the last block transfer in
+ the transaction
+ dmac_blockact_7: Channel will be disabled if it is the last block transfer in
+ the transaction
+ dmac_blockact_8: Channel will be disabled if it is the last block transfer in
+ the transaction
+ dmac_blockact_9: Channel will be disabled if it is the last block transfer in
+ the transaction
+ dmac_channel_0_settings: false
+ dmac_channel_10_settings: false
+ dmac_channel_11_settings: false
+ dmac_channel_12_settings: false
+ dmac_channel_13_settings: false
+ dmac_channel_14_settings: false
+ dmac_channel_15_settings: false
+ dmac_channel_16_settings: false
+ dmac_channel_17_settings: false
+ dmac_channel_18_settings: false
+ dmac_channel_19_settings: false
+ dmac_channel_1_settings: false
+ dmac_channel_20_settings: false
+ dmac_channel_21_settings: false
+ dmac_channel_22_settings: false
+ dmac_channel_23_settings: false
+ dmac_channel_24_settings: false
+ dmac_channel_25_settings: false
+ dmac_channel_26_settings: false
+ dmac_channel_27_settings: false
+ dmac_channel_28_settings: false
+ dmac_channel_29_settings: false
+ dmac_channel_2_settings: false
+ dmac_channel_30_settings: false
+ dmac_channel_31_settings: false
+ dmac_channel_3_settings: false
+ dmac_channel_4_settings: false
+ dmac_channel_5_settings: false
+ dmac_channel_6_settings: false
+ dmac_channel_7_settings: false
+ dmac_channel_8_settings: false
+ dmac_channel_9_settings: false
+ dmac_dbgrun: false
+ dmac_dstinc_0: false
+ dmac_dstinc_1: false
+ dmac_dstinc_10: false
+ dmac_dstinc_11: false
+ dmac_dstinc_12: false
+ dmac_dstinc_13: false
+ dmac_dstinc_14: false
+ dmac_dstinc_15: false
+ dmac_dstinc_16: false
+ dmac_dstinc_17: false
+ dmac_dstinc_18: false
+ dmac_dstinc_19: false
+ dmac_dstinc_2: false
+ dmac_dstinc_20: false
+ dmac_dstinc_21: false
+ dmac_dstinc_22: false
+ dmac_dstinc_23: false
+ dmac_dstinc_24: false
+ dmac_dstinc_25: false
+ dmac_dstinc_26: false
+ dmac_dstinc_27: false
+ dmac_dstinc_28: false
+ dmac_dstinc_29: false
+ dmac_dstinc_3: false
+ dmac_dstinc_30: false
+ dmac_dstinc_31: false
+ dmac_dstinc_4: false
+ dmac_dstinc_5: false
+ dmac_dstinc_6: false
+ dmac_dstinc_7: false
+ dmac_dstinc_8: false
+ dmac_dstinc_9: false
+ dmac_enable: false
+ dmac_evact_0: No action
+ dmac_evact_1: No action
+ dmac_evact_10: No action
+ dmac_evact_11: No action
+ dmac_evact_12: No action
+ dmac_evact_13: No action
+ dmac_evact_14: No action
+ dmac_evact_15: No action
+ dmac_evact_16: No action
+ dmac_evact_17: No action
+ dmac_evact_18: No action
+ dmac_evact_19: No action
+ dmac_evact_2: No action
+ dmac_evact_20: No action
+ dmac_evact_21: No action
+ dmac_evact_22: No action
+ dmac_evact_23: No action
+ dmac_evact_24: No action
+ dmac_evact_25: No action
+ dmac_evact_26: No action
+ dmac_evact_27: No action
+ dmac_evact_28: No action
+ dmac_evact_29: No action
+ dmac_evact_3: No action
+ dmac_evact_30: No action
+ dmac_evact_31: No action
+ dmac_evact_4: No action
+ dmac_evact_5: No action
+ dmac_evact_6: No action
+ dmac_evact_7: No action
+ dmac_evact_8: No action
+ dmac_evact_9: No action
+ dmac_evie_0: false
+ dmac_evie_1: false
+ dmac_evie_10: false
+ dmac_evie_11: false
+ dmac_evie_12: false
+ dmac_evie_13: false
+ dmac_evie_14: false
+ dmac_evie_15: false
+ dmac_evie_16: false
+ dmac_evie_17: false
+ dmac_evie_18: false
+ dmac_evie_19: false
+ dmac_evie_2: false
+ dmac_evie_20: false
+ dmac_evie_21: false
+ dmac_evie_22: false
+ dmac_evie_23: false
+ dmac_evie_24: false
+ dmac_evie_25: false
+ dmac_evie_26: false
+ dmac_evie_27: false
+ dmac_evie_28: false
+ dmac_evie_29: false
+ dmac_evie_3: false
+ dmac_evie_30: false
+ dmac_evie_31: false
+ dmac_evie_4: false
+ dmac_evie_5: false
+ dmac_evie_6: false
+ dmac_evie_7: false
+ dmac_evie_8: false
+ dmac_evie_9: false
+ dmac_evoe_0: false
+ dmac_evoe_1: false
+ dmac_evoe_10: false
+ dmac_evoe_11: false
+ dmac_evoe_12: false
+ dmac_evoe_13: false
+ dmac_evoe_14: false
+ dmac_evoe_15: false
+ dmac_evoe_16: false
+ dmac_evoe_17: false
+ dmac_evoe_18: false
+ dmac_evoe_19: false
+ dmac_evoe_2: false
+ dmac_evoe_20: false
+ dmac_evoe_21: false
+ dmac_evoe_22: false
+ dmac_evoe_23: false
+ dmac_evoe_24: false
+ dmac_evoe_25: false
+ dmac_evoe_26: false
+ dmac_evoe_27: false
+ dmac_evoe_28: false
+ dmac_evoe_29: false
+ dmac_evoe_3: false
+ dmac_evoe_30: false
+ dmac_evoe_31: false
+ dmac_evoe_4: false
+ dmac_evoe_5: false
+ dmac_evoe_6: false
+ dmac_evoe_7: false
+ dmac_evoe_8: false
+ dmac_evoe_9: false
+ dmac_evosel_0: Event generation disabled
+ dmac_evosel_1: Event generation disabled
+ dmac_evosel_10: Event generation disabled
+ dmac_evosel_11: Event generation disabled
+ dmac_evosel_12: Event generation disabled
+ dmac_evosel_13: Event generation disabled
+ dmac_evosel_14: Event generation disabled
+ dmac_evosel_15: Event generation disabled
+ dmac_evosel_16: Event generation disabled
+ dmac_evosel_17: Event generation disabled
+ dmac_evosel_18: Event generation disabled
+ dmac_evosel_19: Event generation disabled
+ dmac_evosel_2: Event generation disabled
+ dmac_evosel_20: Event generation disabled
+ dmac_evosel_21: Event generation disabled
+ dmac_evosel_22: Event generation disabled
+ dmac_evosel_23: Event generation disabled
+ dmac_evosel_24: Event generation disabled
+ dmac_evosel_25: Event generation disabled
+ dmac_evosel_26: Event generation disabled
+ dmac_evosel_27: Event generation disabled
+ dmac_evosel_28: Event generation disabled
+ dmac_evosel_29: Event generation disabled
+ dmac_evosel_3: Event generation disabled
+ dmac_evosel_30: Event generation disabled
+ dmac_evosel_31: Event generation disabled
+ dmac_evosel_4: Event generation disabled
+ dmac_evosel_5: Event generation disabled
+ dmac_evosel_6: Event generation disabled
+ dmac_evosel_7: Event generation disabled
+ dmac_evosel_8: Event generation disabled
+ dmac_evosel_9: Event generation disabled
+ dmac_lvl_0: Channel priority 0
+ dmac_lvl_1: Channel priority 0
+ dmac_lvl_10: Channel priority 0
+ dmac_lvl_11: Channel priority 0
+ dmac_lvl_12: Channel priority 0
+ dmac_lvl_13: Channel priority 0
+ dmac_lvl_14: Channel priority 0
+ dmac_lvl_15: Channel priority 0
+ dmac_lvl_16: Channel priority 0
+ dmac_lvl_17: Channel priority 0
+ dmac_lvl_18: Channel priority 0
+ dmac_lvl_19: Channel priority 0
+ dmac_lvl_2: Channel priority 0
+ dmac_lvl_20: Channel priority 0
+ dmac_lvl_21: Channel priority 0
+ dmac_lvl_22: Channel priority 0
+ dmac_lvl_23: Channel priority 0
+ dmac_lvl_24: Channel priority 0
+ dmac_lvl_25: Channel priority 0
+ dmac_lvl_26: Channel priority 0
+ dmac_lvl_27: Channel priority 0
+ dmac_lvl_28: Channel priority 0
+ dmac_lvl_29: Channel priority 0
+ dmac_lvl_3: Channel priority 0
+ dmac_lvl_30: Channel priority 0
+ dmac_lvl_31: Channel priority 0
+ dmac_lvl_4: Channel priority 0
+ dmac_lvl_5: Channel priority 0
+ dmac_lvl_6: Channel priority 0
+ dmac_lvl_7: Channel priority 0
+ dmac_lvl_8: Channel priority 0
+ dmac_lvl_9: Channel priority 0
+ dmac_lvlen0: true
+ dmac_lvlen1: true
+ dmac_lvlen2: true
+ dmac_lvlen3: true
+ dmac_lvlpri0: 0
+ dmac_lvlpri1: 0
+ dmac_lvlpri2: 0
+ dmac_lvlpri3: 0
+ dmac_rrlvlen0: Static arbitration scheme for channel with priority 0
+ dmac_rrlvlen1: Static arbitration scheme for channel with priority 1
+ dmac_rrlvlen2: Static arbitration scheme for channel with priority 2
+ dmac_rrlvlen3: Static arbitration scheme for channel with priority 3
+ dmac_runstdby_0: false
+ dmac_runstdby_1: false
+ dmac_runstdby_10: false
+ dmac_runstdby_11: false
+ dmac_runstdby_12: false
+ dmac_runstdby_13: false
+ dmac_runstdby_14: false
+ dmac_runstdby_15: false
+ dmac_runstdby_16: false
+ dmac_runstdby_17: false
+ dmac_runstdby_18: false
+ dmac_runstdby_19: false
+ dmac_runstdby_2: false
+ dmac_runstdby_20: false
+ dmac_runstdby_21: false
+ dmac_runstdby_22: false
+ dmac_runstdby_23: false
+ dmac_runstdby_24: false
+ dmac_runstdby_25: false
+ dmac_runstdby_26: false
+ dmac_runstdby_27: false
+ dmac_runstdby_28: false
+ dmac_runstdby_29: false
+ dmac_runstdby_3: false
+ dmac_runstdby_30: false
+ dmac_runstdby_31: false
+ dmac_runstdby_4: false
+ dmac_runstdby_5: false
+ dmac_runstdby_6: false
+ dmac_runstdby_7: false
+ dmac_runstdby_8: false
+ dmac_runstdby_9: false
+ dmac_srcinc_0: false
+ dmac_srcinc_1: false
+ dmac_srcinc_10: false
+ dmac_srcinc_11: false
+ dmac_srcinc_12: false
+ dmac_srcinc_13: false
+ dmac_srcinc_14: false
+ dmac_srcinc_15: false
+ dmac_srcinc_16: false
+ dmac_srcinc_17: false
+ dmac_srcinc_18: false
+ dmac_srcinc_19: false
+ dmac_srcinc_2: false
+ dmac_srcinc_20: false
+ dmac_srcinc_21: false
+ dmac_srcinc_22: false
+ dmac_srcinc_23: false
+ dmac_srcinc_24: false
+ dmac_srcinc_25: false
+ dmac_srcinc_26: false
+ dmac_srcinc_27: false
+ dmac_srcinc_28: false
+ dmac_srcinc_29: false
+ dmac_srcinc_3: false
+ dmac_srcinc_30: false
+ dmac_srcinc_31: false
+ dmac_srcinc_4: false
+ dmac_srcinc_5: false
+ dmac_srcinc_6: false
+ dmac_srcinc_7: false
+ dmac_srcinc_8: false
+ dmac_srcinc_9: false
+ dmac_stepsel_0: Step size settings apply to the destination address
+ dmac_stepsel_1: Step size settings apply to the destination address
+ dmac_stepsel_10: Step size settings apply to the destination address
+ dmac_stepsel_11: Step size settings apply to the destination address
+ dmac_stepsel_12: Step size settings apply to the destination address
+ dmac_stepsel_13: Step size settings apply to the destination address
+ dmac_stepsel_14: Step size settings apply to the destination address
+ dmac_stepsel_15: Step size settings apply to the destination address
+ dmac_stepsel_16: Step size settings apply to the destination address
+ dmac_stepsel_17: Step size settings apply to the destination address
+ dmac_stepsel_18: Step size settings apply to the destination address
+ dmac_stepsel_19: Step size settings apply to the destination address
+ dmac_stepsel_2: Step size settings apply to the destination address
+ dmac_stepsel_20: Step size settings apply to the destination address
+ dmac_stepsel_21: Step size settings apply to the destination address
+ dmac_stepsel_22: Step size settings apply to the destination address
+ dmac_stepsel_23: Step size settings apply to the destination address
+ dmac_stepsel_24: Step size settings apply to the destination address
+ dmac_stepsel_25: Step size settings apply to the destination address
+ dmac_stepsel_26: Step size settings apply to the destination address
+ dmac_stepsel_27: Step size settings apply to the destination address
+ dmac_stepsel_28: Step size settings apply to the destination address
+ dmac_stepsel_29: Step size settings apply to the destination address
+ dmac_stepsel_3: Step size settings apply to the destination address
+ dmac_stepsel_30: Step size settings apply to the destination address
+ dmac_stepsel_31: Step size settings apply to the destination address
+ dmac_stepsel_4: Step size settings apply to the destination address
+ dmac_stepsel_5: Step size settings apply to the destination address
+ dmac_stepsel_6: Step size settings apply to the destination address
+ dmac_stepsel_7: Step size settings apply to the destination address
+ dmac_stepsel_8: Step size settings apply to the destination address
+ dmac_stepsel_9: Step size settings apply to the destination address
+ dmac_stepsize_0: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_1: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_10: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_11: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_12: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_13: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_14: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_15: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_16: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_17: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_18: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_19: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_2: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_20: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_21: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_22: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_23: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_24: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_25: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_26: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_27: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_28: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_29: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_3: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_30: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_31: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_4: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_5: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_6: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_7: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_8: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_9: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_trifsrc_0: Only software/event triggers
+ dmac_trifsrc_1: Only software/event triggers
+ dmac_trifsrc_10: Only software/event triggers
+ dmac_trifsrc_11: Only software/event triggers
+ dmac_trifsrc_12: Only software/event triggers
+ dmac_trifsrc_13: Only software/event triggers
+ dmac_trifsrc_14: Only software/event triggers
+ dmac_trifsrc_15: Only software/event triggers
+ dmac_trifsrc_16: Only software/event triggers
+ dmac_trifsrc_17: Only software/event triggers
+ dmac_trifsrc_18: Only software/event triggers
+ dmac_trifsrc_19: Only software/event triggers
+ dmac_trifsrc_2: Only software/event triggers
+ dmac_trifsrc_20: Only software/event triggers
+ dmac_trifsrc_21: Only software/event triggers
+ dmac_trifsrc_22: Only software/event triggers
+ dmac_trifsrc_23: Only software/event triggers
+ dmac_trifsrc_24: Only software/event triggers
+ dmac_trifsrc_25: Only software/event triggers
+ dmac_trifsrc_26: Only software/event triggers
+ dmac_trifsrc_27: Only software/event triggers
+ dmac_trifsrc_28: Only software/event triggers
+ dmac_trifsrc_29: Only software/event triggers
+ dmac_trifsrc_3: Only software/event triggers
+ dmac_trifsrc_30: Only software/event triggers
+ dmac_trifsrc_31: Only software/event triggers
+ dmac_trifsrc_4: Only software/event triggers
+ dmac_trifsrc_5: Only software/event triggers
+ dmac_trifsrc_6: Only software/event triggers
+ dmac_trifsrc_7: Only software/event triggers
+ dmac_trifsrc_8: Only software/event triggers
+ dmac_trifsrc_9: Only software/event triggers
+ dmac_trigact_0: One trigger required for each block transfer
+ dmac_trigact_1: One trigger required for each block transfer
+ dmac_trigact_10: One trigger required for each block transfer
+ dmac_trigact_11: One trigger required for each block transfer
+ dmac_trigact_12: One trigger required for each block transfer
+ dmac_trigact_13: One trigger required for each block transfer
+ dmac_trigact_14: One trigger required for each block transfer
+ dmac_trigact_15: One trigger required for each block transfer
+ dmac_trigact_16: One trigger required for each block transfer
+ dmac_trigact_17: One trigger required for each block transfer
+ dmac_trigact_18: One trigger required for each block transfer
+ dmac_trigact_19: One trigger required for each block transfer
+ dmac_trigact_2: One trigger required for each block transfer
+ dmac_trigact_20: One trigger required for each block transfer
+ dmac_trigact_21: One trigger required for each block transfer
+ dmac_trigact_22: One trigger required for each block transfer
+ dmac_trigact_23: One trigger required for each block transfer
+ dmac_trigact_24: One trigger required for each block transfer
+ dmac_trigact_25: One trigger required for each block transfer
+ dmac_trigact_26: One trigger required for each block transfer
+ dmac_trigact_27: One trigger required for each block transfer
+ dmac_trigact_28: One trigger required for each block transfer
+ dmac_trigact_29: One trigger required for each block transfer
+ dmac_trigact_3: One trigger required for each block transfer
+ dmac_trigact_30: One trigger required for each block transfer
+ dmac_trigact_31: One trigger required for each block transfer
+ dmac_trigact_4: One trigger required for each block transfer
+ dmac_trigact_5: One trigger required for each block transfer
+ dmac_trigact_6: One trigger required for each block transfer
+ dmac_trigact_7: One trigger required for each block transfer
+ dmac_trigact_8: One trigger required for each block transfer
+ dmac_trigact_9: One trigger required for each block transfer
+ optional_signals: []
+ variant: null
+ clocks:
+ domain_group: null
+ EXTERNAL_IRQ_0:
+ user_label: EXTERNAL_IRQ_0
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::EIC::driver_config_definition::Default::HAL:Driver:Ext.IRQ
+ functionality: External_IRQ
+ api: HAL:Driver:Ext_IRQ
+ configuration:
+ eic_arch_asynch0: false
+ eic_arch_asynch1: false
+ eic_arch_asynch10: false
+ eic_arch_asynch11: false
+ eic_arch_asynch12: false
+ eic_arch_asynch13: false
+ eic_arch_asynch14: false
+ eic_arch_asynch15: false
+ eic_arch_asynch2: false
+ eic_arch_asynch3: false
+ eic_arch_asynch4: false
+ eic_arch_asynch5: false
+ eic_arch_asynch6: false
+ eic_arch_asynch7: false
+ eic_arch_asynch8: false
+ eic_arch_asynch9: false
+ eic_arch_cksel: Clocked by GCLK
+ eic_arch_debounce_enable0: false
+ eic_arch_debounce_enable1: false
+ eic_arch_debounce_enable10: false
+ eic_arch_debounce_enable11: false
+ eic_arch_debounce_enable12: false
+ eic_arch_debounce_enable13: false
+ eic_arch_debounce_enable14: false
+ eic_arch_debounce_enable15: false
+ eic_arch_debounce_enable2: false
+ eic_arch_debounce_enable3: false
+ eic_arch_debounce_enable4: false
+ eic_arch_debounce_enable5: false
+ eic_arch_debounce_enable6: false
+ eic_arch_debounce_enable7: false
+ eic_arch_debounce_enable8: false
+ eic_arch_debounce_enable9: false
+ eic_arch_enable_irq_setting0: false
+ eic_arch_enable_irq_setting1: false
+ eic_arch_enable_irq_setting10: false
+ eic_arch_enable_irq_setting11: false
+ eic_arch_enable_irq_setting12: false
+ eic_arch_enable_irq_setting13: false
+ eic_arch_enable_irq_setting14: false
+ eic_arch_enable_irq_setting15: false
+ eic_arch_enable_irq_setting2: false
+ eic_arch_enable_irq_setting3: false
+ eic_arch_enable_irq_setting4: false
+ eic_arch_enable_irq_setting5: false
+ eic_arch_enable_irq_setting6: false
+ eic_arch_enable_irq_setting7: false
+ eic_arch_enable_irq_setting8: false
+ eic_arch_enable_irq_setting9: false
+ eic_arch_extinteo0: false
+ eic_arch_extinteo1: false
+ eic_arch_extinteo10: false
+ eic_arch_extinteo11: false
+ eic_arch_extinteo12: false
+ eic_arch_extinteo13: false
+ eic_arch_extinteo14: false
+ eic_arch_extinteo15: false
+ eic_arch_extinteo2: false
+ eic_arch_extinteo3: false
+ eic_arch_extinteo4: false
+ eic_arch_extinteo5: false
+ eic_arch_extinteo6: false
+ eic_arch_extinteo7: false
+ eic_arch_extinteo8: false
+ eic_arch_extinteo9: false
+ eic_arch_filten0: false
+ eic_arch_filten1: false
+ eic_arch_filten10: false
+ eic_arch_filten11: false
+ eic_arch_filten12: false
+ eic_arch_filten13: false
+ eic_arch_filten14: false
+ eic_arch_filten15: false
+ eic_arch_filten2: false
+ eic_arch_filten3: false
+ eic_arch_filten4: false
+ eic_arch_filten5: false
+ eic_arch_filten6: false
+ eic_arch_filten7: false
+ eic_arch_filten8: false
+ eic_arch_filten9: false
+ eic_arch_nmi_ctrl: false
+ eic_arch_nmiasynch: false
+ eic_arch_nmifilten: false
+ eic_arch_nmisense: No detection
+ eic_arch_prescaler0: Divided by 2
+ eic_arch_prescaler1: Divided by 2
+ eic_arch_sense0: No detection
+ eic_arch_sense1: No detection
+ eic_arch_sense10: No detection
+ eic_arch_sense11: No detection
+ eic_arch_sense12: No detection
+ eic_arch_sense13: No detection
+ eic_arch_sense14: No detection
+ eic_arch_sense15: No detection
+ eic_arch_sense2: No detection
+ eic_arch_sense3: No detection
+ eic_arch_sense4: No detection
+ eic_arch_sense5: No detection
+ eic_arch_sense6: No detection
+ eic_arch_sense7: No detection
+ eic_arch_sense8: No detection
+ eic_arch_sense9: No detection
+ eic_arch_states0: '3'
+ eic_arch_states1: '3'
+ eic_arch_tickon: The sampling rate is EIC clock
+ optional_signals:
+ - identifier: EXTERNAL_IRQ_0:EXTINT/7
+ pad: PA07
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::EIC.EXTINT.7
+ name: EIC/EXTINT/7
+ label: EXTINT/7
+ - identifier: EXTERNAL_IRQ_0:EXTINT/14
+ pad: PB30
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::EIC.EXTINT.14
+ name: EIC/EXTINT/14
+ label: EXTINT/14
+ - identifier: EXTERNAL_IRQ_0:EXTINT/15
+ pad: PB31
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::EIC.EXTINT.15
+ name: EIC/EXTINT/15
+ label: EXTINT/15
+ variant: null
+ clocks:
+ domain_group:
+ nodes:
+ - name: EIC
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ configuration:
+ eic_gclk_selection: Generic clock generator 0
+ EVENT_SYSTEM_0:
+ user_label: EVENT_SYSTEM_0
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::EVSYS::driver_config_definition::Event.System::HAL:Driver:Event.system
+ functionality: Event_System
+ api: HAL:Driver:Event_system
+ configuration:
+ evsys_channel_0: No channel output selected
+ evsys_channel_1: No channel output selected
+ evsys_channel_10: No channel output selected
+ evsys_channel_11: No channel output selected
+ evsys_channel_12: No channel output selected
+ evsys_channel_17: No channel output selected
+ evsys_channel_18: No channel output selected
+ evsys_channel_19: No channel output selected
+ evsys_channel_2: No channel output selected
+ evsys_channel_20: No channel output selected
+ evsys_channel_21: No channel output selected
+ evsys_channel_22: No channel output selected
+ evsys_channel_23: No channel output selected
+ evsys_channel_24: No channel output selected
+ evsys_channel_25: No channel output selected
+ evsys_channel_26: No channel output selected
+ evsys_channel_27: No channel output selected
+ evsys_channel_28: No channel output selected
+ evsys_channel_29: No channel output selected
+ evsys_channel_3: No channel output selected
+ evsys_channel_30: No channel output selected
+ evsys_channel_31: No channel output selected
+ evsys_channel_32: No channel output selected
+ evsys_channel_33: No channel output selected
+ evsys_channel_34: No channel output selected
+ evsys_channel_35: No channel output selected
+ evsys_channel_36: No channel output selected
+ evsys_channel_37: No channel output selected
+ evsys_channel_38: No channel output selected
+ evsys_channel_39: No channel output selected
+ evsys_channel_4: No channel output selected
+ evsys_channel_40: No channel output selected
+ evsys_channel_41: No channel output selected
+ evsys_channel_42: No channel output selected
+ evsys_channel_43: No channel output selected
+ evsys_channel_44: No channel output selected
+ evsys_channel_45: No channel output selected
+ evsys_channel_46: No channel output selected
+ evsys_channel_47: No channel output selected
+ evsys_channel_48: No channel output selected
+ evsys_channel_49: No channel output selected
+ evsys_channel_5: No channel output selected
+ evsys_channel_50: No channel output selected
+ evsys_channel_51: No channel output selected
+ evsys_channel_52: No channel output selected
+ evsys_channel_53: No channel output selected
+ evsys_channel_54: No channel output selected
+ evsys_channel_55: No channel output selected
+ evsys_channel_56: No channel output selected
+ evsys_channel_57: No channel output selected
+ evsys_channel_58: No channel output selected
+ evsys_channel_59: No channel output selected
+ evsys_channel_6: No channel output selected
+ evsys_channel_60: No channel output selected
+ evsys_channel_61: No channel output selected
+ evsys_channel_62: No channel output selected
+ evsys_channel_63: No channel output selected
+ evsys_channel_64: No channel output selected
+ evsys_channel_65: No channel output selected
+ evsys_channel_66: No channel output selected
+ evsys_channel_7: No channel output selected
+ evsys_channel_8: No channel output selected
+ evsys_channel_9: No channel output selected
+ evsys_channel_setting_0: false
+ evsys_channel_setting_1: false
+ evsys_channel_setting_10: false
+ evsys_channel_setting_11: false
+ evsys_channel_setting_12: false
+ evsys_channel_setting_13: false
+ evsys_channel_setting_14: false
+ evsys_channel_setting_15: false
+ evsys_channel_setting_16: false
+ evsys_channel_setting_17: false
+ evsys_channel_setting_18: false
+ evsys_channel_setting_19: false
+ evsys_channel_setting_2: false
+ evsys_channel_setting_20: false
+ evsys_channel_setting_21: false
+ evsys_channel_setting_22: false
+ evsys_channel_setting_23: false
+ evsys_channel_setting_24: false
+ evsys_channel_setting_25: false
+ evsys_channel_setting_26: false
+ evsys_channel_setting_27: false
+ evsys_channel_setting_28: false
+ evsys_channel_setting_29: false
+ evsys_channel_setting_3: false
+ evsys_channel_setting_30: false
+ evsys_channel_setting_31: false
+ evsys_channel_setting_4: false
+ evsys_channel_setting_5: false
+ evsys_channel_setting_6: false
+ evsys_channel_setting_7: false
+ evsys_channel_setting_8: false
+ evsys_channel_setting_9: false
+ evsys_edgsel_0: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_1: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_10: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_11: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_12: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_13: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_14: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_15: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_16: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_17: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_18: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_19: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_2: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_20: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_21: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_22: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_23: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_24: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_25: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_26: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_27: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_28: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_29: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_3: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_30: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_31: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_4: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_5: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_6: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_7: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_8: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_9: No event output when using the resynchronized or synchronous
+ path
+ evsys_evd_0: false
+ evsys_evd_1: false
+ evsys_evd_10: false
+ evsys_evd_11: false
+ evsys_evd_12: false
+ evsys_evd_13: false
+ evsys_evd_14: false
+ evsys_evd_15: false
+ evsys_evd_16: false
+ evsys_evd_17: false
+ evsys_evd_18: false
+ evsys_evd_19: false
+ evsys_evd_2: false
+ evsys_evd_20: false
+ evsys_evd_21: false
+ evsys_evd_22: false
+ evsys_evd_23: false
+ evsys_evd_24: false
+ evsys_evd_25: false
+ evsys_evd_26: false
+ evsys_evd_27: false
+ evsys_evd_28: false
+ evsys_evd_29: false
+ evsys_evd_3: false
+ evsys_evd_30: false
+ evsys_evd_31: false
+ evsys_evd_4: false
+ evsys_evd_5: false
+ evsys_evd_6: false
+ evsys_evd_7: false
+ evsys_evd_8: false
+ evsys_evd_9: false
+ evsys_evgen_0: No event generator
+ evsys_evgen_1: No event generator
+ evsys_evgen_10: No event generator
+ evsys_evgen_11: No event generator
+ evsys_evgen_12: No event generator
+ evsys_evgen_13: No event generator
+ evsys_evgen_14: No event generator
+ evsys_evgen_15: No event generator
+ evsys_evgen_16: No event generator
+ evsys_evgen_17: No event generator
+ evsys_evgen_18: No event generator
+ evsys_evgen_19: No event generator
+ evsys_evgen_2: No event generator
+ evsys_evgen_20: No event generator
+ evsys_evgen_21: No event generator
+ evsys_evgen_22: No event generator
+ evsys_evgen_23: No event generator
+ evsys_evgen_24: No event generator
+ evsys_evgen_25: No event generator
+ evsys_evgen_26: No event generator
+ evsys_evgen_27: No event generator
+ evsys_evgen_28: No event generator
+ evsys_evgen_29: No event generator
+ evsys_evgen_3: No event generator
+ evsys_evgen_30: No event generator
+ evsys_evgen_31: No event generator
+ evsys_evgen_4: No event generator
+ evsys_evgen_5: No event generator
+ evsys_evgen_6: No event generator
+ evsys_evgen_7: No event generator
+ evsys_evgen_8: No event generator
+ evsys_evgen_9: No event generator
+ evsys_ondemand_0: false
+ evsys_ondemand_1: false
+ evsys_ondemand_10: false
+ evsys_ondemand_11: false
+ evsys_ondemand_12: false
+ evsys_ondemand_13: false
+ evsys_ondemand_14: false
+ evsys_ondemand_15: false
+ evsys_ondemand_16: false
+ evsys_ondemand_17: false
+ evsys_ondemand_18: false
+ evsys_ondemand_19: false
+ evsys_ondemand_2: false
+ evsys_ondemand_20: false
+ evsys_ondemand_21: false
+ evsys_ondemand_22: false
+ evsys_ondemand_23: false
+ evsys_ondemand_24: false
+ evsys_ondemand_25: false
+ evsys_ondemand_26: false
+ evsys_ondemand_27: false
+ evsys_ondemand_28: false
+ evsys_ondemand_29: false
+ evsys_ondemand_3: false
+ evsys_ondemand_30: false
+ evsys_ondemand_31: false
+ evsys_ondemand_4: false
+ evsys_ondemand_5: false
+ evsys_ondemand_6: false
+ evsys_ondemand_7: false
+ evsys_ondemand_8: false
+ evsys_ondemand_9: false
+ evsys_ovr_0: false
+ evsys_ovr_1: false
+ evsys_ovr_10: false
+ evsys_ovr_11: false
+ evsys_ovr_12: false
+ evsys_ovr_13: false
+ evsys_ovr_14: false
+ evsys_ovr_15: false
+ evsys_ovr_16: false
+ evsys_ovr_17: false
+ evsys_ovr_18: false
+ evsys_ovr_19: false
+ evsys_ovr_2: false
+ evsys_ovr_20: false
+ evsys_ovr_21: false
+ evsys_ovr_22: false
+ evsys_ovr_23: false
+ evsys_ovr_24: false
+ evsys_ovr_25: false
+ evsys_ovr_26: false
+ evsys_ovr_27: false
+ evsys_ovr_28: false
+ evsys_ovr_29: false
+ evsys_ovr_3: false
+ evsys_ovr_30: false
+ evsys_ovr_31: false
+ evsys_ovr_4: false
+ evsys_ovr_5: false
+ evsys_ovr_6: false
+ evsys_ovr_7: false
+ evsys_ovr_8: false
+ evsys_ovr_9: false
+ evsys_path_0: Synchronous path
+ evsys_path_1: Synchronous path
+ evsys_path_10: Synchronous path
+ evsys_path_11: Synchronous path
+ evsys_path_12: Synchronous path
+ evsys_path_13: Synchronous path
+ evsys_path_14: Synchronous path
+ evsys_path_15: Synchronous path
+ evsys_path_16: Synchronous path
+ evsys_path_17: Synchronous path
+ evsys_path_18: Synchronous path
+ evsys_path_19: Synchronous path
+ evsys_path_2: Synchronous path
+ evsys_path_20: Synchronous path
+ evsys_path_21: Synchronous path
+ evsys_path_22: Synchronous path
+ evsys_path_23: Synchronous path
+ evsys_path_24: Synchronous path
+ evsys_path_25: Synchronous path
+ evsys_path_26: Synchronous path
+ evsys_path_27: Synchronous path
+ evsys_path_28: Synchronous path
+ evsys_path_29: Synchronous path
+ evsys_path_3: Synchronous path
+ evsys_path_30: Synchronous path
+ evsys_path_31: Synchronous path
+ evsys_path_4: Synchronous path
+ evsys_path_5: Synchronous path
+ evsys_path_6: Synchronous path
+ evsys_path_7: Synchronous path
+ evsys_path_8: Synchronous path
+ evsys_path_9: Synchronous path
+ evsys_runstdby_0: false
+ evsys_runstdby_1: false
+ evsys_runstdby_10: false
+ evsys_runstdby_11: false
+ evsys_runstdby_12: false
+ evsys_runstdby_13: false
+ evsys_runstdby_14: false
+ evsys_runstdby_15: false
+ evsys_runstdby_16: false
+ evsys_runstdby_17: false
+ evsys_runstdby_18: false
+ evsys_runstdby_19: false
+ evsys_runstdby_2: false
+ evsys_runstdby_20: false
+ evsys_runstdby_21: false
+ evsys_runstdby_22: false
+ evsys_runstdby_23: false
+ evsys_runstdby_24: false
+ evsys_runstdby_25: false
+ evsys_runstdby_26: false
+ evsys_runstdby_27: false
+ evsys_runstdby_28: false
+ evsys_runstdby_29: false
+ evsys_runstdby_3: false
+ evsys_runstdby_30: false
+ evsys_runstdby_31: false
+ evsys_runstdby_4: false
+ evsys_runstdby_5: false
+ evsys_runstdby_6: false
+ evsys_runstdby_7: false
+ evsys_runstdby_8: false
+ evsys_runstdby_9: false
+ optional_signals: []
+ variant: null
+ clocks:
+ domain_group:
+ nodes:
+ - name: Channel 0
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ - name: Channel 1
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ - name: Channel 2
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ - name: Channel 3
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ - name: Channel 4
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ - name: Channel 5
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ - name: Channel 6
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ - name: Channel 7
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ - name: Channel 8
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ - name: Channel 9
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ - name: Channel 10
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ - name: Channel 11
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ configuration:
+ evsys_clk_selection_0: Generic clock generator 0
+ evsys_clk_selection_1: Generic clock generator 0
+ evsys_clk_selection_10: Generic clock generator 0
+ evsys_clk_selection_11: Generic clock generator 0
+ evsys_clk_selection_2: Generic clock generator 0
+ evsys_clk_selection_3: Generic clock generator 0
+ evsys_clk_selection_4: Generic clock generator 0
+ evsys_clk_selection_5: Generic clock generator 0
+ evsys_clk_selection_6: Generic clock generator 0
+ evsys_clk_selection_7: Generic clock generator 0
+ evsys_clk_selection_8: Generic clock generator 0
+ evsys_clk_selection_9: Generic clock generator 0
+ GCLK:
+ user_label: GCLK
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::GCLK::driver_config_definition::GCLK::HAL:HPL:GCLK
+ functionality: System
+ api: HAL:HPL:GCLK
+ configuration:
+ $input: 12000000
+ $input_id: External Crystal Oscillator 8-48MHz (XOSC1)
+ RESERVED_InputFreq: 12000000
+ RESERVED_InputFreq_id: External Crystal Oscillator 8-48MHz (XOSC1)
+ _$freq_output_Generic clock generator 0: 12000000
+ _$freq_output_Generic clock generator 1: 48000000
+ _$freq_output_Generic clock generator 10: 12000000
+ _$freq_output_Generic clock generator 11: 12000000
+ _$freq_output_Generic clock generator 2: 3000000
+ _$freq_output_Generic clock generator 3: 32768
+ _$freq_output_Generic clock generator 4: 12000000
+ _$freq_output_Generic clock generator 5: 12000000
+ _$freq_output_Generic clock generator 6: 12000000
+ _$freq_output_Generic clock generator 7: 12000000
+ _$freq_output_Generic clock generator 8: 12000000
+ _$freq_output_Generic clock generator 9: 12000000
+ enable_gclk_gen_0: true
+ enable_gclk_gen_0__externalclock: 1000000
+ enable_gclk_gen_1: false
+ enable_gclk_gen_10: false
+ enable_gclk_gen_10__externalclock: 1000000
+ enable_gclk_gen_11: false
+ enable_gclk_gen_11__externalclock: 1000000
+ enable_gclk_gen_1__externalclock: 1000000
+ enable_gclk_gen_2: false
+ enable_gclk_gen_2__externalclock: 1000000
+ enable_gclk_gen_3: false
+ enable_gclk_gen_3__externalclock: 1000000
+ enable_gclk_gen_4: false
+ enable_gclk_gen_4__externalclock: 1000000
+ enable_gclk_gen_5: false
+ enable_gclk_gen_5__externalclock: 1000000
+ enable_gclk_gen_6: false
+ enable_gclk_gen_6__externalclock: 1000000
+ enable_gclk_gen_7: false
+ enable_gclk_gen_7__externalclock: 1000000
+ enable_gclk_gen_8: false
+ enable_gclk_gen_8__externalclock: 1000000
+ enable_gclk_gen_9: false
+ enable_gclk_gen_9__externalclock: 1000000
+ gclk_arch_gen_0_enable: true
+ gclk_arch_gen_0_idc: false
+ gclk_arch_gen_0_oe: false
+ gclk_arch_gen_0_oov: false
+ gclk_arch_gen_0_runstdby: false
+ gclk_arch_gen_10_enable: false
+ gclk_arch_gen_10_idc: false
+ gclk_arch_gen_10_oe: false
+ gclk_arch_gen_10_oov: false
+ gclk_arch_gen_10_runstdby: false
+ gclk_arch_gen_11_enable: false
+ gclk_arch_gen_11_idc: false
+ gclk_arch_gen_11_oe: false
+ gclk_arch_gen_11_oov: false
+ gclk_arch_gen_11_runstdby: false
+ gclk_arch_gen_1_enable: false
+ gclk_arch_gen_1_idc: false
+ gclk_arch_gen_1_oe: false
+ gclk_arch_gen_1_oov: false
+ gclk_arch_gen_1_runstdby: false
+ gclk_arch_gen_2_enable: false
+ gclk_arch_gen_2_idc: false
+ gclk_arch_gen_2_oe: false
+ gclk_arch_gen_2_oov: false
+ gclk_arch_gen_2_runstdby: false
+ gclk_arch_gen_3_enable: false
+ gclk_arch_gen_3_idc: false
+ gclk_arch_gen_3_oe: false
+ gclk_arch_gen_3_oov: false
+ gclk_arch_gen_3_runstdby: false
+ gclk_arch_gen_4_enable: false
+ gclk_arch_gen_4_idc: false
+ gclk_arch_gen_4_oe: false
+ gclk_arch_gen_4_oov: false
+ gclk_arch_gen_4_runstdby: false
+ gclk_arch_gen_5_enable: false
+ gclk_arch_gen_5_idc: false
+ gclk_arch_gen_5_oe: false
+ gclk_arch_gen_5_oov: false
+ gclk_arch_gen_5_runstdby: false
+ gclk_arch_gen_6_enable: false
+ gclk_arch_gen_6_idc: false
+ gclk_arch_gen_6_oe: false
+ gclk_arch_gen_6_oov: false
+ gclk_arch_gen_6_runstdby: false
+ gclk_arch_gen_7_enable: false
+ gclk_arch_gen_7_idc: false
+ gclk_arch_gen_7_oe: false
+ gclk_arch_gen_7_oov: false
+ gclk_arch_gen_7_runstdby: false
+ gclk_arch_gen_8_enable: false
+ gclk_arch_gen_8_idc: false
+ gclk_arch_gen_8_oe: false
+ gclk_arch_gen_8_oov: false
+ gclk_arch_gen_8_runstdby: false
+ gclk_arch_gen_9_enable: false
+ gclk_arch_gen_9_idc: false
+ gclk_arch_gen_9_oe: false
+ gclk_arch_gen_9_oov: false
+ gclk_arch_gen_9_runstdby: false
+ gclk_gen_0_div: 1
+ gclk_gen_0_div_sel: false
+ gclk_gen_0_oscillator: External Crystal Oscillator 8-48MHz (XOSC1)
+ gclk_gen_10_div: 1
+ gclk_gen_10_div_sel: false
+ gclk_gen_10_oscillator: External Crystal Oscillator 8-48MHz (XOSC1)
+ gclk_gen_11_div: 1
+ gclk_gen_11_div_sel: false
+ gclk_gen_11_oscillator: External Crystal Oscillator 8-48MHz (XOSC1)
+ gclk_gen_1_div: 1
+ gclk_gen_1_div_sel: false
+ gclk_gen_1_oscillator: Digital Frequency Locked Loop (DFLL48M)
+ gclk_gen_2_div: 1
+ gclk_gen_2_div_sel: true
+ gclk_gen_2_oscillator: External Crystal Oscillator 8-48MHz (XOSC1)
+ gclk_gen_3_div: 1
+ gclk_gen_3_div_sel: false
+ gclk_gen_3_oscillator: 32kHz External Crystal Oscillator (XOSC32K)
+ gclk_gen_4_div: 1
+ gclk_gen_4_div_sel: false
+ gclk_gen_4_oscillator: External Crystal Oscillator 8-48MHz (XOSC1)
+ gclk_gen_5_div: 1
+ gclk_gen_5_div_sel: false
+ gclk_gen_5_oscillator: External Crystal Oscillator 8-48MHz (XOSC1)
+ gclk_gen_6_div: 1
+ gclk_gen_6_div_sel: false
+ gclk_gen_6_oscillator: External Crystal Oscillator 8-48MHz (XOSC1)
+ gclk_gen_7_div: 1
+ gclk_gen_7_div_sel: false
+ gclk_gen_7_oscillator: External Crystal Oscillator 8-48MHz (XOSC1)
+ gclk_gen_8_div: 1
+ gclk_gen_8_div_sel: false
+ gclk_gen_8_oscillator: External Crystal Oscillator 8-48MHz (XOSC1)
+ gclk_gen_9_div: 1
+ gclk_gen_9_div_sel: false
+ gclk_gen_9_oscillator: External Crystal Oscillator 8-48MHz (XOSC1)
+ optional_signals: []
+ variant: null
+ clocks:
+ domain_group: null
+ MCLK:
+ user_label: MCLK
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::MCLK::driver_config_definition::MCLK::HAL:HPL:MCLK
+ functionality: System
+ api: HAL:HPL:MCLK
+ configuration:
+ $input: 12000000
+ $input_id: Generic clock generator 0
+ RESERVED_InputFreq: 12000000
+ RESERVED_InputFreq_id: Generic clock generator 0
+ _$freq_output_CPU: 12000000
+ cpu_clock_source: Generic clock generator 0
+ cpu_div: '1'
+ enable_cpu_clock: true
+ mclk_arch_bupdiv: Divide by 8
+ mclk_arch_hsdiv: Divide by 1
+ mclk_arch_lpdiv: Divide by 4
+ nvm_wait_states: '0'
+ optional_signals: []
+ variant: null
+ clocks:
+ domain_group:
+ nodes:
+ - name: CPU
+ input: CPU
+ external: false
+ external_frequency: 0
+ configuration: {}
+ OSC32KCTRL:
+ user_label: OSC32KCTRL
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::OSC32KCTRL::driver_config_definition::OSC32KCTRL::HAL:HPL:OSC32KCTRL
+ functionality: System
+ api: HAL:HPL:OSC32KCTRL
+ configuration:
+ $input: 32768
+ $input_id: 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
+ RESERVED_InputFreq: 32768
+ RESERVED_InputFreq_id: 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
+ _$freq_output_RTC source: 32768
+ enable_osculp32k: true
+ enable_rtc_source: false
+ enable_xosc32k: false
+ osculp32k_calib: 0
+ osculp32k_calib_enable: false
+ rtc_1khz_selection: false
+ rtc_source_oscillator: 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
+ xosc32k_arch_cfden: false
+ xosc32k_arch_cfdeo: false
+ xosc32k_arch_cgm: Standard mode
+ xosc32k_arch_en1k: false
+ xosc32k_arch_en32k: false
+ xosc32k_arch_enable: false
+ xosc32k_arch_ondemand: true
+ xosc32k_arch_runstdby: false
+ xosc32k_arch_startup: 62592us
+ xosc32k_arch_swben: false
+ xosc32k_arch_xtalen: true
+ optional_signals: []
+ variant: null
+ clocks:
+ domain_group: null
+ OSCCTRL:
+ user_label: OSCCTRL
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::OSCCTRL::driver_config_definition::OSCCTRL::HAL:HPL:OSCCTRL
+ functionality: System
+ api: HAL:HPL:OSCCTRL
+ configuration:
+ $input: 32768
+ $input_id: 32kHz External Crystal Oscillator (XOSC32K)
+ RESERVED_InputFreq: 32768
+ RESERVED_InputFreq_id: 32kHz External Crystal Oscillator (XOSC32K)
+ _$freq_output_Digital Frequency Locked Loop (DFLL48M): 48000000
+ _$freq_output_Digital Phase Locked Loop (DPLL0): 47985664
+ _$freq_output_Digital Phase Locked Loop (DPLL1): 47985664
+ _$freq_output_External Crystal Oscillator 8-48MHz (XOSC0): '12000000'
+ _$freq_output_External Crystal Oscillator 8-48MHz (XOSC1): '12000000'
+ dfll_arch_bplckc: false
+ dfll_arch_calibration: false
+ dfll_arch_ccdis: false
+ dfll_arch_coarse: 31
+ dfll_arch_cstep: 1
+ dfll_arch_enable: false
+ dfll_arch_fine: 128
+ dfll_arch_fstep: 1
+ dfll_arch_llaw: false
+ dfll_arch_ondemand: false
+ dfll_arch_qldis: false
+ dfll_arch_runstdby: false
+ dfll_arch_stable: false
+ dfll_arch_usbcrm: false
+ dfll_arch_waitlock: true
+ dfll_mode: Open Loop Mode
+ dfll_mul: 0
+ dfll_ref_clock: Generic clock generator 3
+ enable_dfll: false
+ enable_fdpll0: false
+ enable_fdpll1: false
+ enable_xosc0: false
+ enable_xosc1: true
+ fdpll0_arch_dcoen: false
+ fdpll0_arch_enable: false
+ fdpll0_arch_filter: 0
+ fdpll0_arch_lbypass: false
+ fdpll0_arch_ltime: No time-out, automatic lock
+ fdpll0_arch_ondemand: false
+ fdpll0_arch_refclk: XOSC32K clock reference
+ fdpll0_arch_runstdby: false
+ fdpll0_arch_wuf: false
+ fdpll0_clock_dcofilter: 0
+ fdpll0_clock_div: 0
+ fdpll0_ldr: 1463
+ fdpll0_ldrfrac: 13
+ fdpll0_ref_clock: 32kHz External Crystal Oscillator (XOSC32K)
+ fdpll1_arch_dcoen: false
+ fdpll1_arch_enable: false
+ fdpll1_arch_filter: 0
+ fdpll1_arch_lbypass: false
+ fdpll1_arch_ltime: No time-out, automatic lock
+ fdpll1_arch_ondemand: false
+ fdpll1_arch_refclk: XOSC32K clock reference
+ fdpll1_arch_runstdby: false
+ fdpll1_arch_wuf: false
+ fdpll1_clock_dcofilter: 0
+ fdpll1_clock_div: 0
+ fdpll1_ldr: 1463
+ fdpll1_ldrfrac: 13
+ fdpll1_ref_clock: 32kHz External Crystal Oscillator (XOSC32K)
+ xosc0_arch_cfden: false
+ xosc0_arch_enable: false
+ xosc0_arch_enalc: false
+ xosc0_arch_lowbufgain: false
+ xosc0_arch_ondemand: false
+ xosc0_arch_runstdby: false
+ xosc0_arch_startup: 31us
+ xosc0_arch_swben: false
+ xosc0_arch_xtalen: false
+ xosc0_frequency: 12000000
+ xosc1_arch_cfden: false
+ xosc1_arch_enable: true
+ xosc1_arch_enalc: false
+ xosc1_arch_lowbufgain: false
+ xosc1_arch_ondemand: false
+ xosc1_arch_runstdby: false
+ xosc1_arch_startup: 31us
+ xosc1_arch_swben: false
+ xosc1_arch_xtalen: true
+ xosc1_frequency: 12000000
+ optional_signals: []
+ variant: null
+ clocks:
+ domain_group: null
+ PORT:
+ user_label: PORT
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::PORT::driver_config_definition::PORT::HAL:HPL:PORT
+ functionality: System
+ api: HAL:HPL:PORT
+ configuration:
+ enable_port_input_event_0: false
+ enable_port_input_event_1: false
+ enable_port_input_event_2: false
+ enable_port_input_event_3: false
+ porta_event_action_0: Output register of pin will be set to level of event
+ porta_event_action_1: Output register of pin will be set to level of event
+ porta_event_action_2: Output register of pin will be set to level of event
+ porta_event_action_3: Output register of pin will be set to level of event
+ porta_event_pin_identifier_0: 0
+ porta_event_pin_identifier_1: 0
+ porta_event_pin_identifier_2: 0
+ porta_event_pin_identifier_3: 0
+ porta_input_event_enable_0: false
+ porta_input_event_enable_1: false
+ porta_input_event_enable_2: false
+ porta_input_event_enable_3: false
+ portb_event_action_0: Output register of pin will be set to level of event
+ portb_event_action_1: Output register of pin will be set to level of event
+ portb_event_action_2: Output register of pin will be set to level of event
+ portb_event_action_3: Output register of pin will be set to level of event
+ portb_event_pin_identifier_0: 0
+ portb_event_pin_identifier_1: 0
+ portb_event_pin_identifier_2: 0
+ portb_event_pin_identifier_3: 0
+ portb_input_event_enable_0: false
+ portb_input_event_enable_1: false
+ portb_input_event_enable_2: false
+ portb_input_event_enable_3: false
+ optional_signals: []
+ variant: null
+ clocks:
+ domain_group: null
+ QUAD_SPI_0:
+ user_label: QUAD_SPI_0
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::QSPI::driver_config_definition::QSPI.Master::HAL:Driver:QSPI.Sync
+ functionality: Quad_SPI
+ api: HAL:Driver:QSPI_Sync
+ configuration:
+ qspi_advanced: false
+ qspi_baud_rate: 375000
+ qspi_cpha: Data is changed on the leading edge of SPCK and captured on the following
+ edge of SPCK.
+ qspi_cpol: The inactive state value of SPCK is logic level zero.
+ qspi_dlybs: 0
+ qspi_dlycs: 0
+ optional_signals:
+ - identifier: QUAD_SPI_0:CS
+ pad: PB11
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::QSPI.CS
+ name: QSPI/CS
+ label: CS
+ - identifier: QUAD_SPI_0:DATA/0
+ pad: PA08
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::QSPI.DATA.0
+ name: QSPI/DATA/0
+ label: DATA/0
+ - identifier: QUAD_SPI_0:DATA/1
+ pad: PA09
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::QSPI.DATA.1
+ name: QSPI/DATA/1
+ label: DATA/1
+ - identifier: QUAD_SPI_0:DATA/2
+ pad: PA10
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::QSPI.DATA.2
+ name: QSPI/DATA/2
+ label: DATA/2
+ - identifier: QUAD_SPI_0:DATA/3
+ pad: PA11
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::QSPI.DATA.3
+ name: QSPI/DATA/3
+ label: DATA/3
+ - identifier: QUAD_SPI_0:SCK
+ pad: PB10
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::QSPI.SCK
+ name: QSPI/SCK
+ label: SCK
+ variant: null
+ clocks:
+ domain_group: null
+ RAMECC:
+ user_label: RAMECC
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::RAMECC::driver_config_definition::RAMECC::HAL:HPL:RAMECC
+ functionality: System
+ api: HAL:HPL:RAMECC
+ configuration: {}
+ optional_signals: []
+ variant: null
+ clocks:
+ domain_group: null
+ SPI_1:
+ user_label: SPI_1
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::SERCOM1::driver_config_definition::SPI.Master::HAL:Driver:SPI.Master.Sync
+ functionality: SPI
+ api: HAL:Driver:SPI_Master_Sync
+ configuration:
+ spi_master_advanced: false
+ spi_master_arch_cpha: Sample input on leading edge
+ spi_master_arch_cpol: SCK is low when idle
+ spi_master_arch_dbgstop: Keep running
+ spi_master_arch_dord: MSB first
+ spi_master_arch_ibon: In data stream
+ spi_master_arch_runstdby: false
+ spi_master_baud_rate: 50000
+ spi_master_character_size: 8 bits
+ spi_master_dummybyte: 511
+ spi_master_rx_enable: true
+ optional_signals: []
+ variant:
+ specification: TXPO=0, RXPO=3
+ required_signals:
+ - name: SERCOM1/PAD/0
+ pad: PA00
+ label: MOSI
+ - name: SERCOM1/PAD/1
+ pad: PA01
+ label: SCK
+ - name: SERCOM1/PAD/3
+ pad: PB23
+ label: MISO
+ clocks:
+ domain_group:
+ nodes:
+ - name: Core
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ - name: Slow
+ input: Generic clock generator 3
+ external: false
+ external_frequency: 0
+ configuration:
+ core_gclk_selection: Generic clock generator 0
+ slow_gclk_selection: Generic clock generator 3
+ SPI_2:
+ user_label: SPI_2
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::SERCOM2::driver_config_definition::SPI.Master::HAL:Driver:SPI.Master.Async
+ functionality: SPI
+ api: HAL:Driver:SPI_Master_Async
+ configuration:
+ spi_master_advanced: false
+ spi_master_arch_cpha: Sample input on leading edge
+ spi_master_arch_cpol: SCK is low when idle
+ spi_master_arch_dbgstop: Keep running
+ spi_master_arch_dord: MSB first
+ spi_master_arch_ibon: In data stream
+ spi_master_arch_runstdby: false
+ spi_master_baud_rate: 50000
+ spi_master_character_size: 8 bits
+ spi_master_dummybyte: 511
+ spi_master_rx_enable: true
+ optional_signals: []
+ variant:
+ specification: TXPO=0, RXPO=3
+ required_signals:
+ - name: SERCOM2/PAD/0
+ pad: PA12
+ label: MOSI
+ - name: SERCOM2/PAD/1
+ pad: PA13
+ label: SCK
+ - name: SERCOM2/PAD/3
+ pad: PA15
+ label: MISO
+ clocks:
+ domain_group:
+ nodes:
+ - name: Core
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ - name: Slow
+ input: Generic clock generator 3
+ external: false
+ external_frequency: 0
+ configuration:
+ core_gclk_selection: Generic clock generator 0
+ slow_gclk_selection: Generic clock generator 3
+ SPI_3:
+ user_label: SPI_3
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::SERCOM5::driver_config_definition::SPI.Master::HAL:Driver:SPI.Master.Sync
+ functionality: SPI
+ api: HAL:Driver:SPI_Master_Sync
+ configuration:
+ spi_master_advanced: false
+ spi_master_arch_cpha: Sample input on leading edge
+ spi_master_arch_cpol: SCK is low when idle
+ spi_master_arch_dbgstop: Keep running
+ spi_master_arch_dord: MSB first
+ spi_master_arch_ibon: In data stream
+ spi_master_arch_runstdby: false
+ spi_master_baud_rate: 50000
+ spi_master_character_size: 8 bits
+ spi_master_dummybyte: 511
+ spi_master_rx_enable: true
+ optional_signals: []
+ variant:
+ specification: TXPO=0, RXPO=3
+ required_signals:
+ - name: SERCOM5/PAD/0
+ pad: PB02
+ label: MOSI
+ - name: SERCOM5/PAD/1
+ pad: PB03
+ label: SCK
+ - name: SERCOM5/PAD/3
+ pad: PB01
+ label: MISO
+ clocks:
+ domain_group:
+ nodes:
+ - name: Core
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ - name: Slow
+ input: Generic clock generator 3
+ external: false
+ external_frequency: 0
+ configuration:
+ core_gclk_selection: Generic clock generator 0
+ slow_gclk_selection: Generic clock generator 3
+ PWM_0:
+ user_label: PWM_0
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::TCC0::driver_config_definition::PWM::HAL:Driver:PWM
+ functionality: PWM
+ api: HAL:Driver:PWM
+ configuration:
+ tcc_arch_alock: false
+ tcc_arch_cc0: 0
+ tcc_arch_cc1: 0
+ tcc_arch_cc2: 0
+ tcc_arch_cc3: 0
+ tcc_arch_cc4: 0
+ tcc_arch_cc5: 0
+ tcc_arch_cnteo: false
+ tcc_arch_cntsel: An interrupt/event is generated when a new counter cycle starts
+ tcc_arch_cpten0: false
+ tcc_arch_cpten1: false
+ tcc_arch_cpten2: false
+ tcc_arch_cpten3: false
+ tcc_arch_cpten4: false
+ tcc_arch_cpten5: false
+ tcc_arch_cpten6: false
+ tcc_arch_cpten7: false
+ tcc_arch_dbgrun: false
+ tcc_arch_evact0: Event action disabled
+ tcc_arch_evact1: Event action disabled
+ tcc_arch_lupd: true
+ tcc_arch_mcei0: false
+ tcc_arch_mcei1: false
+ tcc_arch_mcei2: false
+ tcc_arch_mcei3: false
+ tcc_arch_mcei4: false
+ tcc_arch_mcei5: false
+ tcc_arch_mceo0: false
+ tcc_arch_mceo1: false
+ tcc_arch_mceo2: false
+ tcc_arch_mceo3: false
+ tcc_arch_mceo4: false
+ tcc_arch_mceo5: false
+ tcc_arch_ovfeo: false
+ tcc_arch_prescsync: Reload or reset counter on next GCLK
+ tcc_arch_runstdby: false
+ tcc_arch_sel_ch: 1
+ tcc_arch_tcei0: false
+ tcc_arch_tcei1: false
+ tcc_arch_tceinv0: false
+ tcc_arch_tceinv1: false
+ tcc_arch_trgeo: false
+ tcc_arch_wave_duty_val: 500
+ tcc_arch_wave_per_val: 1000
+ tcc_arch_wavegen: Single-slope PWM
+ tcc_per: 10000
+ tcc_prescaler: Divide by 8
+ timer_event_control: false
+ optional_signals:
+ - identifier: PWM_0:WO/0
+ pad: PB12
+ mode: PWM output
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::TCC0.WO.0
+ name: TCC0/WO/0
+ label: WO/0
+ - identifier: PWM_0:WO/1
+ pad: PB13
+ mode: PWM output
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::TCC0.WO.1
+ name: TCC0/WO/1
+ label: WO/1
+ - identifier: PWM_0:WO/2
+ pad: PB14
+ mode: PWM output
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::TCC0.WO.2
+ name: TCC0/WO/2
+ label: WO/2
+ - identifier: PWM_0:WO/3
+ pad: PB15
+ mode: PWM output
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::TCC0.WO.3
+ name: TCC0/WO/3
+ label: WO/3
+ - identifier: PWM_0:WO/4
+ pad: PB16
+ mode: PWM output
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::TCC0.WO.4
+ name: TCC0/WO/4
+ label: WO/4
+ - identifier: PWM_0:WO/5
+ pad: PB17
+ mode: PWM output
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::TCC0.WO.5
+ name: TCC0/WO/5
+ label: WO/5
+ variant: null
+ clocks:
+ domain_group:
+ nodes:
+ - name: TCC
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ configuration:
+ tcc_gclk_selection: Generic clock generator 0
+ PWM_1:
+ user_label: PWM_1
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::TCC1::driver_config_definition::PWM::HAL:Driver:PWM
+ functionality: PWM
+ api: HAL:Driver:PWM
+ configuration:
+ tcc_arch_alock: false
+ tcc_arch_cc0: 0
+ tcc_arch_cc1: 0
+ tcc_arch_cc2: 0
+ tcc_arch_cc3: 0
+ tcc_arch_cnteo: false
+ tcc_arch_cntsel: An interrupt/event is generated when a new counter cycle starts
+ tcc_arch_cpten0: false
+ tcc_arch_cpten1: false
+ tcc_arch_cpten2: false
+ tcc_arch_cpten3: false
+ tcc_arch_cpten4: false
+ tcc_arch_cpten5: false
+ tcc_arch_cpten6: false
+ tcc_arch_cpten7: false
+ tcc_arch_dbgrun: false
+ tcc_arch_evact0: Event action disabled
+ tcc_arch_evact1: Event action disabled
+ tcc_arch_lupd: true
+ tcc_arch_mcei0: false
+ tcc_arch_mcei1: false
+ tcc_arch_mcei2: false
+ tcc_arch_mcei3: false
+ tcc_arch_mceo0: false
+ tcc_arch_mceo1: false
+ tcc_arch_mceo2: false
+ tcc_arch_mceo3: false
+ tcc_arch_ovfeo: false
+ tcc_arch_prescsync: Reload or reset counter on next GCLK
+ tcc_arch_runstdby: false
+ tcc_arch_sel_ch: 1
+ tcc_arch_tcei0: false
+ tcc_arch_tcei1: false
+ tcc_arch_tceinv0: false
+ tcc_arch_tceinv1: false
+ tcc_arch_trgeo: false
+ tcc_arch_wave_duty_val: 500
+ tcc_arch_wave_per_val: 1000
+ tcc_arch_wavegen: Single-slope PWM
+ tcc_per: 10000
+ tcc_prescaler: Divide by 8
+ timer_event_control: false
+ optional_signals:
+ - identifier: PWM_1:WO/0
+ pad: PA16
+ mode: PWM output
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::TCC1.WO.0
+ name: TCC1/WO/0
+ label: WO/0
+ - identifier: PWM_1:WO/1
+ pad: PA17
+ mode: PWM output
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::TCC1.WO.1
+ name: TCC1/WO/1
+ label: WO/1
+ - identifier: PWM_1:WO/2
+ pad: PA18
+ mode: PWM output
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::TCC1.WO.2
+ name: TCC1/WO/2
+ label: WO/2
+ - identifier: PWM_1:WO/3
+ pad: PA19
+ mode: PWM output
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::TCC1.WO.3
+ name: TCC1/WO/3
+ label: WO/3
+ - identifier: PWM_1:WO/4
+ pad: PA20
+ mode: PWM output
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::TCC1.WO.4
+ name: TCC1/WO/4
+ label: WO/4
+ - identifier: PWM_1:WO/5
+ pad: PA21
+ mode: PWM output
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::TCC1.WO.5
+ name: TCC1/WO/5
+ label: WO/5
+ variant: null
+ clocks:
+ domain_group:
+ nodes:
+ - name: TCC
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ configuration:
+ tcc_gclk_selection: Generic clock generator 0
+pads:
+ SPI1_MOSI:
+ name: PA00
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA00
+ mode: Digital output
+ user_label: SPI1_MOSI
+ configuration: null
+ SPI1_SCK:
+ name: PA01
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA01
+ mode: Digital output
+ user_label: SPI1_SCK
+ configuration: null
+ ALOG_0:
+ name: PA02
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA02
+ mode: Analog
+ user_label: ALOG_0
+ configuration: null
+ ANAREF_2V48:
+ name: PA03
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA03
+ mode: Analog
+ user_label: ANAREF_2V48
+ configuration: null
+ M1_IA:
+ name: PB04
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB04
+ mode: Analog
+ user_label: M1_IA
+ configuration: null
+ M1_IB:
+ name: PB05
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB05
+ mode: Analog
+ user_label: M1_IB
+ configuration: null
+ M2_IA:
+ name: PB06
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB06
+ mode: Analog
+ user_label: M2_IA
+ configuration: null
+ M2_IB:
+ name: PB07
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB07
+ mode: Analog
+ user_label: M2_IB
+ configuration: null
+ half_VREF:
+ name: PB08
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB08
+ mode: Analog
+ user_label: half_VREF
+ configuration: null
+ ALOG_2:
+ name: PB09
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB09
+ mode: Analog
+ user_label: ALOG_2
+ configuration: null
+ M1_HALLA:
+ name: PA04
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA04
+ mode: Peripheral IO
+ user_label: M1_HALLA
+ configuration: null
+ M1_HALLB:
+ name: PA05
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA05
+ mode: Peripheral IO
+ user_label: M1_HALLB
+ configuration: null
+ M1_HALLC:
+ name: PA06
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA06
+ mode: Peripheral IO
+ user_label: M1_HALLC
+ configuration: null
+ ECAT_SYNC:
+ name: PA07
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA07
+ mode: Digital input
+ user_label: ECAT_SYNC
+ configuration: null
+ ECAT_QSPI_MOSI:
+ name: PA08
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA08
+ mode: Advanced
+ user_label: ECAT_QSPI_MOSI
+ configuration: null
+ ECAT_QSPI_MISO:
+ name: PA09
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA09
+ mode: Advanced
+ user_label: ECAT_QSPI_MISO
+ configuration: null
+ ECAT_QSPI_DATA2:
+ name: PA10
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA10
+ mode: Advanced
+ user_label: ECAT_QSPI_DATA2
+ configuration: null
+ ECAT_QSPI_DATA3:
+ name: PA11
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA11
+ mode: Advanced
+ user_label: ECAT_QSPI_DATA3
+ configuration: null
+ ECAT_QSPI_SCK:
+ name: PB10
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB10
+ mode: Digital input
+ user_label: ECAT_QSPI_SCK
+ configuration: null
+ ECAT_QSPI_CS:
+ name: PB11
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB11
+ mode: Digital input
+ user_label: ECAT_QSPI_CS
+ configuration: null
+ M1_PWMA:
+ name: PB12
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB12
+ mode: Peripheral IO
+ user_label: M1_PWMA
+ configuration: null
+ M1_PWMB:
+ name: PB13
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB13
+ mode: Peripheral IO
+ user_label: M1_PWMB
+ configuration: null
+ M1_PWMC:
+ name: PB14
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB14
+ mode: Peripheral IO
+ user_label: M1_PWMC
+ configuration: null
+ M1_ENA:
+ name: PB15
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB15
+ mode: Peripheral IO
+ user_label: M1_ENA
+ configuration: null
+ SPI2_MOSI:
+ name: PA12
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA12
+ mode: Digital output
+ user_label: SPI2_MOSI
+ configuration: null
+ SPI2_SCK:
+ name: PA13
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA13
+ mode: Digital output
+ user_label: SPI2_SCK
+ configuration: null
+ SPI2_SS:
+ name: PA14
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA14
+ mode: Peripheral IO
+ user_label: SPI2_SS
+ configuration: null
+ SPI2_MISO:
+ name: PA15
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA15
+ mode: Digital input
+ user_label: SPI2_MISO
+ configuration: null
+ M2_PWMA:
+ name: PA16
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA16
+ mode: Peripheral IO
+ user_label: M2_PWMA
+ configuration: null
+ M2_PWMB:
+ name: PA17
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA17
+ mode: Peripheral IO
+ user_label: M2_PWMB
+ configuration: null
+ M2_PWMC:
+ name: PA18
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA18
+ mode: Peripheral IO
+ user_label: M2_PWMC
+ configuration: null
+ M2_ENA:
+ name: PA19
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA19
+ mode: Peripheral IO
+ user_label: M2_ENA
+ configuration: null
+ M1_ENB:
+ name: PB16
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB16
+ mode: Peripheral IO
+ user_label: M1_ENB
+ configuration: null
+ M1_ENC:
+ name: PB17
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB17
+ mode: Peripheral IO
+ user_label: M1_ENC
+ configuration: null
+ M2_ENB:
+ name: PA20
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA20
+ mode: Peripheral IO
+ user_label: M2_ENB
+ configuration: null
+ M2_ENC:
+ name: PA21
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA21
+ mode: Peripheral IO
+ user_label: M2_ENC
+ configuration: null
+ M2_HALLA:
+ name: PA22
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA22
+ mode: Peripheral IO
+ user_label: M2_HALLA
+ configuration: null
+ M2_HALLB:
+ name: PA23
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA23
+ mode: Peripheral IO
+ user_label: M2_HALLB
+ configuration: null
+ M2_HALLC:
+ name: PA24
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA24
+ mode: Peripheral IO
+ user_label: M2_HALLC
+ configuration: null
+ M1_RST:
+ name: PA25
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA25
+ mode: Digital output
+ user_label: M1_RST
+ configuration: null
+ SPI1_CS:
+ name: PB22
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB22
+ mode: Peripheral IO
+ user_label: SPI1_CS
+ configuration: null
+ SPI1_MISO:
+ name: PB23
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB23
+ mode: Digital input
+ user_label: SPI1_MISO
+ configuration: null
+ M2_RST:
+ name: PA27
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA27
+ mode: Digital output
+ user_label: M2_RST
+ configuration: null
+ M1_RST_Bar:
+ name: PB30
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB30
+ mode: Digital input
+ user_label: M1_RST_Bar
+ configuration: null
+ M2_RST_Bar:
+ name: PB31
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB31
+ mode: Digital input
+ user_label: M2_RST_Bar
+ configuration: null
+ SPI3_SS:
+ name: PB00
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB00
+ mode: Peripheral IO
+ user_label: SPI3_SS
+ configuration: null
+ SPI3_MISO:
+ name: PB01
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB01
+ mode: Digital input
+ user_label: SPI3_MISO
+ configuration: null
+ SPI3_MOSI:
+ name: PB02
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB02
+ mode: Digital output
+ user_label: SPI3_MOSI
+ configuration: null
+ SPI3_SCK:
+ name: PB03
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB03
+ mode: Digital output
+ user_label: SPI3_SCK
+ configuration: null
+toolchain_options: []
+static_files: []
diff --git a/2_Motor_Slave/2_Motor_Slave.atzip b/2_Motor_Slave/2_Motor_Slave.atzip
new file mode 100644
index 0000000..4b227aa
Binary files /dev/null and b/2_Motor_Slave/2_Motor_Slave.atzip differ
diff --git a/2_Motor_Slave/2_motor_slave.atstart b/2_Motor_Slave/2_motor_slave.atstart
new file mode 100644
index 0000000..cfe964a
--- /dev/null
+++ b/2_Motor_Slave/2_motor_slave.atstart
@@ -0,0 +1,2433 @@
+format_version: '2'
+name: My Project
+versions:
+ api: '1.0'
+ backend: 1.8.580
+ commit: f3d8d96e294de8dee688333bbbe8d8458a4f6b4c
+ content: unknown
+ content_pack_name: unknown
+ format: '2'
+ frontend: 1.8.580
+ packs_version_avr8: 1.0.1463
+ packs_version_qtouch: unknown
+ packs_version_sam: 1.0.1726
+ version_backend: 1.8.580
+ version_frontend: ''
+board:
+ identifier: CustomBoard
+ device: SAME51J19A-MF
+details: null
+application: null
+middlewares: {}
+drivers:
+ ADC_0:
+ user_label: ADC_0
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::ADC0::driver_config_definition::ADC::HAL:Driver:ADC.Sync
+ functionality: ADC
+ api: HAL:Driver:ADC_Sync
+ configuration:
+ adc_advanced_settings: false
+ adc_arch_adjres: 0
+ adc_arch_corren: false
+ adc_arch_dbgrun: false
+ adc_arch_event_settings: false
+ adc_arch_flushei: false
+ adc_arch_flushinv: false
+ adc_arch_gaincorr: 0
+ adc_arch_leftadj: false
+ adc_arch_offcomp: false
+ adc_arch_offsetcorr: 0
+ adc_arch_ondemand: false
+ adc_arch_refcomp: false
+ adc_arch_resrdyeo: false
+ adc_arch_runstdby: false
+ adc_arch_samplen: 0
+ adc_arch_samplenum: 1 sample
+ adc_arch_seqen: 0
+ adc_arch_startei: false
+ adc_arch_startinv: false
+ adc_arch_winlt: 0
+ adc_arch_winmode: No window mode
+ adc_arch_winmoneo: false
+ adc_arch_winut: 0
+ adc_differential_mode: true
+ adc_freerunning_mode: false
+ adc_pinmux_negative: ADC AIN2 pin
+ adc_pinmux_positive: ADC AIN0 pin
+ adc_prescaler: Peripheral clock divided by 2
+ adc_reference: External reference A
+ adc_resolution: 12-bit
+ optional_signals:
+ - identifier: ADC_0:AIN/0
+ pad: PA02
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::ADC0.AIN.0
+ name: ADC0/AIN/0
+ label: AIN/0
+ - identifier: ADC_0:AIN/3
+ pad: PB09
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::ADC0.AIN.3
+ name: ADC0/AIN/3
+ label: AIN/3
+ - identifier: ADC_0:AIN/7
+ pad: PA07
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::ADC0.AIN.7
+ name: ADC0/AIN/7
+ label: AIN/7
+ - identifier: ADC_0:AIN/10
+ pad: PA10
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::ADC0.AIN.10
+ name: ADC0/AIN/10
+ label: AIN/10
+ - identifier: ADC_0:AIN/11
+ pad: PA11
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::ADC0.AIN.11
+ name: ADC0/AIN/11
+ label: AIN/11
+ variant: null
+ clocks:
+ domain_group:
+ nodes:
+ - name: ADC
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ configuration:
+ adc_gclk_selection: Generic clock generator 0
+ ADC_1:
+ user_label: ADC_1
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::ADC1::driver_config_definition::ADC::HAL:Driver:ADC.Sync
+ functionality: ADC
+ api: HAL:Driver:ADC_Sync
+ configuration:
+ adc_advanced_settings: false
+ adc_arch_adjres: 0
+ adc_arch_corren: false
+ adc_arch_dbgrun: false
+ adc_arch_event_settings: false
+ adc_arch_flushei: false
+ adc_arch_flushinv: false
+ adc_arch_gaincorr: 0
+ adc_arch_leftadj: false
+ adc_arch_offcomp: false
+ adc_arch_offsetcorr: 0
+ adc_arch_ondemand: false
+ adc_arch_refcomp: false
+ adc_arch_resrdyeo: false
+ adc_arch_runstdby: false
+ adc_arch_samplen: 0
+ adc_arch_samplenum: 1 sample
+ adc_arch_seqen: 0
+ adc_arch_startei: false
+ adc_arch_startinv: false
+ adc_arch_winlt: 0
+ adc_arch_winmode: No window mode
+ adc_arch_winmoneo: false
+ adc_arch_winut: 0
+ adc_differential_mode: true
+ adc_freerunning_mode: false
+ adc_pinmux_negative: ADC AIN0 pin
+ adc_pinmux_positive: ADC AIN1 pin
+ adc_prescaler: Peripheral clock divided by 2
+ adc_reference: External reference A
+ adc_resolution: 12-bit
+ optional_signals:
+ - identifier: ADC_1:AIN/6
+ pad: PB04
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::ADC1.AIN.6
+ name: ADC1/AIN/6
+ label: AIN/6
+ - identifier: ADC_1:AIN/7
+ pad: PB05
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::ADC1.AIN.7
+ name: ADC1/AIN/7
+ label: AIN/7
+ - identifier: ADC_1:AIN/8
+ pad: PB06
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::ADC1.AIN.8
+ name: ADC1/AIN/8
+ label: AIN/8
+ - identifier: ADC_1:AIN/9
+ pad: PB07
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::ADC1.AIN.9
+ name: ADC1/AIN/9
+ label: AIN/9
+ variant: null
+ clocks:
+ domain_group:
+ nodes:
+ - name: ADC
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ configuration:
+ adc_gclk_selection: Generic clock generator 0
+ DIGITAL_GLUE_LOGIC_0:
+ user_label: DIGITAL_GLUE_LOGIC_0
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::CCL::driver_config_definition::CCL::HAL:Driver:CCL
+ functionality: Digital_Glue_Logic
+ api: HAL:Driver:CCL
+ configuration:
+ ccl_arch_advanced_settings: false
+ ccl_arch_edgesel_0: false
+ ccl_arch_edgesel_1: false
+ ccl_arch_edgesel_2: false
+ ccl_arch_edgesel_3: false
+ ccl_arch_filtsel_0: Disabled
+ ccl_arch_filtsel_1: Disabled
+ ccl_arch_filtsel_2: Disabled
+ ccl_arch_filtsel_3: Disabled
+ ccl_arch_insel0_0: IO pin input source
+ ccl_arch_insel0_1: IO pin input source
+ ccl_arch_insel0_2: IO pin input source
+ ccl_arch_insel0_3: IO pin input source
+ ccl_arch_insel1_0: IO pin input source
+ ccl_arch_insel1_1: IO pin input source
+ ccl_arch_insel1_2: IO pin input source
+ ccl_arch_insel1_3: IO pin input source
+ ccl_arch_insel2_0: IO pin input source
+ ccl_arch_insel2_1: IO pin input source
+ ccl_arch_insel2_2: IO pin input source
+ ccl_arch_insel2_3: IO pin input source
+ ccl_arch_invei_0: false
+ ccl_arch_invei_1: false
+ ccl_arch_invei_2: false
+ ccl_arch_invei_3: false
+ ccl_arch_lutctrl0: false
+ ccl_arch_lutctrl1: false
+ ccl_arch_lutctrl2: false
+ ccl_arch_lutctrl3: false
+ ccl_arch_lutei_0: false
+ ccl_arch_lutei_1: false
+ ccl_arch_lutei_2: false
+ ccl_arch_lutei_3: false
+ ccl_arch_luteo_0: false
+ ccl_arch_luteo_1: false
+ ccl_arch_luteo_2: false
+ ccl_arch_luteo_3: false
+ ccl_arch_runstdby: false
+ ccl_arch_seqsel_0: Sequential logic is disabled
+ ccl_arch_seqsel_1: Sequential logic is disabled
+ ccl_arch_truth_0: 0
+ ccl_arch_truth_1: 0
+ ccl_arch_truth_2: 0
+ ccl_arch_truth_3: 0
+ ccl_e_persistance_0: ''
+ ccl_e_persistance_1: ''
+ ccl_e_persistance_2: ''
+ ccl_e_persistance_3: ''
+ ccl_l_persistance_0: ''
+ ccl_l_persistance_1: ''
+ ccl_l_persistance_2: ''
+ ccl_l_persistance_3: ''
+ optional_signals:
+ - identifier: DIGITAL_GLUE_LOGIC_0:IN/0
+ pad: PA04
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::CCL.IN.0
+ name: CCL/IN/0
+ label: IN/0
+ - identifier: DIGITAL_GLUE_LOGIC_0:IN/1
+ pad: PA05
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::CCL.IN.1
+ name: CCL/IN/1
+ label: IN/1
+ - identifier: DIGITAL_GLUE_LOGIC_0:IN/2
+ pad: PA06
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::CCL.IN.2
+ name: CCL/IN/2
+ label: IN/2
+ - identifier: DIGITAL_GLUE_LOGIC_0:IN/6
+ pad: PA22
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::CCL.IN.6
+ name: CCL/IN/6
+ label: IN/6
+ - identifier: DIGITAL_GLUE_LOGIC_0:IN/7
+ pad: PA23
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::CCL.IN.7
+ name: CCL/IN/7
+ label: IN/7
+ - identifier: DIGITAL_GLUE_LOGIC_0:IN/8
+ pad: PA24
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::CCL.IN.8
+ name: CCL/IN/8
+ label: IN/8
+ variant: null
+ clocks:
+ domain_group:
+ nodes:
+ - name: CCL
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ configuration:
+ ccl_gclk_selection: Generic clock generator 0
+ CMCC:
+ user_label: CMCC
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::CMCC::driver_config_definition::CMCC::HAL:HPL:CMCC
+ functionality: System
+ api: HAL:HPL:CMCC
+ configuration:
+ cache_size: 4 KB
+ cmcc_advanced_configuration: false
+ cmcc_clock_gating_disable: false
+ cmcc_data_cache_disable: false
+ cmcc_enable: false
+ cmcc_inst_cache_disable: false
+ optional_signals: []
+ variant: null
+ clocks:
+ domain_group: null
+ DMAC:
+ user_label: DMAC
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::DMAC::driver_config_definition::DMAC::HAL:HPL:DMAC
+ functionality: System
+ api: HAL:HPL:DMAC
+ configuration:
+ dmac_beatsize_0: 8-bit bus transfer
+ dmac_beatsize_1: 8-bit bus transfer
+ dmac_beatsize_10: 8-bit bus transfer
+ dmac_beatsize_11: 8-bit bus transfer
+ dmac_beatsize_12: 8-bit bus transfer
+ dmac_beatsize_13: 8-bit bus transfer
+ dmac_beatsize_14: 8-bit bus transfer
+ dmac_beatsize_15: 8-bit bus transfer
+ dmac_beatsize_16: 8-bit bus transfer
+ dmac_beatsize_17: 8-bit bus transfer
+ dmac_beatsize_18: 8-bit bus transfer
+ dmac_beatsize_19: 8-bit bus transfer
+ dmac_beatsize_2: 8-bit bus transfer
+ dmac_beatsize_20: 8-bit bus transfer
+ dmac_beatsize_21: 8-bit bus transfer
+ dmac_beatsize_22: 8-bit bus transfer
+ dmac_beatsize_23: 8-bit bus transfer
+ dmac_beatsize_24: 8-bit bus transfer
+ dmac_beatsize_25: 8-bit bus transfer
+ dmac_beatsize_26: 8-bit bus transfer
+ dmac_beatsize_27: 8-bit bus transfer
+ dmac_beatsize_28: 8-bit bus transfer
+ dmac_beatsize_29: 8-bit bus transfer
+ dmac_beatsize_3: 8-bit bus transfer
+ dmac_beatsize_30: 8-bit bus transfer
+ dmac_beatsize_31: 8-bit bus transfer
+ dmac_beatsize_4: 8-bit bus transfer
+ dmac_beatsize_5: 8-bit bus transfer
+ dmac_beatsize_6: 8-bit bus transfer
+ dmac_beatsize_7: 8-bit bus transfer
+ dmac_beatsize_8: 8-bit bus transfer
+ dmac_beatsize_9: 8-bit bus transfer
+ dmac_blockact_0: Channel will be disabled if it is the last block transfer in
+ the transaction
+ dmac_blockact_1: Channel will be disabled if it is the last block transfer in
+ the transaction
+ dmac_blockact_10: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_11: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_12: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_13: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_14: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_15: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_16: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_17: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_18: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_19: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_2: Channel will be disabled if it is the last block transfer in
+ the transaction
+ dmac_blockact_20: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_21: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_22: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_23: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_24: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_25: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_26: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_27: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_28: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_29: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_3: Channel will be disabled if it is the last block transfer in
+ the transaction
+ dmac_blockact_30: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_31: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_4: Channel will be disabled if it is the last block transfer in
+ the transaction
+ dmac_blockact_5: Channel will be disabled if it is the last block transfer in
+ the transaction
+ dmac_blockact_6: Channel will be disabled if it is the last block transfer in
+ the transaction
+ dmac_blockact_7: Channel will be disabled if it is the last block transfer in
+ the transaction
+ dmac_blockact_8: Channel will be disabled if it is the last block transfer in
+ the transaction
+ dmac_blockact_9: Channel will be disabled if it is the last block transfer in
+ the transaction
+ dmac_channel_0_settings: false
+ dmac_channel_10_settings: false
+ dmac_channel_11_settings: false
+ dmac_channel_12_settings: false
+ dmac_channel_13_settings: false
+ dmac_channel_14_settings: false
+ dmac_channel_15_settings: false
+ dmac_channel_16_settings: false
+ dmac_channel_17_settings: false
+ dmac_channel_18_settings: false
+ dmac_channel_19_settings: false
+ dmac_channel_1_settings: false
+ dmac_channel_20_settings: false
+ dmac_channel_21_settings: false
+ dmac_channel_22_settings: false
+ dmac_channel_23_settings: false
+ dmac_channel_24_settings: false
+ dmac_channel_25_settings: false
+ dmac_channel_26_settings: false
+ dmac_channel_27_settings: false
+ dmac_channel_28_settings: false
+ dmac_channel_29_settings: false
+ dmac_channel_2_settings: false
+ dmac_channel_30_settings: false
+ dmac_channel_31_settings: false
+ dmac_channel_3_settings: false
+ dmac_channel_4_settings: false
+ dmac_channel_5_settings: false
+ dmac_channel_6_settings: false
+ dmac_channel_7_settings: false
+ dmac_channel_8_settings: false
+ dmac_channel_9_settings: false
+ dmac_dbgrun: false
+ dmac_dstinc_0: false
+ dmac_dstinc_1: false
+ dmac_dstinc_10: false
+ dmac_dstinc_11: false
+ dmac_dstinc_12: false
+ dmac_dstinc_13: false
+ dmac_dstinc_14: false
+ dmac_dstinc_15: false
+ dmac_dstinc_16: false
+ dmac_dstinc_17: false
+ dmac_dstinc_18: false
+ dmac_dstinc_19: false
+ dmac_dstinc_2: false
+ dmac_dstinc_20: false
+ dmac_dstinc_21: false
+ dmac_dstinc_22: false
+ dmac_dstinc_23: false
+ dmac_dstinc_24: false
+ dmac_dstinc_25: false
+ dmac_dstinc_26: false
+ dmac_dstinc_27: false
+ dmac_dstinc_28: false
+ dmac_dstinc_29: false
+ dmac_dstinc_3: false
+ dmac_dstinc_30: false
+ dmac_dstinc_31: false
+ dmac_dstinc_4: false
+ dmac_dstinc_5: false
+ dmac_dstinc_6: false
+ dmac_dstinc_7: false
+ dmac_dstinc_8: false
+ dmac_dstinc_9: false
+ dmac_enable: false
+ dmac_evact_0: No action
+ dmac_evact_1: No action
+ dmac_evact_10: No action
+ dmac_evact_11: No action
+ dmac_evact_12: No action
+ dmac_evact_13: No action
+ dmac_evact_14: No action
+ dmac_evact_15: No action
+ dmac_evact_16: No action
+ dmac_evact_17: No action
+ dmac_evact_18: No action
+ dmac_evact_19: No action
+ dmac_evact_2: No action
+ dmac_evact_20: No action
+ dmac_evact_21: No action
+ dmac_evact_22: No action
+ dmac_evact_23: No action
+ dmac_evact_24: No action
+ dmac_evact_25: No action
+ dmac_evact_26: No action
+ dmac_evact_27: No action
+ dmac_evact_28: No action
+ dmac_evact_29: No action
+ dmac_evact_3: No action
+ dmac_evact_30: No action
+ dmac_evact_31: No action
+ dmac_evact_4: No action
+ dmac_evact_5: No action
+ dmac_evact_6: No action
+ dmac_evact_7: No action
+ dmac_evact_8: No action
+ dmac_evact_9: No action
+ dmac_evie_0: false
+ dmac_evie_1: false
+ dmac_evie_10: false
+ dmac_evie_11: false
+ dmac_evie_12: false
+ dmac_evie_13: false
+ dmac_evie_14: false
+ dmac_evie_15: false
+ dmac_evie_16: false
+ dmac_evie_17: false
+ dmac_evie_18: false
+ dmac_evie_19: false
+ dmac_evie_2: false
+ dmac_evie_20: false
+ dmac_evie_21: false
+ dmac_evie_22: false
+ dmac_evie_23: false
+ dmac_evie_24: false
+ dmac_evie_25: false
+ dmac_evie_26: false
+ dmac_evie_27: false
+ dmac_evie_28: false
+ dmac_evie_29: false
+ dmac_evie_3: false
+ dmac_evie_30: false
+ dmac_evie_31: false
+ dmac_evie_4: false
+ dmac_evie_5: false
+ dmac_evie_6: false
+ dmac_evie_7: false
+ dmac_evie_8: false
+ dmac_evie_9: false
+ dmac_evoe_0: false
+ dmac_evoe_1: false
+ dmac_evoe_10: false
+ dmac_evoe_11: false
+ dmac_evoe_12: false
+ dmac_evoe_13: false
+ dmac_evoe_14: false
+ dmac_evoe_15: false
+ dmac_evoe_16: false
+ dmac_evoe_17: false
+ dmac_evoe_18: false
+ dmac_evoe_19: false
+ dmac_evoe_2: false
+ dmac_evoe_20: false
+ dmac_evoe_21: false
+ dmac_evoe_22: false
+ dmac_evoe_23: false
+ dmac_evoe_24: false
+ dmac_evoe_25: false
+ dmac_evoe_26: false
+ dmac_evoe_27: false
+ dmac_evoe_28: false
+ dmac_evoe_29: false
+ dmac_evoe_3: false
+ dmac_evoe_30: false
+ dmac_evoe_31: false
+ dmac_evoe_4: false
+ dmac_evoe_5: false
+ dmac_evoe_6: false
+ dmac_evoe_7: false
+ dmac_evoe_8: false
+ dmac_evoe_9: false
+ dmac_evosel_0: Event generation disabled
+ dmac_evosel_1: Event generation disabled
+ dmac_evosel_10: Event generation disabled
+ dmac_evosel_11: Event generation disabled
+ dmac_evosel_12: Event generation disabled
+ dmac_evosel_13: Event generation disabled
+ dmac_evosel_14: Event generation disabled
+ dmac_evosel_15: Event generation disabled
+ dmac_evosel_16: Event generation disabled
+ dmac_evosel_17: Event generation disabled
+ dmac_evosel_18: Event generation disabled
+ dmac_evosel_19: Event generation disabled
+ dmac_evosel_2: Event generation disabled
+ dmac_evosel_20: Event generation disabled
+ dmac_evosel_21: Event generation disabled
+ dmac_evosel_22: Event generation disabled
+ dmac_evosel_23: Event generation disabled
+ dmac_evosel_24: Event generation disabled
+ dmac_evosel_25: Event generation disabled
+ dmac_evosel_26: Event generation disabled
+ dmac_evosel_27: Event generation disabled
+ dmac_evosel_28: Event generation disabled
+ dmac_evosel_29: Event generation disabled
+ dmac_evosel_3: Event generation disabled
+ dmac_evosel_30: Event generation disabled
+ dmac_evosel_31: Event generation disabled
+ dmac_evosel_4: Event generation disabled
+ dmac_evosel_5: Event generation disabled
+ dmac_evosel_6: Event generation disabled
+ dmac_evosel_7: Event generation disabled
+ dmac_evosel_8: Event generation disabled
+ dmac_evosel_9: Event generation disabled
+ dmac_lvl_0: Channel priority 0
+ dmac_lvl_1: Channel priority 0
+ dmac_lvl_10: Channel priority 0
+ dmac_lvl_11: Channel priority 0
+ dmac_lvl_12: Channel priority 0
+ dmac_lvl_13: Channel priority 0
+ dmac_lvl_14: Channel priority 0
+ dmac_lvl_15: Channel priority 0
+ dmac_lvl_16: Channel priority 0
+ dmac_lvl_17: Channel priority 0
+ dmac_lvl_18: Channel priority 0
+ dmac_lvl_19: Channel priority 0
+ dmac_lvl_2: Channel priority 0
+ dmac_lvl_20: Channel priority 0
+ dmac_lvl_21: Channel priority 0
+ dmac_lvl_22: Channel priority 0
+ dmac_lvl_23: Channel priority 0
+ dmac_lvl_24: Channel priority 0
+ dmac_lvl_25: Channel priority 0
+ dmac_lvl_26: Channel priority 0
+ dmac_lvl_27: Channel priority 0
+ dmac_lvl_28: Channel priority 0
+ dmac_lvl_29: Channel priority 0
+ dmac_lvl_3: Channel priority 0
+ dmac_lvl_30: Channel priority 0
+ dmac_lvl_31: Channel priority 0
+ dmac_lvl_4: Channel priority 0
+ dmac_lvl_5: Channel priority 0
+ dmac_lvl_6: Channel priority 0
+ dmac_lvl_7: Channel priority 0
+ dmac_lvl_8: Channel priority 0
+ dmac_lvl_9: Channel priority 0
+ dmac_lvlen0: true
+ dmac_lvlen1: true
+ dmac_lvlen2: true
+ dmac_lvlen3: true
+ dmac_lvlpri0: 0
+ dmac_lvlpri1: 0
+ dmac_lvlpri2: 0
+ dmac_lvlpri3: 0
+ dmac_rrlvlen0: Static arbitration scheme for channel with priority 0
+ dmac_rrlvlen1: Static arbitration scheme for channel with priority 1
+ dmac_rrlvlen2: Static arbitration scheme for channel with priority 2
+ dmac_rrlvlen3: Static arbitration scheme for channel with priority 3
+ dmac_runstdby_0: false
+ dmac_runstdby_1: false
+ dmac_runstdby_10: false
+ dmac_runstdby_11: false
+ dmac_runstdby_12: false
+ dmac_runstdby_13: false
+ dmac_runstdby_14: false
+ dmac_runstdby_15: false
+ dmac_runstdby_16: false
+ dmac_runstdby_17: false
+ dmac_runstdby_18: false
+ dmac_runstdby_19: false
+ dmac_runstdby_2: false
+ dmac_runstdby_20: false
+ dmac_runstdby_21: false
+ dmac_runstdby_22: false
+ dmac_runstdby_23: false
+ dmac_runstdby_24: false
+ dmac_runstdby_25: false
+ dmac_runstdby_26: false
+ dmac_runstdby_27: false
+ dmac_runstdby_28: false
+ dmac_runstdby_29: false
+ dmac_runstdby_3: false
+ dmac_runstdby_30: false
+ dmac_runstdby_31: false
+ dmac_runstdby_4: false
+ dmac_runstdby_5: false
+ dmac_runstdby_6: false
+ dmac_runstdby_7: false
+ dmac_runstdby_8: false
+ dmac_runstdby_9: false
+ dmac_srcinc_0: false
+ dmac_srcinc_1: false
+ dmac_srcinc_10: false
+ dmac_srcinc_11: false
+ dmac_srcinc_12: false
+ dmac_srcinc_13: false
+ dmac_srcinc_14: false
+ dmac_srcinc_15: false
+ dmac_srcinc_16: false
+ dmac_srcinc_17: false
+ dmac_srcinc_18: false
+ dmac_srcinc_19: false
+ dmac_srcinc_2: false
+ dmac_srcinc_20: false
+ dmac_srcinc_21: false
+ dmac_srcinc_22: false
+ dmac_srcinc_23: false
+ dmac_srcinc_24: false
+ dmac_srcinc_25: false
+ dmac_srcinc_26: false
+ dmac_srcinc_27: false
+ dmac_srcinc_28: false
+ dmac_srcinc_29: false
+ dmac_srcinc_3: false
+ dmac_srcinc_30: false
+ dmac_srcinc_31: false
+ dmac_srcinc_4: false
+ dmac_srcinc_5: false
+ dmac_srcinc_6: false
+ dmac_srcinc_7: false
+ dmac_srcinc_8: false
+ dmac_srcinc_9: false
+ dmac_stepsel_0: Step size settings apply to the destination address
+ dmac_stepsel_1: Step size settings apply to the destination address
+ dmac_stepsel_10: Step size settings apply to the destination address
+ dmac_stepsel_11: Step size settings apply to the destination address
+ dmac_stepsel_12: Step size settings apply to the destination address
+ dmac_stepsel_13: Step size settings apply to the destination address
+ dmac_stepsel_14: Step size settings apply to the destination address
+ dmac_stepsel_15: Step size settings apply to the destination address
+ dmac_stepsel_16: Step size settings apply to the destination address
+ dmac_stepsel_17: Step size settings apply to the destination address
+ dmac_stepsel_18: Step size settings apply to the destination address
+ dmac_stepsel_19: Step size settings apply to the destination address
+ dmac_stepsel_2: Step size settings apply to the destination address
+ dmac_stepsel_20: Step size settings apply to the destination address
+ dmac_stepsel_21: Step size settings apply to the destination address
+ dmac_stepsel_22: Step size settings apply to the destination address
+ dmac_stepsel_23: Step size settings apply to the destination address
+ dmac_stepsel_24: Step size settings apply to the destination address
+ dmac_stepsel_25: Step size settings apply to the destination address
+ dmac_stepsel_26: Step size settings apply to the destination address
+ dmac_stepsel_27: Step size settings apply to the destination address
+ dmac_stepsel_28: Step size settings apply to the destination address
+ dmac_stepsel_29: Step size settings apply to the destination address
+ dmac_stepsel_3: Step size settings apply to the destination address
+ dmac_stepsel_30: Step size settings apply to the destination address
+ dmac_stepsel_31: Step size settings apply to the destination address
+ dmac_stepsel_4: Step size settings apply to the destination address
+ dmac_stepsel_5: Step size settings apply to the destination address
+ dmac_stepsel_6: Step size settings apply to the destination address
+ dmac_stepsel_7: Step size settings apply to the destination address
+ dmac_stepsel_8: Step size settings apply to the destination address
+ dmac_stepsel_9: Step size settings apply to the destination address
+ dmac_stepsize_0: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_1: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_10: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_11: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_12: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_13: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_14: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_15: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_16: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_17: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_18: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_19: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_2: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_20: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_21: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_22: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_23: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_24: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_25: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_26: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_27: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_28: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_29: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_3: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_30: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_31: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_4: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_5: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_6: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_7: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_8: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_9: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_trifsrc_0: Only software/event triggers
+ dmac_trifsrc_1: Only software/event triggers
+ dmac_trifsrc_10: Only software/event triggers
+ dmac_trifsrc_11: Only software/event triggers
+ dmac_trifsrc_12: Only software/event triggers
+ dmac_trifsrc_13: Only software/event triggers
+ dmac_trifsrc_14: Only software/event triggers
+ dmac_trifsrc_15: Only software/event triggers
+ dmac_trifsrc_16: Only software/event triggers
+ dmac_trifsrc_17: Only software/event triggers
+ dmac_trifsrc_18: Only software/event triggers
+ dmac_trifsrc_19: Only software/event triggers
+ dmac_trifsrc_2: Only software/event triggers
+ dmac_trifsrc_20: Only software/event triggers
+ dmac_trifsrc_21: Only software/event triggers
+ dmac_trifsrc_22: Only software/event triggers
+ dmac_trifsrc_23: Only software/event triggers
+ dmac_trifsrc_24: Only software/event triggers
+ dmac_trifsrc_25: Only software/event triggers
+ dmac_trifsrc_26: Only software/event triggers
+ dmac_trifsrc_27: Only software/event triggers
+ dmac_trifsrc_28: Only software/event triggers
+ dmac_trifsrc_29: Only software/event triggers
+ dmac_trifsrc_3: Only software/event triggers
+ dmac_trifsrc_30: Only software/event triggers
+ dmac_trifsrc_31: Only software/event triggers
+ dmac_trifsrc_4: Only software/event triggers
+ dmac_trifsrc_5: Only software/event triggers
+ dmac_trifsrc_6: Only software/event triggers
+ dmac_trifsrc_7: Only software/event triggers
+ dmac_trifsrc_8: Only software/event triggers
+ dmac_trifsrc_9: Only software/event triggers
+ dmac_trigact_0: One trigger required for each block transfer
+ dmac_trigact_1: One trigger required for each block transfer
+ dmac_trigact_10: One trigger required for each block transfer
+ dmac_trigact_11: One trigger required for each block transfer
+ dmac_trigact_12: One trigger required for each block transfer
+ dmac_trigact_13: One trigger required for each block transfer
+ dmac_trigact_14: One trigger required for each block transfer
+ dmac_trigact_15: One trigger required for each block transfer
+ dmac_trigact_16: One trigger required for each block transfer
+ dmac_trigact_17: One trigger required for each block transfer
+ dmac_trigact_18: One trigger required for each block transfer
+ dmac_trigact_19: One trigger required for each block transfer
+ dmac_trigact_2: One trigger required for each block transfer
+ dmac_trigact_20: One trigger required for each block transfer
+ dmac_trigact_21: One trigger required for each block transfer
+ dmac_trigact_22: One trigger required for each block transfer
+ dmac_trigact_23: One trigger required for each block transfer
+ dmac_trigact_24: One trigger required for each block transfer
+ dmac_trigact_25: One trigger required for each block transfer
+ dmac_trigact_26: One trigger required for each block transfer
+ dmac_trigact_27: One trigger required for each block transfer
+ dmac_trigact_28: One trigger required for each block transfer
+ dmac_trigact_29: One trigger required for each block transfer
+ dmac_trigact_3: One trigger required for each block transfer
+ dmac_trigact_30: One trigger required for each block transfer
+ dmac_trigact_31: One trigger required for each block transfer
+ dmac_trigact_4: One trigger required for each block transfer
+ dmac_trigact_5: One trigger required for each block transfer
+ dmac_trigact_6: One trigger required for each block transfer
+ dmac_trigact_7: One trigger required for each block transfer
+ dmac_trigact_8: One trigger required for each block transfer
+ dmac_trigact_9: One trigger required for each block transfer
+ optional_signals: []
+ variant: null
+ clocks:
+ domain_group: null
+ EXTERNAL_IRQ_0:
+ user_label: EXTERNAL_IRQ_0
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::EIC::driver_config_definition::Default::HAL:Driver:Ext.IRQ
+ functionality: External_IRQ
+ api: HAL:Driver:Ext_IRQ
+ configuration:
+ eic_arch_asynch0: false
+ eic_arch_asynch1: false
+ eic_arch_asynch10: false
+ eic_arch_asynch11: false
+ eic_arch_asynch12: false
+ eic_arch_asynch13: false
+ eic_arch_asynch14: false
+ eic_arch_asynch15: false
+ eic_arch_asynch2: false
+ eic_arch_asynch3: false
+ eic_arch_asynch4: false
+ eic_arch_asynch5: false
+ eic_arch_asynch6: false
+ eic_arch_asynch7: false
+ eic_arch_asynch8: false
+ eic_arch_asynch9: false
+ eic_arch_cksel: Clocked by GCLK
+ eic_arch_debounce_enable0: false
+ eic_arch_debounce_enable1: false
+ eic_arch_debounce_enable10: false
+ eic_arch_debounce_enable11: false
+ eic_arch_debounce_enable12: false
+ eic_arch_debounce_enable13: false
+ eic_arch_debounce_enable14: false
+ eic_arch_debounce_enable15: false
+ eic_arch_debounce_enable2: false
+ eic_arch_debounce_enable3: false
+ eic_arch_debounce_enable4: false
+ eic_arch_debounce_enable5: false
+ eic_arch_debounce_enable6: false
+ eic_arch_debounce_enable7: false
+ eic_arch_debounce_enable8: false
+ eic_arch_debounce_enable9: false
+ eic_arch_enable_irq_setting0: false
+ eic_arch_enable_irq_setting1: false
+ eic_arch_enable_irq_setting10: false
+ eic_arch_enable_irq_setting11: false
+ eic_arch_enable_irq_setting12: false
+ eic_arch_enable_irq_setting13: false
+ eic_arch_enable_irq_setting14: false
+ eic_arch_enable_irq_setting15: false
+ eic_arch_enable_irq_setting2: false
+ eic_arch_enable_irq_setting3: false
+ eic_arch_enable_irq_setting4: false
+ eic_arch_enable_irq_setting5: false
+ eic_arch_enable_irq_setting6: false
+ eic_arch_enable_irq_setting7: false
+ eic_arch_enable_irq_setting8: false
+ eic_arch_enable_irq_setting9: false
+ eic_arch_extinteo0: false
+ eic_arch_extinteo1: false
+ eic_arch_extinteo10: false
+ eic_arch_extinteo11: false
+ eic_arch_extinteo12: false
+ eic_arch_extinteo13: false
+ eic_arch_extinteo14: false
+ eic_arch_extinteo15: false
+ eic_arch_extinteo2: false
+ eic_arch_extinteo3: false
+ eic_arch_extinteo4: false
+ eic_arch_extinteo5: false
+ eic_arch_extinteo6: false
+ eic_arch_extinteo7: false
+ eic_arch_extinteo8: false
+ eic_arch_extinteo9: false
+ eic_arch_filten0: false
+ eic_arch_filten1: false
+ eic_arch_filten10: false
+ eic_arch_filten11: false
+ eic_arch_filten12: false
+ eic_arch_filten13: false
+ eic_arch_filten14: false
+ eic_arch_filten15: false
+ eic_arch_filten2: false
+ eic_arch_filten3: false
+ eic_arch_filten4: false
+ eic_arch_filten5: false
+ eic_arch_filten6: false
+ eic_arch_filten7: false
+ eic_arch_filten8: false
+ eic_arch_filten9: false
+ eic_arch_nmi_ctrl: false
+ eic_arch_nmiasynch: false
+ eic_arch_nmifilten: false
+ eic_arch_nmisense: No detection
+ eic_arch_prescaler0: Divided by 2
+ eic_arch_prescaler1: Divided by 2
+ eic_arch_sense0: No detection
+ eic_arch_sense1: No detection
+ eic_arch_sense10: No detection
+ eic_arch_sense11: No detection
+ eic_arch_sense12: No detection
+ eic_arch_sense13: No detection
+ eic_arch_sense14: No detection
+ eic_arch_sense15: No detection
+ eic_arch_sense2: No detection
+ eic_arch_sense3: No detection
+ eic_arch_sense4: No detection
+ eic_arch_sense5: No detection
+ eic_arch_sense6: No detection
+ eic_arch_sense7: No detection
+ eic_arch_sense8: No detection
+ eic_arch_sense9: No detection
+ eic_arch_states0: '3'
+ eic_arch_states1: '3'
+ eic_arch_tickon: The sampling rate is EIC clock
+ optional_signals:
+ - identifier: EXTERNAL_IRQ_0:EXTINT/11
+ pad: PB11
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::EIC.EXTINT.11
+ name: EIC/EXTINT/11
+ label: EXTINT/11
+ - identifier: EXTERNAL_IRQ_0:EXTINT/14
+ pad: PB30
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::EIC.EXTINT.14
+ name: EIC/EXTINT/14
+ label: EXTINT/14
+ - identifier: EXTERNAL_IRQ_0:EXTINT/15
+ pad: PB31
+ mode: Enabled
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::EIC.EXTINT.15
+ name: EIC/EXTINT/15
+ label: EXTINT/15
+ variant: null
+ clocks:
+ domain_group:
+ nodes:
+ - name: EIC
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ configuration:
+ eic_gclk_selection: Generic clock generator 0
+ EVENT_SYSTEM_0:
+ user_label: EVENT_SYSTEM_0
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::EVSYS::driver_config_definition::Event.System::HAL:Driver:Event.system
+ functionality: Event_System
+ api: HAL:Driver:Event_system
+ configuration:
+ evsys_channel_0: No channel output selected
+ evsys_channel_1: No channel output selected
+ evsys_channel_10: No channel output selected
+ evsys_channel_11: No channel output selected
+ evsys_channel_12: No channel output selected
+ evsys_channel_17: No channel output selected
+ evsys_channel_18: No channel output selected
+ evsys_channel_19: No channel output selected
+ evsys_channel_2: No channel output selected
+ evsys_channel_20: No channel output selected
+ evsys_channel_21: No channel output selected
+ evsys_channel_22: No channel output selected
+ evsys_channel_23: No channel output selected
+ evsys_channel_24: No channel output selected
+ evsys_channel_25: No channel output selected
+ evsys_channel_26: No channel output selected
+ evsys_channel_27: No channel output selected
+ evsys_channel_28: No channel output selected
+ evsys_channel_29: No channel output selected
+ evsys_channel_3: No channel output selected
+ evsys_channel_30: No channel output selected
+ evsys_channel_31: No channel output selected
+ evsys_channel_32: No channel output selected
+ evsys_channel_33: No channel output selected
+ evsys_channel_34: No channel output selected
+ evsys_channel_35: No channel output selected
+ evsys_channel_36: No channel output selected
+ evsys_channel_37: No channel output selected
+ evsys_channel_38: No channel output selected
+ evsys_channel_39: No channel output selected
+ evsys_channel_4: No channel output selected
+ evsys_channel_40: No channel output selected
+ evsys_channel_41: No channel output selected
+ evsys_channel_42: No channel output selected
+ evsys_channel_43: No channel output selected
+ evsys_channel_44: No channel output selected
+ evsys_channel_45: No channel output selected
+ evsys_channel_46: No channel output selected
+ evsys_channel_47: No channel output selected
+ evsys_channel_48: No channel output selected
+ evsys_channel_49: No channel output selected
+ evsys_channel_5: No channel output selected
+ evsys_channel_50: No channel output selected
+ evsys_channel_51: No channel output selected
+ evsys_channel_52: No channel output selected
+ evsys_channel_53: No channel output selected
+ evsys_channel_54: No channel output selected
+ evsys_channel_55: No channel output selected
+ evsys_channel_56: No channel output selected
+ evsys_channel_57: No channel output selected
+ evsys_channel_58: No channel output selected
+ evsys_channel_59: No channel output selected
+ evsys_channel_6: No channel output selected
+ evsys_channel_60: No channel output selected
+ evsys_channel_61: No channel output selected
+ evsys_channel_62: No channel output selected
+ evsys_channel_63: No channel output selected
+ evsys_channel_64: No channel output selected
+ evsys_channel_65: No channel output selected
+ evsys_channel_66: No channel output selected
+ evsys_channel_7: No channel output selected
+ evsys_channel_8: No channel output selected
+ evsys_channel_9: No channel output selected
+ evsys_channel_setting_0: false
+ evsys_channel_setting_1: false
+ evsys_channel_setting_10: false
+ evsys_channel_setting_11: false
+ evsys_channel_setting_12: false
+ evsys_channel_setting_13: false
+ evsys_channel_setting_14: false
+ evsys_channel_setting_15: false
+ evsys_channel_setting_16: false
+ evsys_channel_setting_17: false
+ evsys_channel_setting_18: false
+ evsys_channel_setting_19: false
+ evsys_channel_setting_2: false
+ evsys_channel_setting_20: false
+ evsys_channel_setting_21: false
+ evsys_channel_setting_22: false
+ evsys_channel_setting_23: false
+ evsys_channel_setting_24: false
+ evsys_channel_setting_25: false
+ evsys_channel_setting_26: false
+ evsys_channel_setting_27: false
+ evsys_channel_setting_28: false
+ evsys_channel_setting_29: false
+ evsys_channel_setting_3: false
+ evsys_channel_setting_30: false
+ evsys_channel_setting_31: false
+ evsys_channel_setting_4: false
+ evsys_channel_setting_5: false
+ evsys_channel_setting_6: false
+ evsys_channel_setting_7: false
+ evsys_channel_setting_8: false
+ evsys_channel_setting_9: false
+ evsys_edgsel_0: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_1: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_10: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_11: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_12: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_13: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_14: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_15: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_16: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_17: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_18: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_19: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_2: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_20: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_21: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_22: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_23: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_24: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_25: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_26: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_27: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_28: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_29: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_3: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_30: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_31: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_4: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_5: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_6: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_7: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_8: No event output when using the resynchronized or synchronous
+ path
+ evsys_edgsel_9: No event output when using the resynchronized or synchronous
+ path
+ evsys_evd_0: false
+ evsys_evd_1: false
+ evsys_evd_10: false
+ evsys_evd_11: false
+ evsys_evd_12: false
+ evsys_evd_13: false
+ evsys_evd_14: false
+ evsys_evd_15: false
+ evsys_evd_16: false
+ evsys_evd_17: false
+ evsys_evd_18: false
+ evsys_evd_19: false
+ evsys_evd_2: false
+ evsys_evd_20: false
+ evsys_evd_21: false
+ evsys_evd_22: false
+ evsys_evd_23: false
+ evsys_evd_24: false
+ evsys_evd_25: false
+ evsys_evd_26: false
+ evsys_evd_27: false
+ evsys_evd_28: false
+ evsys_evd_29: false
+ evsys_evd_3: false
+ evsys_evd_30: false
+ evsys_evd_31: false
+ evsys_evd_4: false
+ evsys_evd_5: false
+ evsys_evd_6: false
+ evsys_evd_7: false
+ evsys_evd_8: false
+ evsys_evd_9: false
+ evsys_evgen_0: No event generator
+ evsys_evgen_1: No event generator
+ evsys_evgen_10: No event generator
+ evsys_evgen_11: No event generator
+ evsys_evgen_12: No event generator
+ evsys_evgen_13: No event generator
+ evsys_evgen_14: No event generator
+ evsys_evgen_15: No event generator
+ evsys_evgen_16: No event generator
+ evsys_evgen_17: No event generator
+ evsys_evgen_18: No event generator
+ evsys_evgen_19: No event generator
+ evsys_evgen_2: No event generator
+ evsys_evgen_20: No event generator
+ evsys_evgen_21: No event generator
+ evsys_evgen_22: No event generator
+ evsys_evgen_23: No event generator
+ evsys_evgen_24: No event generator
+ evsys_evgen_25: No event generator
+ evsys_evgen_26: No event generator
+ evsys_evgen_27: No event generator
+ evsys_evgen_28: No event generator
+ evsys_evgen_29: No event generator
+ evsys_evgen_3: No event generator
+ evsys_evgen_30: No event generator
+ evsys_evgen_31: No event generator
+ evsys_evgen_4: No event generator
+ evsys_evgen_5: No event generator
+ evsys_evgen_6: No event generator
+ evsys_evgen_7: No event generator
+ evsys_evgen_8: No event generator
+ evsys_evgen_9: No event generator
+ evsys_ondemand_0: false
+ evsys_ondemand_1: false
+ evsys_ondemand_10: false
+ evsys_ondemand_11: false
+ evsys_ondemand_12: false
+ evsys_ondemand_13: false
+ evsys_ondemand_14: false
+ evsys_ondemand_15: false
+ evsys_ondemand_16: false
+ evsys_ondemand_17: false
+ evsys_ondemand_18: false
+ evsys_ondemand_19: false
+ evsys_ondemand_2: false
+ evsys_ondemand_20: false
+ evsys_ondemand_21: false
+ evsys_ondemand_22: false
+ evsys_ondemand_23: false
+ evsys_ondemand_24: false
+ evsys_ondemand_25: false
+ evsys_ondemand_26: false
+ evsys_ondemand_27: false
+ evsys_ondemand_28: false
+ evsys_ondemand_29: false
+ evsys_ondemand_3: false
+ evsys_ondemand_30: false
+ evsys_ondemand_31: false
+ evsys_ondemand_4: false
+ evsys_ondemand_5: false
+ evsys_ondemand_6: false
+ evsys_ondemand_7: false
+ evsys_ondemand_8: false
+ evsys_ondemand_9: false
+ evsys_ovr_0: false
+ evsys_ovr_1: false
+ evsys_ovr_10: false
+ evsys_ovr_11: false
+ evsys_ovr_12: false
+ evsys_ovr_13: false
+ evsys_ovr_14: false
+ evsys_ovr_15: false
+ evsys_ovr_16: false
+ evsys_ovr_17: false
+ evsys_ovr_18: false
+ evsys_ovr_19: false
+ evsys_ovr_2: false
+ evsys_ovr_20: false
+ evsys_ovr_21: false
+ evsys_ovr_22: false
+ evsys_ovr_23: false
+ evsys_ovr_24: false
+ evsys_ovr_25: false
+ evsys_ovr_26: false
+ evsys_ovr_27: false
+ evsys_ovr_28: false
+ evsys_ovr_29: false
+ evsys_ovr_3: false
+ evsys_ovr_30: false
+ evsys_ovr_31: false
+ evsys_ovr_4: false
+ evsys_ovr_5: false
+ evsys_ovr_6: false
+ evsys_ovr_7: false
+ evsys_ovr_8: false
+ evsys_ovr_9: false
+ evsys_path_0: Synchronous path
+ evsys_path_1: Synchronous path
+ evsys_path_10: Synchronous path
+ evsys_path_11: Synchronous path
+ evsys_path_12: Synchronous path
+ evsys_path_13: Synchronous path
+ evsys_path_14: Synchronous path
+ evsys_path_15: Synchronous path
+ evsys_path_16: Synchronous path
+ evsys_path_17: Synchronous path
+ evsys_path_18: Synchronous path
+ evsys_path_19: Synchronous path
+ evsys_path_2: Synchronous path
+ evsys_path_20: Synchronous path
+ evsys_path_21: Synchronous path
+ evsys_path_22: Synchronous path
+ evsys_path_23: Synchronous path
+ evsys_path_24: Synchronous path
+ evsys_path_25: Synchronous path
+ evsys_path_26: Synchronous path
+ evsys_path_27: Synchronous path
+ evsys_path_28: Synchronous path
+ evsys_path_29: Synchronous path
+ evsys_path_3: Synchronous path
+ evsys_path_30: Synchronous path
+ evsys_path_31: Synchronous path
+ evsys_path_4: Synchronous path
+ evsys_path_5: Synchronous path
+ evsys_path_6: Synchronous path
+ evsys_path_7: Synchronous path
+ evsys_path_8: Synchronous path
+ evsys_path_9: Synchronous path
+ evsys_runstdby_0: false
+ evsys_runstdby_1: false
+ evsys_runstdby_10: false
+ evsys_runstdby_11: false
+ evsys_runstdby_12: false
+ evsys_runstdby_13: false
+ evsys_runstdby_14: false
+ evsys_runstdby_15: false
+ evsys_runstdby_16: false
+ evsys_runstdby_17: false
+ evsys_runstdby_18: false
+ evsys_runstdby_19: false
+ evsys_runstdby_2: false
+ evsys_runstdby_20: false
+ evsys_runstdby_21: false
+ evsys_runstdby_22: false
+ evsys_runstdby_23: false
+ evsys_runstdby_24: false
+ evsys_runstdby_25: false
+ evsys_runstdby_26: false
+ evsys_runstdby_27: false
+ evsys_runstdby_28: false
+ evsys_runstdby_29: false
+ evsys_runstdby_3: false
+ evsys_runstdby_30: false
+ evsys_runstdby_31: false
+ evsys_runstdby_4: false
+ evsys_runstdby_5: false
+ evsys_runstdby_6: false
+ evsys_runstdby_7: false
+ evsys_runstdby_8: false
+ evsys_runstdby_9: false
+ optional_signals: []
+ variant: null
+ clocks:
+ domain_group:
+ nodes:
+ - name: Channel 0
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ - name: Channel 1
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ - name: Channel 2
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ - name: Channel 3
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ - name: Channel 4
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ - name: Channel 5
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ - name: Channel 6
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ - name: Channel 7
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ - name: Channel 8
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ - name: Channel 9
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ - name: Channel 10
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ - name: Channel 11
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ configuration:
+ evsys_clk_selection_0: Generic clock generator 0
+ evsys_clk_selection_1: Generic clock generator 0
+ evsys_clk_selection_10: Generic clock generator 0
+ evsys_clk_selection_11: Generic clock generator 0
+ evsys_clk_selection_2: Generic clock generator 0
+ evsys_clk_selection_3: Generic clock generator 0
+ evsys_clk_selection_4: Generic clock generator 0
+ evsys_clk_selection_5: Generic clock generator 0
+ evsys_clk_selection_6: Generic clock generator 0
+ evsys_clk_selection_7: Generic clock generator 0
+ evsys_clk_selection_8: Generic clock generator 0
+ evsys_clk_selection_9: Generic clock generator 0
+ GCLK:
+ user_label: GCLK
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::GCLK::driver_config_definition::GCLK::HAL:HPL:GCLK
+ functionality: System
+ api: HAL:HPL:GCLK
+ configuration:
+ $input: 12000000
+ $input_id: External Crystal Oscillator 8-48MHz (XOSC1)
+ RESERVED_InputFreq: 12000000
+ RESERVED_InputFreq_id: External Crystal Oscillator 8-48MHz (XOSC1)
+ _$freq_output_Generic clock generator 0: 12000000
+ _$freq_output_Generic clock generator 1: 48000000
+ _$freq_output_Generic clock generator 10: 12000000
+ _$freq_output_Generic clock generator 11: 12000000
+ _$freq_output_Generic clock generator 2: 3000000
+ _$freq_output_Generic clock generator 3: 32768
+ _$freq_output_Generic clock generator 4: 12000000
+ _$freq_output_Generic clock generator 5: 12000000
+ _$freq_output_Generic clock generator 6: 12000000
+ _$freq_output_Generic clock generator 7: 12000000
+ _$freq_output_Generic clock generator 8: 12000000
+ _$freq_output_Generic clock generator 9: 12000000
+ enable_gclk_gen_0: true
+ enable_gclk_gen_0__externalclock: 1000000
+ enable_gclk_gen_1: false
+ enable_gclk_gen_10: false
+ enable_gclk_gen_10__externalclock: 1000000
+ enable_gclk_gen_11: false
+ enable_gclk_gen_11__externalclock: 1000000
+ enable_gclk_gen_1__externalclock: 1000000
+ enable_gclk_gen_2: false
+ enable_gclk_gen_2__externalclock: 1000000
+ enable_gclk_gen_3: false
+ enable_gclk_gen_3__externalclock: 1000000
+ enable_gclk_gen_4: false
+ enable_gclk_gen_4__externalclock: 1000000
+ enable_gclk_gen_5: false
+ enable_gclk_gen_5__externalclock: 1000000
+ enable_gclk_gen_6: false
+ enable_gclk_gen_6__externalclock: 1000000
+ enable_gclk_gen_7: false
+ enable_gclk_gen_7__externalclock: 1000000
+ enable_gclk_gen_8: false
+ enable_gclk_gen_8__externalclock: 1000000
+ enable_gclk_gen_9: false
+ enable_gclk_gen_9__externalclock: 1000000
+ gclk_arch_gen_0_enable: true
+ gclk_arch_gen_0_idc: false
+ gclk_arch_gen_0_oe: false
+ gclk_arch_gen_0_oov: false
+ gclk_arch_gen_0_runstdby: false
+ gclk_arch_gen_10_enable: false
+ gclk_arch_gen_10_idc: false
+ gclk_arch_gen_10_oe: false
+ gclk_arch_gen_10_oov: false
+ gclk_arch_gen_10_runstdby: false
+ gclk_arch_gen_11_enable: false
+ gclk_arch_gen_11_idc: false
+ gclk_arch_gen_11_oe: false
+ gclk_arch_gen_11_oov: false
+ gclk_arch_gen_11_runstdby: false
+ gclk_arch_gen_1_enable: false
+ gclk_arch_gen_1_idc: false
+ gclk_arch_gen_1_oe: false
+ gclk_arch_gen_1_oov: false
+ gclk_arch_gen_1_runstdby: false
+ gclk_arch_gen_2_enable: false
+ gclk_arch_gen_2_idc: false
+ gclk_arch_gen_2_oe: false
+ gclk_arch_gen_2_oov: false
+ gclk_arch_gen_2_runstdby: false
+ gclk_arch_gen_3_enable: false
+ gclk_arch_gen_3_idc: false
+ gclk_arch_gen_3_oe: false
+ gclk_arch_gen_3_oov: false
+ gclk_arch_gen_3_runstdby: false
+ gclk_arch_gen_4_enable: false
+ gclk_arch_gen_4_idc: false
+ gclk_arch_gen_4_oe: false
+ gclk_arch_gen_4_oov: false
+ gclk_arch_gen_4_runstdby: false
+ gclk_arch_gen_5_enable: false
+ gclk_arch_gen_5_idc: false
+ gclk_arch_gen_5_oe: false
+ gclk_arch_gen_5_oov: false
+ gclk_arch_gen_5_runstdby: false
+ gclk_arch_gen_6_enable: false
+ gclk_arch_gen_6_idc: false
+ gclk_arch_gen_6_oe: false
+ gclk_arch_gen_6_oov: false
+ gclk_arch_gen_6_runstdby: false
+ gclk_arch_gen_7_enable: false
+ gclk_arch_gen_7_idc: false
+ gclk_arch_gen_7_oe: false
+ gclk_arch_gen_7_oov: false
+ gclk_arch_gen_7_runstdby: false
+ gclk_arch_gen_8_enable: false
+ gclk_arch_gen_8_idc: false
+ gclk_arch_gen_8_oe: false
+ gclk_arch_gen_8_oov: false
+ gclk_arch_gen_8_runstdby: false
+ gclk_arch_gen_9_enable: false
+ gclk_arch_gen_9_idc: false
+ gclk_arch_gen_9_oe: false
+ gclk_arch_gen_9_oov: false
+ gclk_arch_gen_9_runstdby: false
+ gclk_gen_0_div: 1
+ gclk_gen_0_div_sel: false
+ gclk_gen_0_oscillator: External Crystal Oscillator 8-48MHz (XOSC1)
+ gclk_gen_10_div: 1
+ gclk_gen_10_div_sel: false
+ gclk_gen_10_oscillator: External Crystal Oscillator 8-48MHz (XOSC1)
+ gclk_gen_11_div: 1
+ gclk_gen_11_div_sel: false
+ gclk_gen_11_oscillator: External Crystal Oscillator 8-48MHz (XOSC1)
+ gclk_gen_1_div: 1
+ gclk_gen_1_div_sel: false
+ gclk_gen_1_oscillator: Digital Frequency Locked Loop (DFLL48M)
+ gclk_gen_2_div: 1
+ gclk_gen_2_div_sel: true
+ gclk_gen_2_oscillator: External Crystal Oscillator 8-48MHz (XOSC1)
+ gclk_gen_3_div: 1
+ gclk_gen_3_div_sel: false
+ gclk_gen_3_oscillator: 32kHz External Crystal Oscillator (XOSC32K)
+ gclk_gen_4_div: 1
+ gclk_gen_4_div_sel: false
+ gclk_gen_4_oscillator: External Crystal Oscillator 8-48MHz (XOSC1)
+ gclk_gen_5_div: 1
+ gclk_gen_5_div_sel: false
+ gclk_gen_5_oscillator: External Crystal Oscillator 8-48MHz (XOSC1)
+ gclk_gen_6_div: 1
+ gclk_gen_6_div_sel: false
+ gclk_gen_6_oscillator: External Crystal Oscillator 8-48MHz (XOSC1)
+ gclk_gen_7_div: 1
+ gclk_gen_7_div_sel: false
+ gclk_gen_7_oscillator: External Crystal Oscillator 8-48MHz (XOSC1)
+ gclk_gen_8_div: 1
+ gclk_gen_8_div_sel: false
+ gclk_gen_8_oscillator: External Crystal Oscillator 8-48MHz (XOSC1)
+ gclk_gen_9_div: 1
+ gclk_gen_9_div_sel: false
+ gclk_gen_9_oscillator: External Crystal Oscillator 8-48MHz (XOSC1)
+ optional_signals: []
+ variant: null
+ clocks:
+ domain_group: null
+ MCLK:
+ user_label: MCLK
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::MCLK::driver_config_definition::MCLK::HAL:HPL:MCLK
+ functionality: System
+ api: HAL:HPL:MCLK
+ configuration:
+ $input: 12000000
+ $input_id: Generic clock generator 0
+ RESERVED_InputFreq: 12000000
+ RESERVED_InputFreq_id: Generic clock generator 0
+ _$freq_output_CPU: 12000000
+ cpu_clock_source: Generic clock generator 0
+ cpu_div: '1'
+ enable_cpu_clock: true
+ mclk_arch_bupdiv: Divide by 8
+ mclk_arch_hsdiv: Divide by 1
+ mclk_arch_lpdiv: Divide by 4
+ nvm_wait_states: '0'
+ optional_signals: []
+ variant: null
+ clocks:
+ domain_group:
+ nodes:
+ - name: CPU
+ input: CPU
+ external: false
+ external_frequency: 0
+ configuration: {}
+ OSC32KCTRL:
+ user_label: OSC32KCTRL
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::OSC32KCTRL::driver_config_definition::OSC32KCTRL::HAL:HPL:OSC32KCTRL
+ functionality: System
+ api: HAL:HPL:OSC32KCTRL
+ configuration:
+ $input: 32768
+ $input_id: 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
+ RESERVED_InputFreq: 32768
+ RESERVED_InputFreq_id: 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
+ _$freq_output_RTC source: 32768
+ enable_osculp32k: true
+ enable_rtc_source: false
+ enable_xosc32k: false
+ osculp32k_calib: 0
+ osculp32k_calib_enable: false
+ rtc_1khz_selection: false
+ rtc_source_oscillator: 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
+ xosc32k_arch_cfden: false
+ xosc32k_arch_cfdeo: false
+ xosc32k_arch_cgm: Standard mode
+ xosc32k_arch_en1k: false
+ xosc32k_arch_en32k: false
+ xosc32k_arch_enable: false
+ xosc32k_arch_ondemand: true
+ xosc32k_arch_runstdby: false
+ xosc32k_arch_startup: 62592us
+ xosc32k_arch_swben: false
+ xosc32k_arch_xtalen: true
+ optional_signals: []
+ variant: null
+ clocks:
+ domain_group: null
+ OSCCTRL:
+ user_label: OSCCTRL
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::OSCCTRL::driver_config_definition::OSCCTRL::HAL:HPL:OSCCTRL
+ functionality: System
+ api: HAL:HPL:OSCCTRL
+ configuration:
+ $input: 32768
+ $input_id: 32kHz External Crystal Oscillator (XOSC32K)
+ RESERVED_InputFreq: 32768
+ RESERVED_InputFreq_id: 32kHz External Crystal Oscillator (XOSC32K)
+ _$freq_output_Digital Frequency Locked Loop (DFLL48M): 48000000
+ _$freq_output_Digital Phase Locked Loop (DPLL0): 47985664
+ _$freq_output_Digital Phase Locked Loop (DPLL1): 47985664
+ _$freq_output_External Crystal Oscillator 8-48MHz (XOSC0): '12000000'
+ _$freq_output_External Crystal Oscillator 8-48MHz (XOSC1): '12000000'
+ dfll_arch_bplckc: false
+ dfll_arch_calibration: false
+ dfll_arch_ccdis: false
+ dfll_arch_coarse: 31
+ dfll_arch_cstep: 1
+ dfll_arch_enable: false
+ dfll_arch_fine: 128
+ dfll_arch_fstep: 1
+ dfll_arch_llaw: false
+ dfll_arch_ondemand: false
+ dfll_arch_qldis: false
+ dfll_arch_runstdby: false
+ dfll_arch_stable: false
+ dfll_arch_usbcrm: false
+ dfll_arch_waitlock: true
+ dfll_mode: Open Loop Mode
+ dfll_mul: 0
+ dfll_ref_clock: Generic clock generator 3
+ enable_dfll: false
+ enable_fdpll0: false
+ enable_fdpll1: false
+ enable_xosc0: false
+ enable_xosc1: true
+ fdpll0_arch_dcoen: false
+ fdpll0_arch_enable: false
+ fdpll0_arch_filter: 0
+ fdpll0_arch_lbypass: false
+ fdpll0_arch_ltime: No time-out, automatic lock
+ fdpll0_arch_ondemand: false
+ fdpll0_arch_refclk: XOSC32K clock reference
+ fdpll0_arch_runstdby: false
+ fdpll0_arch_wuf: false
+ fdpll0_clock_dcofilter: 0
+ fdpll0_clock_div: 0
+ fdpll0_ldr: 1463
+ fdpll0_ldrfrac: 13
+ fdpll0_ref_clock: 32kHz External Crystal Oscillator (XOSC32K)
+ fdpll1_arch_dcoen: false
+ fdpll1_arch_enable: false
+ fdpll1_arch_filter: 0
+ fdpll1_arch_lbypass: false
+ fdpll1_arch_ltime: No time-out, automatic lock
+ fdpll1_arch_ondemand: false
+ fdpll1_arch_refclk: XOSC32K clock reference
+ fdpll1_arch_runstdby: false
+ fdpll1_arch_wuf: false
+ fdpll1_clock_dcofilter: 0
+ fdpll1_clock_div: 0
+ fdpll1_ldr: 1463
+ fdpll1_ldrfrac: 13
+ fdpll1_ref_clock: 32kHz External Crystal Oscillator (XOSC32K)
+ xosc0_arch_cfden: false
+ xosc0_arch_enable: false
+ xosc0_arch_enalc: false
+ xosc0_arch_lowbufgain: false
+ xosc0_arch_ondemand: false
+ xosc0_arch_runstdby: false
+ xosc0_arch_startup: 31us
+ xosc0_arch_swben: false
+ xosc0_arch_xtalen: false
+ xosc0_frequency: 12000000
+ xosc1_arch_cfden: false
+ xosc1_arch_enable: true
+ xosc1_arch_enalc: false
+ xosc1_arch_lowbufgain: false
+ xosc1_arch_ondemand: false
+ xosc1_arch_runstdby: false
+ xosc1_arch_startup: 31us
+ xosc1_arch_swben: false
+ xosc1_arch_xtalen: true
+ xosc1_frequency: 12000000
+ optional_signals: []
+ variant: null
+ clocks:
+ domain_group: null
+ PORT:
+ user_label: PORT
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::PORT::driver_config_definition::PORT::HAL:HPL:PORT
+ functionality: System
+ api: HAL:HPL:PORT
+ configuration:
+ enable_port_input_event_0: false
+ enable_port_input_event_1: false
+ enable_port_input_event_2: false
+ enable_port_input_event_3: false
+ porta_event_action_0: Output register of pin will be set to level of event
+ porta_event_action_1: Output register of pin will be set to level of event
+ porta_event_action_2: Output register of pin will be set to level of event
+ porta_event_action_3: Output register of pin will be set to level of event
+ porta_event_pin_identifier_0: 0
+ porta_event_pin_identifier_1: 0
+ porta_event_pin_identifier_2: 0
+ porta_event_pin_identifier_3: 0
+ porta_input_event_enable_0: false
+ porta_input_event_enable_1: false
+ porta_input_event_enable_2: false
+ porta_input_event_enable_3: false
+ portb_event_action_0: Output register of pin will be set to level of event
+ portb_event_action_1: Output register of pin will be set to level of event
+ portb_event_action_2: Output register of pin will be set to level of event
+ portb_event_action_3: Output register of pin will be set to level of event
+ portb_event_pin_identifier_0: 0
+ portb_event_pin_identifier_1: 0
+ portb_event_pin_identifier_2: 0
+ portb_event_pin_identifier_3: 0
+ portb_input_event_enable_0: false
+ portb_input_event_enable_1: false
+ portb_input_event_enable_2: false
+ portb_input_event_enable_3: false
+ optional_signals: []
+ variant: null
+ clocks:
+ domain_group: null
+ RAMECC:
+ user_label: RAMECC
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::RAMECC::driver_config_definition::RAMECC::HAL:HPL:RAMECC
+ functionality: System
+ api: HAL:HPL:RAMECC
+ configuration: {}
+ optional_signals: []
+ variant: null
+ clocks:
+ domain_group: null
+ I2C_0:
+ user_label: I2C_0
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::SERCOM0::driver_config_definition::I2C.Master.Standard~2FFast-mode::HAL:Driver:I2C.Master.Sync
+ functionality: I2C
+ api: HAL:Driver:I2C_Master_Sync
+ configuration:
+ i2c_master_advanced: false
+ i2c_master_arch_dbgstop: Keep running
+ i2c_master_arch_inactout: Disabled
+ i2c_master_arch_lowtout: false
+ i2c_master_arch_mexttoen: false
+ i2c_master_arch_runstdby: false
+ i2c_master_arch_sdahold: 300-600ns hold time
+ i2c_master_arch_sexttoen: false
+ i2c_master_arch_trise: 215
+ i2c_master_baud_rate: 100000
+ optional_signals: []
+ variant:
+ specification: SDA=0, SCL=1
+ required_signals:
+ - name: SERCOM0/PAD/0
+ pad: PA08
+ label: SDA
+ - name: SERCOM0/PAD/1
+ pad: PA09
+ label: SCL
+ clocks:
+ domain_group:
+ nodes:
+ - name: Core
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ - name: Slow
+ input: Generic clock generator 3
+ external: false
+ external_frequency: 0
+ configuration:
+ core_gclk_selection: Generic clock generator 0
+ slow_gclk_selection: Generic clock generator 3
+ SPI_1:
+ user_label: SPI_1
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::SERCOM1::driver_config_definition::SPI.Master::HAL:Driver:SPI.Master.Sync
+ functionality: SPI
+ api: HAL:Driver:SPI_Master_Sync
+ configuration:
+ spi_master_advanced: false
+ spi_master_arch_cpha: Sample input on leading edge
+ spi_master_arch_cpol: SCK is low when idle
+ spi_master_arch_dbgstop: Keep running
+ spi_master_arch_dord: MSB first
+ spi_master_arch_ibon: In data stream
+ spi_master_arch_runstdby: false
+ spi_master_baud_rate: 50000
+ spi_master_character_size: 8 bits
+ spi_master_dummybyte: 511
+ spi_master_rx_enable: true
+ optional_signals: []
+ variant:
+ specification: TXPO=0, RXPO=3
+ required_signals:
+ - name: SERCOM1/PAD/0
+ pad: PA00
+ label: MOSI
+ - name: SERCOM1/PAD/1
+ pad: PA01
+ label: SCK
+ - name: SERCOM1/PAD/3
+ pad: PB23
+ label: MISO
+ clocks:
+ domain_group:
+ nodes:
+ - name: Core
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ - name: Slow
+ input: Generic clock generator 3
+ external: false
+ external_frequency: 0
+ configuration:
+ core_gclk_selection: Generic clock generator 0
+ slow_gclk_selection: Generic clock generator 3
+ SPI_2:
+ user_label: SPI_2
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::SERCOM2::driver_config_definition::SPI.Master::HAL:Driver:SPI.Master.Async
+ functionality: SPI
+ api: HAL:Driver:SPI_Master_Async
+ configuration:
+ spi_master_advanced: false
+ spi_master_arch_cpha: Sample input on leading edge
+ spi_master_arch_cpol: SCK is low when idle
+ spi_master_arch_dbgstop: Keep running
+ spi_master_arch_dord: MSB first
+ spi_master_arch_ibon: In data stream
+ spi_master_arch_runstdby: false
+ spi_master_baud_rate: 50000
+ spi_master_character_size: 8 bits
+ spi_master_dummybyte: 511
+ spi_master_rx_enable: true
+ optional_signals: []
+ variant:
+ specification: TXPO=0, RXPO=3
+ required_signals:
+ - name: SERCOM2/PAD/0
+ pad: PA12
+ label: MOSI
+ - name: SERCOM2/PAD/1
+ pad: PA13
+ label: SCK
+ - name: SERCOM2/PAD/3
+ pad: PA15
+ label: MISO
+ clocks:
+ domain_group:
+ nodes:
+ - name: Core
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ - name: Slow
+ input: Generic clock generator 3
+ external: false
+ external_frequency: 0
+ configuration:
+ core_gclk_selection: Generic clock generator 0
+ slow_gclk_selection: Generic clock generator 3
+ SPI_3:
+ user_label: SPI_3
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::SERCOM5::driver_config_definition::SPI.Master::HAL:Driver:SPI.Master.Sync
+ functionality: SPI
+ api: HAL:Driver:SPI_Master_Sync
+ configuration:
+ spi_master_advanced: false
+ spi_master_arch_cpha: Sample input on leading edge
+ spi_master_arch_cpol: SCK is low when idle
+ spi_master_arch_dbgstop: Keep running
+ spi_master_arch_dord: MSB first
+ spi_master_arch_ibon: In data stream
+ spi_master_arch_runstdby: false
+ spi_master_baud_rate: 50000
+ spi_master_character_size: 8 bits
+ spi_master_dummybyte: 511
+ spi_master_rx_enable: true
+ optional_signals: []
+ variant:
+ specification: TXPO=0, RXPO=3
+ required_signals:
+ - name: SERCOM5/PAD/0
+ pad: PB02
+ label: MOSI
+ - name: SERCOM5/PAD/1
+ pad: PB03
+ label: SCK
+ - name: SERCOM5/PAD/3
+ pad: PB01
+ label: MISO
+ clocks:
+ domain_group:
+ nodes:
+ - name: Core
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ - name: Slow
+ input: Generic clock generator 3
+ external: false
+ external_frequency: 0
+ configuration:
+ core_gclk_selection: Generic clock generator 0
+ slow_gclk_selection: Generic clock generator 3
+ PWM_0:
+ user_label: PWM_0
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::TCC0::driver_config_definition::PWM::HAL:Driver:PWM
+ functionality: PWM
+ api: HAL:Driver:PWM
+ configuration:
+ tcc_arch_alock: false
+ tcc_arch_cc0: 0
+ tcc_arch_cc1: 0
+ tcc_arch_cc2: 0
+ tcc_arch_cc3: 0
+ tcc_arch_cc4: 0
+ tcc_arch_cc5: 0
+ tcc_arch_cnteo: false
+ tcc_arch_cntsel: An interrupt/event is generated when a new counter cycle starts
+ tcc_arch_cpten0: false
+ tcc_arch_cpten1: false
+ tcc_arch_cpten2: false
+ tcc_arch_cpten3: false
+ tcc_arch_cpten4: false
+ tcc_arch_cpten5: false
+ tcc_arch_cpten6: false
+ tcc_arch_cpten7: false
+ tcc_arch_dbgrun: false
+ tcc_arch_evact0: Event action disabled
+ tcc_arch_evact1: Event action disabled
+ tcc_arch_lupd: true
+ tcc_arch_mcei0: false
+ tcc_arch_mcei1: false
+ tcc_arch_mcei2: false
+ tcc_arch_mcei3: false
+ tcc_arch_mcei4: false
+ tcc_arch_mcei5: false
+ tcc_arch_mceo0: false
+ tcc_arch_mceo1: false
+ tcc_arch_mceo2: false
+ tcc_arch_mceo3: false
+ tcc_arch_mceo4: false
+ tcc_arch_mceo5: false
+ tcc_arch_ovfeo: false
+ tcc_arch_prescsync: Reload or reset counter on next GCLK
+ tcc_arch_runstdby: false
+ tcc_arch_sel_ch: 1
+ tcc_arch_tcei0: false
+ tcc_arch_tcei1: false
+ tcc_arch_tceinv0: false
+ tcc_arch_tceinv1: false
+ tcc_arch_trgeo: false
+ tcc_arch_wave_duty_val: 500
+ tcc_arch_wave_per_val: 1000
+ tcc_arch_wavegen: Single-slope PWM
+ tcc_per: 10000
+ tcc_prescaler: Divide by 8
+ timer_event_control: false
+ optional_signals:
+ - identifier: PWM_0:WO/0
+ pad: PB12
+ mode: PWM output
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::TCC0.WO.0
+ name: TCC0/WO/0
+ label: WO/0
+ - identifier: PWM_0:WO/1
+ pad: PB13
+ mode: PWM output
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::TCC0.WO.1
+ name: TCC0/WO/1
+ label: WO/1
+ - identifier: PWM_0:WO/2
+ pad: PB14
+ mode: PWM output
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::TCC0.WO.2
+ name: TCC0/WO/2
+ label: WO/2
+ - identifier: PWM_0:WO/3
+ pad: PB15
+ mode: PWM output
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::TCC0.WO.3
+ name: TCC0/WO/3
+ label: WO/3
+ - identifier: PWM_0:WO/4
+ pad: PB16
+ mode: PWM output
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::TCC0.WO.4
+ name: TCC0/WO/4
+ label: WO/4
+ - identifier: PWM_0:WO/5
+ pad: PB17
+ mode: PWM output
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::TCC0.WO.5
+ name: TCC0/WO/5
+ label: WO/5
+ variant: null
+ clocks:
+ domain_group:
+ nodes:
+ - name: TCC
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ configuration:
+ tcc_gclk_selection: Generic clock generator 0
+ PWM_1:
+ user_label: PWM_1
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::TCC1::driver_config_definition::PWM::HAL:Driver:PWM
+ functionality: PWM
+ api: HAL:Driver:PWM
+ configuration:
+ tcc_arch_alock: false
+ tcc_arch_cc0: 0
+ tcc_arch_cc1: 0
+ tcc_arch_cc2: 0
+ tcc_arch_cc3: 0
+ tcc_arch_cnteo: false
+ tcc_arch_cntsel: An interrupt/event is generated when a new counter cycle starts
+ tcc_arch_cpten0: false
+ tcc_arch_cpten1: false
+ tcc_arch_cpten2: false
+ tcc_arch_cpten3: false
+ tcc_arch_cpten4: false
+ tcc_arch_cpten5: false
+ tcc_arch_cpten6: false
+ tcc_arch_cpten7: false
+ tcc_arch_dbgrun: false
+ tcc_arch_evact0: Event action disabled
+ tcc_arch_evact1: Event action disabled
+ tcc_arch_lupd: true
+ tcc_arch_mcei0: false
+ tcc_arch_mcei1: false
+ tcc_arch_mcei2: false
+ tcc_arch_mcei3: false
+ tcc_arch_mceo0: false
+ tcc_arch_mceo1: false
+ tcc_arch_mceo2: false
+ tcc_arch_mceo3: false
+ tcc_arch_ovfeo: false
+ tcc_arch_prescsync: Reload or reset counter on next GCLK
+ tcc_arch_runstdby: false
+ tcc_arch_sel_ch: 1
+ tcc_arch_tcei0: false
+ tcc_arch_tcei1: false
+ tcc_arch_tceinv0: false
+ tcc_arch_tceinv1: false
+ tcc_arch_trgeo: false
+ tcc_arch_wave_duty_val: 500
+ tcc_arch_wave_per_val: 1000
+ tcc_arch_wavegen: Single-slope PWM
+ tcc_per: 10000
+ tcc_prescaler: Divide by 8
+ timer_event_control: false
+ optional_signals:
+ - identifier: PWM_1:WO/0
+ pad: PA16
+ mode: PWM output
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::TCC1.WO.0
+ name: TCC1/WO/0
+ label: WO/0
+ - identifier: PWM_1:WO/1
+ pad: PA17
+ mode: PWM output
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::TCC1.WO.1
+ name: TCC1/WO/1
+ label: WO/1
+ - identifier: PWM_1:WO/2
+ pad: PA18
+ mode: PWM output
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::TCC1.WO.2
+ name: TCC1/WO/2
+ label: WO/2
+ - identifier: PWM_1:WO/3
+ pad: PA19
+ mode: PWM output
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::TCC1.WO.3
+ name: TCC1/WO/3
+ label: WO/3
+ - identifier: PWM_1:WO/4
+ pad: PA20
+ mode: PWM output
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::TCC1.WO.4
+ name: TCC1/WO/4
+ label: WO/4
+ - identifier: PWM_1:WO/5
+ pad: PA21
+ mode: PWM output
+ configuration: null
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::optional_signal_definition::TCC1.WO.5
+ name: TCC1/WO/5
+ label: WO/5
+ variant: null
+ clocks:
+ domain_group:
+ nodes:
+ - name: TCC
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ configuration:
+ tcc_gclk_selection: Generic clock generator 0
+pads:
+ SPI1_MOSI:
+ name: PA00
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA00
+ mode: Digital output
+ user_label: SPI1_MOSI
+ configuration: null
+ SPI1_SCK:
+ name: PA01
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA01
+ mode: Digital output
+ user_label: SPI1_SCK
+ configuration: null
+ ALOG_1:
+ name: PA02
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA02
+ mode: Analog
+ user_label: ALOG_1
+ configuration: null
+ ANAREF_2V48:
+ name: PA03
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA03
+ mode: Analog
+ user_label: ANAREF_2V48
+ configuration: null
+ M1_IA:
+ name: PB04
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB04
+ mode: Analog
+ user_label: M1_IA
+ configuration: null
+ M1_IB:
+ name: PB05
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB05
+ mode: Analog
+ user_label: M1_IB
+ configuration: null
+ M2_IA:
+ name: PB06
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB06
+ mode: Analog
+ user_label: M2_IA
+ configuration: null
+ M2_IB:
+ name: PB07
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB07
+ mode: Analog
+ user_label: M2_IB
+ configuration: null
+ half_VREF:
+ name: PB08
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB08
+ mode: Analog
+ user_label: half_VREF
+ configuration: null
+ ALOG_2:
+ name: PB09
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB09
+ mode: Analog
+ user_label: ALOG_2
+ configuration: null
+ M1_HALLA:
+ name: PA04
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA04
+ mode: Peripheral IO
+ user_label: M1_HALLA
+ configuration: null
+ M1_HALLB:
+ name: PA05
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA05
+ mode: Peripheral IO
+ user_label: M1_HALLB
+ configuration: null
+ M1_HALLC:
+ name: PA06
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA06
+ mode: Peripheral IO
+ user_label: M1_HALLC
+ configuration: null
+ ALOG_3:
+ name: PA07
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA07
+ mode: Analog
+ user_label: ALOG_3
+ configuration: null
+ IMU_SDA:
+ name: PA08
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA08
+ mode: I2C
+ user_label: IMU_SDA
+ configuration: null
+ IMU_SCL:
+ name: PA09
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA09
+ mode: I2C
+ user_label: IMU_SCL
+ configuration: null
+ ALOG_4:
+ name: PA10
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA10
+ mode: Analog
+ user_label: ALOG_4
+ configuration: null
+ ALOG_5:
+ name: PA11
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA11
+ mode: Analog
+ user_label: ALOG_5
+ configuration: null
+ IMU_RESET:
+ name: PB10
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB10
+ mode: Digital output
+ user_label: IMU_RESET
+ configuration: null
+ IMU_INT:
+ name: PB11
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB11
+ mode: Digital input
+ user_label: IMU_INT
+ configuration: null
+ M1_PWMA:
+ name: PB12
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB12
+ mode: Peripheral IO
+ user_label: M1_PWMA
+ configuration: null
+ M1_PWMB:
+ name: PB13
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB13
+ mode: Peripheral IO
+ user_label: M1_PWMB
+ configuration: null
+ M1_PWMC:
+ name: PB14
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB14
+ mode: Peripheral IO
+ user_label: M1_PWMC
+ configuration: null
+ M1_ENA:
+ name: PB15
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB15
+ mode: Peripheral IO
+ user_label: M1_ENA
+ configuration: null
+ SPI2_MOSI:
+ name: PA12
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA12
+ mode: Digital output
+ user_label: SPI2_MOSI
+ configuration: null
+ SPI2_SCK:
+ name: PA13
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA13
+ mode: Digital output
+ user_label: SPI2_SCK
+ configuration: null
+ SPI2_SS:
+ name: PA14
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA14
+ mode: Peripheral IO
+ user_label: SPI2_SS
+ configuration: null
+ SPI2_MISO:
+ name: PA15
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA15
+ mode: Digital input
+ user_label: SPI2_MISO
+ configuration: null
+ M2_PWMA:
+ name: PA16
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA16
+ mode: Peripheral IO
+ user_label: M2_PWMA
+ configuration: null
+ M2_PWMB:
+ name: PA17
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA17
+ mode: Peripheral IO
+ user_label: M2_PWMB
+ configuration: null
+ M2_PWMC:
+ name: PA18
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA18
+ mode: Peripheral IO
+ user_label: M2_PWMC
+ configuration: null
+ M2_ENA:
+ name: PA19
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA19
+ mode: Peripheral IO
+ user_label: M2_ENA
+ configuration: null
+ M1_ENB:
+ name: PB16
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB16
+ mode: Peripheral IO
+ user_label: M1_ENB
+ configuration: null
+ M1_ENC:
+ name: PB17
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB17
+ mode: Peripheral IO
+ user_label: M1_ENC
+ configuration: null
+ M2_ENB:
+ name: PA20
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA20
+ mode: Peripheral IO
+ user_label: M2_ENB
+ configuration: null
+ M2_ENC:
+ name: PA21
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA21
+ mode: Peripheral IO
+ user_label: M2_ENC
+ configuration: null
+ M2_HALLA:
+ name: PA22
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA22
+ mode: Peripheral IO
+ user_label: M2_HALLA
+ configuration: null
+ M2_HALLB:
+ name: PA23
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA23
+ mode: Peripheral IO
+ user_label: M2_HALLB
+ configuration: null
+ M2_HALLC:
+ name: PA24
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA24
+ mode: Peripheral IO
+ user_label: M2_HALLC
+ configuration: null
+ M1_RST:
+ name: PA25
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA25
+ mode: Digital output
+ user_label: M1_RST
+ configuration: null
+ SPI1_CS:
+ name: PB22
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB22
+ mode: Peripheral IO
+ user_label: SPI1_CS
+ configuration: null
+ SPI1_MISO:
+ name: PB23
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB23
+ mode: Digital input
+ user_label: SPI1_MISO
+ configuration: null
+ M2_RST:
+ name: PA27
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PA27
+ mode: Digital output
+ user_label: M2_RST
+ configuration: null
+ M1_RST_Bar:
+ name: PB30
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB30
+ mode: Digital input
+ user_label: M1_RST_Bar
+ configuration: null
+ M2_RST_Bar:
+ name: PB31
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB31
+ mode: Digital input
+ user_label: M2_RST_Bar
+ configuration: null
+ SPI3_SS:
+ name: PB00
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB00
+ mode: Peripheral IO
+ user_label: SPI3_SS
+ configuration: null
+ SPI3_MISO:
+ name: PB01
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB01
+ mode: Digital input
+ user_label: SPI3_MISO
+ configuration: null
+ SPI3_MOSI:
+ name: PB02
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB02
+ mode: Digital output
+ user_label: SPI3_MOSI
+ configuration: null
+ SPI3_SCK:
+ name: PB03
+ definition: Atmel:SAME51_Drivers:0.0.1::SAME51J19A-MF::pad::PB03
+ mode: Digital output
+ user_label: SPI3_SCK
+ configuration: null
+toolchain_options: []
+static_files: []
diff --git a/Arduino-FOC b/Arduino-FOC
new file mode 160000
index 0000000..a4f9999
--- /dev/null
+++ b/Arduino-FOC
@@ -0,0 +1 @@
+Subproject commit a4f99990d7a120a2b0d3dfaaca9576b4f0d5656b
diff --git a/BLDC_E54v2/BLCD_E54v2/BLCD_E54v2/BLCD_E54v2.cproj b/BLDC_E54v2/BLCD_E54v2/BLCD_E54v2/BLCD_E54v2.cproj
index 3b78680..13fad42 100644
--- a/BLDC_E54v2/BLCD_E54v2/BLCD_E54v2/BLCD_E54v2.cproj
+++ b/BLDC_E54v2/BLCD_E54v2/BLCD_E54v2/BLCD_E54v2.cproj
@@ -375,8 +375,7 @@
True
Maximum (-g3)
True
- True
- -std=gnu99 -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mfp16-format=ieee
+ -std=gnu99 -fsingle-precision-constant -Wdouble-promotion -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mfp16-format=ieee
libm
diff --git a/BLDC_E54v2/BLCD_E54v2/BLCD_E54v2/bldc.h b/BLDC_E54v2/BLCD_E54v2/BLCD_E54v2/bldc.h
index a627d9b..cd6f548 100644
--- a/BLDC_E54v2/BLCD_E54v2/BLCD_E54v2/bldc.h
+++ b/BLDC_E54v2/BLCD_E54v2/BLCD_E54v2/bldc.h
@@ -192,15 +192,15 @@ void BLDC_runPosCntl(BLDCMotor_t *motor, int16_t posfbk, int16_t posRef);
// ----------------------------------------------------------------------
// Functions used with function pointers
// ----------------------------------------------------------------------
-inline uint8_t readM1Hall(void);
-inline uint8_t readM2Hall(void);
-inline uint8_t readM3Hall(void);
+uint8_t readM1Hall(void);
+uint8_t readM2Hall(void);
+uint8_t readM3Hall(void);
void DisableM1GateDrivers(BLDCMotor_t *motor);
void DisableM2GateDrivers(BLDCMotor_t *motor);
void DisableM3GateDrivers(BLDCMotor_t *motor);
-inline void SetM1DutyCycle(const uint16_t duty);
-inline void SetM2DutyCycle(const uint16_t duty);
-inline void SetM3DutyCycle(const uint16_t duty);
+void SetM1DutyCycle(const uint16_t duty);
+void SetM2DutyCycle(const uint16_t duty);
+void SetM3DutyCycle(const uint16_t duty);
// ----------------------------------------------------------------------
// all controller objects, variables and helpers:
diff --git a/BLDC_E54v2/BLCD_E54v2/BLCD_E54v2/configuration.h b/BLDC_E54v2/BLCD_E54v2/BLCD_E54v2/configuration.h
index d02ea2e..1321cdd 100644
--- a/BLDC_E54v2/BLCD_E54v2/BLCD_E54v2/configuration.h
+++ b/BLDC_E54v2/BLCD_E54v2/BLCD_E54v2/configuration.h
@@ -39,7 +39,7 @@
//while(1);
//}
-inline void configure_tcc_pwm(void)
+inline static void configure_tcc_pwm(void)
{
/* TCC0 */
@@ -115,7 +115,7 @@ inline void configure_TC_CCL_SPEED(void)
}
-inline void adc_init_dma(void)
+inline static void adc_init_dma(void)
{
adc_sram_dmac_init();
adc_dmac_sequence_init();
diff --git a/BLDC_E54v2/BLCD_E54v2/BLCD_E54v2/ethercat/ethercat_e54.c b/BLDC_E54v2/BLCD_E54v2/BLCD_E54v2/ethercat/ethercat_e54.c
index ec2afa4..b77378a 100644
--- a/BLDC_E54v2/BLCD_E54v2/BLCD_E54v2/ethercat/ethercat_e54.c
+++ b/BLDC_E54v2/BLCD_E54v2/BLCD_E54v2/ethercat/ethercat_e54.c
@@ -24,7 +24,7 @@ void update_telemetry(void)
{
inline int16_t convert_to_mA(volatile float32_t current_PU)
{
- return (int16_t)(current_PU*1000);
+ return (int16_t)(current_PU*1000.0f);
}
*state = applicationStatus.currentstate;
@@ -48,7 +48,7 @@ void update_setpoints(void)
{
inline float32_t convert_int_to_PU(volatile int16_t input)
{
- return ((float32_t)input/1000.0f);
+ return ((float32_t)(input/1000.0f));
}
//Motor1.des_mode = 0;
//Motor1.set = 0;
diff --git a/BLDC_E54v2/BLCD_E54v2/BLCD_E54v2/ethercat/ethercat_e54.h b/BLDC_E54v2/BLCD_E54v2/BLCD_E54v2/ethercat/ethercat_e54.h
index dcb182b..3549e98 100644
--- a/BLDC_E54v2/BLCD_E54v2/BLCD_E54v2/ethercat/ethercat_e54.h
+++ b/BLDC_E54v2/BLCD_E54v2/BLCD_E54v2/ethercat/ethercat_e54.h
@@ -31,49 +31,49 @@ enum dma_transfer_descriptor_type {
// ----------------------------------------------------------------------
// Register Addresses
// ----------------------------------------------------------------------
-#define read_var_num 32 //to change to 16bits need to change ecat spi lenght.
-#define write_var_num 32 //max 20
+#define read_var_num 32U //to change to 16bits need to change ecat spi lenght.
+#define write_var_num 32U //max 20
// #define read_var_num 2 //to change to 16bits need to change ecat spi lenght.
// #define write_var_num 2 //max 20
-#define ram_wr_start 0
+#define ram_wr_start 0U
#define ram_rd_start write_var_num //write_var_num
#define ram_real_wr_start ram_rd_start + read_var_num
-#define SPI_READ 0x03
-#define SPI_WRITE 0x02
-#define SPI_INC 0x40
-#define SPI_DEC 0x80
-#define TEST_VAL 0x87654321
-#define CSR_BUSY 0x80000000
+#define SPI_READ 0x03U
+#define SPI_WRITE 0x02U
+#define SPI_INC 0x40U
+#define SPI_DEC 0x80U
+#define TEST_VAL 0x87654321U
+#define CSR_BUSY 0x80000000U
#define ADDR_BYTES 2
#define CSR_READ 1<<30
#define CSR_WRITE 0<<30
#define CSR_SIZE 4<<16
#define CSR_HW_RD 1<<27
-#define ECAT_PRAM_RD_DATA 0x0000
-#define ECAT_PRAM_WR_DATA 0x2000
-#define ID_REV 0x5000
-#define IRQ_CFG 0x5400
-#define INT_STS 0x5800
-#define INT_EN 0x5C00
-#define BYTE_TEST 0x6400
-#define HW_CFG 0x7400
-#define PMT_CTRL 0x8400
-#define GPT_CFG 0x8C00
-#define GPT_CNT 0x9000
-#define FREE_RUN 0x9C00
-#define RESET_CTL 0xF801
-#define ECAT_CSR_DATA 0x0003
-#define ECAT_CSR_CMD 0x0403
-#define ECAT_PRAM_RD_ADDR_LEN 0x0803
-#define ECAT_PRAM_RD_CMD 0x0C03
-#define ECAT_PRAM_WR_ADDR_LEN 0x1003
-#define ECAT_PRAM_WR_CMD 0x1403
+#define ECAT_PRAM_RD_DATA 0x0000U
+#define ECAT_PRAM_WR_DATA 0x2000U
+#define ID_REV 0x5000U
+#define IRQ_CFG 0x5400U
+#define INT_STS 0x5800U
+#define INT_EN 0x5C00U
+#define BYTE_TEST 0x6400U
+#define HW_CFG 0x7400U
+#define PMT_CTRL 0x8400U
+#define GPT_CFG 0x8C00U
+#define GPT_CNT 0x9000U
+#define FREE_RUN 0x9C00U
+#define RESET_CTL 0xF801U
+#define ECAT_CSR_DATA 0x0003U
+#define ECAT_CSR_CMD 0x0403U
+#define ECAT_PRAM_RD_ADDR_LEN 0x0803U
+#define ECAT_PRAM_RD_CMD 0x0C03U
+#define ECAT_PRAM_WR_ADDR_LEN 0x1003U
+#define ECAT_PRAM_WR_CMD 0x1403U
-#define PDRAM_RD_ADDRESS 0x1100
-#define PDRAM_WR_ADDRESS 0x1800
+#define PDRAM_RD_ADDRESS 0x1100U
+#define PDRAM_WR_ADDRESS 0x1800U
#define PDRAM_RD_LENGTH 2*read_var_num
#define PDRAM_WR_LENGTH 2*write_var_num
diff --git a/BSXlite_Cortex_M3_M4_M4F/ConfigStings/accel_spec/accel_spec_bma255.txt b/BSXlite_Cortex_M3_M4_M4F/ConfigStings/accel_spec/accel_spec_bma255.txt
new file mode 100644
index 0000000..0a3d8b5
--- /dev/null
+++ b/BSXlite_Cortex_M3_M4_M4F/ConfigStings/accel_spec/accel_spec_bma255.txt
@@ -0,0 +1 @@
+37,0,2,1,0,9,12,150,0,12,180,0,5,0,1,0,176,4,82,3,0,0,64,65,1,1,1,1,2,2,2,3,3,1,1,63,231
\ No newline at end of file
diff --git a/BSXlite_Cortex_M3_M4_M4F/ConfigStings/accel_spec/accel_spec_bmi160accel.txt b/BSXlite_Cortex_M3_M4_M4F/ConfigStings/accel_spec/accel_spec_bmi160accel.txt
new file mode 100644
index 0000000..05ae878
--- /dev/null
+++ b/BSXlite_Cortex_M3_M4_M4F/ConfigStings/accel_spec/accel_spec_bmi160accel.txt
@@ -0,0 +1 @@
+37,0,3,1,0,9,12,150,0,16,60,0,1,0,1,0,176,4,82,3,0,0,64,65,1,1,1,1,2,2,2,3,3,1,1,180,115
\ No newline at end of file
diff --git a/BSXlite_Cortex_M3_M4_M4F/ConfigStings/gyro_spec/gyro_spec_bmg160.txt b/BSXlite_Cortex_M3_M4_M4F/ConfigStings/gyro_spec/gyro_spec_bmg160.txt
new file mode 100644
index 0000000..23df53d
--- /dev/null
+++ b/BSXlite_Cortex_M3_M4_M4F/ConfigStings/gyro_spec/gyro_spec_bmg160.txt
@@ -0,0 +1 @@
+14,0,1,1,3,9,12,136,19,16,1,1,129,46
\ No newline at end of file
diff --git a/BSXlite_Cortex_M3_M4_M4F/ConfigStings/gyro_spec/gyro_spec_bmi160.txt b/BSXlite_Cortex_M3_M4_M4F/ConfigStings/gyro_spec/gyro_spec_bmi160.txt
new file mode 100644
index 0000000..23df53d
--- /dev/null
+++ b/BSXlite_Cortex_M3_M4_M4F/ConfigStings/gyro_spec/gyro_spec_bmi160.txt
@@ -0,0 +1 @@
+14,0,1,1,3,9,12,136,19,16,1,1,129,46
\ No newline at end of file
diff --git a/BSXlite_Cortex_M3_M4_M4F/ConfigStings/mag_spec/mag_spec_bmm150.txt b/BSXlite_Cortex_M3_M4_M4F/ConfigStings/mag_spec/mag_spec_bmm150.txt
new file mode 100644
index 0000000..204ba66
--- /dev/null
+++ b/BSXlite_Cortex_M3_M4_M4F/ConfigStings/mag_spec/mag_spec_bmm150.txt
@@ -0,0 +1 @@
+39,0,2,1,20,5,20,5,196,9,6,9,112,23,0,0,128,61,205,204,76,63,0,0,224,64,1,1,1,1,1,1,1,1,1,1,1,134,84
\ No newline at end of file
diff --git a/BSXlite_Cortex_M3_M4_M4F/ConfigStings/usecase_config/usecase.txt b/BSXlite_Cortex_M3_M4_M4F/ConfigStings/usecase_config/usecase.txt
new file mode 100644
index 0000000..a174129
--- /dev/null
+++ b/BSXlite_Cortex_M3_M4_M4F/ConfigStings/usecase_config/usecase.txt
@@ -0,0 +1 @@
+116,6,1,1,0,0,0,0,0,0,0,0,0,0,0,0,128,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51,51,179,62,205,204,12,63,205,204,12,63,51,51,51,63,51,51,51,63,205,204,76,63,1,0,9,4,2,23,183,209,56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,183,209,56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,183,209,56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,189,55,134,53,189,55,134,53,189,55,134,53,0,0,0,0,0,0,16,66,232,3,5,0,45,0,132,3,176,4,150,0,8,150,0,13,1,1,0,0,0,0,0,0,0,0,0,0,0,0,128,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51,51,179,62,205,204,12,63,205,204,12,63,51,51,51,63,51,51,51,63,205,204,76,62,1,6,4,1,0,5,0,65,1,64,1,36,0,120,0,4,1,20,20,2,2,0,4,0,0,128,63,205,204,204,61,154,153,153,63,205,204,204,62,205,204,204,61,1,0,20,0,16,4,120,0,8,0,0,5,154,153,25,63,154,153,25,63,80,0,9,0,30,0,232,3,80,0,65,0,4,0,4,0,0,128,62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,64,181,254,22,55,181,254,22,55,181,254,22,55,139,222,169,56,0,0,224,64,13,1,1,0,0,0,0,0,0,0,0,0,0,0,0,128,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,205,204,204,61,1,9,9,3,19,50,163,4,205,12,100,40,4,13,0,1,154,153,153,62,154,153,153,62,205,204,204,62,154,153,25,63,154,153,153,62,0,0,128,62,154,153,153,62,236,81,184,62,205,204,76,63,205,204,76,63,205,204,76,63,205,204,76,63,205,204,76,62,205,204,76,62,205,204,76,62,205,204,76,62,0,194,184,178,62,53,250,142,60,10,0,10,0,0,2,0,10,0,80,119,86,61,13,0,0,128,62,143,194,245,60,10,215,163,60,100,128,52,45,70,1,10,0,80,0,0,0,192,63,0,0,0,64,9,2,0,0,200,65,0,0,128,66,0,0,128,65,0,0,192,63,205,204,76,61,194,184,178,61,50,37,59,24,71,0,0,160,64,154,153,25,63,80,119,86,61,0,1,205,204,76,63,0,0,96,64,0,0,32,64,205,204,204,61,4,143,194,245,60,2,1,2,3,4,1,10,176,4,88,2,10,215,35,60,10,0,10,0,0,0,250,67,0,0,122,68,0,0,160,63,0,0,72,66,0,0,128,63,0,0,128,62,205,204,204,61,0,0,32,66,0,0,128,62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,62,0,36,116,73,0,0,0,0,0,0,0,0,0,0,0,0,0,36,116,73,0,0,0,0,0,0,0,0,0,0,0,0,0,36,116,73,0,0,192,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,64,0,0,128,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,64,10,215,35,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,215,35,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,215,35,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,183,209,56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,183,209,56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,183,209,56,0,0,128,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,197,39,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,197,39,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,197,39,55,0,36,116,73,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,116,73,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,116,73,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,4,3,0,0,0,0,0,0,10,3,4,25,64,18,24,0,64,114,8,0,13,226,109
\ No newline at end of file
diff --git a/BSXlite_Cortex_M3_M4_M4F/Doc/Guide/BSXlite_API_Documentation.pdf b/BSXlite_Cortex_M3_M4_M4F/Doc/Guide/BSXlite_API_Documentation.pdf
new file mode 100644
index 0000000..1c1e80e
Binary files /dev/null and b/BSXlite_Cortex_M3_M4_M4F/Doc/Guide/BSXlite_API_Documentation.pdf differ
diff --git a/BSXlite_Cortex_M3_M4_M4F/Doc/Guide/BSXlite_LibraryIntegrationGuideline.pdf b/BSXlite_Cortex_M3_M4_M4F/Doc/Guide/BSXlite_LibraryIntegrationGuideline.pdf
new file mode 100644
index 0000000..a67a3e4
Binary files /dev/null and b/BSXlite_Cortex_M3_M4_M4F/Doc/Guide/BSXlite_LibraryIntegrationGuideline.pdf differ
diff --git a/BSXlite_Cortex_M3_M4_M4F/algo/algo_bsx/Inc/BsxFusionLibrary.h b/BSXlite_Cortex_M3_M4_M4F/algo/algo_bsx/Inc/BsxFusionLibrary.h
new file mode 100644
index 0000000..2eaa56b
--- /dev/null
+++ b/BSXlite_Cortex_M3_M4_M4F/algo/algo_bsx/Inc/BsxFusionLibrary.h
@@ -0,0 +1,1803 @@
+#ifndef __BSXFUSIONLIBRARY_H__
+#define __BSXFUSIONLIBRARY_H__
+/*!
+* @section LICENCE
+* $license$
+*
+* (C) Copyright 2011 - 2015 Bosch Sensortec GmbH All Rights Reserved
+*------------------------------------------------------------------------------
+* Disclaimer
+*
+* Common: Bosch Sensortec products are developed for the consumer goods
+* industry. They may only be used within the parameters of the respective valid
+* product data sheet. Bosch Sensortec products are provided with the express
+* understanding that there is no warranty of fitness for a particular purpose.
+* They are not fit for use in life-sustaining, safety or security sensitive
+* systems or any system or device that may lead to bodily harm or property
+* damage if the system or device malfunctions. In addition, Bosch Sensortec
+* products are not fit for use in products which interact with motor vehicle
+* systems. The resale and/or use of products are at the purchaser's own risk
+* and his own responsibility. The examination of fitness for the intended use
+* is the sole responsibility of the Purchaser.
+*
+* The purchaser shall indemnify Bosch Sensortec from all third party claims,
+* including any claims for incidental, or consequential damages, arising from
+* any product use not covered by the parameters of the respective valid product
+* data sheet or not approved by Bosch Sensortec and reimburse Bosch Sensortec
+* for all costs in connection with such claims.
+*
+* The purchaser must monitor the market for the purchased products,
+* particularly with regard to product safety and inform Bosch Sensortec without
+* delay of all security relevant incidents.
+*
+* Engineering Samples are marked with an asterisk (*) or (e). Samples may vary
+* from the valid technical specifications of the product series. They are
+* therefore not intended or fit for resale to third parties or for use in end
+* products. Their sole purpose is internal client testing. The testing of an
+* engineering sample may in no way replace the testing of a product series.
+* Bosch Sensortec assumes no liability for the use of engineering samples. By
+* accepting the engineering samples, the Purchaser agrees to indemnify Bosch
+* Sensortec from all claims arising from the use of engineering samples.
+*
+* Special: This software module (hereinafter called "Software") and any
+* information on application-sheets (hereinafter called "Information") is
+* provided free of charge for the sole purpose to support your application
+* work. The Software and Information is subject to the following terms and
+* conditions:
+*
+* The Software is specifically designed for the exclusive use for Bosch
+* Sensortec products by personnel who have special experience and training. Do
+* not use this Software if you do not have the proper experience or training.
+*
+* This Software package is provided `` as is `` and without any expressed or
+* implied warranties, including without limitation, the implied warranties of
+* merchantability and fitness for a particular purpose.
+*
+* Bosch Sensortec and their representatives and agents deny any liability for
+* the functional impairment of this Software in terms of fitness, performance
+* and safety. Bosch Sensortec and their representatives and agents shall not be
+* liable for any direct or indirect damages or injury, except as otherwise
+* stipulated in mandatory applicable law.
+*
+* The Information provided is believed to be accurate and reliable. Bosch
+* Sensortec assumes no responsibility for the consequences of use of such
+* Information nor for any infringement of patents or other rights of third
+* parties which may result from its use.
+*
+* @file bsxfusionlibrary.h
+* @date 2013/02/12 created
+*
+* @brief
+* This file provides an interface to use the functionality of nine degree of freedom software library
+*
+*
+* bsxfusionlibrary - nine degree of freedom software library for the processing of the
+* accelerometer, magnetometer and gyroscope sensor data.The library supports different
+* operational modes of the sensors. Additionally, the library provides the virtual sensors
+* like compass, imu, 9dof sensors for orientation processing, which uses the sensor fusion
+* algorithm for estimation of the orientation processing or sensor calibration methods.
+*
+*/
+
+/************************************************************************************************************/
+/**\name INCLUDES */
+/************************************************************************************************************/
+
+#include "BsxLibraryDataTypes.h"
+
+/************************************************************************************************************/
+/**\name GENERAL INTERFACE */
+/************************************************************************************************************/
+
+/*!
+* @brief Get version of the BSX Fusion Library.
+* Version is a structure of four element which
+* consists of major, minor, minorbugfix and majorbugfix.
+* e.g. major=3, minor=0, minorbugfix =1 and
+* majorbugfix = 0 implies its bsx 3.0.1.0
+* @param *version-> Pointer to version structure
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_version(ts_version*);
+
+/*!
+* @brief This API initializes the main library process.
+* If the input pointer is NULL then it will
+* initialize with default values defined in the library.
+*
+* @param inputparams -> pointer to acc,mag,gyro specs and usecase config
+*
+* Inputparam->accelspec : Pointer to accelspec char array that holds settings for particular accelerometer sensor
+* Inputparam->magspec : Pointer to magspec char array that holds settings for particular magnetometer sensor
+* Inputparam->gyrospec : Pointer to gyrospec char array that holds settings for particular gyroscope sensor
+* Inputparam->usecaseconfig : Pointer to usecase char array that holds settings for particular usecase
+*
+* Inputparam->accelspec_status holds the status if the spec is error free and not modified from original
+*
+* 0 -> error in accelerometer spec char array
+* 1 -> No error in accelerometer spec array and spec corresponds to bma250
+* 2 -> No error in accelerometer spec array and spec corresponds to bma255
+* 3 -> No error in accelerometer spec array and spec corresponds to bma280
+*
+* Inputparam->magspec_status holds the status if the spec is error free and not modified from original
+*
+* 0 -> error in magnetometer spec char array
+* 1 -> No error in magnetometer spec array and spec corresponds to bmm050
+* 2 -> No error in magnetometer spec array and spec corresponds to bmm150
+*
+* Inputparam->gyrospec_status holds the status if the spec is error free and not modified from original
+*
+* 0 -> error in gyroscope spec char array
+* 1 -> No error in gyroscope spec array and spec corresponds to bmg160
+*
+* Inputparam->usecase_status holds the status if the spec is error free and not modified from original
+*
+* 0 -> error in usecase char array
+* 1 -> No error in usecase char array
+*
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_init(initParam_t*);
+
+/*!
+* @brief reset dynamic state of the library
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_reset(void);
+
+/*!
+* @brief Main library process - divided into three process running at different frequency - dopreprocess , docalibration and dousecase
+* @brief dopreprocess - preprocessing sensor - accel , mag , gyro, compass ->includes conversions to units from lsb and other preprocessing
+
+* @brief docalibration - calibration of accel,mag,gyro -> includes classical and fmc calibration for mag
+
+* @brief dousecase - COMPASS/M4G , IMU , NDOF processing
+* @param libraryinput_p -> pointer to sensor data
+* structure which includes sensor data S32 type and
+* time stamp in microseconds of U64 type
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_dostep(libraryinput_t* );
+
+/*!
+* @brief Pre Process Library (includes preprocessing of accel, mag, gyro,fmc, compass)
+* @param libraryinput_p -> pointer to sensor data
+* structure which includes sensor data S32 type and
+* time stamp in microseconds of U64 type
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_dopreprocess(libraryinput_t*);
+
+/*!
+* @brief Sensor Calibration Layer - (includes calibration of accel, mag, gyro, fmc when corresponding tick.calib is enabled)
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_docalibration(void);
+
+
+/*!
+* @brief Sensor Usecase Layer - responsible for all use-case processing (COMPASS,M4G,IMU,NDOF)
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_dousecase(void);
+
+/************************************************************************************************************/
+/**\name ACCELEROMETER API */
+/************************************************************************************************************/
+
+/*!
+* @brief Initialization of accelerometer modules with the settings of particular accel sensor.
+* If NULL is passed,the default values(BMA250) are loaded.
+* @param *p_accelspec -> Pointer to accelspec char array that holds settings for particular accel sensor
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_init_acc(BSX_U8*);
+
+/*!
+* @brief Sets the measurement range for accelerometer
+* @param measrange -> measurement range of accelerometer.
+*
+* Permissible values
+* 0 -> BSX_ACCRANGE_2G ;
+* 1 -> BSX_ACCRANGE_4G ;
+* 2 -> BSX_ACCRANGE_8G ;
+* 3 -> BSX_ACCRANGE_16G;
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_set_accrange(BSX_U8);
+
+/*!
+* @brief Get the measurement range for accelerometer
+* @param *measrange -> pointer to measurement range of accelerometer
+*
+* 0 -> BSX_ACCRANGE_2G;
+* 1 -> BSX_ACCRANGE_4G;
+* 2 -> BSX_ACCRANGE_8G;
+* 3 -> BSX_ACCRANGE_16G;
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_accrange(BSX_U8*);
+
+/*!
+* @brief Set the calling datarate for the accelerometer
+* @param accDataRate-> calling data rate of accelerometer
+*
+* permissible values
+* 0 -> 1Hz
+* 1 -> 5Hz
+* 2 -> 6.25Hz
+* 3 -> 10Hz
+* 4 -> 12.5Hz
+* 5 -> 20Hz
+* 6 -> 25Hz
+* 7 -> 40Hz
+* 8 -> 50Hz
+* 9 -> 100Hz
+* 10 -> 125Hz
+* 11 -> 200Hz
+* 12 -> 400Hz
+* 13 -> Invalid upper data rate
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_set_accdatarate(BSX_U8);
+
+/*!
+* @brief Get the datarate for the accelerometer
+* @param accDataRate -> parameter to get data rate of accelerometer that is being set
+*
+* Output values
+* 0 -> 1Hz
+* 1 -> 5Hz
+* 2 -> 6.25Hz
+* 3 -> 10Hz
+* 4 -> 12.5Hz
+* 5 -> 20Hz
+* 6 -> 25Hz
+* 7 -> 40Hz
+* 8 -> 50Hz
+* 9 -> 100Hz
+* 10 -> 125Hz
+* 11 -> 200Hz
+* 12 -> 400Hz
+* 13 -> Invalid upper data rate
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_accdatarate(BSX_U8*);
+
+/*!
+* @brief Set the accelerometer calibration accuracy threshold
+* @param accThreshold -> calibration accuracy threshold of accelerometer
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_set_acccalib_accuracythreshold(BSX_U8);
+
+/*!
+* @brief Set the accelerometer calibration profile(calibration offset and accuracy status)
+* @param calibprofile-> variable to Accelerometer calibration profile structure
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_set_acccalibprofile(ts_calibprofile*);
+
+/*!
+* @brief Get the acceleromter calibration profile
+* @param *calibprofile -> Pointer to Accelerometer calibration profile
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_acccalibprofile(ts_calibprofile*);
+
+/*!
+* @brief reset the accelerometer calibration module
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_reset_acccalib(void);
+
+/************************************************************************************************************/
+/**\name PEDOMETER DATA INTERFACE */
+/************************************************************************************************************/
+/*!
+ * @brief This API is used to set the step detection opmode.
+ * accel opmode should be enabled to enable the algorithm
+ * since it uses only accel data in the algorithm.
+ * As the Pedometer algorithm gives event for every change in steps
+ * this API should be called with Opmode = 1.By default, Pedometer feature
+ * is OFF. To enable, this api can be called with param Opmode=1.
+ * @param Opmode -> to activate or deactivate step detection motion
+ Opmode = 1 activate step detection motion
+ Opmode = 0 deactivate step detection motion
+
+ * @return zero for success, non-zero failed
+ * @retval 0 -> Success
+ * @retval 1 -> Error
+ */
+BSX_S8 bsx_set_stepdetectionopmode(BSX_U8);
+
+/*!
+* @brief This API is used to get the stepdetection opmode.This API is called to
+* know the step detection opmode is enabled or disabled
+* This API can be called only when BSX_PEDO_SUPPORT is ON
+* @param *Opmodestatus -> to provide status of opmode
+* Opmodestatus = 1 step detection active
+* Opmodestatus = 0 step detection inactive.
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+ */
+BSX_S8 bsx_get_stepdetectionopmode(BSX_U8*);
+
+/*!
+* @brief This API is used to set the stepeventdetection opmode;BSX_PEDO_SUPPORT should be ON and internal step detection event
+* will get enable based on this opmode. As the Pedometer algorithm will start
+* detecting the event for every change in steps, this API should be called with event state = 1.
+* If event state = 0((It will stop detecting the steps the last step count will be stored till
+* system will call the start detection again).
+* @param eventstate
+* eventstate = 1 activate step detection motion
+* eventstate = 0 deactivate step detection motion
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+ */
+BSX_S8 bsx_set_stepeventdetectionopmode(BSX_U8);
+
+/*!
+* @brief This API is used to get the stepeventdetection opmode;
+* This API gives the status of step event detection opmode.
+* @param *eventstatus -> pointer to get eventstatus
+* event status = 1 activate start step detection.
+* event status= 0 activate stop step detection .
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_stepeventdetectionopmode(BSX_U8*);
+
+/*!
+ * @brief This API is used to get the step detection robustness.
+ * The stepdetection robustness will tell the robustness
+ * (i.e. the steps detected by algorithm in robust or un robust).
+ * @param *robuststatus -> to get robuststatus
+ * robuststatus = 1 activate robustness
+ * robuststatus = 0 deactivate robustness
+ * @return zero for success, non-zero failed
+ * @retval 0 -> Success
+ * @retval 1 -> Error
+ */
+BSX_S8 bsx_get_stepdetectionrobustness(BSX_U8*);
+
+/*!
+ * @brief This API is used to get the step detection status.
+ * This step detection status will Update for every step get detected from algorithm.
+ * The status will retain from the last step detection based on the datarate.
+ * This API can be called only when BSX_PEDO_SUPPORT is ON
+ * @param activity -> status variable
+ activity = 1 new step get detected
+ activity = 0 no new step get detected
+ * @return zero for success, non-zero failed
+ * @retval 0 -> stationary
+ * @retval 1 -> step detected
+ */
+BSX_S8 bsx_get_stepdetectionstatus(BSX_U8*);
+
+/*!
+ * @brief This API is used to get the steps count.
+ * The steps will update for every change in valid movements of a user.
+ * This steps count will be updated till the next time the system gets reboot.
+ * This API can be called only when BSX_PEDO_SUPPORT is ON
+ * @param steps -> it will return the number of steps detected by algorithm.
+ * @return zero for success, non-zero failed
+ * @retval 0 -> Success
+ * @retval 1 -> Error
+ */
+BSX_S8 bsx_get_stepcount(BSX_U64*);
+
+/*!
+ * @brief This API is used to set the step detection mean constant
+ * This value helps to evaluate valid step count and Detection
+ * This API can be called only when BSX_PEDO_SUPPORT is ON
+ * @param meanconst-> parameter to set meanconst
+ * @return zero for success, non-zero failed
+ * @retval 0 -> Success
+ * @retval 1 -> Error
+ */
+BSX_S8 bsx_set_stepdetectionmeanconst(BSX_F32 meanconst);
+
+/*!
+ * @brief This API is used to get the step detection mean constant
+ * This API can be called only when BSX_PEDO_SUPPORT is ON
+ * @param *meanconst-> parameter to get meanconst value
+ * @return zero for success, non-zero failed
+ * @retval 0 -> Success
+ * @retval 1 -> Error
+ */
+BSX_S8 bsx_get_stepdetectionmeanconst(BSX_F32* meanconst);
+
+/*!
+ * @brief This API is used to set the step detection envmin variable
+ * This API can be called only when BSX_PEDO_SUPPORT is ON
+ * @param envmin -> to set envmin varaiable
+ * @return zero for success, non-zero failed
+ * @retval 0 -> Success
+ * @retval 1 -> Error
+ */
+BSX_S8 bsx_set_stepdetectionenvmin(BSX_F32 envmin);
+
+/*!
+ * @brief This API is used to get the step detection envmin variable
+ * This API can be called only when BSX_PEDO_SUPPORT is ON
+ * @param envmin-> parameter to get envmin value
+ * @return zero for success, non-zero failed
+ * @retval 0 -> Success
+ * @retval 1 -> Error
+ */
+BSX_S8 bsx_get_stepdetectionenvmin(BSX_F32* envmin);
+
+/*!
+ * @brief This API is used to set the step detection coefficient variable
+ * @param coefficient -> parameter to set step detection coefficient
+ * @return zero for success, non-zero failed
+ * @retval 0 -> Success
+ * @retval 1 -> Error
+ */
+BSX_S8 bsx_set_stepdetectioncoefficient(BSX_F32 coefficient);
+
+/*!
+ * @brief This API is used to get the step detection coefficient variable
+ * This API can be called only when BSX_PEDO_SUPPORT is ON
+ * @param *coefficient -> to get step detection coefficient
+ * @return zero for success, non-zero failed
+ * @retval 0 -> Success
+ * @retval 1 -> Error
+ */
+BSX_S8 bsx_get_stepdetectioncoefficient(BSX_F32* coefficient);
+
+/*!
+ * @brief This API is used to set the step detection mean step frequency variable
+ * This step detection frequency value will be help in evaluating
+ * the valid time duration for step detection & count.
+ * This API can be called only when BSX_PEDO_SUPPORT is ON
+ * @param meanstepfreq-> parameter holding value of meanstepfreq
+ * @return zero for success, non-zero failed
+ * @retval 0 -> Success
+ * @retval 1 -> Error
+ */
+BSX_S8 bsx_set_stepdetectionmeanstepfreq(BSX_F32 meanstepfreq);
+/*!
+ * @brief This API is used to get the step detection mean step frequency variable
+ * This step detection frequency value will be help in evaluating the
+ * valid time duration for step detection & count.
+ * This API can be called only when BSX_PEDO_SUPPORT is ON
+ * @param meanstepfreq-> parameter to get meanstepfreq value
+ * @return zero for success, non-zero failed
+ * @retval 0 -> Success
+ * @retval 1 -> Error
+ */
+BSX_S8 bsx_get_stepdetectionmeanstepfreq(BSX_F32* meanstepfreq);
+
+/*!
+ * @brief This API is used to set the step detection steps to buffer;
+ * This step detection frequency value will be help in evaluating
+ * the valid time duration for step detection & count.
+ * This API can be called only when BSX_PEDO_SUPPORT is ON
+ * @param nstepstobuff -> holds nstepstobuff to be set
+ * @return zero for success, non-zero failed
+ * @retval 0 -> Success
+ * @retval 1 -> Error
+ */
+BSX_S8 bsx_set_stepdetectionnstepstobuff(BSX_U32 nstepstobuff);
+
+/*!
+ * @brief This API is used to get the step detection steps to buffer
+ * This step detection frequency value will be help in evaluating
+ * the valid time duration for step detection & count.
+ * This API can be called only when BSX_PEDO_SUPPORT is ON
+ * @param nstepstobuff ->to get value of nstepstobuff
+ * @return zero for success, non-zero failed
+ * @retval 0 -> Success
+ * @retval 1 -> Error
+ */
+BSX_S8 bsx_get_stepdetectionnstepstobuff(BSX_U32* nstepstobuff);
+
+/*!
+* @brief Resets the stepcounter value to zero it will resets
+* the StepCount to initial vlaue as zero.
+* This API can be called only when BSX_PEDO_SUPPORT is ON
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_reset_stepcount(void);
+
+/************************************************************************************************************/
+/**\name ACCELEROMETER DATA INTERFACE */
+/************************************************************************************************************/
+/*!
+* @brief Get the raw accelerometer data(x,y and z direction) in m/s^2
+* @param *rawAccData: pointer to accelerometer raw data structure
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_accrawdata(ts_dataxyzf32*);
+
+/*!
+* @brief Get the corrected accelerometer data(x,y and z direction)
+* in m/s^2. Corrected data = raw data – offset.
+* @param corAccData -> accel data in ms^2
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_acccordata(ts_dataxyzf32*);
+
+
+/*!
+* @brief Get the filtered accelerometer data in ms^2
+* from digital filter 1
+* @param filtaccdata -> pointer to accelerometer data structure
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_accfiltdata1(ts_dataxyzf32*);
+
+/*!
+* @brief Get the filtered accelerometer data in ms^2
+* from digital filter 2
+* @param *filtAccData: pointer to accelerometer data structure
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_accfiltdata2(ts_dataxyzf32*);
+
+/*!
+* @brief Get the estimated offsets of the accelerometer in m/s^2
+* @param *offset: pointer to structure having estimated offsets
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_accoffset(ts_dataxyzf32*);
+
+/*!
+* @brief Get the accelerometer calibration accuracy status
+* @param *calibaccuracy -> current accelerometer calibration accuracy status
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_acccalibaccuracy(BSX_U8*);
+
+/*!
+* @brief Get the accelerometer raw data in mg
+* @param *rawdata_mg -> current accelerometer raw data in mg
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_accrawdata_mg(ts_dataxyzf32* );
+
+/*!
+* @brief Get the accelerometer cor data in mg
+* @param *cordata_mg -> current accelerometer cor data in mg
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_acccordata_mg(ts_dataxyzf32* );
+
+/*!
+* @brief Get the accelerometer filt data1 in mg
+* @param *filtdata1_mg -> current accelerometer filter data1 in mg
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_accfiltdata1_mg(ts_dataxyzf32* );
+
+/*!
+* @brief Get the accelerometer filt data2 in mg
+* @param *filtdata2_mg -> current accelerometer filter data2 in mg
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_accfiltdata2_mg(ts_dataxyzf32* );
+
+/*!
+* @brief Get the accelerometer offsets in mg
+* @param *accoffsets_mg -> current accelerometer offsets in mg
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_accoffsets_mg(ts_dataxyzs32* );
+
+/************************************************************************************************************/
+/**\name MAGNETOMETER API */
+/************************************************************************************************************/
+/*!
+* @brief Initialization of magnetometer modules with the settings for particular mag sensor.
+* If NULL is passed,the default values(bmm050) are loaded.
+* @param p_magspec-> Pointer to magspec char array that holds settings for particular mag sensor
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_init_mag(BSX_U8*);
+
+/*!
+* @brief Set the calling datarate for the magnetometer
+* @param magdatarate -> calling data rate of magnetometer\
+
+* permissible values
+* 0 -> 1Hz
+* 1 -> 5Hz
+* 2 -> 6.25Hz
+* 3 -> 10Hz
+* 4 -> 12.5Hz
+* 5 -> 20Hz
+* 6 -> 25Hz
+* 7 -> 40Hz
+* 8 -> 50Hz
+* 9 -> 100Hz
+* 10 -> 125Hz
+* 11 -> 200Hz
+* 12 -> 400Hz
+* 13 -> Invalid upper data rate
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_set_magdatarate(BSX_U8);
+
+/*!
+* @brief based on datarate, gyrosyncdelay and gyro buffer size is updated.
+* @brief Allowed values for gyrosyncdelay are
+*
+* 12.5Hz -> delay used is 7;
+* 20Hz -> delay used is 4;
+* 25Hz -> delay used is 3;
+* @param datarate : mag datarate
+
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_updatefmcparam(BSX_U8 );
+
+/*!
+* @brief Get the datarate for the magnetometer
+* @param dataRate -> parameter to get data rate of magnetometer that is being set
+*
+* Output values
+* 0 -> 1Hz
+* 1 -> 5Hz
+* 2 -> 6.25Hz
+* 3 -> 10Hz
+* 4 -> 12.5Hz
+* 5 -> 20Hz
+* 6 -> 25Hz
+* 7 -> 40Hz
+* 8 -> 50Hz
+* 9 -> 100Hz
+* 10 -> 125Hz
+* 11 -> 200Hz
+* 12 -> 400Hz
+* 13 -> Invalid upper data rate
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_magdatarate(BSX_U8*);
+
+/*!
+* @brief Set the magnetomter calibration profile(calibration offset and status)
+* @param *calibprofile-> pointer to magnetometer calibration profile
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_set_magcalibprofile(ts_calibprofile*);
+
+/*!
+* @brief Get the magnetomter calibration profile (includes offsets and accuracy status)
+* @param *calibprofile-> pointer to magnetometer calibration profile structure
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_magcalibprofile(ts_calibprofile*);
+
+/*!
+* @brief reset magnetometer calibration
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_reset_magcalib(void);
+
+/************************************************************************************************************/
+/**\name MAGNETOMETER CALIB INTERFACE */
+/************************************************************************************************************/
+/*!
+* @brief set magnetometer calibration process Noise. This API
+* should be invoked only on special request from the
+* customer. It is expected to use in daemon for specific
+* customer requirement only. Input noise parameters should
+* be provided by system engineers only. Parameters will
+* be provided if required to meet specific customer requirement.
+* @param processNoise -> pointer to processNoise vector
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_set_magcalib_processnoise( BSX_F32*);
+
+/*!
+* @brief Get magnetometer calibration process Noise. This
+* API is invoked to get the process noise either
+* default parameters or parameters set by using set
+* API. It can be used to check the set parameters
+* in algorithm.
+* @param *processNoise -> pointer to processNoise vector
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_magcalib_processnoise( BSX_F32 *);
+
+/************************************************************************************************************/
+/**\name SOFT IRON CORRECTION INTERFACE */
+/************************************************************************************************************/
+/*!
+* @brief Used to set the sensitivity correction matrix for soft iron
+* correction.this API should be used with correct matrix as
+* input else algorithm will behave unexpectedly. SIC matrix
+* is predetermined either from SIC app, customer provided
+* or other methods based on customer platform.
+* @param correctMatrix : correction matrix 3x3 (pointer to float
+* array of 9 elements i.e. 3 by 3 matrix)
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_set_softiron_correctionmatrix(ts_sensmatrix);
+
+/*!
+* @brief get the sensitivity correction matrix.
+* This API can be used to retrieve the default
+* SIC matrix (If it’s not set explicitly using set API)
+* or set by using set API.
+* @param *correctMatrix : pointer to correction matrix 3x3
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_softiron_correctionmatrix(ts_sensmatrix*);
+/************************************************************************************************************/
+/**\name ACCEL DYNAMIC FOR DISTORTION INTERFACE */
+/************************************************************************************************************/
+
+/*!
+* @brief Sets the accelerometer dynamic detection mode.
+* This API is used to set the mode of distortion
+* detection based on accelerometer dynamics. It
+* can be made 0->1 when accel dynamics should be
+* used for distortion detection and 1->0 when it
+* is preferred not to use accel dynamics for distortion
+* detection. This provision was provide for special
+* usecase of coil testing when magnetic field is moved
+* around and sensor is static, in this case the flag
+* should be 1->0.
+* @param mode -> Enable/Disable mode
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_set_accdyn_distdetmode(BSX_U8 );
+
+/*!
+* @brief gets the accelerometer dynamic detection mode
+* @param mode -> pointer to mode (Enable/Disable mode status)
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_accdyn_distdetmode(BSX_U8 *);
+/************************************************************************************************************/
+/**\name MAGNETOMETER DATA INTERFACE */
+/************************************************************************************************************/
+
+/*!
+* @brief Get the raw 3-axis magnetometer data in MicroTesla
+* @param *rawmagdata -> mag data in MicroTesla
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_magrawdata(ts_dataxyzf32*);
+
+/*!
+* @brief Get the 3-axis corrected magnetometer data in MicroTesla
+* Corrected = raw – offset.
+* @param *corMagData -> mag data in MicroTesla
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_magcordata(ts_dataxyzf32*);
+
+/*!
+* @brief Get the filtered 3-axis magnetometer data in MicroTesla
+* from digital filter 1
+* @param *filtMagData -> mag data in MicroTesla
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_magfiltdata1(ts_dataxyzf32*);
+
+/*!
+* @brief Get the filtered 3-axis magnetometer data in MicroTesla
+* from digital filter 2
+* @param *filtMagData: mag data in MicroTesla
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_magfiltdata2(ts_dataxyzf32*);
+
+/*!
+* @brief Get the estimated parameter of the magnetometer
+* @param offset -> estimated offsets in MicroTesla
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_magoffsets(ts_dataxyzf32*);
+
+/*!
+* @brief Get the magnetometer calibration accuracy status
+* @param calibaccuracy -> current magnetometer calibration accuracy status
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_magcalibaccuracy(BSX_U8 *);
+
+/*!
+* @brief Get the soft iron correction data.
+* This API is the interface for magnetometer soft iron corrected(using SIC matrix) and uncalibrated data
+* from generic data preprocessing. Data interface is only for ndof and compass module.
+* @param sicdata -> pointer to corrected data
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_magsoftironcorrecteddata(ts_dataxyzf32* );
+
+/*!
+* @brief get the soft iron correction data in lsb.
+* This API is the interface for magnetometer soft iron corrected(using SIC matrix) and uncalibrated data
+* from generic data preprocessing. Data interface is only for ndof and compass module.
+* @param sicdatalsb -> pointer to corrected data microtesla
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_magsoftironcorrecteddata_lsb(ts_dataxyzf32*);
+
+/************************************************************************************************************/
+/**\name GYROSCOPE API */
+/************************************************************************************************************/
+
+/*!
+* @brief Initialization of gyroscope modules with the settings of particular gyro sensor. Default values(bmg160)
+* @param p_gyrospec-> Pointer to gyrospec char array that holds settings for particular gyro sensor
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_init_gyro(BSX_U8*);
+
+/*!
+* @brief Set the measurement range for gyroscope
+* @param measrange -> measurement range of gyroscope
+* Permissible Range
+* 0 -> 2048 Dps
+* 1 -> 2000 Dps
+* 2 -> 1000 Dps
+* 3 -> 500 Dps
+* 4 -> 250 Dps
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_set_gyrorange(BSX_U8);
+
+/*!
+* @brief Get the measurement range for gyroscope
+* @param *measrange -> pointer to measurement range of gyroscope
+* Output Range
+* 0 -> 2048 Dps
+* 1 -> 2000 Dps
+* 2 -> 1000 Dps
+* 3 -> 500 Dps
+* 4 -> 250 Dps
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_gyrorange(BSX_U8*);
+
+/*!
+* @brief Set the calling datarate for the gyroscope
+* @param datarate-> datarate of gyroscope
+*
+* permissible values
+* 0 -> 1Hz
+* 1 -> 5Hz
+* 2 -> 6.25Hz
+* 3 -> 10Hz
+* 4 -> 12.5Hz
+* 5 -> 20Hz
+* 6 -> 25Hz
+* 7 -> 40Hz
+* 8 -> 50Hz
+* 9 -> 100Hz
+* 10 -> 125Hz
+* 11 -> 200Hz
+* 12 -> 400Hz
+* 13 -> Invalid upper data rate
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+
+BSX_S8 bsx_set_gyrodatarate(BSX_U8);
+
+/*!
+* @brief Get the calling datarate for the gyroscope
+* @param *datarate-> pointer to datarate of gyroscope
+*
+* permissible values
+* 0 -> 1Hz
+* 1 -> 5Hz
+* 2 -> 6.25Hz
+* 3 -> 10Hz
+* 4 -> 12.5Hz
+* 5 -> 20Hz
+* 6 -> 25Hz
+* 7 -> 40Hz
+* 8 -> 50Hz
+* 9 -> 100Hz
+* 10 -> 125Hz
+* 11 -> 200Hz
+* 12 -> 400Hz
+* 13 -> Invalid upper data rate
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_gyrodatarate(BSX_U8*);
+
+/*!
+* @brief Set the gyroscope calibration profile(includes offsets and accuracy status)
+* @param calibprofile-> gyroscope calibration profile structure variable
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_set_gyrocalibprofile(ts_calibprofile*);
+
+/*!
+* @brief Get the gyroscope calibration profile (includes offsets and accuracy status)
+* @param *calibprofile-> pointer to gyroscope calibration profile structure
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_gyrocalibprofile(ts_calibprofile*);
+
+/*!
+* @brief reset gyroscope calibration
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_reset_gyrocalib(void);
+
+/************************************************************************************************************/
+/**\name GYROSCOPE DATA INTERFACE */
+/************************************************************************************************************/
+
+/*!
+* @brief Get the raw 3-axis gryoscope data in degrees/sec
+* @param rawgyrodata -> gyro data in degrees/sec
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_gyrorawdata_dps(ts_dataxyzf32*);
+
+/*!
+* @brief Get the raw 3-axis gryoscope data in radians/sec
+* @param rawgyrodata -> gyro data in radians/sec
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_gyrorawdata_rps(ts_dataxyzf32*);
+
+/*!
+* @brief Get the corrected 3-axis gryoscope data in degrees/sec
+* @param corgyrodata -> gyro data in degrees/sec
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_gyrocordata_dps(ts_dataxyzf32*);
+
+/*!
+* @brief Get the raw 3-axis gryoscope data in radians/sec
+* @param corgyrodata -> gyro data in radians/sec
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_gyrocordata_rps(ts_dataxyzf32*);
+
+/*!
+* @brief Get filtered 3-axis gyroscope data in degrees/sec
+* from digital filter 1
+* @param filtgyrodata -> gyro data in degrees/sec
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_gyrofiltdata1_dps(ts_dataxyzf32*);
+
+/*!
+* @brief Get filtered 3-axis gyroscope data in radians/sec
+* from digital filter 1
+* @param filtgyrodata -> gyro data in radians/sec
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_gyrofiltdata1_rps(ts_dataxyzf32*);
+
+/*!
+* @brief Get filtered 3-axis gyroscope data in degrees/sec
+* from digital filter 2
+* @param filtgyrodata -> gyro data in degrees/sec
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_gyrofiltdata2_dps(ts_dataxyzf32*);
+
+/*!
+* @brief Get filtered 3-axis gyroscope data in radians/sec
+* from digital filter 2
+* @param filtgyrodata -> gyro data in radians/sec
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_gyrofiltdata2_rps(ts_dataxyzf32*);
+
+/*!
+* @brief Get the estimated parameter of the gyroscope
+* @param offset -> estimated offsets in degrees per sec
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_gyrooffset_dps(ts_dataxyzf32*);
+
+/*!
+* @brief Get the estimated parameter of the gyroscope
+* @param offset -> estimated offsets in radians per sec
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_gyrooffset_rps(ts_dataxyzf32*);
+
+/*!
+* @brief Get the gyroscope calibration accuracy status
+* @param *gyrocalibaccuracy -> current gyroscope calibration accuracy status
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_gyrocalibaccuracy(BSX_U8*);
+
+/************************************************************************************************************/
+/**\name ORIENTATION PROCESSING API */
+/************************************************************************************************************/
+
+/*!
+* @brief Initialization of orientation modules
+* For compass mode -> compass module is initialized
+* For IMU or NDOF mode -> NDOF module
+* For ALL mode -> compass and NDOF module
+* @param p_usecaseconfig -> Pointer to usecase char array that holds settings for particular usecase
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_init_orient(BSX_U8*);
+
+/*!
+* @brief Reset of Orientation module
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_reset_orient(void);
+
+/*!
+* @brief Restart of Orientation module
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_restart_orient(void);
+
+/*!
+* @brief Heading base threshold for calcuting accuracy status
+* Accuracy levels are defined as
+*
+* Status 0: Unreliable
+* Status 1: Low
+* Status 2: Medium
+* Status 3: High
+* @param basethresholddeg ->parameter to set base threshold
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_set_HeadingAccuracyBaseThresh(BSX_F32 );
+/************************************************************************************************************/
+/**\name ORIENTATION DATA INTERFACE */
+/************************************************************************************************************/
+
+/*!
+* @brief Get the orientation quaternion data
+* @param *quatData -> quaternion data (w,x,y,z)
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_orientdata_quat(ts_dataquatf32 *);
+
+/*!
+* @brief Get the orientation quaternion data in lsb(scaling factor 2^14=16384)
+* @param quatDataLsb -> quaternion data (w,x,y,z)
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_orientdata_quat_lsb(ts_dataquat *);
+
+/*!
+* @brief Get the orientation euler data(heading, pitch and roll) in degrees
+* @param *eulerData -> euler data (h,p,r)
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_orientdata_euler_deg(ts_dataeulerf32 *);
+
+/*!
+* @brief Get the orientation euler data(heading, pitch and roll) in radians
+* @param eulerDataRad -> euler data (h,p,r)
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_orientdata_euler_rad(ts_dataeulerf32 *);
+
+
+/*!
+* @brief Get the imu orientation quaternion data
+* @param *imuquatData -> quaternion data (w,x,y,z)
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_imuorientdata_quat(ts_dataquatf32 *);
+
+
+/*!
+* @brief Get the imu orientation quaternion data in lsb
+* @param *quatDataLsb -> quaternion data (w,x,y,z)
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_imuorientdata_quat_lsb(ts_dataquat *);
+
+/*!
+* @brief Get the imu orientation euler data(heading, pitch and roll) in degrees
+* @param imueulerDatadeg -> euler data (h,p,r)
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_imuorientdata_euler_deg(ts_dataeulerf32 *);
+
+/*!
+* @brief Get the imu orientation euler data(heading, pitch and roll) in radians
+* @param imueulerDataRad -> pointer to get imu euler dat in rad(h,p,r)
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_imuorientdata_euler_rad(ts_dataeulerf32 *);
+
+/*!
+* @brief Get the orientation data accuracy status
+* @param datastatus -> pointer to orientation accuracy status as 0,1,2,3: Which 3 indicates
+* heading is close to true magnetic heading and similarly 0 indicates unreliable.
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_orient_datastatus( BSX_U8* );
+
+/*!
+* @brief Get the heading data accuracy in radians
+* @brief Heading status refers to accuracy level of orientation data(from library) from
+* @brief true heading calculation. This comparison is done with magnetic data coupling.
+* @param *headingaccrad -> Pointer to read the error in heading in radians
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_headingaccuracy_rad( BSX_F32* );
+
+/*!
+* @brief Get the heading data accuracy in degree
+* @brief Heading status refers to accuracy level of orientation data(from library) from
+* @brief true heading calculation. This comparison is done with magnetic data coupling.
+* @param *headingaccdeg -> Pointer to read the error in heading in degrees
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_headingaccuracy_deg( BSX_F32* );
+
+/************************************************************************************************************/
+/**\name COMPASS CONFIG INTERFACE */
+/************************************************************************************************************/
+/*!
+* @brief Get the filter mode for compass and M4G
+*
+* Permissible values
+* 0 -> Bypass mode. No filtering
+* 1 -> Low. Low orientation filtering for high dynamic level
+* 2 -> Medium. Medium orientation filtering for medium dynamic level
+* 3-> High. High orientation filtering for low dynamic level
+* @param mode -> filter mode for compass
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_compass_filtermode(BSX_U8*);
+
+/*!
+* @brief Set the magnetometer noise threshold for compass and M4G
+* @param magnoise-> magnetometer noise threshold
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_set_compass_magnoise( BSX_F32);
+
+/*!
+* @brief Set the filter noise parameters
+* @param basecoef -> value to set base coefficient
+* @param dyncoef -> value to set dynamic coefficient
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_set_compass_magfilterparam(BSX_F32,BSX_F32);
+
+
+//BSX_S8 bsx_set_compass_filternoise(BSX_F32,BSX_F32);
+
+/*!
+* @brief Set the accelerometer noise threshold for compass and M4G
+* @param accnoisethresh -> accelerometer noise threshold
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_set_compass_accel_filternoise(BSX_F32);
+
+/*!
+* @brief Get the accelerometer and magnetometer noise threshold for compass and M4G
+* @param *accnoisethresh -> accelerometer noise threshold
+* @param *magnoisethresh -> magnetometer noise threshold
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_compass_filternoise(BSX_F32*,BSX_F32*);/* TODO: check the name */
+
+
+//BSX_S8 bsx_set_compass_filterparam(BSX_F32, BSX_F32);
+
+/*!
+* @brief Set the accelerometer filter noise parameters
+* @param accelbasecoef -> value to set accelerometer base coefficient
+* @param acceldyncoef -> value to set accelerometer dynamic coefficient
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_set_compass_accel_filterparam(BSX_F32, BSX_F32);
+
+/*!
+* @brief Get the filter noise param for compass and M4G
+* @param accbasecoef -> base coefficient for accelerometer
+* @param accdyncoef -> dynamic coefficient for accelerometer
+* @param magbasecoef -> base coefficient for Magnetometer
+* @param magdyncoef -> dynamic coefficient for magnetometer
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_compass_filterparam(BSX_F32*, BSX_F32*,BSX_F32*, BSX_F32*); /* TODO: check the name */
+
+
+/*!
+* @brief Set the accelerometer dynamic threshold for M4G
+* @param accdynthres -> accelerometer dynamic threshold
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_set_m4g_accdynthreshold( BSX_U8);
+
+/*!
+* @brief Get the accelerometer dynamic threshold for M4G
+* @param accdynthres -> accelerometer dynamic threshold
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_m4g_accdynthreshold( BSX_U8*);
+/************************************************************************************************************/
+/**\name GRAVITY VECTOR DATA INTERFACE */
+/************************************************************************************************************/
+
+/*!
+* @brief Get the gravity vector data in ms^2
+* @param *gravity -> gravity vector data in ms^2
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_gravity(ts_dataxyzf32 *);
+
+/************************************************************************************************************/
+/**\name LINEAR ACCELERATION DATA INTERFACE */
+/************************************************************************************************************/
+
+/*!
+* @brief Get the linear acceleration data in ms^2
+* @param linearAcc -> linear accel data in ms^2
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_linearacceleration(ts_dataxyzf32 *);
+/************************************************************************************************************/
+/**\name POWER MODES INTERFACE */
+/************************************************************************************************************/
+
+
+/*!
+* @brief Sets the working operation mode. Input is a structure of one
+* element of BSX_U32 type and contains encoded operation mode.
+* @param workingModes ->Pointer to working mode
+* e.g.
+*
+* BSX_WORKINGMODE_MAGONLY -> 98308;
+* BSX_WORKINGMODE_ACCMAG -> 98309;
+* BSX_WORKINGMODE_ACCGYRO -> 524305;
+* BSX_WORKINGMODE_IMUPLUS -> 525329;
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_set_workingmode(ts_workingModes*);
+
+/*!
+* @brief Get the sensor switch list for the current working mode.
+* HWsensorSwitchList is a structure of three elements
+* BSX_U8 acc,BSX_U8 mag,BSX_U8 gyro.This function gets
+* the status of these three alements for the
+* given working mode.e.g. if working mode
+* is BSX_WORKINGMODE_MAGONLY then acc = 0,mag = 1,gyro = 0;
+* @param *workingModes -> Pointer to working mode constants
+* @param *HWsensorSwitchList -> Pointer to hardware switch list
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_hwdependency(ts_workingModes,ts_HWsensorSwitchList* );
+
+/************************************************************************************************************/
+/**\name Significant Motion API */
+/************************************************************************************************************/
+
+/*!
+* @brief This API is used to set the significant motion opmode.
+* Compiler switch constant BSX_SIGNIFICANTMOTION_SUPPORT
+* should be declared and accel opmode should be enabled
+* to enable the algorithm since it uses only accel data
+* in the algorithm. As the significant motion algorithm
+* gives event one time only when motion is detected, after
+* that it is disabled, hence to restart the detection
+* this API should be called with mode = 1.
+* Note: If the library is initialized for the first time
+* with BSX_SIGNIFICANTMOTION_SUPPORT enabled the algorithm
+* is already enabled no need to use set API
+* @param mode-> to activate/deactivate motion
+* mode = 1 activate significant motion
+* mode = 0 deactivate significant motion
+* when mode is set to 1, the significant motion
+* initializes to Initial values
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_set_significantmotiondetectionopmode(BSX_U16);
+
+/*!
+* @brief This API is used to get the significant motion opmode
+* @param *mode -> to get the significant motion opmode
+* mode = 1 significant motion active
+* mode = 0 significant motion inactive
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_significantmotiondetectionopmode(BSX_U16*);
+
+/*!
+* @brief This API is used to get the significant motion detection status
+* once the motion is detected the significant motion
+* is deactivated. algorithm can be activated by calling
+* bsx_set_significantmotiondetectionopmode API.
+* @param *status [out]
+* status = 1 motion detected
+* status >=0 no motion detected
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_significantmotiondetectionstatus(BSX_U16*);
+
+/************************************************************************************************************/
+/**\name FLIP GESTURE API */
+/************************************************************************************************************/
+
+/*!
+* @brief returns flip gesture opmode
+* @param *opmode -> pointer to get flip gesture operation mode that is being set
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_flipgesture_opmode(BSX_U8* );
+
+/*!
+* @brief sets flip gesture opmode
+*
+* opmode <= 1 implies value set to s_bsxfusionlibrary.flipgestureOpmode structure variable
+* opmode > 1, returns error state (BSX_STATE_ERROR)
+* @param opmode -> variable holding the value to be set
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_set_flipgesture_opmode(BSX_U8 );
+
+/*!
+* @brief Gets the threshold of faceUp and faceDown angle
+* @param faceup -> Angle for faceup
+* @param facedown -> Angle for facedown;
+* Expected values:
+* 100 < faceup <170
+* 10 < facedown < 80
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_flipgesture_angle(BSX_F32* ,BSX_F32* );
+
+/*!
+* @brief sets flip gesture angle
+* @param faceUp -> Angle for faceup
+* @param faceDown -> Angle for facedown
+* Range ->values should be between specified minimum and maximum limit,
+* else values wont be set
+*
+* Minimum angle limit for FaceUp 100;
+* Maximum angle limit for FaceUp 170;
+* Minimum angle limit for Facedown 10;
+* Maximum angle limit for Facedown 80;
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_set_flipgesture_angle(BSX_F32 ,BSX_F32 );
+
+/*!
+* @brief Get the detect time in mili seconds for flip gesture module
+* @param dettime : Detection time
+* 300 ms < Time < 2000 ms
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_flipgesture_detecttime(BSX_U16* );
+
+/*!
+* @brief To set the detect time for flip gesture module in milliseconds
+* @param time : Detection time
+* 300 ms < Time < 2000 ms
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_set_flipgesture_detecttime(BSX_U16 );
+
+/*!
+* @brief This API gives the calibration tick;– It is an external task calling tick which will be
+* set at the end of bsx_dopreprocess , and is used as a trigger input for calibration.
+* @param calibtick -> pointer to get calib tick
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_calibrationcalltick(BSX_U8* );
+
+/*!
+* @brief This Api gives the Usecase tick;It is an external task calling tick which will be set at the
+* end of bsx_dousecase, and is used as a trigger input for usecase processing.
+* @param usecasetick -> pointer to get usecase tick
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_usecasecalltick(BSX_U8* );
+
+/*!
+* @brief returns flip gesture status
+* @param status: Detection Status
+* status = 0 implies facing is unknown
+* status = 1 implies facing Up
+* status = 2 implies facing Down
+* status = 3 implies facing Neutral
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_flipgesture_status(BSX_U8* );
+
+/*!
+* @brief This API is used to get the co-ordinate system (WIN 8 or Android) which has been set already
+* @param *coordinatesys -> coordinate systems
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_orientcoordinatesystem(BSX_U8* );
+
+/*!
+* @brief Sets orient coordinate system ( this api sets co - ordinate system corresponding to win 8 or android that has been passed as argument)
+* @param coordinatesys -> parameter to set ANDROID or WIN8 coordinate system
+*
+* coordinatesys -1 -> ANDROID (default)
+* coordinatesys -2 -> WIN8
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_set_orientcoordinatesystem(BSX_U8 );
+
+/*!
+* @brief Get rotation matrix
+* @param *rotmatrix -> pointer to get orientation rotation matrix
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_orientrotationmatrix( BSX_F32* );
+
+/*!
+ * @brief calcualtes orient accuracy from accel ,mag and gyro status
+ * @param accStatus -> to get accel accuracy status
+ * @param magStatus -> to get mag accuracy status
+ * @param gyroStatus -> to get gyro accuracy status
+ * @return zero for success, non-zero failed
+ * @retval 0 -> Success
+ * @retval 1 -> Error
+ */
+BSX_U8 bsx_calcorientaccuracy(BSX_U8 accStatus,BSX_U8 magStatus,BSX_U8 gyroStatus);
+
+/*!
+* @brief Get the geo magnetic rotationvector(compass rotation quat)
+* @param *georotationquat -> Orientation quaternion data (w,x,y,z)
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_georotationvector_quat(ts_dataquatf32*);
+
+/*!
+* @brief Get the geo magnetic rotation vector heading data accuracy in radians
+* @brief Heading status refers to accuracy level of orientation data(from library) from
+* @brief true heading calculation. This comparison is done with magnetic data coupling.
+* @param *headingaccrad -> Pointer to read the error in heading in radians
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_geoheadingaccuracy_rad( BSX_F32*);
+
+/*!
+* @brief Get the geo magnetic rotation vector heading data accuracy in Degrees
+* @brief Heading status refers to accuracy level of orientation data(from library) from
+* @brief true heading calculation. This comparison is done with magnetic data coupling.
+* @param *headingaccdeg -> Pointer to read the error in heading in Degrees
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_geoheadingaccuracy_deg( BSX_F32*);
+
+/************************************************************************************************************/
+/**\name PRE-FILTER PARAMETERS API */
+/************************************************************************************************************/
+
+
+/*!
+* @brief Set the heading sensitivity for compass and M4G
+* Permissible values
+* 0 - 5: sensitivity mode values of 0 to 5 is defined
+* If sensitivity is “0”, there will be a lowest heading sensitivity but have high stability level. If high heading stability
+* is desired and heading response is not of importance, this value can be set.
+* If sensitivity is “5”, highest heading sensitivity with low stability.
+* If high heading sensitivity is desired and small heading jitter can be acceptable, this mode can be set
+* @param sensitivity_val -> sensitivity mode for compass
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_set_compass_headingsensitivity(BSX_U8);
+
+/*!
+* @brief Set the orientation correction speed for NDOF
+* Permissible values
+* 0 - 5: correction speed values of 0 to 5 is defined
+*
+* speed = 0 => slow orientation correction with less jitter noise.
+* speed = 5 => fast orientation correction with more jitter noise.
+* @param speed_val -> orientation correction speed for NDOF
+* Permissible values
+* 0 - 5: correction speed values of 0 to 5 is defined
+* speed = 0 => slow orientation correction with less jitter noise.
+* speed = 5 => fast orientation correction with more jitter noise.
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_set_ndof_orientcorrectionspeed(BSX_U8);
+
+/*!
+* @brief Set the Magnetic data filter mode
+* Permissible values: 0 - 5;
+*
+* mode = 0 -> lowest filtering, high noise but better response time.
+* mode = 5 -> Highest filtering, low noise but slow response time.
+* @param mode -> mode for magnetic filter
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_set_magfiltermode(BSX_U8);
+
+/*!
+* @brief Set the Magnetic calibration accuracy status sensitivity
+* Permissible values
+* 0 - 5: sensitivity values of 0 to 5 is defined
+*
+* sensitivity = 0 -> lowest magnetic calibration accuracy sensitivity with high accuracy status stability.
+* sensitivity = 5 -> highest magnetic calibration accuracy sensitvity with low accuracy status stability.
+
+* @param sensitivity -> sensitivity mode for magnetic calibration accuracy status
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_set_magcalibacc_sensitivity(BSX_U8);
+
+/*!
+* @brief Set the Magnetic calibration speed
+* Permissible values
+* 0 - 5: correction speed values of 0 to 5 is defined
+*
+* speed = 0 -> slow magnetic calibration speed, high accuracy after calibration accuracy level 3;
+* speed = 5 -> fast magnetic calibration speed, low heading accuracy after calibration accuracy level 3.
+* @param speed -> magnetic calibration speed
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_set_magcalibrationspeed(BSX_U8);
+
+/*!
+* @brief Set the Magnetic calibration accuracy auto recovery mode
+* @param mode -> auto recovery mode for magnetic calibration accuracy
+* Permissible values [0,1]
+* 0: Auto recovery mode disabled
+* 1: Auto recovery mode Enabled
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_set_compass_magcalibaccautorecmode(BSX_U8);
+
+/*!
+* @brief Get the geo magnetic rotationvector values in lsb
+* @param *georotationquatlsb -> Orientation quaternion data (w,x,y,z)
+* @return zero for success, non-zero failed
+* @retval 0 -> Success
+* @retval 1 -> Error
+*/
+BSX_S8 bsx_get_georotationvector_quat_lsb(ts_dataquat*);
+
+#endif
+
diff --git a/BSXlite_Cortex_M3_M4_M4F/algo/algo_bsx/Inc/BsxLibraryCalibConstants.h b/BSXlite_Cortex_M3_M4_M4F/algo/algo_bsx/Inc/BsxLibraryCalibConstants.h
new file mode 100644
index 0000000..26c6863
--- /dev/null
+++ b/BSXlite_Cortex_M3_M4_M4F/algo/algo_bsx/Inc/BsxLibraryCalibConstants.h
@@ -0,0 +1,152 @@
+#ifndef __BSXLIBRARYCALIBCONSTANTS_H__
+#define __BSXLIBRARYCALIBCONSTANTS_H__
+/*!
+* @section LICENCE
+* $license$
+*
+*
+* (C) Copyright 2011 - 2015 Bosch Sensortec GmbH All Rights Reserved
+*------------------------------------------------------------------------------
+* Disclaimer
+*
+* Common: Bosch Sensortec products are developed for the consumer goods
+* industry. They may only be used within the parameters of the respective valid
+* product data sheet. Bosch Sensortec products are provided with the express
+* understanding that there is no warranty of fitness for a particular purpose.
+* They are not fit for use in life-sustaining, safety or security sensitive
+* systems or any system or device that may lead to bodily harm or property
+* damage if the system or device malfunctions. In addition, Bosch Sensortec
+* products are not fit for use in products which interact with motor vehicle
+* systems. The resale and/or use of products are at the purchaser's own risk
+* and his own responsibility. The examination of fitness for the intended use
+* is the sole responsibility of the Purchaser.
+*
+* The purchaser shall indemnify Bosch Sensortec from all third party claims,
+* including any claims for incidental, or consequential damages, arising from
+* any product use not covered by the parameters of the respective valid product
+* data sheet or not approved by Bosch Sensortec and reimburse Bosch Sensortec
+* for all costs in connection with such claims.
+*
+* The purchaser must monitor the market for the purchased products,
+* particularly with regard to product safety and inform Bosch Sensortec without
+* delay of all security relevant incidents.
+*
+* Engineering Samples are marked with an asterisk (*) or (e). Samples may vary
+* from the valid technical specifications of the product series. They are
+* therefore not intended or fit for resale to third parties or for use in end
+* products. Their sole purpose is internal client testing. The testing of an
+* engineering sample may in no way replace the testing of a product series.
+* Bosch Sensortec assumes no liability for the use of engineering samples. By
+* accepting the engineering samples, the Purchaser agrees to indemnify Bosch
+* Sensortec from all claims arising from the use of engineering samples.
+*
+* Special: This software module (hereinafter called "Software") and any
+* information on application-sheets (hereinafter called "Information") is
+* provided free of charge for the sole purpose to support your application
+* work. The Software and Information is subject to the following terms and
+* conditions:
+*
+* The Software is specifically designed for the exclusive use for Bosch
+* Sensortec products by personnel who have special experience and training. Do
+* not use this Software if you do not have the proper experience or training.
+*
+* This Software package is provided `` as is `` and without any expressed or
+* implied warranties, including without limitation, the implied warranties of
+* merchantability and fitness for a particular purpose.
+*
+* Bosch Sensortec and their representatives and agents deny any liability for
+* the functional impairment of this Software in terms of fitness, performance
+* and safety. Bosch Sensortec and their representatives and agents shall not be
+* liable for any direct or indirect damages or injury, except as otherwise
+* stipulated in mandatory applicable law.
+*
+* The Information provided is believed to be accurate and reliable. Bosch
+* Sensortec assumes no responsibility for the consequences of use of such
+* Information nor for any infringement of patents or other rights of third
+* parties which may result from its use.
+*
+
+* @file bsxlibrarycalibconstants.h
+* @date 2013/02/12 created
+*
+* @brief
+* This file provides constants definition for calibration modules
+*
+*
+*/
+
+/************************************************************************************************************/
+/* INCLUDES */
+/************************************************************************************************************/
+
+#include "BsxLibraryDataTypes.h"
+
+/************************************************************************************************************/
+/* CONSTANT DEFINITIONS */
+/************************************************************************************************************/
+
+/**\name Calibration modes */
+
+#define BSX_CALIB_SLEEP (0U) /**< sleep mode for calibration */
+#define BSX_CALIB_MONITORING (1U) /**< Calibration monitoring is active*/
+#define BSX_CALIB_MODEOFFSETACTIVE (2U) /**< Calibration offsets estimation is active */
+
+/**\name Data correction modes */
+
+#define BSX_DATACORRECTION_SLEEP (0U) /**< 0 => No Data correction */
+#define BSX_DATACORRECTION_OFFSET (1U) /**< 1 = Only offset correction is included */
+#define BSX_DATACORRECTION_SENSDOFFSET (2U) /**< 2 = offset + diagonal sensitivity correction are included*/
+#define BSX_DATACORRECTION_SENSFOFFSET (3U) /**< 3 = offset + full sensitivity correction are used for data correction */
+
+/**\name Calibration Source types */
+
+#define BSX_CALIBSOURCE_NONE (0U) /**< no Calibration source*/
+#define BSX_CALIBSOURCE_CLASSIC (1U) /**< Calibration source is classical*/
+#define BSX_CALIBSOURCE_FAST (2U) /**< Calibration source is FMC*/
+
+/**\name Gyro calibration modes */
+
+#define BSX_GYROCALIB_SLEEP (0U) /**< 0= Gyroscope Calibration is not Active */
+#define BSX_GYROCALIB_GYRODATA (1U) /**< 1= Gyroscope Calibration based on (Gyroscope) data only */
+#define BSX_GYROCALIB_GYROACC (2U) /**< 2= Gyroscope Calibration based on (Gyroscope+Accelerometer) Data */
+#define BSX_GYROCALIB_GYROACCMAG (3U) /**< 3= Gyroscope Calibration based on (Gyroscope+Accelerometer+Magnetometer) Data */
+
+#endif
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BSXlite_Cortex_M3_M4_M4F/algo/algo_bsx/Inc/BsxLibraryConstants.h b/BSXlite_Cortex_M3_M4_M4F/algo/algo_bsx/Inc/BsxLibraryConstants.h
new file mode 100644
index 0000000..ae214cb
--- /dev/null
+++ b/BSXlite_Cortex_M3_M4_M4F/algo/algo_bsx/Inc/BsxLibraryConstants.h
@@ -0,0 +1,311 @@
+#ifndef __BSXLIBRARYCONSTANTS_H__
+#define __BSXLIBRARYCONSTANTS_H__
+/*!
+* @section LICENCE
+* $license$
+*
+* (C) Copyright 2011 - 2015 Bosch Sensortec GmbH All Rights Reserved
+*------------------------------------------------------------------------------
+* Disclaimer
+*
+* Common: Bosch Sensortec products are developed for the consumer goods
+* industry. They may only be used within the parameters of the respective valid
+* product data sheet. Bosch Sensortec products are provided with the express
+* understanding that there is no warranty of fitness for a particular purpose.
+* They are not fit for use in life-sustaining, safety or security sensitive
+* systems or any system or device that may lead to bodily harm or property
+* damage if the system or device malfunctions. In addition, Bosch Sensortec
+* products are not fit for use in products which interact with motor vehicle
+* systems. The resale and/or use of products are at the purchaser's own risk
+* and his own responsibility. The examination of fitness for the intended use
+* is the sole responsibility of the Purchaser.
+*
+* The purchaser shall indemnify Bosch Sensortec from all third party claims,
+* including any claims for incidental, or consequential damages, arising from
+* any product use not covered by the parameters of the respective valid product
+* data sheet or not approved by Bosch Sensortec and reimburse Bosch Sensortec
+* for all costs in connection with such claims.
+*
+* The purchaser must monitor the market for the purchased products,
+* particularly with regard to product safety and inform Bosch Sensortec without
+* delay of all security relevant incidents.
+*
+* Engineering Samples are marked with an asterisk (*) or (e). Samples may vary
+* from the valid technical specifications of the product series. They are
+* therefore not intended or fit for resale to third parties or for use in end
+* products. Their sole purpose is internal client testing. The testing of an
+* engineering sample may in no way replace the testing of a product series.
+* Bosch Sensortec assumes no liability for the use of engineering samples. By
+* accepting the engineering samples, the Purchaser agrees to indemnify Bosch
+* Sensortec from all claims arising from the use of engineering samples.
+*
+* Special: This software module (hereinafter called "Software") and any
+* information on application-sheets (hereinafter called "Information") is
+* provided free of charge for the sole purpose to support your application
+* work. The Software and Information is subject to the following terms and
+* conditions:
+*
+* The Software is specifically designed for the exclusive use for Bosch
+* Sensortec products by personnel who have special experience and training. Do
+* not use this Software if you do not have the proper experience or training.
+*
+* This Software package is provided `` as is `` and without any expressed or
+* implied warranties, including without limitation, the implied warranties of
+* merchantability and fitness for a particular purpose.
+*
+* Bosch Sensortec and their representatives and agents deny any liability for
+* the functional impairment of this Software in terms of fitness, performance
+* and safety. Bosch Sensortec and their representatives and agents shall not be
+* liable for any direct or indirect damages or injury, except as otherwise
+* stipulated in mandatory applicable law.
+*
+* The Information provided is believed to be accurate and reliable. Bosch
+* Sensortec assumes no responsibility for the consequences of use of such
+* Information nor for any infringement of patents or other rights of third
+* parties which may result from its use.
+*
+
+* @file bsxlibraryconstants.h
+* @date 2013/02/12 created
+*
+* @brief
+* This file provides constants definition used by library
+*
+*
+*/
+
+/************************************************************************************************************/
+/* INCLUDES */
+/************************************************************************************************************/
+
+#include "BsxLibraryDataTypes.h"
+
+/************************************************************************************************************/
+/* CONSTANT DEFINITIONS */
+/************************************************************************************************************/
+
+
+/* gravity on earth = 9.80665 m/s2 */
+#define BSX_GRAVITY (9.80665f) /**< gravity equivalent in ms^2*/
+
+/**\name Conversion factors */
+#define BSX_CONVFACTOR_RES16BIT_UNITS2LSB (32767.0f) /**< conversion factor res16bit units to lsb */
+#define BSX_CONVFACTOR_RES16BIT_LSB2UNITS (3.0519e-005f) /**< 1/32767 */
+#define BSX_CONVFACTOR_RES15BIT_UNITS2LSB (16384.0f) /** metre per second squared */
+#define UNIT_SCALING_ACC_MPS22INTERNAL (1.019835806435164e+02f) /**< calculated as 1/0.00980665f */
+#define UNIT_SCALING_ACC_INTERNAL2G (1e-3f) /**< internal unit [mg] to [g]*/
+#define UNIT_SCALING_ACC_G2INTERNAL (1000U) /**< [g] to internal unit [mg]*/
+#define UNIT_SCALING_GYRO_INTERNAL2DEGPS (6.1e-2f) /**< internal unit [0.061 deg/s] to [deg/s]; note: 2000/2^15 = 0.061 ;1/BSX_CONVFACTOR_DPS2LSB */
+#define UNIT_SCALING_GYRO_DEGPS2INTERNAL (16.384f) /**< [deg/s] to internal unit [0.061 deg/s]; note: 2^15/2000 = 16.384*/
+#define UNIT_SCALING_GYRO_INTERNAL2RADPS (0.001065264436031695f) /**< internal unit [0.0011 rad/s] to [deg/s]; note: 2000/2^15*pi/180 = 0.0011*/
+#define UNIT_SCALING_GYRO_RADPS2INTERNAL (938.7341f) /**< calculated as BSX_CONVFACTOR_DPS2LSB*180/pi */
+#define UNIT_SCALING_MAG_INTERNAL2UTESLA (0.1f) /**< internal unit [0.1 uT] to [uT]*/
+#define UNIT_SCALING_MAG_UTESLA2INTERNAL (10U) /**< [uT] to internal unit [0.1 uT]*/
+/**\name Supported Data Rate */
+#define BSX_DATARATE_1HZ (0U) /**< Library constant for 1hz datarate*/
+#define BSX_DATARATE_5HZ (1U) /**< Library constant for 5Hz datarate*/
+#define BSX_DATARATE_6_25HZ (2U) /**< Library constant for 6_25Hz datarate*/
+#define BSX_DATARATE_10HZ (3U) /**< Library constant for 10Hz datarate*/
+#define BSX_DATARATE_12_50HZ (4U) /**< Library constant for 12_50hz datarate*/
+#define BSX_DATARATE_20HZ (5U) /**< Library constant for 20hz datarate*/
+#define BSX_DATARATE_25HZ (6U) /**< Library constant for 25hz datarate*/
+#define BSX_DATARATE_40HZ (7U) /**< Library constant for 40hz datarate*/
+#define BSX_DATARATE_50HZ (8U) /**< Library constant for 50hz datarate*/
+#define BSX_DATARATE_100HZ (9U) /**< Library constant for 100hz datarate*/
+#define BSX_DATARATE_125HZ (10U) /**< Library constant for 125hz datarate*/
+#define BSX_DATARATE_200HZ (11U) /**< Library constant for 200hz datarate*/
+#define BSX_DATARATE_400HZ (12U) /**< Library constant for 400hz datarate*/
+#define DATARATE_INVALIDUPPER (13U) /**< Upper boundary on allowed values*/
+
+/**\name Operational modes */
+#define BSX_OPMODE_SLEEP (0U) /**< Operation mode -> sleep(0)*/
+#define BSX_OPMODE_REGULAR (1U) /**< Operation mode -> Regular(1)*/
+#define BSX_OPMODE_FIFO (2U) /**< Operation mode -> fifo(2)*/
+
+/**\name Geomagnetic rotation modes */
+#define BSX_NDOFGRV_SLEEP (0U) /**< Geomagnetic rotation mode sleep*/
+#define BSX_NDOFGRV_ACTIVE (1U) /**< Geomagnetic rotation mode active*/
+
+/**\name Filter modes (0 = bypass; 1 = forward; 2 = backward;) */
+#define BSX_FILTERMODE_BYPASS (0U) /**< Filter mode -> BYPASS */
+#define BSX_FILTERMODE_FORWARD (1U) /**< Filter Mode -> FORWARD */
+#define BSX_FILTERMODE_BACKWARD (2U) /**< Filter mode -> BACKWARD */
+
+
+/**\name Measurement range of the accelerometer */
+#define BSX_ACCRANGE_2G (0U) /**< Accel range -> 2g*/
+#define BSX_ACCRANGE_4G (1U) /**< Accel range -> 4g*/
+#define BSX_ACCRANGE_8G (2U) /**< Accel range -> 8g*/
+#define BSX_ACCRANGE_16G (3U) /**< Accel range -> 16g*/
+
+/**\name Measurement range of the Gyroscope */
+#define BSX_GYRORANGE_2048DPS (0U) /**< Measurement Range -> 2048 Degrees/sec */
+#define BSX_GYRORANGE_2000DPS (1U) /**< Measurement Range -> 2000 Degrees/sec */
+#define BSX_GYRORANGE_1000DPS (2U) /**< Measurement Range -> 1000 Degrees/sec */
+#define BSX_GYRORANGE_500DPS (3U) /**< Measurement Range -> 500 Degrees/sec */
+#define BSX_GYRORANGE_250DPS (4U) /**< Measurement Range -> 250 Degrees/sec */
+#define BSX_GYRORANGE_MAX (4U) /**< Maximum gyro measurement range */
+
+/** \name Sensor Accuracy Information */
+#define BSX_SENSOR_STATUS_UNRELIABLE (0U) /**< Sensor accuracy : unreliable */
+#define BSX_SENSOR_STATUS_ACCURACY_LOW (1U) /**< Sensor accuracy status:low*/
+#define BSX_SENSOR_STATUS_ACCURACY_MEDIUM (2U) /**< Sensor accuracy status: medium*/
+#define BSX_SENSOR_STATUS_ACCURACY_HIGH (3U) /**< Sensor accuracy status: high*/
+
+/**\name Constants representing a sensor */
+#define BSX_TYPE_ACCELEROMETER (1) /**< Represents Accelerometer sensor */
+#define BSX_TYPE_AMBIENT_TEMPERATURE (13)/**< Represents Ambient Temperature sensor */
+#define BSX_TYPE_GRAVITY (9)/**< Represents Gravity sensor */
+#define BSX_TYPE_GYROSCOPE (4)/**< Represents Gyro sensor */
+#define BSX_TYPE_LIGHT (5)/**< Represents Light sensor */
+#define BSX_TYPE_LINEAR_ACCELERATION (10)/**< Represents Linear Acceleration sensor */
+#define BSX_TYPE_MAGNETIC_FIELD (2)/**< Represents Magnetic Field sensor */
+#define BSX_TYPE_ORIENTATION (3)/**< Represents Orientaion sensor */
+#define BSX_TYPE_PRESSURE (6)/**< Represents Pressure sensor */
+#define BSX_TYPE_PROXIMITY (8)/**< Represents Proximity sensor */
+#define BSX_TYPE_RELATIVE_HUMIDITY (12)/**< Represents Relative Humidity sensor */
+#define BSX_TYPE_ROTATION_VECTOR (11)/**< Represents RotationVector sensor */
+#define BSX_TYPE_TEMPERATURE (7)/**< Represents Temperature sensor */
+
+/**\name Datarate Array in Hz */
+#define BSX_ARRAY_DATARATE {(1.0f), (5.0f), (6.25f), (10.0f), (12.5f), (20.0f), (25.0f), (40.0f), (50.0f), (100.0f), (125.0f), (200.0f), (400.0f)} /**< Datarate array*/
+#define BSX_ARRAY_ACCMEASRANGE {(2U), (4U), (8U), (16U)} /**< Accelerometer Measurment Range Array in G */
+#define BSX_ARRAY_GYROMEASRANGE {(2048), (2000), (1000), (500), (250)} /**< Gyroscope measurement range in dps */
+#define BSX_ARRAY_FILTERIIRCOEFF {(0.0f), (0.0f), (0.0f), (0.0f), (0.0f), (0.0f), (0.0f), (0.0f), (0.35f), (0.55f), (0.55f), (0.7f), (0.7f)} /**< filtering coefficient : 0 => no filtering*/
+#define BSX_REF_ARRAY {(1000.0f), (200.0f),(160.0f),(100.0f),(80.0f), (50.0f), (40.0f), (25.0f), (20.0f), (10.0f), (8.0f), (5.0f), (2.5f)} /**< Reference time array in ms */
+
+/**\name Opmode Shift Defines*/
+#define BSX_BITSHIFT_ACCOPMODE (0U) /**< Constant used for bitshifting opmode (accel)*/
+#define BSX_BITSHIFT_MAGOPMODE (2U)/**< Constant used for bitshifting opmode (Mag)*/
+#define BSX_BITSHIFT_GYROOPMODE (4U)/**< Constant used for bitshifting opmode (Gyro)*/
+#define BSX_BITSHIFT_COMPASSOPMODE (6U)/**< Constant used for bitshifting opmode (Compass)*/
+#define BSX_BITSHIFT_M4GOPMODE (8U)/**< Constant used for bitshifting opmode (M4g)*/
+#define BSX_BITSHIFT_NDOFOPMODE (10U)/**< Constant used for bitshifting opmode (Ndof)*/
+#define BSX_BITSHIFT_FASTMAGCALIBOPMODE (12U)/**< Constant used for bitshifting opmode (FastMagcalib)*/
+#define BSX_BITSHIFT_CLASSICALMAGCALIBOPMODE (14U)/**< Constant used for bitshifting opmode (Classical Mag calib)*/
+#define BSX_BITSHIFT_MAGCALIBSOURCE (16U)/**< Constant used for bitshifting opmode (Mag calib source)*/
+#define BSX_BITSHIFT_GYROCALIBOPMODE (18U)/**< Constant used for bitshifting opmode (gyro calib)*/
+#define BSX_BITSHIFT_NDOFGEORVOPMODE (20U)/**< Constant used for bitshifting opmode (Ndof Geo Rv)*/
+
+
+#define BSX_BITMASKING (0x03U) /**< Hex Constant used for Bit Masking */
+
+/**\name Working Modes */
+#define BSX_WORKINGMODE_SLEEP (BSX_U32)((BSX_NDOFGRV_SLEEP< sleep (no sensor is active)*/
+#define BSX_WORKINGMODE_ACCONLY (BSX_U32)((BSX_NDOFGRV_SLEEP< 1 indicates IMU mode*/
+#define BSX_OPMODE_NDOF_REGULAR (2U) /**< Regular Ndof mode*/
+
+/**\name Time related */
+#define BSX_SAMPLETIMETOLERANCE (0.95f) /**< Decreasing of RefTime by this factor => 10ms * 0.95 = 9.5ms --> 105.2Hz */
+
+/**\name Orientation sensor model */
+#define BSX_OPMODE_ORIENT_SLEEP (0U) /**< Orient Opmode:sleep */
+#define BSX_OPMODE_ORIENT_COMPASS (1U) /**< Orient Opmode:Compass */
+#define BSX_OPMODE_ORIENT_M4G (2U) /**< Orient Opmode:M4G */
+#define BSX_OPMODE_ORIENT_IMU (3U) /**< Orient Opmode:IMU */
+#define BSX_OPMODE_ORIENT_NDOF (4U) /**< Orient Opmode:NDOF */
+
+/**\name Flip gesture Operation mode */
+#define BSX_FLIP_GESTURE_MODE_SLEEP (0U) /**< Flig Gesture mode :sleep */
+#define BSX_FLIP_GESTURE_MODE_REGULAR (1U) /**< Flip Gesture mode : regular */
+
+/**\name Significant Motion Operation mode */
+#define BSX_SIGNIFICANT_MOTION_SLEEP (0U) /**< Significant Motion opmode :Sleep */
+#define BSX_SIGNIFICANT_MOTION_REGULAR (1U) /**< Significant Motion opmode :Regular */
+
+/**\name Pedometer Support Operation Mode */
+#define BSX_PEDO_SUPPORT_SLEEP (0U) /**< Pedometer operation mode: sleep*/
+#define BSX_PEDO_SUPPORT_REGULAR (1U) /**< Pedometer operation mode:regular*/
+
+/**\name Orient coordinate system*/
+#define BSX_ORIENTCOORDINATESYSTEM_ANDROID (1U) /**< Coordinate system: Android */
+#define BSX_ORIENTCOORDINATESYSTEM_WIN8 (2U) /**< Coordinate system: Win8 */
+
+/**\name Compass Orient Filter modes*/
+#define BSX_COMPASSORIENTFILTER_MODE_BYPASS (0U) /**< Orient filter mode : Bypass(0)*/
+#define BSX_COMPASSORIENTFILTER_MODE_LOW (1U) /**< Orient filter mode : low(1)*/
+#define BSX_COMPASSORIENTFILTER_MODE_MEDIUM (2U) /**< Orient filter mode : medium(2)*/
+#define BSX_COMPASSORIENTFILTER_MODE_HIGH (3U) /**< Orient filter mode : high(3)*/
+
+#define BSX_COMPASSORIENTFILTERCOEFFCALC_MODE_BYPASS (0U) /**< Coeff Calc mode : bypass(0)*/
+#define BSX_COMPASSORIENTFILTERCOEFFCALC_MODE_FORWARD (1U) /**< Coeff Calc mode : forward(1)*/
+#define BSX_COMPASSORIENTFILTERCOEFFCALC_MODE_BACKWARD (2U) /**< Coeff Calc mode : Backward(2)*/
+
+/**\name Predefined levels*/
+#define BSX_PREDEFINED_LEVEL_ZERO (0U) /**< Predefined level: zero*/
+#define BSX_PREDEFINED_LEVEL_ONE (1U) /**< Predefined level: one*/
+#define BSX_PREDEFINED_LEVEL_TWO (2U) /**< Predefined level: two*/
+#define BSX_PREDEFINED_LEVEL_THREE (3U) /**< Predefined level: three*/
+#define BSX_PREDEFINED_LEVEL_FOUR (4U) /**< Predefined level: four*/
+#define BSX_PREDEFINED_LEVEL_FIVE (5U) /**< Predefined level: five*/
+
+#define BSX_PREDEFINED_LEVEL_MIN BSX_PREDEFINED_LEVEL_ZERO /**< predefined level minimum: level zero*/
+#define BSX_PREDEFINED_LEVEL_DEFAULT BSX_PREDEFINED_LEVEL_ONE /**< predefined level default : level one*/
+#define BSX_PREDEFINED_LEVEL_MAX BSX_PREDEFINED_LEVEL_FIVE /**< predefined level maximum :level five*/
+#endif
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BSXlite_Cortex_M3_M4_M4F/algo/algo_bsx/Inc/BsxLibraryDataTypes.h b/BSXlite_Cortex_M3_M4_M4F/algo/algo_bsx/Inc/BsxLibraryDataTypes.h
new file mode 100644
index 0000000..99c295f
--- /dev/null
+++ b/BSXlite_Cortex_M3_M4_M4F/algo/algo_bsx/Inc/BsxLibraryDataTypes.h
@@ -0,0 +1,483 @@
+#ifndef __BSXLIBRARYDATATYPES_H__
+#define __BSXLIBRARYDATATYPES_H__
+/*!
+* @section LICENCE
+* $license$
+*
+* (C) Copyright 2011 - 2015 Bosch Sensortec GmbH All Rights Reserved
+*------------------------------------------------------------------------------
+* Disclaimer
+*
+* Common: Bosch Sensortec products are developed for the consumer goods
+* industry. They may only be used within the parameters of the respective valid
+* product data sheet. Bosch Sensortec products are provided with the express
+* understanding that there is no warranty of fitness for a particular purpose.
+* They are not fit for use in life-sustaining, safety or security sensitive
+* systems or any system or device that may lead to bodily harm or property
+* damage if the system or device malfunctions. In addition, Bosch Sensortec
+* products are not fit for use in products which interact with motor vehicle
+* systems. The resale and/or use of products are at the purchaser's own risk
+* and his own responsibility. The examination of fitness for the intended use
+* is the sole responsibility of the Purchaser.
+*
+* The purchaser shall indemnify Bosch Sensortec from all third party claims,
+* including any claims for incidental, or consequential damages, arising from
+* any product use not covered by the parameters of the respective valid product
+* data sheet or not approved by Bosch Sensortec and reimburse Bosch Sensortec
+* for all costs in connection with such claims.
+*
+* The purchaser must monitor the market for the purchased products,
+* particularly with regard to product safety and inform Bosch Sensortec without
+* delay of all security relevant incidents.
+*
+* Engineering Samples are marked with an asterisk (*) or (e). Samples may vary
+* from the valid technical specifications of the product series. They are
+* therefore not intended or fit for resale to third parties or for use in end
+* products. Their sole purpose is internal client testing. The testing of an
+* engineering sample may in no way replace the testing of a product series.
+* Bosch Sensortec assumes no liability for the use of engineering samples. By
+* accepting the engineering samples, the Purchaser agrees to indemnify Bosch
+* Sensortec from all claims arising from the use of engineering samples.
+*
+* Special: This software module (hereinafter called "Software") and any
+* information on application-sheets (hereinafter called "Information") is
+* provided free of charge for the sole purpose to support your application
+* work. The Software and Information is subject to the following terms and
+* conditions:
+*
+* The Software is specifically designed for the exclusive use for Bosch
+* Sensortec products by personnel who have special experience and training. Do
+* not use this Software if you do not have the proper experience or training.
+*
+* This Software package is provided `` as is `` and without any expressed or
+* implied warranties, including without limitation, the implied warranties of
+* merchantability and fitness for a particular purpose.
+*
+* Bosch Sensortec and their representatives and agents deny any liability for
+* the functional impairment of this Software in terms of fitness, performance
+* and safety. Bosch Sensortec and their representatives and agents shall not be
+* liable for any direct or indirect damages or injury, except as otherwise
+* stipulated in mandatory applicable law.
+*
+* The Information provided is believed to be accurate and reliable. Bosch
+* Sensortec assumes no responsibility for the consequences of use of such
+* Information nor for any infringement of patents or other rights of third
+* parties which may result from its use.
+*
+
+* @file bsxlibrarydatatypes.h
+* @date 2013/02/12 created
+*
+* @brief
+* This file provides datatypes used by library
+*/
+
+/************************************************************************************************************/
+/* INCLUDES */
+/************************************************************************************************************/
+
+#include
+#include "BsxLibraryConstants.h"
+#include "BsxLibraryCalibConstants.h"
+#include "BsxLibraryErrorConstants.h"
+#include
+#include
+
+/************************************************************************************************************/
+/* TYPE DEFINITIONS */
+/************************************************************************************************************/
+
+/** \def Basic Datatypes */
+#if __STDC_VERSION__ >= 199901L
+ /** C99 standard */
+ typedef int16_t BSX_S16; /**< signed short */
+ typedef uint16_t BSX_U16; /**
+
+
+
+
+
diff --git a/Examples/AS5048A_test/AS5048A_test/.atmelstart/AtmelStart.gpdsc b/Examples/AS5048A_test/AS5048A_test/.atmelstart/AtmelStart.gpdsc
new file mode 100644
index 0000000..b768379
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/.atmelstart/AtmelStart.gpdsc
@@ -0,0 +1,220 @@
+
+ Atmel
+ My Project
+ Project generated by Atmel Start
+ http://start.atmel.com/
+
+ Initial version
+
+
+ Configuration Files generated by Atmel Start
+
+
+
+ Atmel Start
+
+ http://start.atmel.com/
+
+
+
+
+
+
+
+
+ Dependency on CMSIS core and Device Startup components
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Atmel Start Framework
+ #define ATMEL_START
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Examples/AS5048A_test/AS5048A_test/.atmelstart/atmel_start_config.atstart b/Examples/AS5048A_test/AS5048A_test/.atmelstart/atmel_start_config.atstart
new file mode 100644
index 0000000..64c9801
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/.atmelstart/atmel_start_config.atstart
@@ -0,0 +1,1084 @@
+format_version: '2'
+name: My Project
+versions:
+ api: '1.0'
+ backend: 1.8.580
+ commit: f3d8d96e294de8dee688333bbbe8d8458a4f6b4c
+ content: unknown
+ content_pack_name: unknown
+ format: '2'
+ frontend: 1.8.580
+ packs_version_avr8: 1.0.1463
+ packs_version_qtouch: unknown
+ packs_version_sam: 1.0.1726
+ version_backend: 1.8.580
+ version_frontend: ''
+board:
+ identifier: SAME54XplainedPro
+ device: SAME54P20A-AU
+details: null
+application: null
+middlewares:
+ STDIO_REDIRECT_0:
+ user_label: STDIO_REDIRECT_0
+ configuration: {}
+ definition: Atmel:STDIO_redirect:0.0.1::STDIO_Redirect
+ functionality: STDIO_Redirect
+ api: STDIO:Redirect:IO
+ dependencies:
+ Target IO: TARGET_IO
+drivers:
+ CMCC:
+ user_label: CMCC
+ definition: Atmel:SAME54_Drivers:0.0.1::SAME54P20A-AU::CMCC::driver_config_definition::CMCC::HAL:HPL:CMCC
+ functionality: System
+ api: HAL:HPL:CMCC
+ configuration:
+ cache_size: 4 KB
+ cmcc_advanced_configuration: false
+ cmcc_clock_gating_disable: false
+ cmcc_data_cache_disable: false
+ cmcc_enable: false
+ cmcc_inst_cache_disable: false
+ optional_signals: []
+ variant: null
+ clocks:
+ domain_group: null
+ DMAC:
+ user_label: DMAC
+ definition: Atmel:SAME54_Drivers:0.0.1::SAME54P20A-AU::DMAC::driver_config_definition::DMAC::HAL:HPL:DMAC
+ functionality: System
+ api: HAL:HPL:DMAC
+ configuration:
+ dmac_beatsize_0: 8-bit bus transfer
+ dmac_beatsize_1: 8-bit bus transfer
+ dmac_beatsize_10: 8-bit bus transfer
+ dmac_beatsize_11: 8-bit bus transfer
+ dmac_beatsize_12: 8-bit bus transfer
+ dmac_beatsize_13: 8-bit bus transfer
+ dmac_beatsize_14: 8-bit bus transfer
+ dmac_beatsize_15: 8-bit bus transfer
+ dmac_beatsize_16: 8-bit bus transfer
+ dmac_beatsize_17: 8-bit bus transfer
+ dmac_beatsize_18: 8-bit bus transfer
+ dmac_beatsize_19: 8-bit bus transfer
+ dmac_beatsize_2: 8-bit bus transfer
+ dmac_beatsize_20: 8-bit bus transfer
+ dmac_beatsize_21: 8-bit bus transfer
+ dmac_beatsize_22: 8-bit bus transfer
+ dmac_beatsize_23: 8-bit bus transfer
+ dmac_beatsize_24: 8-bit bus transfer
+ dmac_beatsize_25: 8-bit bus transfer
+ dmac_beatsize_26: 8-bit bus transfer
+ dmac_beatsize_27: 8-bit bus transfer
+ dmac_beatsize_28: 8-bit bus transfer
+ dmac_beatsize_29: 8-bit bus transfer
+ dmac_beatsize_3: 8-bit bus transfer
+ dmac_beatsize_30: 8-bit bus transfer
+ dmac_beatsize_31: 8-bit bus transfer
+ dmac_beatsize_4: 8-bit bus transfer
+ dmac_beatsize_5: 8-bit bus transfer
+ dmac_beatsize_6: 8-bit bus transfer
+ dmac_beatsize_7: 8-bit bus transfer
+ dmac_beatsize_8: 8-bit bus transfer
+ dmac_beatsize_9: 8-bit bus transfer
+ dmac_blockact_0: Channel will be disabled if it is the last block transfer in
+ the transaction
+ dmac_blockact_1: Channel will be disabled if it is the last block transfer in
+ the transaction
+ dmac_blockact_10: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_11: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_12: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_13: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_14: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_15: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_16: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_17: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_18: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_19: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_2: Channel will be disabled if it is the last block transfer in
+ the transaction
+ dmac_blockact_20: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_21: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_22: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_23: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_24: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_25: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_26: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_27: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_28: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_29: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_3: Channel will be disabled if it is the last block transfer in
+ the transaction
+ dmac_blockact_30: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_31: Channel will be disabled if it is the last block transfer
+ in the transaction
+ dmac_blockact_4: Channel will be disabled if it is the last block transfer in
+ the transaction
+ dmac_blockact_5: Channel will be disabled if it is the last block transfer in
+ the transaction
+ dmac_blockact_6: Channel will be disabled if it is the last block transfer in
+ the transaction
+ dmac_blockact_7: Channel will be disabled if it is the last block transfer in
+ the transaction
+ dmac_blockact_8: Channel will be disabled if it is the last block transfer in
+ the transaction
+ dmac_blockact_9: Channel will be disabled if it is the last block transfer in
+ the transaction
+ dmac_channel_0_settings: false
+ dmac_channel_10_settings: false
+ dmac_channel_11_settings: false
+ dmac_channel_12_settings: false
+ dmac_channel_13_settings: false
+ dmac_channel_14_settings: false
+ dmac_channel_15_settings: false
+ dmac_channel_16_settings: false
+ dmac_channel_17_settings: false
+ dmac_channel_18_settings: false
+ dmac_channel_19_settings: false
+ dmac_channel_1_settings: false
+ dmac_channel_20_settings: false
+ dmac_channel_21_settings: false
+ dmac_channel_22_settings: false
+ dmac_channel_23_settings: false
+ dmac_channel_24_settings: false
+ dmac_channel_25_settings: false
+ dmac_channel_26_settings: false
+ dmac_channel_27_settings: false
+ dmac_channel_28_settings: false
+ dmac_channel_29_settings: false
+ dmac_channel_2_settings: false
+ dmac_channel_30_settings: false
+ dmac_channel_31_settings: false
+ dmac_channel_3_settings: false
+ dmac_channel_4_settings: false
+ dmac_channel_5_settings: false
+ dmac_channel_6_settings: false
+ dmac_channel_7_settings: false
+ dmac_channel_8_settings: false
+ dmac_channel_9_settings: false
+ dmac_dbgrun: false
+ dmac_dstinc_0: false
+ dmac_dstinc_1: false
+ dmac_dstinc_10: false
+ dmac_dstinc_11: false
+ dmac_dstinc_12: false
+ dmac_dstinc_13: false
+ dmac_dstinc_14: false
+ dmac_dstinc_15: false
+ dmac_dstinc_16: false
+ dmac_dstinc_17: false
+ dmac_dstinc_18: false
+ dmac_dstinc_19: false
+ dmac_dstinc_2: false
+ dmac_dstinc_20: false
+ dmac_dstinc_21: false
+ dmac_dstinc_22: false
+ dmac_dstinc_23: false
+ dmac_dstinc_24: false
+ dmac_dstinc_25: false
+ dmac_dstinc_26: false
+ dmac_dstinc_27: false
+ dmac_dstinc_28: false
+ dmac_dstinc_29: false
+ dmac_dstinc_3: false
+ dmac_dstinc_30: false
+ dmac_dstinc_31: false
+ dmac_dstinc_4: false
+ dmac_dstinc_5: false
+ dmac_dstinc_6: false
+ dmac_dstinc_7: false
+ dmac_dstinc_8: false
+ dmac_dstinc_9: false
+ dmac_enable: false
+ dmac_evact_0: No action
+ dmac_evact_1: No action
+ dmac_evact_10: No action
+ dmac_evact_11: No action
+ dmac_evact_12: No action
+ dmac_evact_13: No action
+ dmac_evact_14: No action
+ dmac_evact_15: No action
+ dmac_evact_16: No action
+ dmac_evact_17: No action
+ dmac_evact_18: No action
+ dmac_evact_19: No action
+ dmac_evact_2: No action
+ dmac_evact_20: No action
+ dmac_evact_21: No action
+ dmac_evact_22: No action
+ dmac_evact_23: No action
+ dmac_evact_24: No action
+ dmac_evact_25: No action
+ dmac_evact_26: No action
+ dmac_evact_27: No action
+ dmac_evact_28: No action
+ dmac_evact_29: No action
+ dmac_evact_3: No action
+ dmac_evact_30: No action
+ dmac_evact_31: No action
+ dmac_evact_4: No action
+ dmac_evact_5: No action
+ dmac_evact_6: No action
+ dmac_evact_7: No action
+ dmac_evact_8: No action
+ dmac_evact_9: No action
+ dmac_evie_0: false
+ dmac_evie_1: false
+ dmac_evie_10: false
+ dmac_evie_11: false
+ dmac_evie_12: false
+ dmac_evie_13: false
+ dmac_evie_14: false
+ dmac_evie_15: false
+ dmac_evie_16: false
+ dmac_evie_17: false
+ dmac_evie_18: false
+ dmac_evie_19: false
+ dmac_evie_2: false
+ dmac_evie_20: false
+ dmac_evie_21: false
+ dmac_evie_22: false
+ dmac_evie_23: false
+ dmac_evie_24: false
+ dmac_evie_25: false
+ dmac_evie_26: false
+ dmac_evie_27: false
+ dmac_evie_28: false
+ dmac_evie_29: false
+ dmac_evie_3: false
+ dmac_evie_30: false
+ dmac_evie_31: false
+ dmac_evie_4: false
+ dmac_evie_5: false
+ dmac_evie_6: false
+ dmac_evie_7: false
+ dmac_evie_8: false
+ dmac_evie_9: false
+ dmac_evoe_0: false
+ dmac_evoe_1: false
+ dmac_evoe_10: false
+ dmac_evoe_11: false
+ dmac_evoe_12: false
+ dmac_evoe_13: false
+ dmac_evoe_14: false
+ dmac_evoe_15: false
+ dmac_evoe_16: false
+ dmac_evoe_17: false
+ dmac_evoe_18: false
+ dmac_evoe_19: false
+ dmac_evoe_2: false
+ dmac_evoe_20: false
+ dmac_evoe_21: false
+ dmac_evoe_22: false
+ dmac_evoe_23: false
+ dmac_evoe_24: false
+ dmac_evoe_25: false
+ dmac_evoe_26: false
+ dmac_evoe_27: false
+ dmac_evoe_28: false
+ dmac_evoe_29: false
+ dmac_evoe_3: false
+ dmac_evoe_30: false
+ dmac_evoe_31: false
+ dmac_evoe_4: false
+ dmac_evoe_5: false
+ dmac_evoe_6: false
+ dmac_evoe_7: false
+ dmac_evoe_8: false
+ dmac_evoe_9: false
+ dmac_evosel_0: Event generation disabled
+ dmac_evosel_1: Event generation disabled
+ dmac_evosel_10: Event generation disabled
+ dmac_evosel_11: Event generation disabled
+ dmac_evosel_12: Event generation disabled
+ dmac_evosel_13: Event generation disabled
+ dmac_evosel_14: Event generation disabled
+ dmac_evosel_15: Event generation disabled
+ dmac_evosel_16: Event generation disabled
+ dmac_evosel_17: Event generation disabled
+ dmac_evosel_18: Event generation disabled
+ dmac_evosel_19: Event generation disabled
+ dmac_evosel_2: Event generation disabled
+ dmac_evosel_20: Event generation disabled
+ dmac_evosel_21: Event generation disabled
+ dmac_evosel_22: Event generation disabled
+ dmac_evosel_23: Event generation disabled
+ dmac_evosel_24: Event generation disabled
+ dmac_evosel_25: Event generation disabled
+ dmac_evosel_26: Event generation disabled
+ dmac_evosel_27: Event generation disabled
+ dmac_evosel_28: Event generation disabled
+ dmac_evosel_29: Event generation disabled
+ dmac_evosel_3: Event generation disabled
+ dmac_evosel_30: Event generation disabled
+ dmac_evosel_31: Event generation disabled
+ dmac_evosel_4: Event generation disabled
+ dmac_evosel_5: Event generation disabled
+ dmac_evosel_6: Event generation disabled
+ dmac_evosel_7: Event generation disabled
+ dmac_evosel_8: Event generation disabled
+ dmac_evosel_9: Event generation disabled
+ dmac_lvl_0: Channel priority 0
+ dmac_lvl_1: Channel priority 0
+ dmac_lvl_10: Channel priority 0
+ dmac_lvl_11: Channel priority 0
+ dmac_lvl_12: Channel priority 0
+ dmac_lvl_13: Channel priority 0
+ dmac_lvl_14: Channel priority 0
+ dmac_lvl_15: Channel priority 0
+ dmac_lvl_16: Channel priority 0
+ dmac_lvl_17: Channel priority 0
+ dmac_lvl_18: Channel priority 0
+ dmac_lvl_19: Channel priority 0
+ dmac_lvl_2: Channel priority 0
+ dmac_lvl_20: Channel priority 0
+ dmac_lvl_21: Channel priority 0
+ dmac_lvl_22: Channel priority 0
+ dmac_lvl_23: Channel priority 0
+ dmac_lvl_24: Channel priority 0
+ dmac_lvl_25: Channel priority 0
+ dmac_lvl_26: Channel priority 0
+ dmac_lvl_27: Channel priority 0
+ dmac_lvl_28: Channel priority 0
+ dmac_lvl_29: Channel priority 0
+ dmac_lvl_3: Channel priority 0
+ dmac_lvl_30: Channel priority 0
+ dmac_lvl_31: Channel priority 0
+ dmac_lvl_4: Channel priority 0
+ dmac_lvl_5: Channel priority 0
+ dmac_lvl_6: Channel priority 0
+ dmac_lvl_7: Channel priority 0
+ dmac_lvl_8: Channel priority 0
+ dmac_lvl_9: Channel priority 0
+ dmac_lvlen0: true
+ dmac_lvlen1: true
+ dmac_lvlen2: true
+ dmac_lvlen3: true
+ dmac_lvlpri0: 0
+ dmac_lvlpri1: 0
+ dmac_lvlpri2: 0
+ dmac_lvlpri3: 0
+ dmac_rrlvlen0: Static arbitration scheme for channel with priority 0
+ dmac_rrlvlen1: Static arbitration scheme for channel with priority 1
+ dmac_rrlvlen2: Static arbitration scheme for channel with priority 2
+ dmac_rrlvlen3: Static arbitration scheme for channel with priority 3
+ dmac_runstdby_0: false
+ dmac_runstdby_1: false
+ dmac_runstdby_10: false
+ dmac_runstdby_11: false
+ dmac_runstdby_12: false
+ dmac_runstdby_13: false
+ dmac_runstdby_14: false
+ dmac_runstdby_15: false
+ dmac_runstdby_16: false
+ dmac_runstdby_17: false
+ dmac_runstdby_18: false
+ dmac_runstdby_19: false
+ dmac_runstdby_2: false
+ dmac_runstdby_20: false
+ dmac_runstdby_21: false
+ dmac_runstdby_22: false
+ dmac_runstdby_23: false
+ dmac_runstdby_24: false
+ dmac_runstdby_25: false
+ dmac_runstdby_26: false
+ dmac_runstdby_27: false
+ dmac_runstdby_28: false
+ dmac_runstdby_29: false
+ dmac_runstdby_3: false
+ dmac_runstdby_30: false
+ dmac_runstdby_31: false
+ dmac_runstdby_4: false
+ dmac_runstdby_5: false
+ dmac_runstdby_6: false
+ dmac_runstdby_7: false
+ dmac_runstdby_8: false
+ dmac_runstdby_9: false
+ dmac_srcinc_0: false
+ dmac_srcinc_1: false
+ dmac_srcinc_10: false
+ dmac_srcinc_11: false
+ dmac_srcinc_12: false
+ dmac_srcinc_13: false
+ dmac_srcinc_14: false
+ dmac_srcinc_15: false
+ dmac_srcinc_16: false
+ dmac_srcinc_17: false
+ dmac_srcinc_18: false
+ dmac_srcinc_19: false
+ dmac_srcinc_2: false
+ dmac_srcinc_20: false
+ dmac_srcinc_21: false
+ dmac_srcinc_22: false
+ dmac_srcinc_23: false
+ dmac_srcinc_24: false
+ dmac_srcinc_25: false
+ dmac_srcinc_26: false
+ dmac_srcinc_27: false
+ dmac_srcinc_28: false
+ dmac_srcinc_29: false
+ dmac_srcinc_3: false
+ dmac_srcinc_30: false
+ dmac_srcinc_31: false
+ dmac_srcinc_4: false
+ dmac_srcinc_5: false
+ dmac_srcinc_6: false
+ dmac_srcinc_7: false
+ dmac_srcinc_8: false
+ dmac_srcinc_9: false
+ dmac_stepsel_0: Step size settings apply to the destination address
+ dmac_stepsel_1: Step size settings apply to the destination address
+ dmac_stepsel_10: Step size settings apply to the destination address
+ dmac_stepsel_11: Step size settings apply to the destination address
+ dmac_stepsel_12: Step size settings apply to the destination address
+ dmac_stepsel_13: Step size settings apply to the destination address
+ dmac_stepsel_14: Step size settings apply to the destination address
+ dmac_stepsel_15: Step size settings apply to the destination address
+ dmac_stepsel_16: Step size settings apply to the destination address
+ dmac_stepsel_17: Step size settings apply to the destination address
+ dmac_stepsel_18: Step size settings apply to the destination address
+ dmac_stepsel_19: Step size settings apply to the destination address
+ dmac_stepsel_2: Step size settings apply to the destination address
+ dmac_stepsel_20: Step size settings apply to the destination address
+ dmac_stepsel_21: Step size settings apply to the destination address
+ dmac_stepsel_22: Step size settings apply to the destination address
+ dmac_stepsel_23: Step size settings apply to the destination address
+ dmac_stepsel_24: Step size settings apply to the destination address
+ dmac_stepsel_25: Step size settings apply to the destination address
+ dmac_stepsel_26: Step size settings apply to the destination address
+ dmac_stepsel_27: Step size settings apply to the destination address
+ dmac_stepsel_28: Step size settings apply to the destination address
+ dmac_stepsel_29: Step size settings apply to the destination address
+ dmac_stepsel_3: Step size settings apply to the destination address
+ dmac_stepsel_30: Step size settings apply to the destination address
+ dmac_stepsel_31: Step size settings apply to the destination address
+ dmac_stepsel_4: Step size settings apply to the destination address
+ dmac_stepsel_5: Step size settings apply to the destination address
+ dmac_stepsel_6: Step size settings apply to the destination address
+ dmac_stepsel_7: Step size settings apply to the destination address
+ dmac_stepsel_8: Step size settings apply to the destination address
+ dmac_stepsel_9: Step size settings apply to the destination address
+ dmac_stepsize_0: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_1: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_10: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_11: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_12: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_13: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_14: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_15: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_16: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_17: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_18: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_19: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_2: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_20: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_21: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_22: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_23: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_24: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_25: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_26: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_27: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_28: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_29: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_3: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_30: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_31: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_4: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_5: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_6: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_7: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_8: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_stepsize_9: Next ADDR = ADDR + (BEATSIZE + 1) * 1
+ dmac_trifsrc_0: Only software/event triggers
+ dmac_trifsrc_1: Only software/event triggers
+ dmac_trifsrc_10: Only software/event triggers
+ dmac_trifsrc_11: Only software/event triggers
+ dmac_trifsrc_12: Only software/event triggers
+ dmac_trifsrc_13: Only software/event triggers
+ dmac_trifsrc_14: Only software/event triggers
+ dmac_trifsrc_15: Only software/event triggers
+ dmac_trifsrc_16: Only software/event triggers
+ dmac_trifsrc_17: Only software/event triggers
+ dmac_trifsrc_18: Only software/event triggers
+ dmac_trifsrc_19: Only software/event triggers
+ dmac_trifsrc_2: Only software/event triggers
+ dmac_trifsrc_20: Only software/event triggers
+ dmac_trifsrc_21: Only software/event triggers
+ dmac_trifsrc_22: Only software/event triggers
+ dmac_trifsrc_23: Only software/event triggers
+ dmac_trifsrc_24: Only software/event triggers
+ dmac_trifsrc_25: Only software/event triggers
+ dmac_trifsrc_26: Only software/event triggers
+ dmac_trifsrc_27: Only software/event triggers
+ dmac_trifsrc_28: Only software/event triggers
+ dmac_trifsrc_29: Only software/event triggers
+ dmac_trifsrc_3: Only software/event triggers
+ dmac_trifsrc_30: Only software/event triggers
+ dmac_trifsrc_31: Only software/event triggers
+ dmac_trifsrc_4: Only software/event triggers
+ dmac_trifsrc_5: Only software/event triggers
+ dmac_trifsrc_6: Only software/event triggers
+ dmac_trifsrc_7: Only software/event triggers
+ dmac_trifsrc_8: Only software/event triggers
+ dmac_trifsrc_9: Only software/event triggers
+ dmac_trigact_0: One trigger required for each block transfer
+ dmac_trigact_1: One trigger required for each block transfer
+ dmac_trigact_10: One trigger required for each block transfer
+ dmac_trigact_11: One trigger required for each block transfer
+ dmac_trigact_12: One trigger required for each block transfer
+ dmac_trigact_13: One trigger required for each block transfer
+ dmac_trigact_14: One trigger required for each block transfer
+ dmac_trigact_15: One trigger required for each block transfer
+ dmac_trigact_16: One trigger required for each block transfer
+ dmac_trigact_17: One trigger required for each block transfer
+ dmac_trigact_18: One trigger required for each block transfer
+ dmac_trigact_19: One trigger required for each block transfer
+ dmac_trigact_2: One trigger required for each block transfer
+ dmac_trigact_20: One trigger required for each block transfer
+ dmac_trigact_21: One trigger required for each block transfer
+ dmac_trigact_22: One trigger required for each block transfer
+ dmac_trigact_23: One trigger required for each block transfer
+ dmac_trigact_24: One trigger required for each block transfer
+ dmac_trigact_25: One trigger required for each block transfer
+ dmac_trigact_26: One trigger required for each block transfer
+ dmac_trigact_27: One trigger required for each block transfer
+ dmac_trigact_28: One trigger required for each block transfer
+ dmac_trigact_29: One trigger required for each block transfer
+ dmac_trigact_3: One trigger required for each block transfer
+ dmac_trigact_30: One trigger required for each block transfer
+ dmac_trigact_31: One trigger required for each block transfer
+ dmac_trigact_4: One trigger required for each block transfer
+ dmac_trigact_5: One trigger required for each block transfer
+ dmac_trigact_6: One trigger required for each block transfer
+ dmac_trigact_7: One trigger required for each block transfer
+ dmac_trigact_8: One trigger required for each block transfer
+ dmac_trigact_9: One trigger required for each block transfer
+ optional_signals: []
+ variant: null
+ clocks:
+ domain_group: null
+ GCLK:
+ user_label: GCLK
+ definition: Atmel:SAME54_Drivers:0.0.1::SAME54P20A-AU::GCLK::driver_config_definition::GCLK::HAL:HPL:GCLK
+ functionality: System
+ api: HAL:HPL:GCLK
+ configuration:
+ $input: 12000000
+ $input_id: External Crystal Oscillator 8-48MHz (XOSC1)
+ RESERVED_InputFreq: 12000000
+ RESERVED_InputFreq_id: External Crystal Oscillator 8-48MHz (XOSC1)
+ _$freq_output_Generic clock generator 0: 12000000
+ _$freq_output_Generic clock generator 1: 48000000
+ _$freq_output_Generic clock generator 10: 12000000
+ _$freq_output_Generic clock generator 11: 12000000
+ _$freq_output_Generic clock generator 2: 3000000
+ _$freq_output_Generic clock generator 3: 32768
+ _$freq_output_Generic clock generator 4: 12000000
+ _$freq_output_Generic clock generator 5: 12000000
+ _$freq_output_Generic clock generator 6: 12000000
+ _$freq_output_Generic clock generator 7: 12000000
+ _$freq_output_Generic clock generator 8: 12000000
+ _$freq_output_Generic clock generator 9: 12000000
+ enable_gclk_gen_0: true
+ enable_gclk_gen_0__externalclock: 1000000
+ enable_gclk_gen_1: false
+ enable_gclk_gen_10: false
+ enable_gclk_gen_10__externalclock: 1000000
+ enable_gclk_gen_11: false
+ enable_gclk_gen_11__externalclock: 1000000
+ enable_gclk_gen_1__externalclock: 1000000
+ enable_gclk_gen_2: false
+ enable_gclk_gen_2__externalclock: 1000000
+ enable_gclk_gen_3: false
+ enable_gclk_gen_3__externalclock: 1000000
+ enable_gclk_gen_4: false
+ enable_gclk_gen_4__externalclock: 1000000
+ enable_gclk_gen_5: false
+ enable_gclk_gen_5__externalclock: 1000000
+ enable_gclk_gen_6: false
+ enable_gclk_gen_6__externalclock: 1000000
+ enable_gclk_gen_7: false
+ enable_gclk_gen_7__externalclock: 1000000
+ enable_gclk_gen_8: false
+ enable_gclk_gen_8__externalclock: 1000000
+ enable_gclk_gen_9: false
+ enable_gclk_gen_9__externalclock: 1000000
+ gclk_arch_gen_0_enable: true
+ gclk_arch_gen_0_idc: false
+ gclk_arch_gen_0_oe: false
+ gclk_arch_gen_0_oov: false
+ gclk_arch_gen_0_runstdby: false
+ gclk_arch_gen_10_enable: false
+ gclk_arch_gen_10_idc: false
+ gclk_arch_gen_10_oe: false
+ gclk_arch_gen_10_oov: false
+ gclk_arch_gen_10_runstdby: false
+ gclk_arch_gen_11_enable: false
+ gclk_arch_gen_11_idc: false
+ gclk_arch_gen_11_oe: false
+ gclk_arch_gen_11_oov: false
+ gclk_arch_gen_11_runstdby: false
+ gclk_arch_gen_1_enable: false
+ gclk_arch_gen_1_idc: false
+ gclk_arch_gen_1_oe: false
+ gclk_arch_gen_1_oov: false
+ gclk_arch_gen_1_runstdby: false
+ gclk_arch_gen_2_enable: false
+ gclk_arch_gen_2_idc: false
+ gclk_arch_gen_2_oe: false
+ gclk_arch_gen_2_oov: false
+ gclk_arch_gen_2_runstdby: false
+ gclk_arch_gen_3_enable: false
+ gclk_arch_gen_3_idc: false
+ gclk_arch_gen_3_oe: false
+ gclk_arch_gen_3_oov: false
+ gclk_arch_gen_3_runstdby: false
+ gclk_arch_gen_4_enable: false
+ gclk_arch_gen_4_idc: false
+ gclk_arch_gen_4_oe: false
+ gclk_arch_gen_4_oov: false
+ gclk_arch_gen_4_runstdby: false
+ gclk_arch_gen_5_enable: false
+ gclk_arch_gen_5_idc: false
+ gclk_arch_gen_5_oe: false
+ gclk_arch_gen_5_oov: false
+ gclk_arch_gen_5_runstdby: false
+ gclk_arch_gen_6_enable: false
+ gclk_arch_gen_6_idc: false
+ gclk_arch_gen_6_oe: false
+ gclk_arch_gen_6_oov: false
+ gclk_arch_gen_6_runstdby: false
+ gclk_arch_gen_7_enable: false
+ gclk_arch_gen_7_idc: false
+ gclk_arch_gen_7_oe: false
+ gclk_arch_gen_7_oov: false
+ gclk_arch_gen_7_runstdby: false
+ gclk_arch_gen_8_enable: false
+ gclk_arch_gen_8_idc: false
+ gclk_arch_gen_8_oe: false
+ gclk_arch_gen_8_oov: false
+ gclk_arch_gen_8_runstdby: false
+ gclk_arch_gen_9_enable: false
+ gclk_arch_gen_9_idc: false
+ gclk_arch_gen_9_oe: false
+ gclk_arch_gen_9_oov: false
+ gclk_arch_gen_9_runstdby: false
+ gclk_gen_0_div: 1
+ gclk_gen_0_div_sel: false
+ gclk_gen_0_oscillator: External Crystal Oscillator 8-48MHz (XOSC1)
+ gclk_gen_10_div: 1
+ gclk_gen_10_div_sel: false
+ gclk_gen_10_oscillator: External Crystal Oscillator 8-48MHz (XOSC1)
+ gclk_gen_11_div: 1
+ gclk_gen_11_div_sel: false
+ gclk_gen_11_oscillator: External Crystal Oscillator 8-48MHz (XOSC1)
+ gclk_gen_1_div: 1
+ gclk_gen_1_div_sel: false
+ gclk_gen_1_oscillator: Digital Frequency Locked Loop (DFLL48M)
+ gclk_gen_2_div: 1
+ gclk_gen_2_div_sel: true
+ gclk_gen_2_oscillator: External Crystal Oscillator 8-48MHz (XOSC1)
+ gclk_gen_3_div: 1
+ gclk_gen_3_div_sel: false
+ gclk_gen_3_oscillator: 32kHz External Crystal Oscillator (XOSC32K)
+ gclk_gen_4_div: 1
+ gclk_gen_4_div_sel: false
+ gclk_gen_4_oscillator: External Crystal Oscillator 8-48MHz (XOSC1)
+ gclk_gen_5_div: 1
+ gclk_gen_5_div_sel: false
+ gclk_gen_5_oscillator: External Crystal Oscillator 8-48MHz (XOSC1)
+ gclk_gen_6_div: 1
+ gclk_gen_6_div_sel: false
+ gclk_gen_6_oscillator: External Crystal Oscillator 8-48MHz (XOSC1)
+ gclk_gen_7_div: 1
+ gclk_gen_7_div_sel: false
+ gclk_gen_7_oscillator: External Crystal Oscillator 8-48MHz (XOSC1)
+ gclk_gen_8_div: 1
+ gclk_gen_8_div_sel: false
+ gclk_gen_8_oscillator: External Crystal Oscillator 8-48MHz (XOSC1)
+ gclk_gen_9_div: 1
+ gclk_gen_9_div_sel: false
+ gclk_gen_9_oscillator: External Crystal Oscillator 8-48MHz (XOSC1)
+ optional_signals: []
+ variant: null
+ clocks:
+ domain_group: null
+ MCLK:
+ user_label: MCLK
+ definition: Atmel:SAME54_Drivers:0.0.1::SAME54P20A-AU::MCLK::driver_config_definition::MCLK::HAL:HPL:MCLK
+ functionality: System
+ api: HAL:HPL:MCLK
+ configuration:
+ $input: 12000000
+ $input_id: Generic clock generator 0
+ RESERVED_InputFreq: 12000000
+ RESERVED_InputFreq_id: Generic clock generator 0
+ _$freq_output_CPU: 12000000
+ cpu_clock_source: Generic clock generator 0
+ cpu_div: '1'
+ enable_cpu_clock: true
+ mclk_arch_bupdiv: Divide by 8
+ mclk_arch_hsdiv: Divide by 1
+ mclk_arch_lpdiv: Divide by 4
+ nvm_wait_states: '0'
+ optional_signals: []
+ variant: null
+ clocks:
+ domain_group:
+ nodes:
+ - name: CPU
+ input: CPU
+ external: false
+ external_frequency: 0
+ configuration: {}
+ OSC32KCTRL:
+ user_label: OSC32KCTRL
+ definition: Atmel:SAME54_Drivers:0.0.1::SAME54P20A-AU::OSC32KCTRL::driver_config_definition::OSC32KCTRL::HAL:HPL:OSC32KCTRL
+ functionality: System
+ api: HAL:HPL:OSC32KCTRL
+ configuration:
+ $input: 32768
+ $input_id: 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
+ RESERVED_InputFreq: 32768
+ RESERVED_InputFreq_id: 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
+ _$freq_output_RTC source: 32768
+ enable_osculp32k: true
+ enable_rtc_source: false
+ enable_xosc32k: false
+ osculp32k_calib: 0
+ osculp32k_calib_enable: false
+ rtc_1khz_selection: false
+ rtc_source_oscillator: 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
+ xosc32k_arch_cfden: false
+ xosc32k_arch_cfdeo: false
+ xosc32k_arch_cgm: Standard mode
+ xosc32k_arch_en1k: false
+ xosc32k_arch_en32k: false
+ xosc32k_arch_enable: false
+ xosc32k_arch_ondemand: true
+ xosc32k_arch_runstdby: false
+ xosc32k_arch_startup: 62592us
+ xosc32k_arch_swben: false
+ xosc32k_arch_xtalen: true
+ optional_signals: []
+ variant: null
+ clocks:
+ domain_group: null
+ OSCCTRL:
+ user_label: OSCCTRL
+ definition: Atmel:SAME54_Drivers:0.0.1::SAME54P20A-AU::OSCCTRL::driver_config_definition::OSCCTRL::HAL:HPL:OSCCTRL
+ functionality: System
+ api: HAL:HPL:OSCCTRL
+ configuration:
+ $input: 32768
+ $input_id: 32kHz External Crystal Oscillator (XOSC32K)
+ RESERVED_InputFreq: 32768
+ RESERVED_InputFreq_id: 32kHz External Crystal Oscillator (XOSC32K)
+ _$freq_output_Digital Frequency Locked Loop (DFLL48M): 48000000
+ _$freq_output_Digital Phase Locked Loop (DPLL0): 47985664
+ _$freq_output_Digital Phase Locked Loop (DPLL1): 47985664
+ _$freq_output_External Crystal Oscillator 8-48MHz (XOSC0): 12000000
+ _$freq_output_External Crystal Oscillator 8-48MHz (XOSC1): 12000000
+ dfll_arch_bplckc: false
+ dfll_arch_calibration: false
+ dfll_arch_ccdis: false
+ dfll_arch_coarse: 31
+ dfll_arch_cstep: 1
+ dfll_arch_enable: false
+ dfll_arch_fine: 128
+ dfll_arch_fstep: 1
+ dfll_arch_llaw: false
+ dfll_arch_ondemand: false
+ dfll_arch_qldis: false
+ dfll_arch_runstdby: false
+ dfll_arch_stable: false
+ dfll_arch_usbcrm: false
+ dfll_arch_waitlock: true
+ dfll_mode: Open Loop Mode
+ dfll_mul: 0
+ dfll_ref_clock: Generic clock generator 3
+ enable_dfll: false
+ enable_fdpll0: false
+ enable_fdpll1: false
+ enable_xosc0: false
+ enable_xosc1: true
+ fdpll0_arch_dcoen: false
+ fdpll0_arch_enable: false
+ fdpll0_arch_filter: 0
+ fdpll0_arch_lbypass: false
+ fdpll0_arch_ltime: No time-out, automatic lock
+ fdpll0_arch_ondemand: false
+ fdpll0_arch_refclk: XOSC32K clock reference
+ fdpll0_arch_runstdby: false
+ fdpll0_arch_wuf: false
+ fdpll0_clock_dcofilter: 0
+ fdpll0_clock_div: 0
+ fdpll0_ldr: 1463
+ fdpll0_ldrfrac: 13
+ fdpll0_ref_clock: 32kHz External Crystal Oscillator (XOSC32K)
+ fdpll1_arch_dcoen: false
+ fdpll1_arch_enable: false
+ fdpll1_arch_filter: 0
+ fdpll1_arch_lbypass: false
+ fdpll1_arch_ltime: No time-out, automatic lock
+ fdpll1_arch_ondemand: false
+ fdpll1_arch_refclk: XOSC32K clock reference
+ fdpll1_arch_runstdby: false
+ fdpll1_arch_wuf: false
+ fdpll1_clock_dcofilter: 0
+ fdpll1_clock_div: 0
+ fdpll1_ldr: 1463
+ fdpll1_ldrfrac: 13
+ fdpll1_ref_clock: 32kHz External Crystal Oscillator (XOSC32K)
+ xosc0_arch_cfden: false
+ xosc0_arch_enable: false
+ xosc0_arch_enalc: false
+ xosc0_arch_lowbufgain: false
+ xosc0_arch_ondemand: false
+ xosc0_arch_runstdby: false
+ xosc0_arch_startup: 31us
+ xosc0_arch_swben: false
+ xosc0_arch_xtalen: false
+ xosc0_frequency: 12000000
+ xosc1_arch_cfden: false
+ xosc1_arch_enable: true
+ xosc1_arch_enalc: false
+ xosc1_arch_lowbufgain: false
+ xosc1_arch_ondemand: false
+ xosc1_arch_runstdby: false
+ xosc1_arch_startup: 31us
+ xosc1_arch_swben: false
+ xosc1_arch_xtalen: true
+ xosc1_frequency: 12000000
+ optional_signals: []
+ variant: null
+ clocks:
+ domain_group: null
+ PORT:
+ user_label: PORT
+ definition: Atmel:SAME54_Drivers:0.0.1::SAME54P20A-AU::PORT::driver_config_definition::PORT::HAL:HPL:PORT
+ functionality: System
+ api: HAL:HPL:PORT
+ configuration:
+ enable_port_input_event_0: false
+ enable_port_input_event_1: false
+ enable_port_input_event_2: false
+ enable_port_input_event_3: false
+ porta_event_action_0: Output register of pin will be set to level of event
+ porta_event_action_1: Output register of pin will be set to level of event
+ porta_event_action_2: Output register of pin will be set to level of event
+ porta_event_action_3: Output register of pin will be set to level of event
+ porta_event_pin_identifier_0: 0
+ porta_event_pin_identifier_1: 0
+ porta_event_pin_identifier_2: 0
+ porta_event_pin_identifier_3: 0
+ porta_input_event_enable_0: false
+ porta_input_event_enable_1: false
+ porta_input_event_enable_2: false
+ porta_input_event_enable_3: false
+ portb_event_action_0: Output register of pin will be set to level of event
+ portb_event_action_1: Output register of pin will be set to level of event
+ portb_event_action_2: Output register of pin will be set to level of event
+ portb_event_action_3: Output register of pin will be set to level of event
+ portb_event_pin_identifier_0: 0
+ portb_event_pin_identifier_1: 0
+ portb_event_pin_identifier_2: 0
+ portb_event_pin_identifier_3: 0
+ portb_input_event_enable_0: false
+ portb_input_event_enable_1: false
+ portb_input_event_enable_2: false
+ portb_input_event_enable_3: false
+ portc_event_action_0: Output register of pin will be set to level of event
+ portc_event_action_1: Output register of pin will be set to level of event
+ portc_event_action_2: Output register of pin will be set to level of event
+ portc_event_action_3: Output register of pin will be set to level of event
+ portc_event_pin_identifier_0: 0
+ portc_event_pin_identifier_1: 0
+ portc_event_pin_identifier_2: 0
+ portc_event_pin_identifier_3: 0
+ portc_input_event_enable_0: false
+ portc_input_event_enable_1: false
+ portc_input_event_enable_2: false
+ portc_input_event_enable_3: false
+ portd_event_action_0: Output register of pin will be set to level of event
+ portd_event_action_1: Output register of pin will be set to level of event
+ portd_event_action_2: Output register of pin will be set to level of event
+ portd_event_action_3: Output register of pin will be set to level of event
+ portd_event_pin_identifier_0: 0
+ portd_event_pin_identifier_1: 0
+ portd_event_pin_identifier_2: 0
+ portd_event_pin_identifier_3: 0
+ portd_input_event_enable_0: false
+ portd_input_event_enable_1: false
+ portd_input_event_enable_2: false
+ portd_input_event_enable_3: false
+ optional_signals: []
+ variant: null
+ clocks:
+ domain_group: null
+ RAMECC:
+ user_label: RAMECC
+ definition: Atmel:SAME54_Drivers:0.0.1::SAME54P20A-AU::RAMECC::driver_config_definition::RAMECC::HAL:HPL:RAMECC
+ functionality: System
+ api: HAL:HPL:RAMECC
+ configuration: {}
+ optional_signals: []
+ variant: null
+ clocks:
+ domain_group: null
+ TARGET_IO:
+ user_label: TARGET_IO
+ definition: Atmel:SAME54_Drivers:0.0.1::SAME54P20A-AU::SERCOM2::driver_config_definition::UART::HAL:Driver:USART.Sync
+ functionality: USART
+ api: HAL:Driver:USART_Sync
+ configuration:
+ usart_advanced: false
+ usart_arch_clock_mode: USART with internal clock
+ usart_arch_cloden: false
+ usart_arch_dbgstop: Keep running
+ usart_arch_dord: LSB is transmitted first
+ usart_arch_enc: No encoding
+ usart_arch_fractional: 0
+ usart_arch_ibon: false
+ usart_arch_lin_slave_enable: Disable
+ usart_arch_runstdby: false
+ usart_arch_sampa: 7-8-9 (3-4-5 8-bit over-sampling)
+ usart_arch_sampr: 16x arithmetic
+ usart_arch_sfde: false
+ usart_baud_rate: 9600
+ usart_character_size: 8 bits
+ usart_parity: No parity
+ usart_rx_enable: true
+ usart_stop_bit: One stop bit
+ usart_tx_enable: true
+ optional_signals: []
+ variant:
+ specification: TXPO=0, RXPO=1, CMODE=0
+ required_signals:
+ - name: SERCOM2/PAD/0
+ pad: PB25
+ label: TX
+ - name: SERCOM2/PAD/1
+ pad: PB24
+ label: RX
+ clocks:
+ domain_group:
+ nodes:
+ - name: Core
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ - name: Slow
+ input: Generic clock generator 3
+ external: false
+ external_frequency: 0
+ configuration:
+ core_gclk_selection: Generic clock generator 0
+ slow_gclk_selection: Generic clock generator 3
+ SPI_0:
+ user_label: SPI_0
+ definition: Atmel:SAME54_Drivers:0.0.1::SAME54P20A-AU::SERCOM4::driver_config_definition::SPI.Master::HAL:Driver:SPI.Master.Sync
+ functionality: SPI
+ api: HAL:Driver:SPI_Master_Sync
+ configuration:
+ spi_master_advanced: false
+ spi_master_arch_cpha: Sample input on leading edge
+ spi_master_arch_cpol: SCK is low when idle
+ spi_master_arch_dbgstop: Keep running
+ spi_master_arch_dord: MSB first
+ spi_master_arch_ibon: In data stream
+ spi_master_arch_runstdby: false
+ spi_master_baud_rate: 1000000
+ spi_master_character_size: 8 bits
+ spi_master_dummybyte: 511
+ spi_master_rx_enable: true
+ optional_signals: []
+ variant:
+ specification: TXPO=0, RXPO=3
+ required_signals:
+ - name: SERCOM4/PAD/0
+ pad: PB27
+ label: MOSI
+ - name: SERCOM4/PAD/1
+ pad: PB26
+ label: SCK
+ - name: SERCOM4/PAD/3
+ pad: PB29
+ label: MISO
+ clocks:
+ domain_group:
+ nodes:
+ - name: Core
+ input: Generic clock generator 0
+ external: false
+ external_frequency: 0
+ - name: Slow
+ input: Generic clock generator 3
+ external: false
+ external_frequency: 0
+ configuration:
+ core_gclk_selection: Generic clock generator 0
+ slow_gclk_selection: Generic clock generator 3
+pads:
+ UART_RX:
+ name: PB24
+ definition: Atmel:SAME54_Drivers:0.0.1::SAME54P20A-AU::pad::PB24
+ mode: Peripheral IO
+ user_label: UART_RX
+ configuration: null
+ UART_TX:
+ name: PB25
+ definition: Atmel:SAME54_Drivers:0.0.1::SAME54P20A-AU::pad::PB25
+ mode: Peripheral IO
+ user_label: UART_TX
+ configuration: null
+ SPI_SCK:
+ name: PB26
+ definition: Atmel:SAME54_Drivers:0.0.1::SAME54P20A-AU::pad::PB26
+ mode: Digital output
+ user_label: SPI_SCK
+ configuration: null
+ SPI_MOSI:
+ name: PB27
+ definition: Atmel:SAME54_Drivers:0.0.1::SAME54P20A-AU::pad::PB27
+ mode: Digital output
+ user_label: SPI_MOSI
+ configuration: null
+ SPI_SS:
+ name: PB28
+ definition: Atmel:SAME54_Drivers:0.0.1::SAME54P20A-AU::pad::PB28
+ mode: Digital output
+ user_label: SPI_SS
+ configuration:
+ pad_initial_level: High
+ SPI_MISO:
+ name: PB29
+ definition: Atmel:SAME54_Drivers:0.0.1::SAME54P20A-AU::pad::PB29
+ mode: Digital input
+ user_label: SPI_MISO
+ configuration: null
+toolchain_options: []
+static_files: []
diff --git a/Examples/AS5048A_test/AS5048A_test/AS5048A.c b/Examples/AS5048A_test/AS5048A_test/AS5048A.c
new file mode 100644
index 0000000..7baeade
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/AS5048A.c
@@ -0,0 +1,270 @@
+/*
+ * AS5048A.c
+ *
+ * Created: 10/07/2021 15:40:53
+ * Author: Nick-XMG
+ */
+
+/*
+ * Read a register from the sensor
+ * Takes the address of the register as a 16 bit word
+ * Returns the value of the register
+
+ **
+ * Utility function used to calculate even parity of word
+ */
+
+static const float AS5048A_MAX_VALUE = 8191.0;
+
+#include "AS5048A.h"
+
+uint8_t errorFlag = 0;
+
+bool AS5048A_init(void){
+ if(spi_m_sync_get_io_descriptor(&SPI_0, &io)) {
+ return false;
+ }
+ spi_m_sync_set_mode(&SPI_0,SPI_MODE_1);
+ spi_m_sync_enable(&SPI_0);
+
+ as5048a.errorFlag = 0;
+ as5048a.position = 0;
+ return true;
+}
+
+uint8_t spiCalcEvenParity(uint16_t value){
+ uint8_t cnt = 0;
+ uint8_t i;
+ for (i = 0; i < 16; i++)
+ {
+ if (value & 0x1)
+ {
+ cnt++;
+ }
+ value >>= 1;
+ }
+ return cnt & 0x1;
+ }
+
+
+
+uint16_t read(uint16_t registerAddress)
+{
+ uint8_t dummy_packet[2] = {0xC0,0x00};
+ union { uint16_t val; struct { uint8_t lsb; uint8_t msb; }; } t;
+ uint8_t in_buf[2], out_buf[2];
+
+ volatile uint16_t command = 0b0100000000000000; // PAR=0 R/W=R
+ command = command | registerAddress;
+
+ //Add a parity bit on the the MSB
+ command |= ((uint16_t)spiCalcEvenParity(command)<<15);
+
+ //Split the command into two bytes
+ out_buf[1] = command & 0xFF;
+ out_buf[0] = ( command >> 8 ) & 0xFF;
+
+ struct spi_xfer xfer;
+ xfer.rxbuf = in_buf;
+ xfer.txbuf = out_buf;
+ xfer.size = 2;
+
+
+ /* Send Command */
+ gpio_set_pin_level(AS5048A_CS, false);
+ //io_write(io, &out_buf, 2);
+ spi_m_sync_transfer(&SPI_0, &xfer);
+ gpio_set_pin_level(AS5048A_CS, true);
+// spi_m_sync_transfer(&SPI_0, &xfer);
+ //HAL_SPI_Transmit(_spi, (uint8_t *)&data, 2, 0xFFFF);
+ ////while (HAL_SPI_GetState(_spi) != HAL_SPI_STATE_READY) {}
+ //gpio_set_pin_level(AS5048A_CS, true);
+ //delay_us(1);
+ //gpio_set_pin_level(AS5048A_CS, false);
+ ////xfer.txbuf = dummy_packet;
+ //spi_m_sync_transfer(&SPI_0, &xfer);
+ /////* Send dummy data to get reply */
+ //gpio_set_pin_level(AS5048A_CS, true);
+ //////xfer.txbuf[0] = 0x00;
+ //////xfer.txbuf[1] = 0x00;
+ //////spi_m_sync_transfer(&SPI_0, &xfer);
+ //////HAL_SPI_Receive(_spi, (uint8_t *)&data, 2, 0xFFFF);
+ //////while (HAL_SPI_GetState(_spi) != HAL_SPI_STATE_READY) {}
+ ////gpio_set_pin_level(AS5048A_CS, true);
+
+ if (in_buf[1] & 0x40) {
+ as5048a.errorFlag = 1;
+ } else {
+ as5048a.errorFlag = 0;
+ }
+
+ //Return the data, stripping the parity and error bits
+
+ //return (in_buf[1]<<8u)|in_buf[0];
+ //return (( ( data[1] & 0xFF ) << 8 ) | ( data[0] & 0xFF )) & ~0xC000;
+ return (( ( in_buf[1] & 0xFF ) << 8 ) | ( in_buf[0] & 0xFF )) & ~0xC000;
+}
+
+/*
+ * Write to a register
+ * Takes the 16-bit address of the target register and the 16 bit word of data
+ * to be written to that register
+ * Returns the value of the register after the write has been performed. This
+ * is read back from the sensor to ensure a sucessful write.
+ */
+//uint16_t write(uint16_t registerAddress, uint16_t data) {
+//
+ //uint8_t dat[2];
+//
+ //uint16_t command = 0b0000000000000000; // PAR=0 R/W=W
+ //command |= registerAddress;
+//
+ ////Add a parity bit on the the MSB
+ //command |= ((uint16_t)spiCalcEvenParity(command)<<15);
+//
+ ////Split the command into two bytes
+ //dat[1] = command & 0xFF;
+ //dat[0] = ( command >> 8 ) & 0xFF;
+//
+ ////Start the write command with the target address
+ //EN_SPI;
+ //HAL_SPI_Transmit(_spi, (uint8_t *)&dat, 2, 0xFFFF);
+ //while (HAL_SPI_GetState(_spi) != HAL_SPI_STATE_READY) {}
+ //DIS_SPI;
+//
+ //uint16_t dataToSend = 0b0000000000000000;
+ //dataToSend |= data;
+//
+ ////Craft another packet including the data and parity
+ //dataToSend |= ((uint16_t)spiCalcEvenParity(dataToSend)<<15);
+ //dat[1] = command & 0xFF;
+ //dat[0] = ( command >> 8 ) & 0xFF;
+//
+ ////Now send the data packet
+ //EN_SPI;
+ //HAL_SPI_Transmit(_spi, (uint8_t *)&dat, 2, 0xFFFF);
+ //while (HAL_SPI_GetState(_spi) != HAL_SPI_STATE_READY) {}
+ //DIS_SPI;
+//
+ ////Send a NOP to get the new data in the register
+ //dat[1] = 0x00;
+ //dat[0] = 0x00;
+ //EN_SPI;
+ //HAL_SPI_Transmit(_spi, (uint8_t *)&dat, 2, 0xFFFF);
+ //while (HAL_SPI_GetState(_spi) != HAL_SPI_STATE_READY) {}
+ //HAL_SPI_Receive(_spi, (uint8_t *)&dat, 2, 0xFFFF);
+ //while (HAL_SPI_GetState(_spi) != HAL_SPI_STATE_READY) {}
+ //DIS_SPI;
+//
+ ////Return the data, stripping the parity and error bits
+ //return (( ( dat[1] & 0xFF ) << 8 ) | ( dat[0] & 0xFF )) & ~0xC000;
+//}
+
+/**
+ * Returns the raw angle directly from the sensor
+ */
+uint16_t getRawRotation(){
+ return read(AS5048A_ANGLE);
+}
+
+/**
+ * Get the rotation of the sensor relative to the zero position.
+ *
+ * @return {int} between -2^13 and 2^13
+ */
+int getRotation(){
+ volatile uint16_t data;
+ volatile int rotation;
+
+ data = getRawRotation();
+ rotation = (int)data - (int)as5048a.position;
+ if(rotation > 8191) rotation = -((0x3FFF)-rotation); //more than -180
+ //if(rotation < -0x1FFF) rotation = rotation+0x3FFF;
+
+ return rotation;
+}
+
+/**
+ * returns the value of the state register
+ * @return 16 bit word containing flags
+ */
+uint16_t getState(){
+ return read(AS5048A_DIAG_AGC);
+}
+
+/*
+ * Check if an error has been encountered.
+ */
+uint8_t error(){
+ return errorFlag;
+}
+
+/**
+ * Returns the value used for Automatic Gain Control (Part of diagnostic
+ * register)
+ */
+uint8_t getGain(){
+ uint16_t data = getState();
+ return (uint8_t) data & 0xFF;
+}
+
+/*
+ * Get and clear the error register by reading it
+ */
+uint16_t getErrors(){
+ return read(AS5048A_CLEAR_ERROR_FLAG);
+}
+
+/*
+ * Set the zero AS5048A.position
+ */
+void setZeroPosition(uint16_t arg_position){
+ as5048a.position = arg_position % 0x3FFF;
+}
+
+/*
+ * Returns the current zero AS5048A.position
+ */
+uint16_t getZeroPosition(){
+ return as5048a.position;
+}
+
+/*
+ * Returns normalized angle value
+ */
+float normalize(float angle) {
+ // http://stackoverflow.com/a/11498248/3167294
+ #ifdef ANGLE_MODE_1
+ angle += 180;
+ #endif
+ angle = fmod(angle, 360);
+ if (angle < 0) {
+ angle += 360;
+ }
+ #ifdef ANGLE_MODE_1
+ angle -= 180;
+ #endif
+ return angle;
+}
+
+/*
+ * Returns calculated angle value
+ */
+float read2angle(uint16_t angle) {
+ /*
+ * 14 bits = 2^(14) - 1 = 16.383
+ *
+ * https://www.arduino.cc/en/Reference/Map
+ *
+ */
+ return (float)angle * ((float)360 / 16383);
+};
+
+float getRotationInDegrees()
+{
+ int16_t rotation = getRotation();
+ float degrees = 360.0 * (rotation + AS5048A_MAX_VALUE) / (AS5048A_MAX_VALUE * 2.0);
+ printf("%f\r\n", degrees);
+ return degrees;
+
+}
\ No newline at end of file
diff --git a/Examples/AS5048A_test/AS5048A_test/AS5048A.h b/Examples/AS5048A_test/AS5048A_test/AS5048A.h
new file mode 100644
index 0000000..76a04a5
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/AS5048A.h
@@ -0,0 +1,43 @@
+
+#ifndef AS5048A_H
+#define AS5048A_H
+
+#include
+
+
+struct io_descriptor *io;
+
+#define AS5048A_MISO GPIO(GPIO_PORTB, 29)
+#define AS5048A_MOSI GPIO(GPIO_PORTB, 27)
+#define AS5048A_SCK GPIO(GPIO_PORTB, 26)
+#define AS5048A_CS GPIO(GPIO_PORTB, 28)
+
+#define AS5048A_CMD_NOP 0x0000
+#define AS5048A_READ 0x4000
+#define AS5048A_CLEAR_ERROR_FLAG 0x0001
+#define AS5048A_PROGRAMMING_CONTROL 0x0003
+#define AS5048A_OTP_REGISTER_ZERO_POS_HIGH 0x0016
+#define AS5048A_OTP_REGISTER_ZERO_POS_LOW 0x0017
+#define AS5048A_DIAG_AGC 0x3FFD
+#define AS5048A_MAGNITUDE 0x3FFE
+#define AS5048A_ANGLE 0x3FFF
+
+bool AS5048A_init(void);
+uint8_t spiCalcEvenParity(uint16_t value);
+uint16_t read(uint16_t registerAddress);
+uint16_t getRawRotation();
+uint8_t getGain();
+uint16_t getErrors();
+void setZeroPosition(uint16_t arg_position);
+uint16_t getZeroPosition();
+float normalize(float angle);
+float read2angle(uint16_t angle);
+uint16_t getState();
+
+struct AS5048A {
+ uint8_t errorFlag;
+ uint16_t position;
+} as5048a;
+
+
+#endif
\ No newline at end of file
diff --git a/Examples/AS5048A_test/AS5048A_test/AS5048A_test.componentinfo.xml b/Examples/AS5048A_test/AS5048A_test/AS5048A_test.componentinfo.xml
new file mode 100644
index 0000000..dc0e9b9
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/AS5048A_test.componentinfo.xml
@@ -0,0 +1,169 @@
+
+
+
+
+
+
+ CMSIS
+ CORE
+
+
+ ARM
+ 5.1.2
+ C:/Program Files (x86)\Atmel\Studio\7.0\Packs
+
+
+
+
+ C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\CMSIS\5.4.0\CMSIS\Documentation\Core\html\index.html
+
+ doc
+
+
+
+ CMSIS/Documentation/Core/html/index.html
+
+
+
+
+ C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\CMSIS\5.4.0\CMSIS\Core\Include\
+
+ include
+
+
+
+ CMSIS/Core/Include/
+
+
+
+
+ CMSIS
+ C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/CMSIS/5.4.0/ARM.CMSIS.pdsc
+ 5.4.0
+ true
+ ARMv6_7_8-M Device
+
+
+
+ Resolved
+ Fixed
+ true
+
+
+
+
+ Device
+ Startup
+
+
+ Atmel
+ 1.1.0
+ C:/Program Files (x86)\Atmel\Studio\7.0\Packs
+
+
+
+
+
+
+ C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAME54_DFP\1.1.134\include
+
+ include
+ C
+
+
+ include
+
+
+
+
+ C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAME54_DFP\1.1.134\include\sam.h
+
+ header
+ C
+ 8A8bci0EePdi0b+8Lluv4A==
+
+ include/sam.h
+
+
+
+
+ C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAME54_DFP\1.1.134\templates\main.c
+ template
+ source
+ C Exe
+ XM3tW0X9p/jxE2KrHZ3m5g==
+
+ templates/main.c
+ Main file (.c)
+
+
+
+ C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAME54_DFP\1.1.134\templates\main.cpp
+ template
+ source
+ C Exe
+ Wwcf/gxegRQ10+cCzYcFIw==
+
+ templates/main.cpp
+ Main file (.cpp)
+
+
+
+ C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAME54_DFP\1.1.134\gcc\system_same54.c
+ config
+ source
+ GCC Exe
+ 13EKFJ9ZysfwBWEbJglN5Q==
+
+ gcc/system_same54.c
+
+
+
+
+ C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAME54_DFP\1.1.134\gcc\gcc\startup_same54.c
+ config
+ source
+ GCC Exe
+ hvyBThCuEBmDbH8Yhxa2Jw==
+
+ gcc/gcc/startup_same54.c
+
+
+
+
+ C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAME54_DFP\1.1.134\gcc\gcc\same54p20a_flash.ld
+ config
+ linkerScript
+ GCC Exe
+ KxZPrZpayTyit24vDXKm8w==
+
+ gcc/gcc/same54p20a_flash.ld
+
+
+
+
+ C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAME54_DFP\1.1.134\gcc\gcc\same54p20a_sram.ld
+ config
+ other
+ GCC Exe
+ +7n8kxIwTIMsWzB2gEYtIg==
+
+ gcc/gcc/same54p20a_sram.ld
+
+
+
+
+ SAME54_DFP
+ C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAME54_DFP/1.1.134/Atmel.SAME54_DFP.pdsc
+ 1.1.134
+ true
+ ATSAME54P20A
+
+
+
+ Resolved
+ Fixed
+ true
+
+
+
\ No newline at end of file
diff --git a/Examples/AS5048A_test/AS5048A_test/AS5048A_test.cproj b/Examples/AS5048A_test/AS5048A_test/AS5048A_test.cproj
new file mode 100644
index 0000000..becad0e
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/AS5048A_test.cproj
@@ -0,0 +1,886 @@
+
+
+
+ 2.0
+ 7.0
+ com.Atmel.ARMGCC.C
+ dce6c7e3-ee26-4d79-826b-08594b9ad897
+ ATSAME54P20A
+ none
+ Executable
+ C
+ $(MSBuildProjectName)
+ .elf
+ $(MSBuildProjectDirectory)\$(Configuration)
+ AS5048A_test
+ AS5048A_test
+ AS5048A_test
+ Native
+ true
+ false
+ true
+ true
+ 0x20000000
+
+ true
+ exception_table
+ 2
+ 0
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+ gcc
+ .atmelstart\atmel_start_config.atstart
+ .atmelstart\AtmelStart.gpdsc
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ True
+ True
+ True
+ True
+ True
+
+
+ NDEBUG
+
+
+
+
+ %24(PackRepoDir)\arm\CMSIS\5.4.0\CMSIS\Core\Include\
+ ../Config
+ ../
+ ../examples
+ ../hal/include
+ ../hal/utils/include
+ ../hpl/cmcc
+ ../hpl/core
+ ../hpl/dmac
+ ../hpl/gclk
+ ../hpl/mclk
+ ../hpl/osc32kctrl
+ ../hpl/oscctrl
+ ../hpl/pm
+ ../hpl/port
+ ../hpl/ramecc
+ ../hpl/sercom
+ ../hri
+ ../stdio_redirect
+ %24(PackRepoDir)\atmel\SAME54_DFP\1.1.134\include
+
+
+ Optimize for size (-Os)
+ True
+ True
+ -std=gnu99 -mfloat-abi=softfp -mfpu=fpv4-sp-d16
+ True
+
+
+ libm
+
+
+
+
+ %24(ProjectDir)\Device_Startup
+
+
+ True
+ -Tsame54p20a_flash.ld
+
+
+ %24(PackRepoDir)\arm\CMSIS\5.4.0\CMSIS\Core\Include\
+ ../Config
+ ../
+ ../examples
+ ../hal/include
+ ../hal/utils/include
+ ../hpl/cmcc
+ ../hpl/core
+ ../hpl/dmac
+ ../hpl/gclk
+ ../hpl/mclk
+ ../hpl/osc32kctrl
+ ../hpl/oscctrl
+ ../hpl/pm
+ ../hpl/port
+ ../hpl/ramecc
+ ../hpl/sercom
+ ../hri
+ ../stdio_redirect
+ %24(PackRepoDir)\atmel\SAME54_DFP\1.1.134\include
+
+
+
+
+ %24(PackRepoDir)\arm\CMSIS\5.4.0\CMSIS\Core\Include\
+ ../Config
+ ../
+ ../examples
+ ../hal/include
+ ../hal/utils/include
+ ../hpl/cmcc
+ ../hpl/core
+ ../hpl/dmac
+ ../hpl/gclk
+ ../hpl/mclk
+ ../hpl/osc32kctrl
+ ../hpl/oscctrl
+ ../hpl/pm
+ ../hpl/port
+ ../hpl/ramecc
+ ../hpl/sercom
+ ../hri
+ ../stdio_redirect
+ %24(PackRepoDir)\atmel\SAME54_DFP\1.1.134\include
+
+
+
+
+
+
+
+
+ True
+ True
+ True
+ True
+ True
+
+
+ DEBUG
+
+
+
+
+ %24(PackRepoDir)\arm\CMSIS\5.4.0\CMSIS\Core\Include\
+ ../Config
+ ../
+ ../examples
+ ../hal/include
+ ../hal/utils/include
+ ../hpl/cmcc
+ ../hpl/core
+ ../hpl/dmac
+ ../hpl/gclk
+ ../hpl/mclk
+ ../hpl/osc32kctrl
+ ../hpl/oscctrl
+ ../hpl/pm
+ ../hpl/port
+ ../hpl/ramecc
+ ../hpl/sercom
+ ../hri
+ ../stdio_redirect
+ %24(PackRepoDir)\atmel\SAME54_DFP\1.1.134\include
+
+
+ Optimize debugging experience (-Og)
+ True
+ Maximum (-g3)
+ True
+ -std=gnu99 -mfloat-abi=softfp -mfpu=fpv4-sp-d16
+
+
+ libm
+
+
+
+
+ %24(ProjectDir)\Device_Startup
+
+
+ True
+
+ -Tsame54p20a_flash.ld
+
+
+ %24(PackRepoDir)\arm\CMSIS\5.4.0\CMSIS\Core\Include\
+ ../Config
+ ../
+ ../examples
+ ../hal/include
+ ../hal/utils/include
+ ../hpl/cmcc
+ ../hpl/core
+ ../hpl/dmac
+ ../hpl/gclk
+ ../hpl/mclk
+ ../hpl/osc32kctrl
+ ../hpl/oscctrl
+ ../hpl/pm
+ ../hpl/port
+ ../hpl/ramecc
+ ../hpl/sercom
+ ../hri
+ ../stdio_redirect
+ %24(PackRepoDir)\atmel\SAME54_DFP\1.1.134\include
+
+
+ Default (-g)
+
+
+ %24(PackRepoDir)\arm\CMSIS\5.4.0\CMSIS\Core\Include\
+ ../Config
+ ../
+ ../examples
+ ../hal/include
+ ../hal/utils/include
+ ../hpl/cmcc
+ ../hpl/core
+ ../hpl/dmac
+ ../hpl/gclk
+ ../hpl/mclk
+ ../hpl/osc32kctrl
+ ../hpl/oscctrl
+ ../hpl/pm
+ ../hpl/port
+ ../hpl/ramecc
+ ../hpl/sercom
+ ../hri
+ ../stdio_redirect
+ %24(PackRepoDir)\atmel\SAME54_DFP\1.1.134\include
+
+
+ Default (-Wa,-g)
+
+
+
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+
+
\ No newline at end of file
diff --git a/Examples/AS5048A_test/AS5048A_test/Config/RTE_Components.h b/Examples/AS5048A_test/AS5048A_test/Config/RTE_Components.h
new file mode 100644
index 0000000..b10bb22
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/Config/RTE_Components.h
@@ -0,0 +1,54 @@
+ /**
+ * \file
+ *
+ * \brief Autogenerated API include file for the Atmel Configuration Management Engine (ACME)
+ *
+ * Copyright (c) 2012 Atmel Corporation. All rights reserved.
+ *
+ * \acme_license_start
+ *
+ * \page License
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The name of Atmel may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 4. This software may only be redistributed and used in connection with an
+ * Atmel microcontroller product.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * \acme_license_stop
+ *
+ * Project: AS5048A_test
+ * Target: ATSAME54P20A
+ *
+ **/
+
+
+#ifndef RTE_COMPONENTS_H
+#define RTE_COMPONENTS_H
+
+
+#define ATMEL_START
+
+#endif /* RTE_COMPONENTS_H */
diff --git a/Examples/AS5048A_test/AS5048A_test/Config/hpl_cmcc_config.h b/Examples/AS5048A_test/AS5048A_test/Config/hpl_cmcc_config.h
new file mode 100644
index 0000000..8590736
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/Config/hpl_cmcc_config.h
@@ -0,0 +1,54 @@
+/* Auto-generated config file hpl_cmcc_config.h */
+#ifndef HPL_CMCC_CONFIG_H
+#define HPL_CMCC_CONFIG_H
+
+// <<< Use Configuration Wizard in Context Menu >>>
+
+// Basic Configuration
+
+// Cache enable
+// Defines the cache should be enabled or not.
+// cmcc_enable
+#ifndef CONF_CMCC_ENABLE
+#define CONF_CMCC_ENABLE 0x0
+#endif
+
+// Cache Size
+// Defines the cache memory size to be configured.
+// <0x0=>1 KB
+// <0x1=>2 KB
+// <0x2=>4 KB
+// cache_size
+#ifndef CONF_CMCC_CACHE_SIZE
+#define CONF_CMCC_CACHE_SIZE 0x2
+#endif
+
+// Advanced Configuration
+// cmcc_advanced_configuration
+// Data cache disable
+// Defines the data cache should be disabled or not.
+// cmcc_data_cache_disable
+#ifndef CONF_CMCC_DATA_CACHE_DISABLE
+#define CONF_CMCC_DATA_CACHE_DISABLE 0x0
+#endif
+
+// Instruction cache disable
+// Defines the Instruction cache should be disabled or not.
+// cmcc_inst_cache_disable
+#ifndef CONF_CMCC_INST_CACHE_DISABLE
+#define CONF_CMCC_INST_CACHE_DISABLE 0x0
+#endif
+
+// Clock Gating disable
+// Defines the clock gating should be disabled or not.
+// cmcc_clock_gating_disable
+#ifndef CONF_CMCC_CLK_GATING_DISABLE
+#define CONF_CMCC_CLK_GATING_DISABLE 0x0
+#endif
+
+//
+//
+
+// <<< end of configuration section >>>
+
+#endif // HPL_CMCC_CONFIG_H
diff --git a/Examples/AS5048A_test/AS5048A_test/Config/hpl_dmac_config.h b/Examples/AS5048A_test/AS5048A_test/Config/hpl_dmac_config.h
new file mode 100644
index 0000000..90499fc
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/Config/hpl_dmac_config.h
@@ -0,0 +1,7277 @@
+/* Auto-generated config file hpl_dmac_config.h */
+#ifndef HPL_DMAC_CONFIG_H
+#define HPL_DMAC_CONFIG_H
+
+// <<< Use Configuration Wizard in Context Menu >>>
+
+// DMAC enable
+// Indicates whether dmac is enabled or not
+// dmac_enable
+#ifndef CONF_DMAC_ENABLE
+#define CONF_DMAC_ENABLE 0
+#endif
+
+// Priority Level 0
+// Indicates whether Priority Level 0 is enabled or not
+// dmac_lvlen0
+#ifndef CONF_DMAC_LVLEN0
+#define CONF_DMAC_LVLEN0 1
+#endif
+
+// Level 0 Round-Robin Arbitration
+// <0=> Static arbitration scheme for channel with priority 0
+// <1=> Round-robin arbitration scheme for channel with priority 0
+// Defines Level 0 Arbitration for DMA channels
+// dmac_rrlvlen0
+#ifndef CONF_DMAC_RRLVLEN0
+#define CONF_DMAC_RRLVLEN0 0
+#endif
+
+// Level 0 Channel Priority Number <0x00-0xFF>
+// dmac_lvlpri0
+#ifndef CONF_DMAC_LVLPRI0
+#define CONF_DMAC_LVLPRI0 0
+#endif
+// Priority Level 1
+// Indicates whether Priority Level 1 is enabled or not
+// dmac_lvlen1
+#ifndef CONF_DMAC_LVLEN1
+#define CONF_DMAC_LVLEN1 1
+#endif
+
+// Level 1 Round-Robin Arbitration
+// <0=> Static arbitration scheme for channel with priority 1
+// <1=> Round-robin arbitration scheme for channel with priority 1
+// Defines Level 1 Arbitration for DMA channels
+// dmac_rrlvlen1
+#ifndef CONF_DMAC_RRLVLEN1
+#define CONF_DMAC_RRLVLEN1 0
+#endif
+
+// Level 1 Channel Priority Number <0x00-0xFF>
+// dmac_lvlpri1
+#ifndef CONF_DMAC_LVLPRI1
+#define CONF_DMAC_LVLPRI1 0
+#endif
+// Priority Level 2
+// Indicates whether Priority Level 2 is enabled or not
+// dmac_lvlen2
+#ifndef CONF_DMAC_LVLEN2
+#define CONF_DMAC_LVLEN2 1
+#endif
+
+// Level 2 Round-Robin Arbitration
+// <0=> Static arbitration scheme for channel with priority 2
+// <1=> Round-robin arbitration scheme for channel with priority 2
+// Defines Level 2 Arbitration for DMA channels
+// dmac_rrlvlen2
+#ifndef CONF_DMAC_RRLVLEN2
+#define CONF_DMAC_RRLVLEN2 0
+#endif
+
+// Level 2 Channel Priority Number <0x00-0xFF>
+// dmac_lvlpri2
+#ifndef CONF_DMAC_LVLPRI2
+#define CONF_DMAC_LVLPRI2 0
+#endif
+// Priority Level 3
+// Indicates whether Priority Level 3 is enabled or not
+// dmac_lvlen3
+#ifndef CONF_DMAC_LVLEN3
+#define CONF_DMAC_LVLEN3 1
+#endif
+
+// Level 3 Round-Robin Arbitration
+// <0=> Static arbitration scheme for channel with priority 3
+// <1=> Round-robin arbitration scheme for channel with priority 3
+// Defines Level 3 Arbitration for DMA channels
+// dmac_rrlvlen3
+#ifndef CONF_DMAC_RRLVLEN3
+#define CONF_DMAC_RRLVLEN3 0
+#endif
+
+// Level 3 Channel Priority Number <0x00-0xFF>
+// dmac_lvlpri3
+#ifndef CONF_DMAC_LVLPRI3
+#define CONF_DMAC_LVLPRI3 0
+#endif
+// Debug Run
+// Indicates whether Debug Run is enabled or not
+// dmac_dbgrun
+#ifndef CONF_DMAC_DBGRUN
+#define CONF_DMAC_DBGRUN 0
+#endif
+
+// Channel 0 settings
+// dmac_channel_0_settings
+#ifndef CONF_DMAC_CHANNEL_0_SETTINGS
+#define CONF_DMAC_CHANNEL_0_SETTINGS 0
+#endif
+
+// Channel Run in Standby
+// Indicates whether channel 0 is running in standby mode or not
+// dmac_runstdby_0
+#ifndef CONF_DMAC_RUNSTDBY_0
+#define CONF_DMAC_RUNSTDBY_0 0
+#endif
+
+// Trigger action
+// <0=> One trigger required for each block transfer
+// <2=> One trigger required for each beat transfer
+// <3=> One trigger required for each transaction
+// Defines the trigger action used for a transfer
+// dmac_trigact_0
+#ifndef CONF_DMAC_TRIGACT_0
+#define CONF_DMAC_TRIGACT_0 0
+#endif
+
+// Trigger source
+// <0x00=> Only software/event triggers
+// <0x01=> RTC Time Stamp Trigger
+// <0x02=> DSU Debug Communication Channel 0 Trigger
+// <0x03=> DSU Debug Communication Channel 1 Trigger
+// <0x04=> SERCOM0 RX Trigger
+// <0x05=> SERCOM0 TX Trigger
+// <0x06=> SERCOM1 RX Trigger
+// <0x07=> SERCOM1 TX Trigger
+// <0x08=> SERCOM2 RX Trigger
+// <0x09=> SERCOM2 TX Trigger
+// <0x0A=> SERCOM3 RX Trigger
+// <0x0B=> SERCOM3 TX Trigger
+// <0x0C=> SERCOM4 RX Trigger
+// <0x0D=> SERCOM4 TX Trigger
+// <0x0E=> SERCOM5 RX Trigger
+// <0x0F=> SERCOM5 TX Trigger
+// <0x10=> SERCOM6 RX Trigger
+// <0x11=> SERCOM6 TX Trigger
+// <0x12=> SERCOM7 RX Trigger
+// <0x13=> SERCOM7 TX Trigger
+// <0x14=> CAN0 DEBUG Trigger
+// <0x15=> CAN1 DEBUG Trigger
+// <0x16=> TCC0 Overflow Trigger Trigger
+// <0x17=> TCC0 Match/Compare 0 Trigger Trigger
+// <0x18=> TCC0 Match/Compare 1 Trigger Trigger
+// <0x19=> TCC0 Match/Compare 2 Trigger Trigger
+// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger
+// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger
+// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger
+// <0x1D=> TCC1 Overflow Trigger Trigger
+// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger
+// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger
+// <0x20=> TCC1 Match/Compare 2 Trigger Trigger
+// <0x21=> TCC1 Match/Compare 3 Trigger Trigger
+// <0x22=> TCC2 Overflow Trigger Trigger
+// <0x23=> TCC2 Match/Compare 0 Trigger Trigger
+// <0x24=> TCC2 Match/Compare 1 Trigger Trigger
+// <0x25=> TCC2 Match/Compare 2 Trigger Trigger
+// <0x26=> TCC3 Overflow Trigger Trigger
+// <0x27=> TCC3 Match/Compare 0 Trigger Trigger
+// <0x28=> TCC3 Match/Compare 1 Trigger Trigger
+// <0x29=> TCC4 Overflow Trigger Trigger
+// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger
+// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger
+// <0x2C=> TC0 Overflow Trigger
+// <0x2D=> TC0 Match/Compare 0 Trigger
+// <0x2E=> TC0 Match/Compare 1 Trigger
+// <0x2F=> TC1 Overflow Trigger
+// <0x30=> TC1 Match/Compare 0 Trigger
+// <0x31=> TC1 Match/Compare 1 Trigger
+// <0x32=> TC2 Overflow Trigger
+// <0x33=> TC2 Match/Compare 0 Trigger
+// <0x34=> TC2 Match/Compare 1 Trigger
+// <0x35=> TC3 Overflow Trigger
+// <0x36=> TC3 Match/Compare 0 Trigger
+// <0x37=> TC3 Match/Compare 1 Trigger
+// <0x38=> TC4 Overflow Trigger
+// <0x39=> TC4 Match/Compare 0 Trigger
+// <0x3A=> TC4 Match/Compare 1 Trigger
+// <0x3B=> TC5 Overflow Trigger
+// <0x3C=> TC5 Match/Compare 0 Trigger
+// <0x3D=> TC5 Match/Compare 1 Trigger
+// <0x3E=> TC6 Overflow Trigger
+// <0x3F=> TC6 Match/Compare 0 Trigger
+// <0x40=> TC6 Match/Compare 1 Trigger
+// <0x41=> TC7 Overflow Trigger
+// <0x42=> TC7 Match/Compare 0 Trigger
+// <0x43=> TC7 Match/Compare 1 Trigger
+// <0x44=> ADC0 Result Ready Trigger
+// <0x45=> ADC0 Sequencing Trigger
+// <0x46=> ADC1 Result Ready Trigger
+// <0x47=> ADC1 Sequencing Trigger
+// <0x48=> DAC Empty 0 Trigger
+// <0x49=> DAC Empty 1 Trigger
+// <0x4A=> DAC Result Ready 0 Trigger
+// <0x4B=> DAC Result Ready 1 Trigger
+// <0x4C=> I2S Rx 0 Trigger
+// <0x4D=> I2S Rx 1 Trigger
+// <0x4E=> I2S Tx 0 Trigger
+// <0x4F=> I2S Tx 1 Trigger
+// <0x50=> PCC RX Trigger
+// <0x51=> AES Write Trigger
+// <0x52=> AES Read Trigger
+// <0x53=> QSPI Rx Trigger
+// <0x54=> QSPI Tx Trigger
+// Defines the peripheral trigger which is source of the transfer
+// dmac_trifsrc_0
+#ifndef CONF_DMAC_TRIGSRC_0
+#define CONF_DMAC_TRIGSRC_0 0
+#endif
+
+// Channel Arbitration Level
+// <0=> Channel priority 0
+// <1=> Channel priority 1
+// <2=> Channel priority 2
+// <3=> Channel priority 3
+// Defines the arbitration level for this channel
+// dmac_lvl_0
+#ifndef CONF_DMAC_LVL_0
+#define CONF_DMAC_LVL_0 0
+#endif
+
+// Channel Event Output
+// Indicates whether channel event generation is enabled or not
+// dmac_evoe_0
+#ifndef CONF_DMAC_EVOE_0
+#define CONF_DMAC_EVOE_0 0
+#endif
+
+// Channel Event Input
+// Indicates whether channel event reception is enabled or not
+// dmac_evie_0
+#ifndef CONF_DMAC_EVIE_0
+#define CONF_DMAC_EVIE_0 0
+#endif
+
+// Event Input Action
+// <0=> No action
+// <1=> Normal transfer and conditional transfer on strobe trigger
+// <2=> Conditional transfer trigger
+// <3=> Conditional block transfer
+// <4=> Channel suspend operation
+// <5=> Channel resume operation
+// <6=> Skip next block suspend action
+// Defines the event input action
+// dmac_evact_0
+#ifndef CONF_DMAC_EVACT_0
+#define CONF_DMAC_EVACT_0 0
+#endif
+
+// Address Increment Step Size
+// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1
+// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2
+// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4
+// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8
+// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16
+// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32
+// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64
+// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128
+// Defines the address increment step size, applies to source or destination address
+// dmac_stepsize_0
+#ifndef CONF_DMAC_STEPSIZE_0
+#define CONF_DMAC_STEPSIZE_0 0
+#endif
+
+// Step Selection
+// <0=> Step size settings apply to the destination address
+// <1=> Step size settings apply to the source address
+// Defines whether source or destination addresses are using the step size settings
+// dmac_stepsel_0
+#ifndef CONF_DMAC_STEPSEL_0
+#define CONF_DMAC_STEPSEL_0 0
+#endif
+
+// Source Address Increment
+// Indicates whether the source address incrementation is enabled or not
+// dmac_srcinc_0
+#ifndef CONF_DMAC_SRCINC_0
+#define CONF_DMAC_SRCINC_0 0
+#endif
+
+// Destination Address Increment
+// Indicates whether the destination address incrementation is enabled or not
+// dmac_dstinc_0
+#ifndef CONF_DMAC_DSTINC_0
+#define CONF_DMAC_DSTINC_0 0
+#endif
+
+// Beat Size
+// <0=> 8-bit bus transfer
+// <1=> 16-bit bus transfer
+// <2=> 32-bit bus transfer
+// Defines the size of one beat
+// dmac_beatsize_0
+#ifndef CONF_DMAC_BEATSIZE_0
+#define CONF_DMAC_BEATSIZE_0 0
+#endif
+
+// Block Action
+// <0=> Channel will be disabled if it is the last block transfer in the transaction
+// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt
+// <2=> Channel suspend operation is complete
+// <3=> Both channel suspend operation and block interrupt
+// Defines the the DMAC should take after a block transfer has completed
+// dmac_blockact_0
+#ifndef CONF_DMAC_BLOCKACT_0
+#define CONF_DMAC_BLOCKACT_0 0
+#endif
+
+// Event Output Selection
+// <0=> Event generation disabled
+// <1=> Event strobe when block transfer complete
+// <3=> Event strobe when beat transfer complete
+// Defines the event output selection
+// dmac_evosel_0
+#ifndef CONF_DMAC_EVOSEL_0
+#define CONF_DMAC_EVOSEL_0 0
+#endif
+//
+
+// Channel 1 settings
+// dmac_channel_1_settings
+#ifndef CONF_DMAC_CHANNEL_1_SETTINGS
+#define CONF_DMAC_CHANNEL_1_SETTINGS 0
+#endif
+
+// Channel Run in Standby
+// Indicates whether channel 1 is running in standby mode or not
+// dmac_runstdby_1
+#ifndef CONF_DMAC_RUNSTDBY_1
+#define CONF_DMAC_RUNSTDBY_1 0
+#endif
+
+// Trigger action
+// <0=> One trigger required for each block transfer
+// <2=> One trigger required for each beat transfer
+// <3=> One trigger required for each transaction
+// Defines the trigger action used for a transfer
+// dmac_trigact_1
+#ifndef CONF_DMAC_TRIGACT_1
+#define CONF_DMAC_TRIGACT_1 0
+#endif
+
+// Trigger source
+// <0x00=> Only software/event triggers
+// <0x01=> RTC Time Stamp Trigger
+// <0x02=> DSU Debug Communication Channel 0 Trigger
+// <0x03=> DSU Debug Communication Channel 1 Trigger
+// <0x04=> SERCOM0 RX Trigger
+// <0x05=> SERCOM0 TX Trigger
+// <0x06=> SERCOM1 RX Trigger
+// <0x07=> SERCOM1 TX Trigger
+// <0x08=> SERCOM2 RX Trigger
+// <0x09=> SERCOM2 TX Trigger
+// <0x0A=> SERCOM3 RX Trigger
+// <0x0B=> SERCOM3 TX Trigger
+// <0x0C=> SERCOM4 RX Trigger
+// <0x0D=> SERCOM4 TX Trigger
+// <0x0E=> SERCOM5 RX Trigger
+// <0x0F=> SERCOM5 TX Trigger
+// <0x10=> SERCOM6 RX Trigger
+// <0x11=> SERCOM6 TX Trigger
+// <0x12=> SERCOM7 RX Trigger
+// <0x13=> SERCOM7 TX Trigger
+// <0x14=> CAN0 DEBUG Trigger
+// <0x15=> CAN1 DEBUG Trigger
+// <0x16=> TCC0 Overflow Trigger Trigger
+// <0x17=> TCC0 Match/Compare 0 Trigger Trigger
+// <0x18=> TCC0 Match/Compare 1 Trigger Trigger
+// <0x19=> TCC0 Match/Compare 2 Trigger Trigger
+// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger
+// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger
+// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger
+// <0x1D=> TCC1 Overflow Trigger Trigger
+// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger
+// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger
+// <0x20=> TCC1 Match/Compare 2 Trigger Trigger
+// <0x21=> TCC1 Match/Compare 3 Trigger Trigger
+// <0x22=> TCC2 Overflow Trigger Trigger
+// <0x23=> TCC2 Match/Compare 0 Trigger Trigger
+// <0x24=> TCC2 Match/Compare 1 Trigger Trigger
+// <0x25=> TCC2 Match/Compare 2 Trigger Trigger
+// <0x26=> TCC3 Overflow Trigger Trigger
+// <0x27=> TCC3 Match/Compare 0 Trigger Trigger
+// <0x28=> TCC3 Match/Compare 1 Trigger Trigger
+// <0x29=> TCC4 Overflow Trigger Trigger
+// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger
+// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger
+// <0x2C=> TC0 Overflow Trigger
+// <0x2D=> TC0 Match/Compare 0 Trigger
+// <0x2E=> TC0 Match/Compare 1 Trigger
+// <0x2F=> TC1 Overflow Trigger
+// <0x30=> TC1 Match/Compare 0 Trigger
+// <0x31=> TC1 Match/Compare 1 Trigger
+// <0x32=> TC2 Overflow Trigger
+// <0x33=> TC2 Match/Compare 0 Trigger
+// <0x34=> TC2 Match/Compare 1 Trigger
+// <0x35=> TC3 Overflow Trigger
+// <0x36=> TC3 Match/Compare 0 Trigger
+// <0x37=> TC3 Match/Compare 1 Trigger
+// <0x38=> TC4 Overflow Trigger
+// <0x39=> TC4 Match/Compare 0 Trigger
+// <0x3A=> TC4 Match/Compare 1 Trigger
+// <0x3B=> TC5 Overflow Trigger
+// <0x3C=> TC5 Match/Compare 0 Trigger
+// <0x3D=> TC5 Match/Compare 1 Trigger
+// <0x3E=> TC6 Overflow Trigger
+// <0x3F=> TC6 Match/Compare 0 Trigger
+// <0x40=> TC6 Match/Compare 1 Trigger
+// <0x41=> TC7 Overflow Trigger
+// <0x42=> TC7 Match/Compare 0 Trigger
+// <0x43=> TC7 Match/Compare 1 Trigger
+// <0x44=> ADC0 Result Ready Trigger
+// <0x45=> ADC0 Sequencing Trigger
+// <0x46=> ADC1 Result Ready Trigger
+// <0x47=> ADC1 Sequencing Trigger
+// <0x48=> DAC Empty 0 Trigger
+// <0x49=> DAC Empty 1 Trigger
+// <0x4A=> DAC Result Ready 0 Trigger
+// <0x4B=> DAC Result Ready 1 Trigger
+// <0x4C=> I2S Rx 0 Trigger
+// <0x4D=> I2S Rx 1 Trigger
+// <0x4E=> I2S Tx 0 Trigger
+// <0x4F=> I2S Tx 1 Trigger
+// <0x50=> PCC RX Trigger
+// <0x51=> AES Write Trigger
+// <0x52=> AES Read Trigger
+// <0x53=> QSPI Rx Trigger
+// <0x54=> QSPI Tx Trigger
+// Defines the peripheral trigger which is source of the transfer
+// dmac_trifsrc_1
+#ifndef CONF_DMAC_TRIGSRC_1
+#define CONF_DMAC_TRIGSRC_1 0
+#endif
+
+// Channel Arbitration Level
+// <0=> Channel priority 0
+// <1=> Channel priority 1
+// <2=> Channel priority 2
+// <3=> Channel priority 3
+// Defines the arbitration level for this channel
+// dmac_lvl_1
+#ifndef CONF_DMAC_LVL_1
+#define CONF_DMAC_LVL_1 0
+#endif
+
+// Channel Event Output
+// Indicates whether channel event generation is enabled or not
+// dmac_evoe_1
+#ifndef CONF_DMAC_EVOE_1
+#define CONF_DMAC_EVOE_1 0
+#endif
+
+// Channel Event Input
+// Indicates whether channel event reception is enabled or not
+// dmac_evie_1
+#ifndef CONF_DMAC_EVIE_1
+#define CONF_DMAC_EVIE_1 0
+#endif
+
+// Event Input Action
+// <0=> No action
+// <1=> Normal transfer and conditional transfer on strobe trigger
+// <2=> Conditional transfer trigger
+// <3=> Conditional block transfer
+// <4=> Channel suspend operation
+// <5=> Channel resume operation
+// <6=> Skip next block suspend action
+// Defines the event input action
+// dmac_evact_1
+#ifndef CONF_DMAC_EVACT_1
+#define CONF_DMAC_EVACT_1 0
+#endif
+
+// Address Increment Step Size
+// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1
+// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2
+// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4
+// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8
+// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16
+// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32
+// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64
+// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128
+// Defines the address increment step size, applies to source or destination address
+// dmac_stepsize_1
+#ifndef CONF_DMAC_STEPSIZE_1
+#define CONF_DMAC_STEPSIZE_1 0
+#endif
+
+// Step Selection
+// <0=> Step size settings apply to the destination address
+// <1=> Step size settings apply to the source address
+// Defines whether source or destination addresses are using the step size settings
+// dmac_stepsel_1
+#ifndef CONF_DMAC_STEPSEL_1
+#define CONF_DMAC_STEPSEL_1 0
+#endif
+
+// Source Address Increment
+// Indicates whether the source address incrementation is enabled or not
+// dmac_srcinc_1
+#ifndef CONF_DMAC_SRCINC_1
+#define CONF_DMAC_SRCINC_1 0
+#endif
+
+// Destination Address Increment
+// Indicates whether the destination address incrementation is enabled or not
+// dmac_dstinc_1
+#ifndef CONF_DMAC_DSTINC_1
+#define CONF_DMAC_DSTINC_1 0
+#endif
+
+// Beat Size
+// <0=> 8-bit bus transfer
+// <1=> 16-bit bus transfer
+// <2=> 32-bit bus transfer
+// Defines the size of one beat
+// dmac_beatsize_1
+#ifndef CONF_DMAC_BEATSIZE_1
+#define CONF_DMAC_BEATSIZE_1 0
+#endif
+
+// Block Action
+// <0=> Channel will be disabled if it is the last block transfer in the transaction
+// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt
+// <2=> Channel suspend operation is complete
+// <3=> Both channel suspend operation and block interrupt
+// Defines the the DMAC should take after a block transfer has completed
+// dmac_blockact_1
+#ifndef CONF_DMAC_BLOCKACT_1
+#define CONF_DMAC_BLOCKACT_1 0
+#endif
+
+// Event Output Selection
+// <0=> Event generation disabled
+// <1=> Event strobe when block transfer complete
+// <3=> Event strobe when beat transfer complete
+// Defines the event output selection
+// dmac_evosel_1
+#ifndef CONF_DMAC_EVOSEL_1
+#define CONF_DMAC_EVOSEL_1 0
+#endif
+//
+
+// Channel 2 settings
+// dmac_channel_2_settings
+#ifndef CONF_DMAC_CHANNEL_2_SETTINGS
+#define CONF_DMAC_CHANNEL_2_SETTINGS 0
+#endif
+
+// Channel Run in Standby
+// Indicates whether channel 2 is running in standby mode or not
+// dmac_runstdby_2
+#ifndef CONF_DMAC_RUNSTDBY_2
+#define CONF_DMAC_RUNSTDBY_2 0
+#endif
+
+// Trigger action
+// <0=> One trigger required for each block transfer
+// <2=> One trigger required for each beat transfer
+// <3=> One trigger required for each transaction
+// Defines the trigger action used for a transfer
+// dmac_trigact_2
+#ifndef CONF_DMAC_TRIGACT_2
+#define CONF_DMAC_TRIGACT_2 0
+#endif
+
+// Trigger source
+// <0x00=> Only software/event triggers
+// <0x01=> RTC Time Stamp Trigger
+// <0x02=> DSU Debug Communication Channel 0 Trigger
+// <0x03=> DSU Debug Communication Channel 1 Trigger
+// <0x04=> SERCOM0 RX Trigger
+// <0x05=> SERCOM0 TX Trigger
+// <0x06=> SERCOM1 RX Trigger
+// <0x07=> SERCOM1 TX Trigger
+// <0x08=> SERCOM2 RX Trigger
+// <0x09=> SERCOM2 TX Trigger
+// <0x0A=> SERCOM3 RX Trigger
+// <0x0B=> SERCOM3 TX Trigger
+// <0x0C=> SERCOM4 RX Trigger
+// <0x0D=> SERCOM4 TX Trigger
+// <0x0E=> SERCOM5 RX Trigger
+// <0x0F=> SERCOM5 TX Trigger
+// <0x10=> SERCOM6 RX Trigger
+// <0x11=> SERCOM6 TX Trigger
+// <0x12=> SERCOM7 RX Trigger
+// <0x13=> SERCOM7 TX Trigger
+// <0x14=> CAN0 DEBUG Trigger
+// <0x15=> CAN1 DEBUG Trigger
+// <0x16=> TCC0 Overflow Trigger Trigger
+// <0x17=> TCC0 Match/Compare 0 Trigger Trigger
+// <0x18=> TCC0 Match/Compare 1 Trigger Trigger
+// <0x19=> TCC0 Match/Compare 2 Trigger Trigger
+// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger
+// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger
+// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger
+// <0x1D=> TCC1 Overflow Trigger Trigger
+// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger
+// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger
+// <0x20=> TCC1 Match/Compare 2 Trigger Trigger
+// <0x21=> TCC1 Match/Compare 3 Trigger Trigger
+// <0x22=> TCC2 Overflow Trigger Trigger
+// <0x23=> TCC2 Match/Compare 0 Trigger Trigger
+// <0x24=> TCC2 Match/Compare 1 Trigger Trigger
+// <0x25=> TCC2 Match/Compare 2 Trigger Trigger
+// <0x26=> TCC3 Overflow Trigger Trigger
+// <0x27=> TCC3 Match/Compare 0 Trigger Trigger
+// <0x28=> TCC3 Match/Compare 1 Trigger Trigger
+// <0x29=> TCC4 Overflow Trigger Trigger
+// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger
+// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger
+// <0x2C=> TC0 Overflow Trigger
+// <0x2D=> TC0 Match/Compare 0 Trigger
+// <0x2E=> TC0 Match/Compare 1 Trigger
+// <0x2F=> TC1 Overflow Trigger
+// <0x30=> TC1 Match/Compare 0 Trigger
+// <0x31=> TC1 Match/Compare 1 Trigger
+// <0x32=> TC2 Overflow Trigger
+// <0x33=> TC2 Match/Compare 0 Trigger
+// <0x34=> TC2 Match/Compare 1 Trigger
+// <0x35=> TC3 Overflow Trigger
+// <0x36=> TC3 Match/Compare 0 Trigger
+// <0x37=> TC3 Match/Compare 1 Trigger
+// <0x38=> TC4 Overflow Trigger
+// <0x39=> TC4 Match/Compare 0 Trigger
+// <0x3A=> TC4 Match/Compare 1 Trigger
+// <0x3B=> TC5 Overflow Trigger
+// <0x3C=> TC5 Match/Compare 0 Trigger
+// <0x3D=> TC5 Match/Compare 1 Trigger
+// <0x3E=> TC6 Overflow Trigger
+// <0x3F=> TC6 Match/Compare 0 Trigger
+// <0x40=> TC6 Match/Compare 1 Trigger
+// <0x41=> TC7 Overflow Trigger
+// <0x42=> TC7 Match/Compare 0 Trigger
+// <0x43=> TC7 Match/Compare 1 Trigger
+// <0x44=> ADC0 Result Ready Trigger
+// <0x45=> ADC0 Sequencing Trigger
+// <0x46=> ADC1 Result Ready Trigger
+// <0x47=> ADC1 Sequencing Trigger
+// <0x48=> DAC Empty 0 Trigger
+// <0x49=> DAC Empty 1 Trigger
+// <0x4A=> DAC Result Ready 0 Trigger
+// <0x4B=> DAC Result Ready 1 Trigger
+// <0x4C=> I2S Rx 0 Trigger
+// <0x4D=> I2S Rx 1 Trigger
+// <0x4E=> I2S Tx 0 Trigger
+// <0x4F=> I2S Tx 1 Trigger
+// <0x50=> PCC RX Trigger
+// <0x51=> AES Write Trigger
+// <0x52=> AES Read Trigger
+// <0x53=> QSPI Rx Trigger
+// <0x54=> QSPI Tx Trigger
+// Defines the peripheral trigger which is source of the transfer
+// dmac_trifsrc_2
+#ifndef CONF_DMAC_TRIGSRC_2
+#define CONF_DMAC_TRIGSRC_2 0
+#endif
+
+// Channel Arbitration Level
+// <0=> Channel priority 0
+// <1=> Channel priority 1
+// <2=> Channel priority 2
+// <3=> Channel priority 3
+// Defines the arbitration level for this channel
+// dmac_lvl_2
+#ifndef CONF_DMAC_LVL_2
+#define CONF_DMAC_LVL_2 0
+#endif
+
+// Channel Event Output
+// Indicates whether channel event generation is enabled or not
+// dmac_evoe_2
+#ifndef CONF_DMAC_EVOE_2
+#define CONF_DMAC_EVOE_2 0
+#endif
+
+// Channel Event Input
+// Indicates whether channel event reception is enabled or not
+// dmac_evie_2
+#ifndef CONF_DMAC_EVIE_2
+#define CONF_DMAC_EVIE_2 0
+#endif
+
+// Event Input Action
+// <0=> No action
+// <1=> Normal transfer and conditional transfer on strobe trigger
+// <2=> Conditional transfer trigger
+// <3=> Conditional block transfer
+// <4=> Channel suspend operation
+// <5=> Channel resume operation
+// <6=> Skip next block suspend action
+// Defines the event input action
+// dmac_evact_2
+#ifndef CONF_DMAC_EVACT_2
+#define CONF_DMAC_EVACT_2 0
+#endif
+
+// Address Increment Step Size
+// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1
+// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2
+// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4
+// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8
+// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16
+// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32
+// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64
+// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128
+// Defines the address increment step size, applies to source or destination address
+// dmac_stepsize_2
+#ifndef CONF_DMAC_STEPSIZE_2
+#define CONF_DMAC_STEPSIZE_2 0
+#endif
+
+// Step Selection
+// <0=> Step size settings apply to the destination address
+// <1=> Step size settings apply to the source address
+// Defines whether source or destination addresses are using the step size settings
+// dmac_stepsel_2
+#ifndef CONF_DMAC_STEPSEL_2
+#define CONF_DMAC_STEPSEL_2 0
+#endif
+
+// Source Address Increment
+// Indicates whether the source address incrementation is enabled or not
+// dmac_srcinc_2
+#ifndef CONF_DMAC_SRCINC_2
+#define CONF_DMAC_SRCINC_2 0
+#endif
+
+// Destination Address Increment
+// Indicates whether the destination address incrementation is enabled or not
+// dmac_dstinc_2
+#ifndef CONF_DMAC_DSTINC_2
+#define CONF_DMAC_DSTINC_2 0
+#endif
+
+// Beat Size
+// <0=> 8-bit bus transfer
+// <1=> 16-bit bus transfer
+// <2=> 32-bit bus transfer
+// Defines the size of one beat
+// dmac_beatsize_2
+#ifndef CONF_DMAC_BEATSIZE_2
+#define CONF_DMAC_BEATSIZE_2 0
+#endif
+
+// Block Action
+// <0=> Channel will be disabled if it is the last block transfer in the transaction
+// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt
+// <2=> Channel suspend operation is complete
+// <3=> Both channel suspend operation and block interrupt
+// Defines the the DMAC should take after a block transfer has completed
+// dmac_blockact_2
+#ifndef CONF_DMAC_BLOCKACT_2
+#define CONF_DMAC_BLOCKACT_2 0
+#endif
+
+// Event Output Selection
+// <0=> Event generation disabled
+// <1=> Event strobe when block transfer complete
+// <3=> Event strobe when beat transfer complete
+// Defines the event output selection
+// dmac_evosel_2
+#ifndef CONF_DMAC_EVOSEL_2
+#define CONF_DMAC_EVOSEL_2 0
+#endif
+//
+
+// Channel 3 settings
+// dmac_channel_3_settings
+#ifndef CONF_DMAC_CHANNEL_3_SETTINGS
+#define CONF_DMAC_CHANNEL_3_SETTINGS 0
+#endif
+
+// Channel Run in Standby
+// Indicates whether channel 3 is running in standby mode or not
+// dmac_runstdby_3
+#ifndef CONF_DMAC_RUNSTDBY_3
+#define CONF_DMAC_RUNSTDBY_3 0
+#endif
+
+// Trigger action
+// <0=> One trigger required for each block transfer
+// <2=> One trigger required for each beat transfer
+// <3=> One trigger required for each transaction
+// Defines the trigger action used for a transfer
+// dmac_trigact_3
+#ifndef CONF_DMAC_TRIGACT_3
+#define CONF_DMAC_TRIGACT_3 0
+#endif
+
+// Trigger source
+// <0x00=> Only software/event triggers
+// <0x01=> RTC Time Stamp Trigger
+// <0x02=> DSU Debug Communication Channel 0 Trigger
+// <0x03=> DSU Debug Communication Channel 1 Trigger
+// <0x04=> SERCOM0 RX Trigger
+// <0x05=> SERCOM0 TX Trigger
+// <0x06=> SERCOM1 RX Trigger
+// <0x07=> SERCOM1 TX Trigger
+// <0x08=> SERCOM2 RX Trigger
+// <0x09=> SERCOM2 TX Trigger
+// <0x0A=> SERCOM3 RX Trigger
+// <0x0B=> SERCOM3 TX Trigger
+// <0x0C=> SERCOM4 RX Trigger
+// <0x0D=> SERCOM4 TX Trigger
+// <0x0E=> SERCOM5 RX Trigger
+// <0x0F=> SERCOM5 TX Trigger
+// <0x10=> SERCOM6 RX Trigger
+// <0x11=> SERCOM6 TX Trigger
+// <0x12=> SERCOM7 RX Trigger
+// <0x13=> SERCOM7 TX Trigger
+// <0x14=> CAN0 DEBUG Trigger
+// <0x15=> CAN1 DEBUG Trigger
+// <0x16=> TCC0 Overflow Trigger Trigger
+// <0x17=> TCC0 Match/Compare 0 Trigger Trigger
+// <0x18=> TCC0 Match/Compare 1 Trigger Trigger
+// <0x19=> TCC0 Match/Compare 2 Trigger Trigger
+// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger
+// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger
+// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger
+// <0x1D=> TCC1 Overflow Trigger Trigger
+// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger
+// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger
+// <0x20=> TCC1 Match/Compare 2 Trigger Trigger
+// <0x21=> TCC1 Match/Compare 3 Trigger Trigger
+// <0x22=> TCC2 Overflow Trigger Trigger
+// <0x23=> TCC2 Match/Compare 0 Trigger Trigger
+// <0x24=> TCC2 Match/Compare 1 Trigger Trigger
+// <0x25=> TCC2 Match/Compare 2 Trigger Trigger
+// <0x26=> TCC3 Overflow Trigger Trigger
+// <0x27=> TCC3 Match/Compare 0 Trigger Trigger
+// <0x28=> TCC3 Match/Compare 1 Trigger Trigger
+// <0x29=> TCC4 Overflow Trigger Trigger
+// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger
+// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger
+// <0x2C=> TC0 Overflow Trigger
+// <0x2D=> TC0 Match/Compare 0 Trigger
+// <0x2E=> TC0 Match/Compare 1 Trigger
+// <0x2F=> TC1 Overflow Trigger
+// <0x30=> TC1 Match/Compare 0 Trigger
+// <0x31=> TC1 Match/Compare 1 Trigger
+// <0x32=> TC2 Overflow Trigger
+// <0x33=> TC2 Match/Compare 0 Trigger
+// <0x34=> TC2 Match/Compare 1 Trigger
+// <0x35=> TC3 Overflow Trigger
+// <0x36=> TC3 Match/Compare 0 Trigger
+// <0x37=> TC3 Match/Compare 1 Trigger
+// <0x38=> TC4 Overflow Trigger
+// <0x39=> TC4 Match/Compare 0 Trigger
+// <0x3A=> TC4 Match/Compare 1 Trigger
+// <0x3B=> TC5 Overflow Trigger
+// <0x3C=> TC5 Match/Compare 0 Trigger
+// <0x3D=> TC5 Match/Compare 1 Trigger
+// <0x3E=> TC6 Overflow Trigger
+// <0x3F=> TC6 Match/Compare 0 Trigger
+// <0x40=> TC6 Match/Compare 1 Trigger
+// <0x41=> TC7 Overflow Trigger
+// <0x42=> TC7 Match/Compare 0 Trigger
+// <0x43=> TC7 Match/Compare 1 Trigger
+// <0x44=> ADC0 Result Ready Trigger
+// <0x45=> ADC0 Sequencing Trigger
+// <0x46=> ADC1 Result Ready Trigger
+// <0x47=> ADC1 Sequencing Trigger
+// <0x48=> DAC Empty 0 Trigger
+// <0x49=> DAC Empty 1 Trigger
+// <0x4A=> DAC Result Ready 0 Trigger
+// <0x4B=> DAC Result Ready 1 Trigger
+// <0x4C=> I2S Rx 0 Trigger
+// <0x4D=> I2S Rx 1 Trigger
+// <0x4E=> I2S Tx 0 Trigger
+// <0x4F=> I2S Tx 1 Trigger
+// <0x50=> PCC RX Trigger
+// <0x51=> AES Write Trigger
+// <0x52=> AES Read Trigger
+// <0x53=> QSPI Rx Trigger
+// <0x54=> QSPI Tx Trigger
+// Defines the peripheral trigger which is source of the transfer
+// dmac_trifsrc_3
+#ifndef CONF_DMAC_TRIGSRC_3
+#define CONF_DMAC_TRIGSRC_3 0
+#endif
+
+// Channel Arbitration Level
+// <0=> Channel priority 0
+// <1=> Channel priority 1
+// <2=> Channel priority 2
+// <3=> Channel priority 3
+// Defines the arbitration level for this channel
+// dmac_lvl_3
+#ifndef CONF_DMAC_LVL_3
+#define CONF_DMAC_LVL_3 0
+#endif
+
+// Channel Event Output
+// Indicates whether channel event generation is enabled or not
+// dmac_evoe_3
+#ifndef CONF_DMAC_EVOE_3
+#define CONF_DMAC_EVOE_3 0
+#endif
+
+// Channel Event Input
+// Indicates whether channel event reception is enabled or not
+// dmac_evie_3
+#ifndef CONF_DMAC_EVIE_3
+#define CONF_DMAC_EVIE_3 0
+#endif
+
+// Event Input Action
+// <0=> No action
+// <1=> Normal transfer and conditional transfer on strobe trigger
+// <2=> Conditional transfer trigger
+// <3=> Conditional block transfer
+// <4=> Channel suspend operation
+// <5=> Channel resume operation
+// <6=> Skip next block suspend action
+// Defines the event input action
+// dmac_evact_3
+#ifndef CONF_DMAC_EVACT_3
+#define CONF_DMAC_EVACT_3 0
+#endif
+
+// Address Increment Step Size
+// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1
+// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2
+// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4
+// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8
+// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16
+// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32
+// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64
+// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128
+// Defines the address increment step size, applies to source or destination address
+// dmac_stepsize_3
+#ifndef CONF_DMAC_STEPSIZE_3
+#define CONF_DMAC_STEPSIZE_3 0
+#endif
+
+// Step Selection
+// <0=> Step size settings apply to the destination address
+// <1=> Step size settings apply to the source address
+// Defines whether source or destination addresses are using the step size settings
+// dmac_stepsel_3
+#ifndef CONF_DMAC_STEPSEL_3
+#define CONF_DMAC_STEPSEL_3 0
+#endif
+
+// Source Address Increment
+// Indicates whether the source address incrementation is enabled or not
+// dmac_srcinc_3
+#ifndef CONF_DMAC_SRCINC_3
+#define CONF_DMAC_SRCINC_3 0
+#endif
+
+// Destination Address Increment
+// Indicates whether the destination address incrementation is enabled or not
+// dmac_dstinc_3
+#ifndef CONF_DMAC_DSTINC_3
+#define CONF_DMAC_DSTINC_3 0
+#endif
+
+// Beat Size
+// <0=> 8-bit bus transfer
+// <1=> 16-bit bus transfer
+// <2=> 32-bit bus transfer
+// Defines the size of one beat
+// dmac_beatsize_3
+#ifndef CONF_DMAC_BEATSIZE_3
+#define CONF_DMAC_BEATSIZE_3 0
+#endif
+
+// Block Action
+// <0=> Channel will be disabled if it is the last block transfer in the transaction
+// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt
+// <2=> Channel suspend operation is complete
+// <3=> Both channel suspend operation and block interrupt
+// Defines the the DMAC should take after a block transfer has completed
+// dmac_blockact_3
+#ifndef CONF_DMAC_BLOCKACT_3
+#define CONF_DMAC_BLOCKACT_3 0
+#endif
+
+// Event Output Selection
+// <0=> Event generation disabled
+// <1=> Event strobe when block transfer complete
+// <3=> Event strobe when beat transfer complete
+// Defines the event output selection
+// dmac_evosel_3
+#ifndef CONF_DMAC_EVOSEL_3
+#define CONF_DMAC_EVOSEL_3 0
+#endif
+//
+
+// Channel 4 settings
+// dmac_channel_4_settings
+#ifndef CONF_DMAC_CHANNEL_4_SETTINGS
+#define CONF_DMAC_CHANNEL_4_SETTINGS 0
+#endif
+
+// Channel Run in Standby
+// Indicates whether channel 4 is running in standby mode or not
+// dmac_runstdby_4
+#ifndef CONF_DMAC_RUNSTDBY_4
+#define CONF_DMAC_RUNSTDBY_4 0
+#endif
+
+// Trigger action
+// <0=> One trigger required for each block transfer
+// <2=> One trigger required for each beat transfer
+// <3=> One trigger required for each transaction
+// Defines the trigger action used for a transfer
+// dmac_trigact_4
+#ifndef CONF_DMAC_TRIGACT_4
+#define CONF_DMAC_TRIGACT_4 0
+#endif
+
+// Trigger source
+// <0x00=> Only software/event triggers
+// <0x01=> RTC Time Stamp Trigger
+// <0x02=> DSU Debug Communication Channel 0 Trigger
+// <0x03=> DSU Debug Communication Channel 1 Trigger
+// <0x04=> SERCOM0 RX Trigger
+// <0x05=> SERCOM0 TX Trigger
+// <0x06=> SERCOM1 RX Trigger
+// <0x07=> SERCOM1 TX Trigger
+// <0x08=> SERCOM2 RX Trigger
+// <0x09=> SERCOM2 TX Trigger
+// <0x0A=> SERCOM3 RX Trigger
+// <0x0B=> SERCOM3 TX Trigger
+// <0x0C=> SERCOM4 RX Trigger
+// <0x0D=> SERCOM4 TX Trigger
+// <0x0E=> SERCOM5 RX Trigger
+// <0x0F=> SERCOM5 TX Trigger
+// <0x10=> SERCOM6 RX Trigger
+// <0x11=> SERCOM6 TX Trigger
+// <0x12=> SERCOM7 RX Trigger
+// <0x13=> SERCOM7 TX Trigger
+// <0x14=> CAN0 DEBUG Trigger
+// <0x15=> CAN1 DEBUG Trigger
+// <0x16=> TCC0 Overflow Trigger Trigger
+// <0x17=> TCC0 Match/Compare 0 Trigger Trigger
+// <0x18=> TCC0 Match/Compare 1 Trigger Trigger
+// <0x19=> TCC0 Match/Compare 2 Trigger Trigger
+// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger
+// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger
+// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger
+// <0x1D=> TCC1 Overflow Trigger Trigger
+// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger
+// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger
+// <0x20=> TCC1 Match/Compare 2 Trigger Trigger
+// <0x21=> TCC1 Match/Compare 3 Trigger Trigger
+// <0x22=> TCC2 Overflow Trigger Trigger
+// <0x23=> TCC2 Match/Compare 0 Trigger Trigger
+// <0x24=> TCC2 Match/Compare 1 Trigger Trigger
+// <0x25=> TCC2 Match/Compare 2 Trigger Trigger
+// <0x26=> TCC3 Overflow Trigger Trigger
+// <0x27=> TCC3 Match/Compare 0 Trigger Trigger
+// <0x28=> TCC3 Match/Compare 1 Trigger Trigger
+// <0x29=> TCC4 Overflow Trigger Trigger
+// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger
+// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger
+// <0x2C=> TC0 Overflow Trigger
+// <0x2D=> TC0 Match/Compare 0 Trigger
+// <0x2E=> TC0 Match/Compare 1 Trigger
+// <0x2F=> TC1 Overflow Trigger
+// <0x30=> TC1 Match/Compare 0 Trigger
+// <0x31=> TC1 Match/Compare 1 Trigger
+// <0x32=> TC2 Overflow Trigger
+// <0x33=> TC2 Match/Compare 0 Trigger
+// <0x34=> TC2 Match/Compare 1 Trigger
+// <0x35=> TC3 Overflow Trigger
+// <0x36=> TC3 Match/Compare 0 Trigger
+// <0x37=> TC3 Match/Compare 1 Trigger
+// <0x38=> TC4 Overflow Trigger
+// <0x39=> TC4 Match/Compare 0 Trigger
+// <0x3A=> TC4 Match/Compare 1 Trigger
+// <0x3B=> TC5 Overflow Trigger
+// <0x3C=> TC5 Match/Compare 0 Trigger
+// <0x3D=> TC5 Match/Compare 1 Trigger
+// <0x3E=> TC6 Overflow Trigger
+// <0x3F=> TC6 Match/Compare 0 Trigger
+// <0x40=> TC6 Match/Compare 1 Trigger
+// <0x41=> TC7 Overflow Trigger
+// <0x42=> TC7 Match/Compare 0 Trigger
+// <0x43=> TC7 Match/Compare 1 Trigger
+// <0x44=> ADC0 Result Ready Trigger
+// <0x45=> ADC0 Sequencing Trigger
+// <0x46=> ADC1 Result Ready Trigger
+// <0x47=> ADC1 Sequencing Trigger
+// <0x48=> DAC Empty 0 Trigger
+// <0x49=> DAC Empty 1 Trigger
+// <0x4A=> DAC Result Ready 0 Trigger
+// <0x4B=> DAC Result Ready 1 Trigger
+// <0x4C=> I2S Rx 0 Trigger
+// <0x4D=> I2S Rx 1 Trigger
+// <0x4E=> I2S Tx 0 Trigger
+// <0x4F=> I2S Tx 1 Trigger
+// <0x50=> PCC RX Trigger
+// <0x51=> AES Write Trigger
+// <0x52=> AES Read Trigger
+// <0x53=> QSPI Rx Trigger
+// <0x54=> QSPI Tx Trigger
+// Defines the peripheral trigger which is source of the transfer
+// dmac_trifsrc_4
+#ifndef CONF_DMAC_TRIGSRC_4
+#define CONF_DMAC_TRIGSRC_4 0
+#endif
+
+// Channel Arbitration Level
+// <0=> Channel priority 0
+// <1=> Channel priority 1
+// <2=> Channel priority 2
+// <3=> Channel priority 3
+// Defines the arbitration level for this channel
+// dmac_lvl_4
+#ifndef CONF_DMAC_LVL_4
+#define CONF_DMAC_LVL_4 0
+#endif
+
+// Channel Event Output
+// Indicates whether channel event generation is enabled or not
+// dmac_evoe_4
+#ifndef CONF_DMAC_EVOE_4
+#define CONF_DMAC_EVOE_4 0
+#endif
+
+// Channel Event Input
+// Indicates whether channel event reception is enabled or not
+// dmac_evie_4
+#ifndef CONF_DMAC_EVIE_4
+#define CONF_DMAC_EVIE_4 0
+#endif
+
+// Event Input Action
+// <0=> No action
+// <1=> Normal transfer and conditional transfer on strobe trigger
+// <2=> Conditional transfer trigger
+// <3=> Conditional block transfer
+// <4=> Channel suspend operation
+// <5=> Channel resume operation
+// <6=> Skip next block suspend action
+// Defines the event input action
+// dmac_evact_4
+#ifndef CONF_DMAC_EVACT_4
+#define CONF_DMAC_EVACT_4 0
+#endif
+
+// Address Increment Step Size
+// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1
+// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2
+// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4
+// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8
+// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16
+// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32
+// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64
+// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128
+// Defines the address increment step size, applies to source or destination address
+// dmac_stepsize_4
+#ifndef CONF_DMAC_STEPSIZE_4
+#define CONF_DMAC_STEPSIZE_4 0
+#endif
+
+// Step Selection
+// <0=> Step size settings apply to the destination address
+// <1=> Step size settings apply to the source address
+// Defines whether source or destination addresses are using the step size settings
+// dmac_stepsel_4
+#ifndef CONF_DMAC_STEPSEL_4
+#define CONF_DMAC_STEPSEL_4 0
+#endif
+
+// Source Address Increment
+// Indicates whether the source address incrementation is enabled or not
+// dmac_srcinc_4
+#ifndef CONF_DMAC_SRCINC_4
+#define CONF_DMAC_SRCINC_4 0
+#endif
+
+// Destination Address Increment
+// Indicates whether the destination address incrementation is enabled or not
+// dmac_dstinc_4
+#ifndef CONF_DMAC_DSTINC_4
+#define CONF_DMAC_DSTINC_4 0
+#endif
+
+// Beat Size
+// <0=> 8-bit bus transfer
+// <1=> 16-bit bus transfer
+// <2=> 32-bit bus transfer
+// Defines the size of one beat
+// dmac_beatsize_4
+#ifndef CONF_DMAC_BEATSIZE_4
+#define CONF_DMAC_BEATSIZE_4 0
+#endif
+
+// Block Action
+// <0=> Channel will be disabled if it is the last block transfer in the transaction
+// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt
+// <2=> Channel suspend operation is complete
+// <3=> Both channel suspend operation and block interrupt
+// Defines the the DMAC should take after a block transfer has completed
+// dmac_blockact_4
+#ifndef CONF_DMAC_BLOCKACT_4
+#define CONF_DMAC_BLOCKACT_4 0
+#endif
+
+// Event Output Selection
+// <0=> Event generation disabled
+// <1=> Event strobe when block transfer complete
+// <3=> Event strobe when beat transfer complete
+// Defines the event output selection
+// dmac_evosel_4
+#ifndef CONF_DMAC_EVOSEL_4
+#define CONF_DMAC_EVOSEL_4 0
+#endif
+//
+
+// Channel 5 settings
+// dmac_channel_5_settings
+#ifndef CONF_DMAC_CHANNEL_5_SETTINGS
+#define CONF_DMAC_CHANNEL_5_SETTINGS 0
+#endif
+
+// Channel Run in Standby
+// Indicates whether channel 5 is running in standby mode or not
+// dmac_runstdby_5
+#ifndef CONF_DMAC_RUNSTDBY_5
+#define CONF_DMAC_RUNSTDBY_5 0
+#endif
+
+// Trigger action
+// <0=> One trigger required for each block transfer
+// <2=> One trigger required for each beat transfer
+// <3=> One trigger required for each transaction
+// Defines the trigger action used for a transfer
+// dmac_trigact_5
+#ifndef CONF_DMAC_TRIGACT_5
+#define CONF_DMAC_TRIGACT_5 0
+#endif
+
+// Trigger source
+// <0x00=> Only software/event triggers
+// <0x01=> RTC Time Stamp Trigger
+// <0x02=> DSU Debug Communication Channel 0 Trigger
+// <0x03=> DSU Debug Communication Channel 1 Trigger
+// <0x04=> SERCOM0 RX Trigger
+// <0x05=> SERCOM0 TX Trigger
+// <0x06=> SERCOM1 RX Trigger
+// <0x07=> SERCOM1 TX Trigger
+// <0x08=> SERCOM2 RX Trigger
+// <0x09=> SERCOM2 TX Trigger
+// <0x0A=> SERCOM3 RX Trigger
+// <0x0B=> SERCOM3 TX Trigger
+// <0x0C=> SERCOM4 RX Trigger
+// <0x0D=> SERCOM4 TX Trigger
+// <0x0E=> SERCOM5 RX Trigger
+// <0x0F=> SERCOM5 TX Trigger
+// <0x10=> SERCOM6 RX Trigger
+// <0x11=> SERCOM6 TX Trigger
+// <0x12=> SERCOM7 RX Trigger
+// <0x13=> SERCOM7 TX Trigger
+// <0x14=> CAN0 DEBUG Trigger
+// <0x15=> CAN1 DEBUG Trigger
+// <0x16=> TCC0 Overflow Trigger Trigger
+// <0x17=> TCC0 Match/Compare 0 Trigger Trigger
+// <0x18=> TCC0 Match/Compare 1 Trigger Trigger
+// <0x19=> TCC0 Match/Compare 2 Trigger Trigger
+// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger
+// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger
+// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger
+// <0x1D=> TCC1 Overflow Trigger Trigger
+// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger
+// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger
+// <0x20=> TCC1 Match/Compare 2 Trigger Trigger
+// <0x21=> TCC1 Match/Compare 3 Trigger Trigger
+// <0x22=> TCC2 Overflow Trigger Trigger
+// <0x23=> TCC2 Match/Compare 0 Trigger Trigger
+// <0x24=> TCC2 Match/Compare 1 Trigger Trigger
+// <0x25=> TCC2 Match/Compare 2 Trigger Trigger
+// <0x26=> TCC3 Overflow Trigger Trigger
+// <0x27=> TCC3 Match/Compare 0 Trigger Trigger
+// <0x28=> TCC3 Match/Compare 1 Trigger Trigger
+// <0x29=> TCC4 Overflow Trigger Trigger
+// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger
+// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger
+// <0x2C=> TC0 Overflow Trigger
+// <0x2D=> TC0 Match/Compare 0 Trigger
+// <0x2E=> TC0 Match/Compare 1 Trigger
+// <0x2F=> TC1 Overflow Trigger
+// <0x30=> TC1 Match/Compare 0 Trigger
+// <0x31=> TC1 Match/Compare 1 Trigger
+// <0x32=> TC2 Overflow Trigger
+// <0x33=> TC2 Match/Compare 0 Trigger
+// <0x34=> TC2 Match/Compare 1 Trigger
+// <0x35=> TC3 Overflow Trigger
+// <0x36=> TC3 Match/Compare 0 Trigger
+// <0x37=> TC3 Match/Compare 1 Trigger
+// <0x38=> TC4 Overflow Trigger
+// <0x39=> TC4 Match/Compare 0 Trigger
+// <0x3A=> TC4 Match/Compare 1 Trigger
+// <0x3B=> TC5 Overflow Trigger
+// <0x3C=> TC5 Match/Compare 0 Trigger
+// <0x3D=> TC5 Match/Compare 1 Trigger
+// <0x3E=> TC6 Overflow Trigger
+// <0x3F=> TC6 Match/Compare 0 Trigger
+// <0x40=> TC6 Match/Compare 1 Trigger
+// <0x41=> TC7 Overflow Trigger
+// <0x42=> TC7 Match/Compare 0 Trigger
+// <0x43=> TC7 Match/Compare 1 Trigger
+// <0x44=> ADC0 Result Ready Trigger
+// <0x45=> ADC0 Sequencing Trigger
+// <0x46=> ADC1 Result Ready Trigger
+// <0x47=> ADC1 Sequencing Trigger
+// <0x48=> DAC Empty 0 Trigger
+// <0x49=> DAC Empty 1 Trigger
+// <0x4A=> DAC Result Ready 0 Trigger
+// <0x4B=> DAC Result Ready 1 Trigger
+// <0x4C=> I2S Rx 0 Trigger
+// <0x4D=> I2S Rx 1 Trigger
+// <0x4E=> I2S Tx 0 Trigger
+// <0x4F=> I2S Tx 1 Trigger
+// <0x50=> PCC RX Trigger
+// <0x51=> AES Write Trigger
+// <0x52=> AES Read Trigger
+// <0x53=> QSPI Rx Trigger
+// <0x54=> QSPI Tx Trigger
+// Defines the peripheral trigger which is source of the transfer
+// dmac_trifsrc_5
+#ifndef CONF_DMAC_TRIGSRC_5
+#define CONF_DMAC_TRIGSRC_5 0
+#endif
+
+// Channel Arbitration Level
+// <0=> Channel priority 0
+// <1=> Channel priority 1
+// <2=> Channel priority 2
+// <3=> Channel priority 3
+// Defines the arbitration level for this channel
+// dmac_lvl_5
+#ifndef CONF_DMAC_LVL_5
+#define CONF_DMAC_LVL_5 0
+#endif
+
+// Channel Event Output
+// Indicates whether channel event generation is enabled or not
+// dmac_evoe_5
+#ifndef CONF_DMAC_EVOE_5
+#define CONF_DMAC_EVOE_5 0
+#endif
+
+// Channel Event Input
+// Indicates whether channel event reception is enabled or not
+// dmac_evie_5
+#ifndef CONF_DMAC_EVIE_5
+#define CONF_DMAC_EVIE_5 0
+#endif
+
+// Event Input Action
+// <0=> No action
+// <1=> Normal transfer and conditional transfer on strobe trigger
+// <2=> Conditional transfer trigger
+// <3=> Conditional block transfer
+// <4=> Channel suspend operation
+// <5=> Channel resume operation
+// <6=> Skip next block suspend action
+// Defines the event input action
+// dmac_evact_5
+#ifndef CONF_DMAC_EVACT_5
+#define CONF_DMAC_EVACT_5 0
+#endif
+
+// Address Increment Step Size
+// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1
+// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2
+// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4
+// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8
+// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16
+// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32
+// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64
+// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128
+// Defines the address increment step size, applies to source or destination address
+// dmac_stepsize_5
+#ifndef CONF_DMAC_STEPSIZE_5
+#define CONF_DMAC_STEPSIZE_5 0
+#endif
+
+// Step Selection
+// <0=> Step size settings apply to the destination address
+// <1=> Step size settings apply to the source address
+// Defines whether source or destination addresses are using the step size settings
+// dmac_stepsel_5
+#ifndef CONF_DMAC_STEPSEL_5
+#define CONF_DMAC_STEPSEL_5 0
+#endif
+
+// Source Address Increment
+// Indicates whether the source address incrementation is enabled or not
+// dmac_srcinc_5
+#ifndef CONF_DMAC_SRCINC_5
+#define CONF_DMAC_SRCINC_5 0
+#endif
+
+// Destination Address Increment
+// Indicates whether the destination address incrementation is enabled or not
+// dmac_dstinc_5
+#ifndef CONF_DMAC_DSTINC_5
+#define CONF_DMAC_DSTINC_5 0
+#endif
+
+// Beat Size
+// <0=> 8-bit bus transfer
+// <1=> 16-bit bus transfer
+// <2=> 32-bit bus transfer
+// Defines the size of one beat
+// dmac_beatsize_5
+#ifndef CONF_DMAC_BEATSIZE_5
+#define CONF_DMAC_BEATSIZE_5 0
+#endif
+
+// Block Action
+// <0=> Channel will be disabled if it is the last block transfer in the transaction
+// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt
+// <2=> Channel suspend operation is complete
+// <3=> Both channel suspend operation and block interrupt
+// Defines the the DMAC should take after a block transfer has completed
+// dmac_blockact_5
+#ifndef CONF_DMAC_BLOCKACT_5
+#define CONF_DMAC_BLOCKACT_5 0
+#endif
+
+// Event Output Selection
+// <0=> Event generation disabled
+// <1=> Event strobe when block transfer complete
+// <3=> Event strobe when beat transfer complete
+// Defines the event output selection
+// dmac_evosel_5
+#ifndef CONF_DMAC_EVOSEL_5
+#define CONF_DMAC_EVOSEL_5 0
+#endif
+//
+
+// Channel 6 settings
+// dmac_channel_6_settings
+#ifndef CONF_DMAC_CHANNEL_6_SETTINGS
+#define CONF_DMAC_CHANNEL_6_SETTINGS 0
+#endif
+
+// Channel Run in Standby
+// Indicates whether channel 6 is running in standby mode or not
+// dmac_runstdby_6
+#ifndef CONF_DMAC_RUNSTDBY_6
+#define CONF_DMAC_RUNSTDBY_6 0
+#endif
+
+// Trigger action
+// <0=> One trigger required for each block transfer
+// <2=> One trigger required for each beat transfer
+// <3=> One trigger required for each transaction
+// Defines the trigger action used for a transfer
+// dmac_trigact_6
+#ifndef CONF_DMAC_TRIGACT_6
+#define CONF_DMAC_TRIGACT_6 0
+#endif
+
+// Trigger source
+// <0x00=> Only software/event triggers
+// <0x01=> RTC Time Stamp Trigger
+// <0x02=> DSU Debug Communication Channel 0 Trigger
+// <0x03=> DSU Debug Communication Channel 1 Trigger
+// <0x04=> SERCOM0 RX Trigger
+// <0x05=> SERCOM0 TX Trigger
+// <0x06=> SERCOM1 RX Trigger
+// <0x07=> SERCOM1 TX Trigger
+// <0x08=> SERCOM2 RX Trigger
+// <0x09=> SERCOM2 TX Trigger
+// <0x0A=> SERCOM3 RX Trigger
+// <0x0B=> SERCOM3 TX Trigger
+// <0x0C=> SERCOM4 RX Trigger
+// <0x0D=> SERCOM4 TX Trigger
+// <0x0E=> SERCOM5 RX Trigger
+// <0x0F=> SERCOM5 TX Trigger
+// <0x10=> SERCOM6 RX Trigger
+// <0x11=> SERCOM6 TX Trigger
+// <0x12=> SERCOM7 RX Trigger
+// <0x13=> SERCOM7 TX Trigger
+// <0x14=> CAN0 DEBUG Trigger
+// <0x15=> CAN1 DEBUG Trigger
+// <0x16=> TCC0 Overflow Trigger Trigger
+// <0x17=> TCC0 Match/Compare 0 Trigger Trigger
+// <0x18=> TCC0 Match/Compare 1 Trigger Trigger
+// <0x19=> TCC0 Match/Compare 2 Trigger Trigger
+// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger
+// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger
+// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger
+// <0x1D=> TCC1 Overflow Trigger Trigger
+// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger
+// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger
+// <0x20=> TCC1 Match/Compare 2 Trigger Trigger
+// <0x21=> TCC1 Match/Compare 3 Trigger Trigger
+// <0x22=> TCC2 Overflow Trigger Trigger
+// <0x23=> TCC2 Match/Compare 0 Trigger Trigger
+// <0x24=> TCC2 Match/Compare 1 Trigger Trigger
+// <0x25=> TCC2 Match/Compare 2 Trigger Trigger
+// <0x26=> TCC3 Overflow Trigger Trigger
+// <0x27=> TCC3 Match/Compare 0 Trigger Trigger
+// <0x28=> TCC3 Match/Compare 1 Trigger Trigger
+// <0x29=> TCC4 Overflow Trigger Trigger
+// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger
+// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger
+// <0x2C=> TC0 Overflow Trigger
+// <0x2D=> TC0 Match/Compare 0 Trigger
+// <0x2E=> TC0 Match/Compare 1 Trigger
+// <0x2F=> TC1 Overflow Trigger
+// <0x30=> TC1 Match/Compare 0 Trigger
+// <0x31=> TC1 Match/Compare 1 Trigger
+// <0x32=> TC2 Overflow Trigger
+// <0x33=> TC2 Match/Compare 0 Trigger
+// <0x34=> TC2 Match/Compare 1 Trigger
+// <0x35=> TC3 Overflow Trigger
+// <0x36=> TC3 Match/Compare 0 Trigger
+// <0x37=> TC3 Match/Compare 1 Trigger
+// <0x38=> TC4 Overflow Trigger
+// <0x39=> TC4 Match/Compare 0 Trigger
+// <0x3A=> TC4 Match/Compare 1 Trigger
+// <0x3B=> TC5 Overflow Trigger
+// <0x3C=> TC5 Match/Compare 0 Trigger
+// <0x3D=> TC5 Match/Compare 1 Trigger
+// <0x3E=> TC6 Overflow Trigger
+// <0x3F=> TC6 Match/Compare 0 Trigger
+// <0x40=> TC6 Match/Compare 1 Trigger
+// <0x41=> TC7 Overflow Trigger
+// <0x42=> TC7 Match/Compare 0 Trigger
+// <0x43=> TC7 Match/Compare 1 Trigger
+// <0x44=> ADC0 Result Ready Trigger
+// <0x45=> ADC0 Sequencing Trigger
+// <0x46=> ADC1 Result Ready Trigger
+// <0x47=> ADC1 Sequencing Trigger
+// <0x48=> DAC Empty 0 Trigger
+// <0x49=> DAC Empty 1 Trigger
+// <0x4A=> DAC Result Ready 0 Trigger
+// <0x4B=> DAC Result Ready 1 Trigger
+// <0x4C=> I2S Rx 0 Trigger
+// <0x4D=> I2S Rx 1 Trigger
+// <0x4E=> I2S Tx 0 Trigger
+// <0x4F=> I2S Tx 1 Trigger
+// <0x50=> PCC RX Trigger
+// <0x51=> AES Write Trigger
+// <0x52=> AES Read Trigger
+// <0x53=> QSPI Rx Trigger
+// <0x54=> QSPI Tx Trigger
+// Defines the peripheral trigger which is source of the transfer
+// dmac_trifsrc_6
+#ifndef CONF_DMAC_TRIGSRC_6
+#define CONF_DMAC_TRIGSRC_6 0
+#endif
+
+// Channel Arbitration Level
+// <0=> Channel priority 0
+// <1=> Channel priority 1
+// <2=> Channel priority 2
+// <3=> Channel priority 3
+// Defines the arbitration level for this channel
+// dmac_lvl_6
+#ifndef CONF_DMAC_LVL_6
+#define CONF_DMAC_LVL_6 0
+#endif
+
+// Channel Event Output
+// Indicates whether channel event generation is enabled or not
+// dmac_evoe_6
+#ifndef CONF_DMAC_EVOE_6
+#define CONF_DMAC_EVOE_6 0
+#endif
+
+// Channel Event Input
+// Indicates whether channel event reception is enabled or not
+// dmac_evie_6
+#ifndef CONF_DMAC_EVIE_6
+#define CONF_DMAC_EVIE_6 0
+#endif
+
+// Event Input Action
+// <0=> No action
+// <1=> Normal transfer and conditional transfer on strobe trigger
+// <2=> Conditional transfer trigger
+// <3=> Conditional block transfer
+// <4=> Channel suspend operation
+// <5=> Channel resume operation
+// <6=> Skip next block suspend action
+// Defines the event input action
+// dmac_evact_6
+#ifndef CONF_DMAC_EVACT_6
+#define CONF_DMAC_EVACT_6 0
+#endif
+
+// Address Increment Step Size
+// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1
+// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2
+// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4
+// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8
+// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16
+// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32
+// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64
+// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128
+// Defines the address increment step size, applies to source or destination address
+// dmac_stepsize_6
+#ifndef CONF_DMAC_STEPSIZE_6
+#define CONF_DMAC_STEPSIZE_6 0
+#endif
+
+// Step Selection
+// <0=> Step size settings apply to the destination address
+// <1=> Step size settings apply to the source address
+// Defines whether source or destination addresses are using the step size settings
+// dmac_stepsel_6
+#ifndef CONF_DMAC_STEPSEL_6
+#define CONF_DMAC_STEPSEL_6 0
+#endif
+
+// Source Address Increment
+// Indicates whether the source address incrementation is enabled or not
+// dmac_srcinc_6
+#ifndef CONF_DMAC_SRCINC_6
+#define CONF_DMAC_SRCINC_6 0
+#endif
+
+// Destination Address Increment
+// Indicates whether the destination address incrementation is enabled or not
+// dmac_dstinc_6
+#ifndef CONF_DMAC_DSTINC_6
+#define CONF_DMAC_DSTINC_6 0
+#endif
+
+// Beat Size
+// <0=> 8-bit bus transfer
+// <1=> 16-bit bus transfer
+// <2=> 32-bit bus transfer
+// Defines the size of one beat
+// dmac_beatsize_6
+#ifndef CONF_DMAC_BEATSIZE_6
+#define CONF_DMAC_BEATSIZE_6 0
+#endif
+
+// Block Action
+// <0=> Channel will be disabled if it is the last block transfer in the transaction
+// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt
+// <2=> Channel suspend operation is complete
+// <3=> Both channel suspend operation and block interrupt
+// Defines the the DMAC should take after a block transfer has completed
+// dmac_blockact_6
+#ifndef CONF_DMAC_BLOCKACT_6
+#define CONF_DMAC_BLOCKACT_6 0
+#endif
+
+// Event Output Selection
+// <0=> Event generation disabled
+// <1=> Event strobe when block transfer complete
+// <3=> Event strobe when beat transfer complete
+// Defines the event output selection
+// dmac_evosel_6
+#ifndef CONF_DMAC_EVOSEL_6
+#define CONF_DMAC_EVOSEL_6 0
+#endif
+//
+
+// Channel 7 settings
+// dmac_channel_7_settings
+#ifndef CONF_DMAC_CHANNEL_7_SETTINGS
+#define CONF_DMAC_CHANNEL_7_SETTINGS 0
+#endif
+
+// Channel Run in Standby
+// Indicates whether channel 7 is running in standby mode or not
+// dmac_runstdby_7
+#ifndef CONF_DMAC_RUNSTDBY_7
+#define CONF_DMAC_RUNSTDBY_7 0
+#endif
+
+// Trigger action
+// <0=> One trigger required for each block transfer
+// <2=> One trigger required for each beat transfer
+// <3=> One trigger required for each transaction
+// Defines the trigger action used for a transfer
+// dmac_trigact_7
+#ifndef CONF_DMAC_TRIGACT_7
+#define CONF_DMAC_TRIGACT_7 0
+#endif
+
+// Trigger source
+// <0x00=> Only software/event triggers
+// <0x01=> RTC Time Stamp Trigger
+// <0x02=> DSU Debug Communication Channel 0 Trigger
+// <0x03=> DSU Debug Communication Channel 1 Trigger
+// <0x04=> SERCOM0 RX Trigger
+// <0x05=> SERCOM0 TX Trigger
+// <0x06=> SERCOM1 RX Trigger
+// <0x07=> SERCOM1 TX Trigger
+// <0x08=> SERCOM2 RX Trigger
+// <0x09=> SERCOM2 TX Trigger
+// <0x0A=> SERCOM3 RX Trigger
+// <0x0B=> SERCOM3 TX Trigger
+// <0x0C=> SERCOM4 RX Trigger
+// <0x0D=> SERCOM4 TX Trigger
+// <0x0E=> SERCOM5 RX Trigger
+// <0x0F=> SERCOM5 TX Trigger
+// <0x10=> SERCOM6 RX Trigger
+// <0x11=> SERCOM6 TX Trigger
+// <0x12=> SERCOM7 RX Trigger
+// <0x13=> SERCOM7 TX Trigger
+// <0x14=> CAN0 DEBUG Trigger
+// <0x15=> CAN1 DEBUG Trigger
+// <0x16=> TCC0 Overflow Trigger Trigger
+// <0x17=> TCC0 Match/Compare 0 Trigger Trigger
+// <0x18=> TCC0 Match/Compare 1 Trigger Trigger
+// <0x19=> TCC0 Match/Compare 2 Trigger Trigger
+// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger
+// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger
+// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger
+// <0x1D=> TCC1 Overflow Trigger Trigger
+// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger
+// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger
+// <0x20=> TCC1 Match/Compare 2 Trigger Trigger
+// <0x21=> TCC1 Match/Compare 3 Trigger Trigger
+// <0x22=> TCC2 Overflow Trigger Trigger
+// <0x23=> TCC2 Match/Compare 0 Trigger Trigger
+// <0x24=> TCC2 Match/Compare 1 Trigger Trigger
+// <0x25=> TCC2 Match/Compare 2 Trigger Trigger
+// <0x26=> TCC3 Overflow Trigger Trigger
+// <0x27=> TCC3 Match/Compare 0 Trigger Trigger
+// <0x28=> TCC3 Match/Compare 1 Trigger Trigger
+// <0x29=> TCC4 Overflow Trigger Trigger
+// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger
+// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger
+// <0x2C=> TC0 Overflow Trigger
+// <0x2D=> TC0 Match/Compare 0 Trigger
+// <0x2E=> TC0 Match/Compare 1 Trigger
+// <0x2F=> TC1 Overflow Trigger
+// <0x30=> TC1 Match/Compare 0 Trigger
+// <0x31=> TC1 Match/Compare 1 Trigger
+// <0x32=> TC2 Overflow Trigger
+// <0x33=> TC2 Match/Compare 0 Trigger
+// <0x34=> TC2 Match/Compare 1 Trigger
+// <0x35=> TC3 Overflow Trigger
+// <0x36=> TC3 Match/Compare 0 Trigger
+// <0x37=> TC3 Match/Compare 1 Trigger
+// <0x38=> TC4 Overflow Trigger
+// <0x39=> TC4 Match/Compare 0 Trigger
+// <0x3A=> TC4 Match/Compare 1 Trigger
+// <0x3B=> TC5 Overflow Trigger
+// <0x3C=> TC5 Match/Compare 0 Trigger
+// <0x3D=> TC5 Match/Compare 1 Trigger
+// <0x3E=> TC6 Overflow Trigger
+// <0x3F=> TC6 Match/Compare 0 Trigger
+// <0x40=> TC6 Match/Compare 1 Trigger
+// <0x41=> TC7 Overflow Trigger
+// <0x42=> TC7 Match/Compare 0 Trigger
+// <0x43=> TC7 Match/Compare 1 Trigger
+// <0x44=> ADC0 Result Ready Trigger
+// <0x45=> ADC0 Sequencing Trigger
+// <0x46=> ADC1 Result Ready Trigger
+// <0x47=> ADC1 Sequencing Trigger
+// <0x48=> DAC Empty 0 Trigger
+// <0x49=> DAC Empty 1 Trigger
+// <0x4A=> DAC Result Ready 0 Trigger
+// <0x4B=> DAC Result Ready 1 Trigger
+// <0x4C=> I2S Rx 0 Trigger
+// <0x4D=> I2S Rx 1 Trigger
+// <0x4E=> I2S Tx 0 Trigger
+// <0x4F=> I2S Tx 1 Trigger
+// <0x50=> PCC RX Trigger
+// <0x51=> AES Write Trigger
+// <0x52=> AES Read Trigger
+// <0x53=> QSPI Rx Trigger
+// <0x54=> QSPI Tx Trigger
+// Defines the peripheral trigger which is source of the transfer
+// dmac_trifsrc_7
+#ifndef CONF_DMAC_TRIGSRC_7
+#define CONF_DMAC_TRIGSRC_7 0
+#endif
+
+// Channel Arbitration Level
+// <0=> Channel priority 0
+// <1=> Channel priority 1
+// <2=> Channel priority 2
+// <3=> Channel priority 3
+// Defines the arbitration level for this channel
+// dmac_lvl_7
+#ifndef CONF_DMAC_LVL_7
+#define CONF_DMAC_LVL_7 0
+#endif
+
+// Channel Event Output
+// Indicates whether channel event generation is enabled or not
+// dmac_evoe_7
+#ifndef CONF_DMAC_EVOE_7
+#define CONF_DMAC_EVOE_7 0
+#endif
+
+// Channel Event Input
+// Indicates whether channel event reception is enabled or not
+// dmac_evie_7
+#ifndef CONF_DMAC_EVIE_7
+#define CONF_DMAC_EVIE_7 0
+#endif
+
+// Event Input Action
+// <0=> No action
+// <1=> Normal transfer and conditional transfer on strobe trigger
+// <2=> Conditional transfer trigger
+// <3=> Conditional block transfer
+// <4=> Channel suspend operation
+// <5=> Channel resume operation
+// <6=> Skip next block suspend action
+// Defines the event input action
+// dmac_evact_7
+#ifndef CONF_DMAC_EVACT_7
+#define CONF_DMAC_EVACT_7 0
+#endif
+
+// Address Increment Step Size
+// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1
+// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2
+// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4
+// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8
+// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16
+// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32
+// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64
+// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128
+// Defines the address increment step size, applies to source or destination address
+// dmac_stepsize_7
+#ifndef CONF_DMAC_STEPSIZE_7
+#define CONF_DMAC_STEPSIZE_7 0
+#endif
+
+// Step Selection
+// <0=> Step size settings apply to the destination address
+// <1=> Step size settings apply to the source address
+// Defines whether source or destination addresses are using the step size settings
+// dmac_stepsel_7
+#ifndef CONF_DMAC_STEPSEL_7
+#define CONF_DMAC_STEPSEL_7 0
+#endif
+
+// Source Address Increment
+// Indicates whether the source address incrementation is enabled or not
+// dmac_srcinc_7
+#ifndef CONF_DMAC_SRCINC_7
+#define CONF_DMAC_SRCINC_7 0
+#endif
+
+// Destination Address Increment
+// Indicates whether the destination address incrementation is enabled or not
+// dmac_dstinc_7
+#ifndef CONF_DMAC_DSTINC_7
+#define CONF_DMAC_DSTINC_7 0
+#endif
+
+// Beat Size
+// <0=> 8-bit bus transfer
+// <1=> 16-bit bus transfer
+// <2=> 32-bit bus transfer
+// Defines the size of one beat
+// dmac_beatsize_7
+#ifndef CONF_DMAC_BEATSIZE_7
+#define CONF_DMAC_BEATSIZE_7 0
+#endif
+
+// Block Action
+// <0=> Channel will be disabled if it is the last block transfer in the transaction
+// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt
+// <2=> Channel suspend operation is complete
+// <3=> Both channel suspend operation and block interrupt
+// Defines the the DMAC should take after a block transfer has completed
+// dmac_blockact_7
+#ifndef CONF_DMAC_BLOCKACT_7
+#define CONF_DMAC_BLOCKACT_7 0
+#endif
+
+// Event Output Selection
+// <0=> Event generation disabled
+// <1=> Event strobe when block transfer complete
+// <3=> Event strobe when beat transfer complete
+// Defines the event output selection
+// dmac_evosel_7
+#ifndef CONF_DMAC_EVOSEL_7
+#define CONF_DMAC_EVOSEL_7 0
+#endif
+//
+
+// Channel 8 settings
+// dmac_channel_8_settings
+#ifndef CONF_DMAC_CHANNEL_8_SETTINGS
+#define CONF_DMAC_CHANNEL_8_SETTINGS 0
+#endif
+
+// Channel Run in Standby
+// Indicates whether channel 8 is running in standby mode or not
+// dmac_runstdby_8
+#ifndef CONF_DMAC_RUNSTDBY_8
+#define CONF_DMAC_RUNSTDBY_8 0
+#endif
+
+// Trigger action
+// <0=> One trigger required for each block transfer
+// <2=> One trigger required for each beat transfer
+// <3=> One trigger required for each transaction
+// Defines the trigger action used for a transfer
+// dmac_trigact_8
+#ifndef CONF_DMAC_TRIGACT_8
+#define CONF_DMAC_TRIGACT_8 0
+#endif
+
+// Trigger source
+// <0x00=> Only software/event triggers
+// <0x01=> RTC Time Stamp Trigger
+// <0x02=> DSU Debug Communication Channel 0 Trigger
+// <0x03=> DSU Debug Communication Channel 1 Trigger
+// <0x04=> SERCOM0 RX Trigger
+// <0x05=> SERCOM0 TX Trigger
+// <0x06=> SERCOM1 RX Trigger
+// <0x07=> SERCOM1 TX Trigger
+// <0x08=> SERCOM2 RX Trigger
+// <0x09=> SERCOM2 TX Trigger
+// <0x0A=> SERCOM3 RX Trigger
+// <0x0B=> SERCOM3 TX Trigger
+// <0x0C=> SERCOM4 RX Trigger
+// <0x0D=> SERCOM4 TX Trigger
+// <0x0E=> SERCOM5 RX Trigger
+// <0x0F=> SERCOM5 TX Trigger
+// <0x10=> SERCOM6 RX Trigger
+// <0x11=> SERCOM6 TX Trigger
+// <0x12=> SERCOM7 RX Trigger
+// <0x13=> SERCOM7 TX Trigger
+// <0x14=> CAN0 DEBUG Trigger
+// <0x15=> CAN1 DEBUG Trigger
+// <0x16=> TCC0 Overflow Trigger Trigger
+// <0x17=> TCC0 Match/Compare 0 Trigger Trigger
+// <0x18=> TCC0 Match/Compare 1 Trigger Trigger
+// <0x19=> TCC0 Match/Compare 2 Trigger Trigger
+// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger
+// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger
+// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger
+// <0x1D=> TCC1 Overflow Trigger Trigger
+// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger
+// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger
+// <0x20=> TCC1 Match/Compare 2 Trigger Trigger
+// <0x21=> TCC1 Match/Compare 3 Trigger Trigger
+// <0x22=> TCC2 Overflow Trigger Trigger
+// <0x23=> TCC2 Match/Compare 0 Trigger Trigger
+// <0x24=> TCC2 Match/Compare 1 Trigger Trigger
+// <0x25=> TCC2 Match/Compare 2 Trigger Trigger
+// <0x26=> TCC3 Overflow Trigger Trigger
+// <0x27=> TCC3 Match/Compare 0 Trigger Trigger
+// <0x28=> TCC3 Match/Compare 1 Trigger Trigger
+// <0x29=> TCC4 Overflow Trigger Trigger
+// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger
+// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger
+// <0x2C=> TC0 Overflow Trigger
+// <0x2D=> TC0 Match/Compare 0 Trigger
+// <0x2E=> TC0 Match/Compare 1 Trigger
+// <0x2F=> TC1 Overflow Trigger
+// <0x30=> TC1 Match/Compare 0 Trigger
+// <0x31=> TC1 Match/Compare 1 Trigger
+// <0x32=> TC2 Overflow Trigger
+// <0x33=> TC2 Match/Compare 0 Trigger
+// <0x34=> TC2 Match/Compare 1 Trigger
+// <0x35=> TC3 Overflow Trigger
+// <0x36=> TC3 Match/Compare 0 Trigger
+// <0x37=> TC3 Match/Compare 1 Trigger
+// <0x38=> TC4 Overflow Trigger
+// <0x39=> TC4 Match/Compare 0 Trigger
+// <0x3A=> TC4 Match/Compare 1 Trigger
+// <0x3B=> TC5 Overflow Trigger
+// <0x3C=> TC5 Match/Compare 0 Trigger
+// <0x3D=> TC5 Match/Compare 1 Trigger
+// <0x3E=> TC6 Overflow Trigger
+// <0x3F=> TC6 Match/Compare 0 Trigger
+// <0x40=> TC6 Match/Compare 1 Trigger
+// <0x41=> TC7 Overflow Trigger
+// <0x42=> TC7 Match/Compare 0 Trigger
+// <0x43=> TC7 Match/Compare 1 Trigger
+// <0x44=> ADC0 Result Ready Trigger
+// <0x45=> ADC0 Sequencing Trigger
+// <0x46=> ADC1 Result Ready Trigger
+// <0x47=> ADC1 Sequencing Trigger
+// <0x48=> DAC Empty 0 Trigger
+// <0x49=> DAC Empty 1 Trigger
+// <0x4A=> DAC Result Ready 0 Trigger
+// <0x4B=> DAC Result Ready 1 Trigger
+// <0x4C=> I2S Rx 0 Trigger
+// <0x4D=> I2S Rx 1 Trigger
+// <0x4E=> I2S Tx 0 Trigger
+// <0x4F=> I2S Tx 1 Trigger
+// <0x50=> PCC RX Trigger
+// <0x51=> AES Write Trigger
+// <0x52=> AES Read Trigger
+// <0x53=> QSPI Rx Trigger
+// <0x54=> QSPI Tx Trigger
+// Defines the peripheral trigger which is source of the transfer
+// dmac_trifsrc_8
+#ifndef CONF_DMAC_TRIGSRC_8
+#define CONF_DMAC_TRIGSRC_8 0
+#endif
+
+// Channel Arbitration Level
+// <0=> Channel priority 0
+// <1=> Channel priority 1
+// <2=> Channel priority 2
+// <3=> Channel priority 3
+// Defines the arbitration level for this channel
+// dmac_lvl_8
+#ifndef CONF_DMAC_LVL_8
+#define CONF_DMAC_LVL_8 0
+#endif
+
+// Channel Event Output
+// Indicates whether channel event generation is enabled or not
+// dmac_evoe_8
+#ifndef CONF_DMAC_EVOE_8
+#define CONF_DMAC_EVOE_8 0
+#endif
+
+// Channel Event Input
+// Indicates whether channel event reception is enabled or not
+// dmac_evie_8
+#ifndef CONF_DMAC_EVIE_8
+#define CONF_DMAC_EVIE_8 0
+#endif
+
+// Event Input Action
+// <0=> No action
+// <1=> Normal transfer and conditional transfer on strobe trigger
+// <2=> Conditional transfer trigger
+// <3=> Conditional block transfer
+// <4=> Channel suspend operation
+// <5=> Channel resume operation
+// <6=> Skip next block suspend action
+// Defines the event input action
+// dmac_evact_8
+#ifndef CONF_DMAC_EVACT_8
+#define CONF_DMAC_EVACT_8 0
+#endif
+
+// Address Increment Step Size
+// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1
+// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2
+// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4
+// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8
+// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16
+// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32
+// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64
+// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128
+// Defines the address increment step size, applies to source or destination address
+// dmac_stepsize_8
+#ifndef CONF_DMAC_STEPSIZE_8
+#define CONF_DMAC_STEPSIZE_8 0
+#endif
+
+// Step Selection
+// <0=> Step size settings apply to the destination address
+// <1=> Step size settings apply to the source address
+// Defines whether source or destination addresses are using the step size settings
+// dmac_stepsel_8
+#ifndef CONF_DMAC_STEPSEL_8
+#define CONF_DMAC_STEPSEL_8 0
+#endif
+
+// Source Address Increment
+// Indicates whether the source address incrementation is enabled or not
+// dmac_srcinc_8
+#ifndef CONF_DMAC_SRCINC_8
+#define CONF_DMAC_SRCINC_8 0
+#endif
+
+// Destination Address Increment
+// Indicates whether the destination address incrementation is enabled or not
+// dmac_dstinc_8
+#ifndef CONF_DMAC_DSTINC_8
+#define CONF_DMAC_DSTINC_8 0
+#endif
+
+// Beat Size
+// <0=> 8-bit bus transfer
+// <1=> 16-bit bus transfer
+// <2=> 32-bit bus transfer
+// Defines the size of one beat
+// dmac_beatsize_8
+#ifndef CONF_DMAC_BEATSIZE_8
+#define CONF_DMAC_BEATSIZE_8 0
+#endif
+
+// Block Action
+// <0=> Channel will be disabled if it is the last block transfer in the transaction
+// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt
+// <2=> Channel suspend operation is complete
+// <3=> Both channel suspend operation and block interrupt
+// Defines the the DMAC should take after a block transfer has completed
+// dmac_blockact_8
+#ifndef CONF_DMAC_BLOCKACT_8
+#define CONF_DMAC_BLOCKACT_8 0
+#endif
+
+// Event Output Selection
+// <0=> Event generation disabled
+// <1=> Event strobe when block transfer complete
+// <3=> Event strobe when beat transfer complete
+// Defines the event output selection
+// dmac_evosel_8
+#ifndef CONF_DMAC_EVOSEL_8
+#define CONF_DMAC_EVOSEL_8 0
+#endif
+//
+
+// Channel 9 settings
+// dmac_channel_9_settings
+#ifndef CONF_DMAC_CHANNEL_9_SETTINGS
+#define CONF_DMAC_CHANNEL_9_SETTINGS 0
+#endif
+
+// Channel Run in Standby
+// Indicates whether channel 9 is running in standby mode or not
+// dmac_runstdby_9
+#ifndef CONF_DMAC_RUNSTDBY_9
+#define CONF_DMAC_RUNSTDBY_9 0
+#endif
+
+// Trigger action
+// <0=> One trigger required for each block transfer
+// <2=> One trigger required for each beat transfer
+// <3=> One trigger required for each transaction
+// Defines the trigger action used for a transfer
+// dmac_trigact_9
+#ifndef CONF_DMAC_TRIGACT_9
+#define CONF_DMAC_TRIGACT_9 0
+#endif
+
+// Trigger source
+// <0x00=> Only software/event triggers
+// <0x01=> RTC Time Stamp Trigger
+// <0x02=> DSU Debug Communication Channel 0 Trigger
+// <0x03=> DSU Debug Communication Channel 1 Trigger
+// <0x04=> SERCOM0 RX Trigger
+// <0x05=> SERCOM0 TX Trigger
+// <0x06=> SERCOM1 RX Trigger
+// <0x07=> SERCOM1 TX Trigger
+// <0x08=> SERCOM2 RX Trigger
+// <0x09=> SERCOM2 TX Trigger
+// <0x0A=> SERCOM3 RX Trigger
+// <0x0B=> SERCOM3 TX Trigger
+// <0x0C=> SERCOM4 RX Trigger
+// <0x0D=> SERCOM4 TX Trigger
+// <0x0E=> SERCOM5 RX Trigger
+// <0x0F=> SERCOM5 TX Trigger
+// <0x10=> SERCOM6 RX Trigger
+// <0x11=> SERCOM6 TX Trigger
+// <0x12=> SERCOM7 RX Trigger
+// <0x13=> SERCOM7 TX Trigger
+// <0x14=> CAN0 DEBUG Trigger
+// <0x15=> CAN1 DEBUG Trigger
+// <0x16=> TCC0 Overflow Trigger Trigger
+// <0x17=> TCC0 Match/Compare 0 Trigger Trigger
+// <0x18=> TCC0 Match/Compare 1 Trigger Trigger
+// <0x19=> TCC0 Match/Compare 2 Trigger Trigger
+// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger
+// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger
+// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger
+// <0x1D=> TCC1 Overflow Trigger Trigger
+// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger
+// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger
+// <0x20=> TCC1 Match/Compare 2 Trigger Trigger
+// <0x21=> TCC1 Match/Compare 3 Trigger Trigger
+// <0x22=> TCC2 Overflow Trigger Trigger
+// <0x23=> TCC2 Match/Compare 0 Trigger Trigger
+// <0x24=> TCC2 Match/Compare 1 Trigger Trigger
+// <0x25=> TCC2 Match/Compare 2 Trigger Trigger
+// <0x26=> TCC3 Overflow Trigger Trigger
+// <0x27=> TCC3 Match/Compare 0 Trigger Trigger
+// <0x28=> TCC3 Match/Compare 1 Trigger Trigger
+// <0x29=> TCC4 Overflow Trigger Trigger
+// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger
+// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger
+// <0x2C=> TC0 Overflow Trigger
+// <0x2D=> TC0 Match/Compare 0 Trigger
+// <0x2E=> TC0 Match/Compare 1 Trigger
+// <0x2F=> TC1 Overflow Trigger
+// <0x30=> TC1 Match/Compare 0 Trigger
+// <0x31=> TC1 Match/Compare 1 Trigger
+// <0x32=> TC2 Overflow Trigger
+// <0x33=> TC2 Match/Compare 0 Trigger
+// <0x34=> TC2 Match/Compare 1 Trigger
+// <0x35=> TC3 Overflow Trigger
+// <0x36=> TC3 Match/Compare 0 Trigger
+// <0x37=> TC3 Match/Compare 1 Trigger
+// <0x38=> TC4 Overflow Trigger
+// <0x39=> TC4 Match/Compare 0 Trigger
+// <0x3A=> TC4 Match/Compare 1 Trigger
+// <0x3B=> TC5 Overflow Trigger
+// <0x3C=> TC5 Match/Compare 0 Trigger
+// <0x3D=> TC5 Match/Compare 1 Trigger
+// <0x3E=> TC6 Overflow Trigger
+// <0x3F=> TC6 Match/Compare 0 Trigger
+// <0x40=> TC6 Match/Compare 1 Trigger
+// <0x41=> TC7 Overflow Trigger
+// <0x42=> TC7 Match/Compare 0 Trigger
+// <0x43=> TC7 Match/Compare 1 Trigger
+// <0x44=> ADC0 Result Ready Trigger
+// <0x45=> ADC0 Sequencing Trigger
+// <0x46=> ADC1 Result Ready Trigger
+// <0x47=> ADC1 Sequencing Trigger
+// <0x48=> DAC Empty 0 Trigger
+// <0x49=> DAC Empty 1 Trigger
+// <0x4A=> DAC Result Ready 0 Trigger
+// <0x4B=> DAC Result Ready 1 Trigger
+// <0x4C=> I2S Rx 0 Trigger
+// <0x4D=> I2S Rx 1 Trigger
+// <0x4E=> I2S Tx 0 Trigger
+// <0x4F=> I2S Tx 1 Trigger
+// <0x50=> PCC RX Trigger
+// <0x51=> AES Write Trigger
+// <0x52=> AES Read Trigger
+// <0x53=> QSPI Rx Trigger
+// <0x54=> QSPI Tx Trigger
+// Defines the peripheral trigger which is source of the transfer
+// dmac_trifsrc_9
+#ifndef CONF_DMAC_TRIGSRC_9
+#define CONF_DMAC_TRIGSRC_9 0
+#endif
+
+// Channel Arbitration Level
+// <0=> Channel priority 0
+// <1=> Channel priority 1
+// <2=> Channel priority 2
+// <3=> Channel priority 3
+// Defines the arbitration level for this channel
+// dmac_lvl_9
+#ifndef CONF_DMAC_LVL_9
+#define CONF_DMAC_LVL_9 0
+#endif
+
+// Channel Event Output
+// Indicates whether channel event generation is enabled or not
+// dmac_evoe_9
+#ifndef CONF_DMAC_EVOE_9
+#define CONF_DMAC_EVOE_9 0
+#endif
+
+// Channel Event Input
+// Indicates whether channel event reception is enabled or not
+// dmac_evie_9
+#ifndef CONF_DMAC_EVIE_9
+#define CONF_DMAC_EVIE_9 0
+#endif
+
+// Event Input Action
+// <0=> No action
+// <1=> Normal transfer and conditional transfer on strobe trigger
+// <2=> Conditional transfer trigger
+// <3=> Conditional block transfer
+// <4=> Channel suspend operation
+// <5=> Channel resume operation
+// <6=> Skip next block suspend action
+// Defines the event input action
+// dmac_evact_9
+#ifndef CONF_DMAC_EVACT_9
+#define CONF_DMAC_EVACT_9 0
+#endif
+
+// Address Increment Step Size
+// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1
+// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2
+// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4
+// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8
+// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16
+// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32
+// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64
+// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128
+// Defines the address increment step size, applies to source or destination address
+// dmac_stepsize_9
+#ifndef CONF_DMAC_STEPSIZE_9
+#define CONF_DMAC_STEPSIZE_9 0
+#endif
+
+// Step Selection
+// <0=> Step size settings apply to the destination address
+// <1=> Step size settings apply to the source address
+// Defines whether source or destination addresses are using the step size settings
+// dmac_stepsel_9
+#ifndef CONF_DMAC_STEPSEL_9
+#define CONF_DMAC_STEPSEL_9 0
+#endif
+
+// Source Address Increment
+// Indicates whether the source address incrementation is enabled or not
+// dmac_srcinc_9
+#ifndef CONF_DMAC_SRCINC_9
+#define CONF_DMAC_SRCINC_9 0
+#endif
+
+// Destination Address Increment
+// Indicates whether the destination address incrementation is enabled or not
+// dmac_dstinc_9
+#ifndef CONF_DMAC_DSTINC_9
+#define CONF_DMAC_DSTINC_9 0
+#endif
+
+// Beat Size
+// <0=> 8-bit bus transfer
+// <1=> 16-bit bus transfer
+// <2=> 32-bit bus transfer
+// Defines the size of one beat
+// dmac_beatsize_9
+#ifndef CONF_DMAC_BEATSIZE_9
+#define CONF_DMAC_BEATSIZE_9 0
+#endif
+
+// Block Action
+// <0=> Channel will be disabled if it is the last block transfer in the transaction
+// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt
+// <2=> Channel suspend operation is complete
+// <3=> Both channel suspend operation and block interrupt
+// Defines the the DMAC should take after a block transfer has completed
+// dmac_blockact_9
+#ifndef CONF_DMAC_BLOCKACT_9
+#define CONF_DMAC_BLOCKACT_9 0
+#endif
+
+// Event Output Selection
+// <0=> Event generation disabled
+// <1=> Event strobe when block transfer complete
+// <3=> Event strobe when beat transfer complete
+// Defines the event output selection
+// dmac_evosel_9
+#ifndef CONF_DMAC_EVOSEL_9
+#define CONF_DMAC_EVOSEL_9 0
+#endif
+//
+
+// Channel 10 settings
+// dmac_channel_10_settings
+#ifndef CONF_DMAC_CHANNEL_10_SETTINGS
+#define CONF_DMAC_CHANNEL_10_SETTINGS 0
+#endif
+
+// Channel Run in Standby
+// Indicates whether channel 10 is running in standby mode or not
+// dmac_runstdby_10
+#ifndef CONF_DMAC_RUNSTDBY_10
+#define CONF_DMAC_RUNSTDBY_10 0
+#endif
+
+// Trigger action
+// <0=> One trigger required for each block transfer
+// <2=> One trigger required for each beat transfer
+// <3=> One trigger required for each transaction
+// Defines the trigger action used for a transfer
+// dmac_trigact_10
+#ifndef CONF_DMAC_TRIGACT_10
+#define CONF_DMAC_TRIGACT_10 0
+#endif
+
+// Trigger source
+// <0x00=> Only software/event triggers
+// <0x01=> RTC Time Stamp Trigger
+// <0x02=> DSU Debug Communication Channel 0 Trigger
+// <0x03=> DSU Debug Communication Channel 1 Trigger
+// <0x04=> SERCOM0 RX Trigger
+// <0x05=> SERCOM0 TX Trigger
+// <0x06=> SERCOM1 RX Trigger
+// <0x07=> SERCOM1 TX Trigger
+// <0x08=> SERCOM2 RX Trigger
+// <0x09=> SERCOM2 TX Trigger
+// <0x0A=> SERCOM3 RX Trigger
+// <0x0B=> SERCOM3 TX Trigger
+// <0x0C=> SERCOM4 RX Trigger
+// <0x0D=> SERCOM4 TX Trigger
+// <0x0E=> SERCOM5 RX Trigger
+// <0x0F=> SERCOM5 TX Trigger
+// <0x10=> SERCOM6 RX Trigger
+// <0x11=> SERCOM6 TX Trigger
+// <0x12=> SERCOM7 RX Trigger
+// <0x13=> SERCOM7 TX Trigger
+// <0x14=> CAN0 DEBUG Trigger
+// <0x15=> CAN1 DEBUG Trigger
+// <0x16=> TCC0 Overflow Trigger Trigger
+// <0x17=> TCC0 Match/Compare 0 Trigger Trigger
+// <0x18=> TCC0 Match/Compare 1 Trigger Trigger
+// <0x19=> TCC0 Match/Compare 2 Trigger Trigger
+// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger
+// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger
+// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger
+// <0x1D=> TCC1 Overflow Trigger Trigger
+// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger
+// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger
+// <0x20=> TCC1 Match/Compare 2 Trigger Trigger
+// <0x21=> TCC1 Match/Compare 3 Trigger Trigger
+// <0x22=> TCC2 Overflow Trigger Trigger
+// <0x23=> TCC2 Match/Compare 0 Trigger Trigger
+// <0x24=> TCC2 Match/Compare 1 Trigger Trigger
+// <0x25=> TCC2 Match/Compare 2 Trigger Trigger
+// <0x26=> TCC3 Overflow Trigger Trigger
+// <0x27=> TCC3 Match/Compare 0 Trigger Trigger
+// <0x28=> TCC3 Match/Compare 1 Trigger Trigger
+// <0x29=> TCC4 Overflow Trigger Trigger
+// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger
+// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger
+// <0x2C=> TC0 Overflow Trigger
+// <0x2D=> TC0 Match/Compare 0 Trigger
+// <0x2E=> TC0 Match/Compare 1 Trigger
+// <0x2F=> TC1 Overflow Trigger
+// <0x30=> TC1 Match/Compare 0 Trigger
+// <0x31=> TC1 Match/Compare 1 Trigger
+// <0x32=> TC2 Overflow Trigger
+// <0x33=> TC2 Match/Compare 0 Trigger
+// <0x34=> TC2 Match/Compare 1 Trigger
+// <0x35=> TC3 Overflow Trigger
+// <0x36=> TC3 Match/Compare 0 Trigger
+// <0x37=> TC3 Match/Compare 1 Trigger
+// <0x38=> TC4 Overflow Trigger
+// <0x39=> TC4 Match/Compare 0 Trigger
+// <0x3A=> TC4 Match/Compare 1 Trigger
+// <0x3B=> TC5 Overflow Trigger
+// <0x3C=> TC5 Match/Compare 0 Trigger
+// <0x3D=> TC5 Match/Compare 1 Trigger
+// <0x3E=> TC6 Overflow Trigger
+// <0x3F=> TC6 Match/Compare 0 Trigger
+// <0x40=> TC6 Match/Compare 1 Trigger
+// <0x41=> TC7 Overflow Trigger
+// <0x42=> TC7 Match/Compare 0 Trigger
+// <0x43=> TC7 Match/Compare 1 Trigger
+// <0x44=> ADC0 Result Ready Trigger
+// <0x45=> ADC0 Sequencing Trigger
+// <0x46=> ADC1 Result Ready Trigger
+// <0x47=> ADC1 Sequencing Trigger
+// <0x48=> DAC Empty 0 Trigger
+// <0x49=> DAC Empty 1 Trigger
+// <0x4A=> DAC Result Ready 0 Trigger
+// <0x4B=> DAC Result Ready 1 Trigger
+// <0x4C=> I2S Rx 0 Trigger
+// <0x4D=> I2S Rx 1 Trigger
+// <0x4E=> I2S Tx 0 Trigger
+// <0x4F=> I2S Tx 1 Trigger
+// <0x50=> PCC RX Trigger
+// <0x51=> AES Write Trigger
+// <0x52=> AES Read Trigger
+// <0x53=> QSPI Rx Trigger
+// <0x54=> QSPI Tx Trigger
+// Defines the peripheral trigger which is source of the transfer
+// dmac_trifsrc_10
+#ifndef CONF_DMAC_TRIGSRC_10
+#define CONF_DMAC_TRIGSRC_10 0
+#endif
+
+// Channel Arbitration Level
+// <0=> Channel priority 0
+// <1=> Channel priority 1
+// <2=> Channel priority 2
+// <3=> Channel priority 3
+// Defines the arbitration level for this channel
+// dmac_lvl_10
+#ifndef CONF_DMAC_LVL_10
+#define CONF_DMAC_LVL_10 0
+#endif
+
+// Channel Event Output
+// Indicates whether channel event generation is enabled or not
+// dmac_evoe_10
+#ifndef CONF_DMAC_EVOE_10
+#define CONF_DMAC_EVOE_10 0
+#endif
+
+// Channel Event Input
+// Indicates whether channel event reception is enabled or not
+// dmac_evie_10
+#ifndef CONF_DMAC_EVIE_10
+#define CONF_DMAC_EVIE_10 0
+#endif
+
+// Event Input Action
+// <0=> No action
+// <1=> Normal transfer and conditional transfer on strobe trigger
+// <2=> Conditional transfer trigger
+// <3=> Conditional block transfer
+// <4=> Channel suspend operation
+// <5=> Channel resume operation
+// <6=> Skip next block suspend action
+// Defines the event input action
+// dmac_evact_10
+#ifndef CONF_DMAC_EVACT_10
+#define CONF_DMAC_EVACT_10 0
+#endif
+
+// Address Increment Step Size
+// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1
+// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2
+// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4
+// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8
+// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16
+// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32
+// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64
+// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128
+// Defines the address increment step size, applies to source or destination address
+// dmac_stepsize_10
+#ifndef CONF_DMAC_STEPSIZE_10
+#define CONF_DMAC_STEPSIZE_10 0
+#endif
+
+// Step Selection
+// <0=> Step size settings apply to the destination address
+// <1=> Step size settings apply to the source address
+// Defines whether source or destination addresses are using the step size settings
+// dmac_stepsel_10
+#ifndef CONF_DMAC_STEPSEL_10
+#define CONF_DMAC_STEPSEL_10 0
+#endif
+
+// Source Address Increment
+// Indicates whether the source address incrementation is enabled or not
+// dmac_srcinc_10
+#ifndef CONF_DMAC_SRCINC_10
+#define CONF_DMAC_SRCINC_10 0
+#endif
+
+// Destination Address Increment
+// Indicates whether the destination address incrementation is enabled or not
+// dmac_dstinc_10
+#ifndef CONF_DMAC_DSTINC_10
+#define CONF_DMAC_DSTINC_10 0
+#endif
+
+// Beat Size
+// <0=> 8-bit bus transfer
+// <1=> 16-bit bus transfer
+// <2=> 32-bit bus transfer
+// Defines the size of one beat
+// dmac_beatsize_10
+#ifndef CONF_DMAC_BEATSIZE_10
+#define CONF_DMAC_BEATSIZE_10 0
+#endif
+
+// Block Action
+// <0=> Channel will be disabled if it is the last block transfer in the transaction
+// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt
+// <2=> Channel suspend operation is complete
+// <3=> Both channel suspend operation and block interrupt
+// Defines the the DMAC should take after a block transfer has completed
+// dmac_blockact_10
+#ifndef CONF_DMAC_BLOCKACT_10
+#define CONF_DMAC_BLOCKACT_10 0
+#endif
+
+// Event Output Selection
+// <0=> Event generation disabled
+// <1=> Event strobe when block transfer complete
+// <3=> Event strobe when beat transfer complete
+// Defines the event output selection
+// dmac_evosel_10
+#ifndef CONF_DMAC_EVOSEL_10
+#define CONF_DMAC_EVOSEL_10 0
+#endif
+//
+
+// Channel 11 settings
+// dmac_channel_11_settings
+#ifndef CONF_DMAC_CHANNEL_11_SETTINGS
+#define CONF_DMAC_CHANNEL_11_SETTINGS 0
+#endif
+
+// Channel Run in Standby
+// Indicates whether channel 11 is running in standby mode or not
+// dmac_runstdby_11
+#ifndef CONF_DMAC_RUNSTDBY_11
+#define CONF_DMAC_RUNSTDBY_11 0
+#endif
+
+// Trigger action
+// <0=> One trigger required for each block transfer
+// <2=> One trigger required for each beat transfer
+// <3=> One trigger required for each transaction
+// Defines the trigger action used for a transfer
+// dmac_trigact_11
+#ifndef CONF_DMAC_TRIGACT_11
+#define CONF_DMAC_TRIGACT_11 0
+#endif
+
+// Trigger source
+// <0x00=> Only software/event triggers
+// <0x01=> RTC Time Stamp Trigger
+// <0x02=> DSU Debug Communication Channel 0 Trigger
+// <0x03=> DSU Debug Communication Channel 1 Trigger
+// <0x04=> SERCOM0 RX Trigger
+// <0x05=> SERCOM0 TX Trigger
+// <0x06=> SERCOM1 RX Trigger
+// <0x07=> SERCOM1 TX Trigger
+// <0x08=> SERCOM2 RX Trigger
+// <0x09=> SERCOM2 TX Trigger
+// <0x0A=> SERCOM3 RX Trigger
+// <0x0B=> SERCOM3 TX Trigger
+// <0x0C=> SERCOM4 RX Trigger
+// <0x0D=> SERCOM4 TX Trigger
+// <0x0E=> SERCOM5 RX Trigger
+// <0x0F=> SERCOM5 TX Trigger
+// <0x10=> SERCOM6 RX Trigger
+// <0x11=> SERCOM6 TX Trigger
+// <0x12=> SERCOM7 RX Trigger
+// <0x13=> SERCOM7 TX Trigger
+// <0x14=> CAN0 DEBUG Trigger
+// <0x15=> CAN1 DEBUG Trigger
+// <0x16=> TCC0 Overflow Trigger Trigger
+// <0x17=> TCC0 Match/Compare 0 Trigger Trigger
+// <0x18=> TCC0 Match/Compare 1 Trigger Trigger
+// <0x19=> TCC0 Match/Compare 2 Trigger Trigger
+// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger
+// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger
+// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger
+// <0x1D=> TCC1 Overflow Trigger Trigger
+// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger
+// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger
+// <0x20=> TCC1 Match/Compare 2 Trigger Trigger
+// <0x21=> TCC1 Match/Compare 3 Trigger Trigger
+// <0x22=> TCC2 Overflow Trigger Trigger
+// <0x23=> TCC2 Match/Compare 0 Trigger Trigger
+// <0x24=> TCC2 Match/Compare 1 Trigger Trigger
+// <0x25=> TCC2 Match/Compare 2 Trigger Trigger
+// <0x26=> TCC3 Overflow Trigger Trigger
+// <0x27=> TCC3 Match/Compare 0 Trigger Trigger
+// <0x28=> TCC3 Match/Compare 1 Trigger Trigger
+// <0x29=> TCC4 Overflow Trigger Trigger
+// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger
+// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger
+// <0x2C=> TC0 Overflow Trigger
+// <0x2D=> TC0 Match/Compare 0 Trigger
+// <0x2E=> TC0 Match/Compare 1 Trigger
+// <0x2F=> TC1 Overflow Trigger
+// <0x30=> TC1 Match/Compare 0 Trigger
+// <0x31=> TC1 Match/Compare 1 Trigger
+// <0x32=> TC2 Overflow Trigger
+// <0x33=> TC2 Match/Compare 0 Trigger
+// <0x34=> TC2 Match/Compare 1 Trigger
+// <0x35=> TC3 Overflow Trigger
+// <0x36=> TC3 Match/Compare 0 Trigger
+// <0x37=> TC3 Match/Compare 1 Trigger
+// <0x38=> TC4 Overflow Trigger
+// <0x39=> TC4 Match/Compare 0 Trigger
+// <0x3A=> TC4 Match/Compare 1 Trigger
+// <0x3B=> TC5 Overflow Trigger
+// <0x3C=> TC5 Match/Compare 0 Trigger
+// <0x3D=> TC5 Match/Compare 1 Trigger
+// <0x3E=> TC6 Overflow Trigger
+// <0x3F=> TC6 Match/Compare 0 Trigger
+// <0x40=> TC6 Match/Compare 1 Trigger
+// <0x41=> TC7 Overflow Trigger
+// <0x42=> TC7 Match/Compare 0 Trigger
+// <0x43=> TC7 Match/Compare 1 Trigger
+// <0x44=> ADC0 Result Ready Trigger
+// <0x45=> ADC0 Sequencing Trigger
+// <0x46=> ADC1 Result Ready Trigger
+// <0x47=> ADC1 Sequencing Trigger
+// <0x48=> DAC Empty 0 Trigger
+// <0x49=> DAC Empty 1 Trigger
+// <0x4A=> DAC Result Ready 0 Trigger
+// <0x4B=> DAC Result Ready 1 Trigger
+// <0x4C=> I2S Rx 0 Trigger
+// <0x4D=> I2S Rx 1 Trigger
+// <0x4E=> I2S Tx 0 Trigger
+// <0x4F=> I2S Tx 1 Trigger
+// <0x50=> PCC RX Trigger
+// <0x51=> AES Write Trigger
+// <0x52=> AES Read Trigger
+// <0x53=> QSPI Rx Trigger
+// <0x54=> QSPI Tx Trigger
+// Defines the peripheral trigger which is source of the transfer
+// dmac_trifsrc_11
+#ifndef CONF_DMAC_TRIGSRC_11
+#define CONF_DMAC_TRIGSRC_11 0
+#endif
+
+// Channel Arbitration Level
+// <0=> Channel priority 0
+// <1=> Channel priority 1
+// <2=> Channel priority 2
+// <3=> Channel priority 3
+// Defines the arbitration level for this channel
+// dmac_lvl_11
+#ifndef CONF_DMAC_LVL_11
+#define CONF_DMAC_LVL_11 0
+#endif
+
+// Channel Event Output
+// Indicates whether channel event generation is enabled or not
+// dmac_evoe_11
+#ifndef CONF_DMAC_EVOE_11
+#define CONF_DMAC_EVOE_11 0
+#endif
+
+// Channel Event Input
+// Indicates whether channel event reception is enabled or not
+// dmac_evie_11
+#ifndef CONF_DMAC_EVIE_11
+#define CONF_DMAC_EVIE_11 0
+#endif
+
+// Event Input Action
+// <0=> No action
+// <1=> Normal transfer and conditional transfer on strobe trigger
+// <2=> Conditional transfer trigger
+// <3=> Conditional block transfer
+// <4=> Channel suspend operation
+// <5=> Channel resume operation
+// <6=> Skip next block suspend action
+// Defines the event input action
+// dmac_evact_11
+#ifndef CONF_DMAC_EVACT_11
+#define CONF_DMAC_EVACT_11 0
+#endif
+
+// Address Increment Step Size
+// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1
+// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2
+// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4
+// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8
+// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16
+// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32
+// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64
+// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128
+// Defines the address increment step size, applies to source or destination address
+// dmac_stepsize_11
+#ifndef CONF_DMAC_STEPSIZE_11
+#define CONF_DMAC_STEPSIZE_11 0
+#endif
+
+// Step Selection
+// <0=> Step size settings apply to the destination address
+// <1=> Step size settings apply to the source address
+// Defines whether source or destination addresses are using the step size settings
+// dmac_stepsel_11
+#ifndef CONF_DMAC_STEPSEL_11
+#define CONF_DMAC_STEPSEL_11 0
+#endif
+
+// Source Address Increment
+// Indicates whether the source address incrementation is enabled or not
+// dmac_srcinc_11
+#ifndef CONF_DMAC_SRCINC_11
+#define CONF_DMAC_SRCINC_11 0
+#endif
+
+// Destination Address Increment
+// Indicates whether the destination address incrementation is enabled or not
+// dmac_dstinc_11
+#ifndef CONF_DMAC_DSTINC_11
+#define CONF_DMAC_DSTINC_11 0
+#endif
+
+// Beat Size
+// <0=> 8-bit bus transfer
+// <1=> 16-bit bus transfer
+// <2=> 32-bit bus transfer
+// Defines the size of one beat
+// dmac_beatsize_11
+#ifndef CONF_DMAC_BEATSIZE_11
+#define CONF_DMAC_BEATSIZE_11 0
+#endif
+
+// Block Action
+// <0=> Channel will be disabled if it is the last block transfer in the transaction
+// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt
+// <2=> Channel suspend operation is complete
+// <3=> Both channel suspend operation and block interrupt
+// Defines the the DMAC should take after a block transfer has completed
+// dmac_blockact_11
+#ifndef CONF_DMAC_BLOCKACT_11
+#define CONF_DMAC_BLOCKACT_11 0
+#endif
+
+// Event Output Selection
+// <0=> Event generation disabled
+// <1=> Event strobe when block transfer complete
+// <3=> Event strobe when beat transfer complete
+// Defines the event output selection
+// dmac_evosel_11
+#ifndef CONF_DMAC_EVOSEL_11
+#define CONF_DMAC_EVOSEL_11 0
+#endif
+//
+
+// Channel 12 settings
+// dmac_channel_12_settings
+#ifndef CONF_DMAC_CHANNEL_12_SETTINGS
+#define CONF_DMAC_CHANNEL_12_SETTINGS 0
+#endif
+
+// Channel Run in Standby
+// Indicates whether channel 12 is running in standby mode or not
+// dmac_runstdby_12
+#ifndef CONF_DMAC_RUNSTDBY_12
+#define CONF_DMAC_RUNSTDBY_12 0
+#endif
+
+// Trigger action
+// <0=> One trigger required for each block transfer
+// <2=> One trigger required for each beat transfer
+// <3=> One trigger required for each transaction
+// Defines the trigger action used for a transfer
+// dmac_trigact_12
+#ifndef CONF_DMAC_TRIGACT_12
+#define CONF_DMAC_TRIGACT_12 0
+#endif
+
+// Trigger source
+// <0x00=> Only software/event triggers
+// <0x01=> RTC Time Stamp Trigger
+// <0x02=> DSU Debug Communication Channel 0 Trigger
+// <0x03=> DSU Debug Communication Channel 1 Trigger
+// <0x04=> SERCOM0 RX Trigger
+// <0x05=> SERCOM0 TX Trigger
+// <0x06=> SERCOM1 RX Trigger
+// <0x07=> SERCOM1 TX Trigger
+// <0x08=> SERCOM2 RX Trigger
+// <0x09=> SERCOM2 TX Trigger
+// <0x0A=> SERCOM3 RX Trigger
+// <0x0B=> SERCOM3 TX Trigger
+// <0x0C=> SERCOM4 RX Trigger
+// <0x0D=> SERCOM4 TX Trigger
+// <0x0E=> SERCOM5 RX Trigger
+// <0x0F=> SERCOM5 TX Trigger
+// <0x10=> SERCOM6 RX Trigger
+// <0x11=> SERCOM6 TX Trigger
+// <0x12=> SERCOM7 RX Trigger
+// <0x13=> SERCOM7 TX Trigger
+// <0x14=> CAN0 DEBUG Trigger
+// <0x15=> CAN1 DEBUG Trigger
+// <0x16=> TCC0 Overflow Trigger Trigger
+// <0x17=> TCC0 Match/Compare 0 Trigger Trigger
+// <0x18=> TCC0 Match/Compare 1 Trigger Trigger
+// <0x19=> TCC0 Match/Compare 2 Trigger Trigger
+// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger
+// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger
+// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger
+// <0x1D=> TCC1 Overflow Trigger Trigger
+// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger
+// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger
+// <0x20=> TCC1 Match/Compare 2 Trigger Trigger
+// <0x21=> TCC1 Match/Compare 3 Trigger Trigger
+// <0x22=> TCC2 Overflow Trigger Trigger
+// <0x23=> TCC2 Match/Compare 0 Trigger Trigger
+// <0x24=> TCC2 Match/Compare 1 Trigger Trigger
+// <0x25=> TCC2 Match/Compare 2 Trigger Trigger
+// <0x26=> TCC3 Overflow Trigger Trigger
+// <0x27=> TCC3 Match/Compare 0 Trigger Trigger
+// <0x28=> TCC3 Match/Compare 1 Trigger Trigger
+// <0x29=> TCC4 Overflow Trigger Trigger
+// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger
+// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger
+// <0x2C=> TC0 Overflow Trigger
+// <0x2D=> TC0 Match/Compare 0 Trigger
+// <0x2E=> TC0 Match/Compare 1 Trigger
+// <0x2F=> TC1 Overflow Trigger
+// <0x30=> TC1 Match/Compare 0 Trigger
+// <0x31=> TC1 Match/Compare 1 Trigger
+// <0x32=> TC2 Overflow Trigger
+// <0x33=> TC2 Match/Compare 0 Trigger
+// <0x34=> TC2 Match/Compare 1 Trigger
+// <0x35=> TC3 Overflow Trigger
+// <0x36=> TC3 Match/Compare 0 Trigger
+// <0x37=> TC3 Match/Compare 1 Trigger
+// <0x38=> TC4 Overflow Trigger
+// <0x39=> TC4 Match/Compare 0 Trigger
+// <0x3A=> TC4 Match/Compare 1 Trigger
+// <0x3B=> TC5 Overflow Trigger
+// <0x3C=> TC5 Match/Compare 0 Trigger
+// <0x3D=> TC5 Match/Compare 1 Trigger
+// <0x3E=> TC6 Overflow Trigger
+// <0x3F=> TC6 Match/Compare 0 Trigger
+// <0x40=> TC6 Match/Compare 1 Trigger
+// <0x41=> TC7 Overflow Trigger
+// <0x42=> TC7 Match/Compare 0 Trigger
+// <0x43=> TC7 Match/Compare 1 Trigger
+// <0x44=> ADC0 Result Ready Trigger
+// <0x45=> ADC0 Sequencing Trigger
+// <0x46=> ADC1 Result Ready Trigger
+// <0x47=> ADC1 Sequencing Trigger
+// <0x48=> DAC Empty 0 Trigger
+// <0x49=> DAC Empty 1 Trigger
+// <0x4A=> DAC Result Ready 0 Trigger
+// <0x4B=> DAC Result Ready 1 Trigger
+// <0x4C=> I2S Rx 0 Trigger
+// <0x4D=> I2S Rx 1 Trigger
+// <0x4E=> I2S Tx 0 Trigger
+// <0x4F=> I2S Tx 1 Trigger
+// <0x50=> PCC RX Trigger
+// <0x51=> AES Write Trigger
+// <0x52=> AES Read Trigger
+// <0x53=> QSPI Rx Trigger
+// <0x54=> QSPI Tx Trigger
+// Defines the peripheral trigger which is source of the transfer
+// dmac_trifsrc_12
+#ifndef CONF_DMAC_TRIGSRC_12
+#define CONF_DMAC_TRIGSRC_12 0
+#endif
+
+// Channel Arbitration Level
+// <0=> Channel priority 0
+// <1=> Channel priority 1
+// <2=> Channel priority 2
+// <3=> Channel priority 3
+// Defines the arbitration level for this channel
+// dmac_lvl_12
+#ifndef CONF_DMAC_LVL_12
+#define CONF_DMAC_LVL_12 0
+#endif
+
+// Channel Event Output
+// Indicates whether channel event generation is enabled or not
+// dmac_evoe_12
+#ifndef CONF_DMAC_EVOE_12
+#define CONF_DMAC_EVOE_12 0
+#endif
+
+// Channel Event Input
+// Indicates whether channel event reception is enabled or not
+// dmac_evie_12
+#ifndef CONF_DMAC_EVIE_12
+#define CONF_DMAC_EVIE_12 0
+#endif
+
+// Event Input Action
+// <0=> No action
+// <1=> Normal transfer and conditional transfer on strobe trigger
+// <2=> Conditional transfer trigger
+// <3=> Conditional block transfer
+// <4=> Channel suspend operation
+// <5=> Channel resume operation
+// <6=> Skip next block suspend action
+// Defines the event input action
+// dmac_evact_12
+#ifndef CONF_DMAC_EVACT_12
+#define CONF_DMAC_EVACT_12 0
+#endif
+
+// Address Increment Step Size
+// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1
+// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2
+// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4
+// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8
+// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16
+// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32
+// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64
+// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128
+// Defines the address increment step size, applies to source or destination address
+// dmac_stepsize_12
+#ifndef CONF_DMAC_STEPSIZE_12
+#define CONF_DMAC_STEPSIZE_12 0
+#endif
+
+// Step Selection
+// <0=> Step size settings apply to the destination address
+// <1=> Step size settings apply to the source address
+// Defines whether source or destination addresses are using the step size settings
+// dmac_stepsel_12
+#ifndef CONF_DMAC_STEPSEL_12
+#define CONF_DMAC_STEPSEL_12 0
+#endif
+
+// Source Address Increment
+// Indicates whether the source address incrementation is enabled or not
+// dmac_srcinc_12
+#ifndef CONF_DMAC_SRCINC_12
+#define CONF_DMAC_SRCINC_12 0
+#endif
+
+// Destination Address Increment
+// Indicates whether the destination address incrementation is enabled or not
+// dmac_dstinc_12
+#ifndef CONF_DMAC_DSTINC_12
+#define CONF_DMAC_DSTINC_12 0
+#endif
+
+// Beat Size
+// <0=> 8-bit bus transfer
+// <1=> 16-bit bus transfer
+// <2=> 32-bit bus transfer
+// Defines the size of one beat
+// dmac_beatsize_12
+#ifndef CONF_DMAC_BEATSIZE_12
+#define CONF_DMAC_BEATSIZE_12 0
+#endif
+
+// Block Action
+// <0=> Channel will be disabled if it is the last block transfer in the transaction
+// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt
+// <2=> Channel suspend operation is complete
+// <3=> Both channel suspend operation and block interrupt
+// Defines the the DMAC should take after a block transfer has completed
+// dmac_blockact_12
+#ifndef CONF_DMAC_BLOCKACT_12
+#define CONF_DMAC_BLOCKACT_12 0
+#endif
+
+// Event Output Selection
+// <0=> Event generation disabled
+// <1=> Event strobe when block transfer complete
+// <3=> Event strobe when beat transfer complete
+// Defines the event output selection
+// dmac_evosel_12
+#ifndef CONF_DMAC_EVOSEL_12
+#define CONF_DMAC_EVOSEL_12 0
+#endif
+//
+
+// Channel 13 settings
+// dmac_channel_13_settings
+#ifndef CONF_DMAC_CHANNEL_13_SETTINGS
+#define CONF_DMAC_CHANNEL_13_SETTINGS 0
+#endif
+
+// Channel Run in Standby
+// Indicates whether channel 13 is running in standby mode or not
+// dmac_runstdby_13
+#ifndef CONF_DMAC_RUNSTDBY_13
+#define CONF_DMAC_RUNSTDBY_13 0
+#endif
+
+// Trigger action
+// <0=> One trigger required for each block transfer
+// <2=> One trigger required for each beat transfer
+// <3=> One trigger required for each transaction
+// Defines the trigger action used for a transfer
+// dmac_trigact_13
+#ifndef CONF_DMAC_TRIGACT_13
+#define CONF_DMAC_TRIGACT_13 0
+#endif
+
+// Trigger source
+// <0x00=> Only software/event triggers
+// <0x01=> RTC Time Stamp Trigger
+// <0x02=> DSU Debug Communication Channel 0 Trigger
+// <0x03=> DSU Debug Communication Channel 1 Trigger
+// <0x04=> SERCOM0 RX Trigger
+// <0x05=> SERCOM0 TX Trigger
+// <0x06=> SERCOM1 RX Trigger
+// <0x07=> SERCOM1 TX Trigger
+// <0x08=> SERCOM2 RX Trigger
+// <0x09=> SERCOM2 TX Trigger
+// <0x0A=> SERCOM3 RX Trigger
+// <0x0B=> SERCOM3 TX Trigger
+// <0x0C=> SERCOM4 RX Trigger
+// <0x0D=> SERCOM4 TX Trigger
+// <0x0E=> SERCOM5 RX Trigger
+// <0x0F=> SERCOM5 TX Trigger
+// <0x10=> SERCOM6 RX Trigger
+// <0x11=> SERCOM6 TX Trigger
+// <0x12=> SERCOM7 RX Trigger
+// <0x13=> SERCOM7 TX Trigger
+// <0x14=> CAN0 DEBUG Trigger
+// <0x15=> CAN1 DEBUG Trigger
+// <0x16=> TCC0 Overflow Trigger Trigger
+// <0x17=> TCC0 Match/Compare 0 Trigger Trigger
+// <0x18=> TCC0 Match/Compare 1 Trigger Trigger
+// <0x19=> TCC0 Match/Compare 2 Trigger Trigger
+// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger
+// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger
+// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger
+// <0x1D=> TCC1 Overflow Trigger Trigger
+// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger
+// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger
+// <0x20=> TCC1 Match/Compare 2 Trigger Trigger
+// <0x21=> TCC1 Match/Compare 3 Trigger Trigger
+// <0x22=> TCC2 Overflow Trigger Trigger
+// <0x23=> TCC2 Match/Compare 0 Trigger Trigger
+// <0x24=> TCC2 Match/Compare 1 Trigger Trigger
+// <0x25=> TCC2 Match/Compare 2 Trigger Trigger
+// <0x26=> TCC3 Overflow Trigger Trigger
+// <0x27=> TCC3 Match/Compare 0 Trigger Trigger
+// <0x28=> TCC3 Match/Compare 1 Trigger Trigger
+// <0x29=> TCC4 Overflow Trigger Trigger
+// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger
+// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger
+// <0x2C=> TC0 Overflow Trigger
+// <0x2D=> TC0 Match/Compare 0 Trigger
+// <0x2E=> TC0 Match/Compare 1 Trigger
+// <0x2F=> TC1 Overflow Trigger
+// <0x30=> TC1 Match/Compare 0 Trigger
+// <0x31=> TC1 Match/Compare 1 Trigger
+// <0x32=> TC2 Overflow Trigger
+// <0x33=> TC2 Match/Compare 0 Trigger
+// <0x34=> TC2 Match/Compare 1 Trigger
+// <0x35=> TC3 Overflow Trigger
+// <0x36=> TC3 Match/Compare 0 Trigger
+// <0x37=> TC3 Match/Compare 1 Trigger
+// <0x38=> TC4 Overflow Trigger
+// <0x39=> TC4 Match/Compare 0 Trigger
+// <0x3A=> TC4 Match/Compare 1 Trigger
+// <0x3B=> TC5 Overflow Trigger
+// <0x3C=> TC5 Match/Compare 0 Trigger
+// <0x3D=> TC5 Match/Compare 1 Trigger
+// <0x3E=> TC6 Overflow Trigger
+// <0x3F=> TC6 Match/Compare 0 Trigger
+// <0x40=> TC6 Match/Compare 1 Trigger
+// <0x41=> TC7 Overflow Trigger
+// <0x42=> TC7 Match/Compare 0 Trigger
+// <0x43=> TC7 Match/Compare 1 Trigger
+// <0x44=> ADC0 Result Ready Trigger
+// <0x45=> ADC0 Sequencing Trigger
+// <0x46=> ADC1 Result Ready Trigger
+// <0x47=> ADC1 Sequencing Trigger
+// <0x48=> DAC Empty 0 Trigger
+// <0x49=> DAC Empty 1 Trigger
+// <0x4A=> DAC Result Ready 0 Trigger
+// <0x4B=> DAC Result Ready 1 Trigger
+// <0x4C=> I2S Rx 0 Trigger
+// <0x4D=> I2S Rx 1 Trigger
+// <0x4E=> I2S Tx 0 Trigger
+// <0x4F=> I2S Tx 1 Trigger
+// <0x50=> PCC RX Trigger
+// <0x51=> AES Write Trigger
+// <0x52=> AES Read Trigger
+// <0x53=> QSPI Rx Trigger
+// <0x54=> QSPI Tx Trigger
+// Defines the peripheral trigger which is source of the transfer
+// dmac_trifsrc_13
+#ifndef CONF_DMAC_TRIGSRC_13
+#define CONF_DMAC_TRIGSRC_13 0
+#endif
+
+// Channel Arbitration Level
+// <0=> Channel priority 0
+// <1=> Channel priority 1
+// <2=> Channel priority 2
+// <3=> Channel priority 3
+// Defines the arbitration level for this channel
+// dmac_lvl_13
+#ifndef CONF_DMAC_LVL_13
+#define CONF_DMAC_LVL_13 0
+#endif
+
+// Channel Event Output
+// Indicates whether channel event generation is enabled or not
+// dmac_evoe_13
+#ifndef CONF_DMAC_EVOE_13
+#define CONF_DMAC_EVOE_13 0
+#endif
+
+// Channel Event Input
+// Indicates whether channel event reception is enabled or not
+// dmac_evie_13
+#ifndef CONF_DMAC_EVIE_13
+#define CONF_DMAC_EVIE_13 0
+#endif
+
+// Event Input Action
+// <0=> No action
+// <1=> Normal transfer and conditional transfer on strobe trigger
+// <2=> Conditional transfer trigger
+// <3=> Conditional block transfer
+// <4=> Channel suspend operation
+// <5=> Channel resume operation
+// <6=> Skip next block suspend action
+// Defines the event input action
+// dmac_evact_13
+#ifndef CONF_DMAC_EVACT_13
+#define CONF_DMAC_EVACT_13 0
+#endif
+
+// Address Increment Step Size
+// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1
+// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2
+// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4
+// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8
+// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16
+// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32
+// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64
+// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128
+// Defines the address increment step size, applies to source or destination address
+// dmac_stepsize_13
+#ifndef CONF_DMAC_STEPSIZE_13
+#define CONF_DMAC_STEPSIZE_13 0
+#endif
+
+// Step Selection
+// <0=> Step size settings apply to the destination address
+// <1=> Step size settings apply to the source address
+// Defines whether source or destination addresses are using the step size settings
+// dmac_stepsel_13
+#ifndef CONF_DMAC_STEPSEL_13
+#define CONF_DMAC_STEPSEL_13 0
+#endif
+
+// Source Address Increment
+// Indicates whether the source address incrementation is enabled or not
+// dmac_srcinc_13
+#ifndef CONF_DMAC_SRCINC_13
+#define CONF_DMAC_SRCINC_13 0
+#endif
+
+// Destination Address Increment
+// Indicates whether the destination address incrementation is enabled or not
+// dmac_dstinc_13
+#ifndef CONF_DMAC_DSTINC_13
+#define CONF_DMAC_DSTINC_13 0
+#endif
+
+// Beat Size
+// <0=> 8-bit bus transfer
+// <1=> 16-bit bus transfer
+// <2=> 32-bit bus transfer
+// Defines the size of one beat
+// dmac_beatsize_13
+#ifndef CONF_DMAC_BEATSIZE_13
+#define CONF_DMAC_BEATSIZE_13 0
+#endif
+
+// Block Action
+// <0=> Channel will be disabled if it is the last block transfer in the transaction
+// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt
+// <2=> Channel suspend operation is complete
+// <3=> Both channel suspend operation and block interrupt
+// Defines the the DMAC should take after a block transfer has completed
+// dmac_blockact_13
+#ifndef CONF_DMAC_BLOCKACT_13
+#define CONF_DMAC_BLOCKACT_13 0
+#endif
+
+// Event Output Selection
+// <0=> Event generation disabled
+// <1=> Event strobe when block transfer complete
+// <3=> Event strobe when beat transfer complete
+// Defines the event output selection
+// dmac_evosel_13
+#ifndef CONF_DMAC_EVOSEL_13
+#define CONF_DMAC_EVOSEL_13 0
+#endif
+//
+
+// Channel 14 settings
+// dmac_channel_14_settings
+#ifndef CONF_DMAC_CHANNEL_14_SETTINGS
+#define CONF_DMAC_CHANNEL_14_SETTINGS 0
+#endif
+
+// Channel Run in Standby
+// Indicates whether channel 14 is running in standby mode or not
+// dmac_runstdby_14
+#ifndef CONF_DMAC_RUNSTDBY_14
+#define CONF_DMAC_RUNSTDBY_14 0
+#endif
+
+// Trigger action
+// <0=> One trigger required for each block transfer
+// <2=> One trigger required for each beat transfer
+// <3=> One trigger required for each transaction
+// Defines the trigger action used for a transfer
+// dmac_trigact_14
+#ifndef CONF_DMAC_TRIGACT_14
+#define CONF_DMAC_TRIGACT_14 0
+#endif
+
+// Trigger source
+// <0x00=> Only software/event triggers
+// <0x01=> RTC Time Stamp Trigger
+// <0x02=> DSU Debug Communication Channel 0 Trigger
+// <0x03=> DSU Debug Communication Channel 1 Trigger
+// <0x04=> SERCOM0 RX Trigger
+// <0x05=> SERCOM0 TX Trigger
+// <0x06=> SERCOM1 RX Trigger
+// <0x07=> SERCOM1 TX Trigger
+// <0x08=> SERCOM2 RX Trigger
+// <0x09=> SERCOM2 TX Trigger
+// <0x0A=> SERCOM3 RX Trigger
+// <0x0B=> SERCOM3 TX Trigger
+// <0x0C=> SERCOM4 RX Trigger
+// <0x0D=> SERCOM4 TX Trigger
+// <0x0E=> SERCOM5 RX Trigger
+// <0x0F=> SERCOM5 TX Trigger
+// <0x10=> SERCOM6 RX Trigger
+// <0x11=> SERCOM6 TX Trigger
+// <0x12=> SERCOM7 RX Trigger
+// <0x13=> SERCOM7 TX Trigger
+// <0x14=> CAN0 DEBUG Trigger
+// <0x15=> CAN1 DEBUG Trigger
+// <0x16=> TCC0 Overflow Trigger Trigger
+// <0x17=> TCC0 Match/Compare 0 Trigger Trigger
+// <0x18=> TCC0 Match/Compare 1 Trigger Trigger
+// <0x19=> TCC0 Match/Compare 2 Trigger Trigger
+// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger
+// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger
+// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger
+// <0x1D=> TCC1 Overflow Trigger Trigger
+// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger
+// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger
+// <0x20=> TCC1 Match/Compare 2 Trigger Trigger
+// <0x21=> TCC1 Match/Compare 3 Trigger Trigger
+// <0x22=> TCC2 Overflow Trigger Trigger
+// <0x23=> TCC2 Match/Compare 0 Trigger Trigger
+// <0x24=> TCC2 Match/Compare 1 Trigger Trigger
+// <0x25=> TCC2 Match/Compare 2 Trigger Trigger
+// <0x26=> TCC3 Overflow Trigger Trigger
+// <0x27=> TCC3 Match/Compare 0 Trigger Trigger
+// <0x28=> TCC3 Match/Compare 1 Trigger Trigger
+// <0x29=> TCC4 Overflow Trigger Trigger
+// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger
+// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger
+// <0x2C=> TC0 Overflow Trigger
+// <0x2D=> TC0 Match/Compare 0 Trigger
+// <0x2E=> TC0 Match/Compare 1 Trigger
+// <0x2F=> TC1 Overflow Trigger
+// <0x30=> TC1 Match/Compare 0 Trigger
+// <0x31=> TC1 Match/Compare 1 Trigger
+// <0x32=> TC2 Overflow Trigger
+// <0x33=> TC2 Match/Compare 0 Trigger
+// <0x34=> TC2 Match/Compare 1 Trigger
+// <0x35=> TC3 Overflow Trigger
+// <0x36=> TC3 Match/Compare 0 Trigger
+// <0x37=> TC3 Match/Compare 1 Trigger
+// <0x38=> TC4 Overflow Trigger
+// <0x39=> TC4 Match/Compare 0 Trigger
+// <0x3A=> TC4 Match/Compare 1 Trigger
+// <0x3B=> TC5 Overflow Trigger
+// <0x3C=> TC5 Match/Compare 0 Trigger
+// <0x3D=> TC5 Match/Compare 1 Trigger
+// <0x3E=> TC6 Overflow Trigger
+// <0x3F=> TC6 Match/Compare 0 Trigger
+// <0x40=> TC6 Match/Compare 1 Trigger
+// <0x41=> TC7 Overflow Trigger
+// <0x42=> TC7 Match/Compare 0 Trigger
+// <0x43=> TC7 Match/Compare 1 Trigger
+// <0x44=> ADC0 Result Ready Trigger
+// <0x45=> ADC0 Sequencing Trigger
+// <0x46=> ADC1 Result Ready Trigger
+// <0x47=> ADC1 Sequencing Trigger
+// <0x48=> DAC Empty 0 Trigger
+// <0x49=> DAC Empty 1 Trigger
+// <0x4A=> DAC Result Ready 0 Trigger
+// <0x4B=> DAC Result Ready 1 Trigger
+// <0x4C=> I2S Rx 0 Trigger
+// <0x4D=> I2S Rx 1 Trigger
+// <0x4E=> I2S Tx 0 Trigger
+// <0x4F=> I2S Tx 1 Trigger
+// <0x50=> PCC RX Trigger
+// <0x51=> AES Write Trigger
+// <0x52=> AES Read Trigger
+// <0x53=> QSPI Rx Trigger
+// <0x54=> QSPI Tx Trigger
+// Defines the peripheral trigger which is source of the transfer
+// dmac_trifsrc_14
+#ifndef CONF_DMAC_TRIGSRC_14
+#define CONF_DMAC_TRIGSRC_14 0
+#endif
+
+// Channel Arbitration Level
+// <0=> Channel priority 0
+// <1=> Channel priority 1
+// <2=> Channel priority 2
+// <3=> Channel priority 3
+// Defines the arbitration level for this channel
+// dmac_lvl_14
+#ifndef CONF_DMAC_LVL_14
+#define CONF_DMAC_LVL_14 0
+#endif
+
+// Channel Event Output
+// Indicates whether channel event generation is enabled or not
+// dmac_evoe_14
+#ifndef CONF_DMAC_EVOE_14
+#define CONF_DMAC_EVOE_14 0
+#endif
+
+// Channel Event Input
+// Indicates whether channel event reception is enabled or not
+// dmac_evie_14
+#ifndef CONF_DMAC_EVIE_14
+#define CONF_DMAC_EVIE_14 0
+#endif
+
+// Event Input Action
+// <0=> No action
+// <1=> Normal transfer and conditional transfer on strobe trigger
+// <2=> Conditional transfer trigger
+// <3=> Conditional block transfer
+// <4=> Channel suspend operation
+// <5=> Channel resume operation
+// <6=> Skip next block suspend action
+// Defines the event input action
+// dmac_evact_14
+#ifndef CONF_DMAC_EVACT_14
+#define CONF_DMAC_EVACT_14 0
+#endif
+
+// Address Increment Step Size
+// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1
+// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2
+// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4
+// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8
+// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16
+// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32
+// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64
+// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128
+// Defines the address increment step size, applies to source or destination address
+// dmac_stepsize_14
+#ifndef CONF_DMAC_STEPSIZE_14
+#define CONF_DMAC_STEPSIZE_14 0
+#endif
+
+// Step Selection
+// <0=> Step size settings apply to the destination address
+// <1=> Step size settings apply to the source address
+// Defines whether source or destination addresses are using the step size settings
+// dmac_stepsel_14
+#ifndef CONF_DMAC_STEPSEL_14
+#define CONF_DMAC_STEPSEL_14 0
+#endif
+
+// Source Address Increment
+// Indicates whether the source address incrementation is enabled or not
+// dmac_srcinc_14
+#ifndef CONF_DMAC_SRCINC_14
+#define CONF_DMAC_SRCINC_14 0
+#endif
+
+// Destination Address Increment
+// Indicates whether the destination address incrementation is enabled or not
+// dmac_dstinc_14
+#ifndef CONF_DMAC_DSTINC_14
+#define CONF_DMAC_DSTINC_14 0
+#endif
+
+// Beat Size
+// <0=> 8-bit bus transfer
+// <1=> 16-bit bus transfer
+// <2=> 32-bit bus transfer
+// Defines the size of one beat
+// dmac_beatsize_14
+#ifndef CONF_DMAC_BEATSIZE_14
+#define CONF_DMAC_BEATSIZE_14 0
+#endif
+
+// Block Action
+// <0=> Channel will be disabled if it is the last block transfer in the transaction
+// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt
+// <2=> Channel suspend operation is complete
+// <3=> Both channel suspend operation and block interrupt
+// Defines the the DMAC should take after a block transfer has completed
+// dmac_blockact_14
+#ifndef CONF_DMAC_BLOCKACT_14
+#define CONF_DMAC_BLOCKACT_14 0
+#endif
+
+// Event Output Selection
+// <0=> Event generation disabled
+// <1=> Event strobe when block transfer complete
+// <3=> Event strobe when beat transfer complete
+// Defines the event output selection
+// dmac_evosel_14
+#ifndef CONF_DMAC_EVOSEL_14
+#define CONF_DMAC_EVOSEL_14 0
+#endif
+//
+
+// Channel 15 settings
+// dmac_channel_15_settings
+#ifndef CONF_DMAC_CHANNEL_15_SETTINGS
+#define CONF_DMAC_CHANNEL_15_SETTINGS 0
+#endif
+
+// Channel Run in Standby
+// Indicates whether channel 15 is running in standby mode or not
+// dmac_runstdby_15
+#ifndef CONF_DMAC_RUNSTDBY_15
+#define CONF_DMAC_RUNSTDBY_15 0
+#endif
+
+// Trigger action
+// <0=> One trigger required for each block transfer
+// <2=> One trigger required for each beat transfer
+// <3=> One trigger required for each transaction
+// Defines the trigger action used for a transfer
+// dmac_trigact_15
+#ifndef CONF_DMAC_TRIGACT_15
+#define CONF_DMAC_TRIGACT_15 0
+#endif
+
+// Trigger source
+// <0x00=> Only software/event triggers
+// <0x01=> RTC Time Stamp Trigger
+// <0x02=> DSU Debug Communication Channel 0 Trigger
+// <0x03=> DSU Debug Communication Channel 1 Trigger
+// <0x04=> SERCOM0 RX Trigger
+// <0x05=> SERCOM0 TX Trigger
+// <0x06=> SERCOM1 RX Trigger
+// <0x07=> SERCOM1 TX Trigger
+// <0x08=> SERCOM2 RX Trigger
+// <0x09=> SERCOM2 TX Trigger
+// <0x0A=> SERCOM3 RX Trigger
+// <0x0B=> SERCOM3 TX Trigger
+// <0x0C=> SERCOM4 RX Trigger
+// <0x0D=> SERCOM4 TX Trigger
+// <0x0E=> SERCOM5 RX Trigger
+// <0x0F=> SERCOM5 TX Trigger
+// <0x10=> SERCOM6 RX Trigger
+// <0x11=> SERCOM6 TX Trigger
+// <0x12=> SERCOM7 RX Trigger
+// <0x13=> SERCOM7 TX Trigger
+// <0x14=> CAN0 DEBUG Trigger
+// <0x15=> CAN1 DEBUG Trigger
+// <0x16=> TCC0 Overflow Trigger Trigger
+// <0x17=> TCC0 Match/Compare 0 Trigger Trigger
+// <0x18=> TCC0 Match/Compare 1 Trigger Trigger
+// <0x19=> TCC0 Match/Compare 2 Trigger Trigger
+// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger
+// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger
+// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger
+// <0x1D=> TCC1 Overflow Trigger Trigger
+// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger
+// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger
+// <0x20=> TCC1 Match/Compare 2 Trigger Trigger
+// <0x21=> TCC1 Match/Compare 3 Trigger Trigger
+// <0x22=> TCC2 Overflow Trigger Trigger
+// <0x23=> TCC2 Match/Compare 0 Trigger Trigger
+// <0x24=> TCC2 Match/Compare 1 Trigger Trigger
+// <0x25=> TCC2 Match/Compare 2 Trigger Trigger
+// <0x26=> TCC3 Overflow Trigger Trigger
+// <0x27=> TCC3 Match/Compare 0 Trigger Trigger
+// <0x28=> TCC3 Match/Compare 1 Trigger Trigger
+// <0x29=> TCC4 Overflow Trigger Trigger
+// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger
+// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger
+// <0x2C=> TC0 Overflow Trigger
+// <0x2D=> TC0 Match/Compare 0 Trigger
+// <0x2E=> TC0 Match/Compare 1 Trigger
+// <0x2F=> TC1 Overflow Trigger
+// <0x30=> TC1 Match/Compare 0 Trigger
+// <0x31=> TC1 Match/Compare 1 Trigger
+// <0x32=> TC2 Overflow Trigger
+// <0x33=> TC2 Match/Compare 0 Trigger
+// <0x34=> TC2 Match/Compare 1 Trigger
+// <0x35=> TC3 Overflow Trigger
+// <0x36=> TC3 Match/Compare 0 Trigger
+// <0x37=> TC3 Match/Compare 1 Trigger
+// <0x38=> TC4 Overflow Trigger
+// <0x39=> TC4 Match/Compare 0 Trigger
+// <0x3A=> TC4 Match/Compare 1 Trigger
+// <0x3B=> TC5 Overflow Trigger
+// <0x3C=> TC5 Match/Compare 0 Trigger
+// <0x3D=> TC5 Match/Compare 1 Trigger
+// <0x3E=> TC6 Overflow Trigger
+// <0x3F=> TC6 Match/Compare 0 Trigger
+// <0x40=> TC6 Match/Compare 1 Trigger
+// <0x41=> TC7 Overflow Trigger
+// <0x42=> TC7 Match/Compare 0 Trigger
+// <0x43=> TC7 Match/Compare 1 Trigger
+// <0x44=> ADC0 Result Ready Trigger
+// <0x45=> ADC0 Sequencing Trigger
+// <0x46=> ADC1 Result Ready Trigger
+// <0x47=> ADC1 Sequencing Trigger
+// <0x48=> DAC Empty 0 Trigger
+// <0x49=> DAC Empty 1 Trigger
+// <0x4A=> DAC Result Ready 0 Trigger
+// <0x4B=> DAC Result Ready 1 Trigger
+// <0x4C=> I2S Rx 0 Trigger
+// <0x4D=> I2S Rx 1 Trigger
+// <0x4E=> I2S Tx 0 Trigger
+// <0x4F=> I2S Tx 1 Trigger
+// <0x50=> PCC RX Trigger
+// <0x51=> AES Write Trigger
+// <0x52=> AES Read Trigger
+// <0x53=> QSPI Rx Trigger
+// <0x54=> QSPI Tx Trigger
+// Defines the peripheral trigger which is source of the transfer
+// dmac_trifsrc_15
+#ifndef CONF_DMAC_TRIGSRC_15
+#define CONF_DMAC_TRIGSRC_15 0
+#endif
+
+// Channel Arbitration Level
+// <0=> Channel priority 0
+// <1=> Channel priority 1
+// <2=> Channel priority 2
+// <3=> Channel priority 3
+// Defines the arbitration level for this channel
+// dmac_lvl_15
+#ifndef CONF_DMAC_LVL_15
+#define CONF_DMAC_LVL_15 0
+#endif
+
+// Channel Event Output
+// Indicates whether channel event generation is enabled or not
+// dmac_evoe_15
+#ifndef CONF_DMAC_EVOE_15
+#define CONF_DMAC_EVOE_15 0
+#endif
+
+// Channel Event Input
+// Indicates whether channel event reception is enabled or not
+// dmac_evie_15
+#ifndef CONF_DMAC_EVIE_15
+#define CONF_DMAC_EVIE_15 0
+#endif
+
+// Event Input Action
+// <0=> No action
+// <1=> Normal transfer and conditional transfer on strobe trigger
+// <2=> Conditional transfer trigger
+// <3=> Conditional block transfer
+// <4=> Channel suspend operation
+// <5=> Channel resume operation
+// <6=> Skip next block suspend action
+// Defines the event input action
+// dmac_evact_15
+#ifndef CONF_DMAC_EVACT_15
+#define CONF_DMAC_EVACT_15 0
+#endif
+
+// Address Increment Step Size
+// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1
+// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2
+// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4
+// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8
+// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16
+// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32
+// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64
+// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128
+// Defines the address increment step size, applies to source or destination address
+// dmac_stepsize_15
+#ifndef CONF_DMAC_STEPSIZE_15
+#define CONF_DMAC_STEPSIZE_15 0
+#endif
+
+// Step Selection
+// <0=> Step size settings apply to the destination address
+// <1=> Step size settings apply to the source address
+// Defines whether source or destination addresses are using the step size settings
+// dmac_stepsel_15
+#ifndef CONF_DMAC_STEPSEL_15
+#define CONF_DMAC_STEPSEL_15 0
+#endif
+
+// Source Address Increment
+// Indicates whether the source address incrementation is enabled or not
+// dmac_srcinc_15
+#ifndef CONF_DMAC_SRCINC_15
+#define CONF_DMAC_SRCINC_15 0
+#endif
+
+// Destination Address Increment
+// Indicates whether the destination address incrementation is enabled or not
+// dmac_dstinc_15
+#ifndef CONF_DMAC_DSTINC_15
+#define CONF_DMAC_DSTINC_15 0
+#endif
+
+// Beat Size
+// <0=> 8-bit bus transfer
+// <1=> 16-bit bus transfer
+// <2=> 32-bit bus transfer
+// Defines the size of one beat
+// dmac_beatsize_15
+#ifndef CONF_DMAC_BEATSIZE_15
+#define CONF_DMAC_BEATSIZE_15 0
+#endif
+
+// Block Action
+// <0=> Channel will be disabled if it is the last block transfer in the transaction
+// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt
+// <2=> Channel suspend operation is complete
+// <3=> Both channel suspend operation and block interrupt
+// Defines the the DMAC should take after a block transfer has completed
+// dmac_blockact_15
+#ifndef CONF_DMAC_BLOCKACT_15
+#define CONF_DMAC_BLOCKACT_15 0
+#endif
+
+// Event Output Selection
+// <0=> Event generation disabled
+// <1=> Event strobe when block transfer complete
+// <3=> Event strobe when beat transfer complete
+// Defines the event output selection
+// dmac_evosel_15
+#ifndef CONF_DMAC_EVOSEL_15
+#define CONF_DMAC_EVOSEL_15 0
+#endif
+//
+
+// Channel 16 settings
+// dmac_channel_16_settings
+#ifndef CONF_DMAC_CHANNEL_16_SETTINGS
+#define CONF_DMAC_CHANNEL_16_SETTINGS 0
+#endif
+
+// Channel Run in Standby
+// Indicates whether channel 16 is running in standby mode or not
+// dmac_runstdby_16
+#ifndef CONF_DMAC_RUNSTDBY_16
+#define CONF_DMAC_RUNSTDBY_16 0
+#endif
+
+// Trigger action
+// <0=> One trigger required for each block transfer
+// <2=> One trigger required for each beat transfer
+// <3=> One trigger required for each transaction
+// Defines the trigger action used for a transfer
+// dmac_trigact_16
+#ifndef CONF_DMAC_TRIGACT_16
+#define CONF_DMAC_TRIGACT_16 0
+#endif
+
+// Trigger source
+// <0x00=> Only software/event triggers
+// <0x01=> RTC Time Stamp Trigger
+// <0x02=> DSU Debug Communication Channel 0 Trigger
+// <0x03=> DSU Debug Communication Channel 1 Trigger
+// <0x04=> SERCOM0 RX Trigger
+// <0x05=> SERCOM0 TX Trigger
+// <0x06=> SERCOM1 RX Trigger
+// <0x07=> SERCOM1 TX Trigger
+// <0x08=> SERCOM2 RX Trigger
+// <0x09=> SERCOM2 TX Trigger
+// <0x0A=> SERCOM3 RX Trigger
+// <0x0B=> SERCOM3 TX Trigger
+// <0x0C=> SERCOM4 RX Trigger
+// <0x0D=> SERCOM4 TX Trigger
+// <0x0E=> SERCOM5 RX Trigger
+// <0x0F=> SERCOM5 TX Trigger
+// <0x10=> SERCOM6 RX Trigger
+// <0x11=> SERCOM6 TX Trigger
+// <0x12=> SERCOM7 RX Trigger
+// <0x13=> SERCOM7 TX Trigger
+// <0x14=> CAN0 DEBUG Trigger
+// <0x15=> CAN1 DEBUG Trigger
+// <0x16=> TCC0 Overflow Trigger Trigger
+// <0x17=> TCC0 Match/Compare 0 Trigger Trigger
+// <0x18=> TCC0 Match/Compare 1 Trigger Trigger
+// <0x19=> TCC0 Match/Compare 2 Trigger Trigger
+// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger
+// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger
+// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger
+// <0x1D=> TCC1 Overflow Trigger Trigger
+// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger
+// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger
+// <0x20=> TCC1 Match/Compare 2 Trigger Trigger
+// <0x21=> TCC1 Match/Compare 3 Trigger Trigger
+// <0x22=> TCC2 Overflow Trigger Trigger
+// <0x23=> TCC2 Match/Compare 0 Trigger Trigger
+// <0x24=> TCC2 Match/Compare 1 Trigger Trigger
+// <0x25=> TCC2 Match/Compare 2 Trigger Trigger
+// <0x26=> TCC3 Overflow Trigger Trigger
+// <0x27=> TCC3 Match/Compare 0 Trigger Trigger
+// <0x28=> TCC3 Match/Compare 1 Trigger Trigger
+// <0x29=> TCC4 Overflow Trigger Trigger
+// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger
+// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger
+// <0x2C=> TC0 Overflow Trigger
+// <0x2D=> TC0 Match/Compare 0 Trigger
+// <0x2E=> TC0 Match/Compare 1 Trigger
+// <0x2F=> TC1 Overflow Trigger
+// <0x30=> TC1 Match/Compare 0 Trigger
+// <0x31=> TC1 Match/Compare 1 Trigger
+// <0x32=> TC2 Overflow Trigger
+// <0x33=> TC2 Match/Compare 0 Trigger
+// <0x34=> TC2 Match/Compare 1 Trigger
+// <0x35=> TC3 Overflow Trigger
+// <0x36=> TC3 Match/Compare 0 Trigger
+// <0x37=> TC3 Match/Compare 1 Trigger
+// <0x38=> TC4 Overflow Trigger
+// <0x39=> TC4 Match/Compare 0 Trigger
+// <0x3A=> TC4 Match/Compare 1 Trigger
+// <0x3B=> TC5 Overflow Trigger
+// <0x3C=> TC5 Match/Compare 0 Trigger
+// <0x3D=> TC5 Match/Compare 1 Trigger
+// <0x3E=> TC6 Overflow Trigger
+// <0x3F=> TC6 Match/Compare 0 Trigger
+// <0x40=> TC6 Match/Compare 1 Trigger
+// <0x41=> TC7 Overflow Trigger
+// <0x42=> TC7 Match/Compare 0 Trigger
+// <0x43=> TC7 Match/Compare 1 Trigger
+// <0x44=> ADC0 Result Ready Trigger
+// <0x45=> ADC0 Sequencing Trigger
+// <0x46=> ADC1 Result Ready Trigger
+// <0x47=> ADC1 Sequencing Trigger
+// <0x48=> DAC Empty 0 Trigger
+// <0x49=> DAC Empty 1 Trigger
+// <0x4A=> DAC Result Ready 0 Trigger
+// <0x4B=> DAC Result Ready 1 Trigger
+// <0x4C=> I2S Rx 0 Trigger
+// <0x4D=> I2S Rx 1 Trigger
+// <0x4E=> I2S Tx 0 Trigger
+// <0x4F=> I2S Tx 1 Trigger
+// <0x50=> PCC RX Trigger
+// <0x51=> AES Write Trigger
+// <0x52=> AES Read Trigger
+// <0x53=> QSPI Rx Trigger
+// <0x54=> QSPI Tx Trigger
+// Defines the peripheral trigger which is source of the transfer
+// dmac_trifsrc_16
+#ifndef CONF_DMAC_TRIGSRC_16
+#define CONF_DMAC_TRIGSRC_16 0
+#endif
+
+// Channel Arbitration Level
+// <0=> Channel priority 0
+// <1=> Channel priority 1
+// <2=> Channel priority 2
+// <3=> Channel priority 3
+// Defines the arbitration level for this channel
+// dmac_lvl_16
+#ifndef CONF_DMAC_LVL_16
+#define CONF_DMAC_LVL_16 0
+#endif
+
+// Channel Event Output
+// Indicates whether channel event generation is enabled or not
+// dmac_evoe_16
+#ifndef CONF_DMAC_EVOE_16
+#define CONF_DMAC_EVOE_16 0
+#endif
+
+// Channel Event Input
+// Indicates whether channel event reception is enabled or not
+// dmac_evie_16
+#ifndef CONF_DMAC_EVIE_16
+#define CONF_DMAC_EVIE_16 0
+#endif
+
+// Event Input Action
+// <0=> No action
+// <1=> Normal transfer and conditional transfer on strobe trigger
+// <2=> Conditional transfer trigger
+// <3=> Conditional block transfer
+// <4=> Channel suspend operation
+// <5=> Channel resume operation
+// <6=> Skip next block suspend action
+// Defines the event input action
+// dmac_evact_16
+#ifndef CONF_DMAC_EVACT_16
+#define CONF_DMAC_EVACT_16 0
+#endif
+
+// Address Increment Step Size
+// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1
+// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2
+// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4
+// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8
+// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16
+// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32
+// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64
+// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128
+// Defines the address increment step size, applies to source or destination address
+// dmac_stepsize_16
+#ifndef CONF_DMAC_STEPSIZE_16
+#define CONF_DMAC_STEPSIZE_16 0
+#endif
+
+// Step Selection
+// <0=> Step size settings apply to the destination address
+// <1=> Step size settings apply to the source address
+// Defines whether source or destination addresses are using the step size settings
+// dmac_stepsel_16
+#ifndef CONF_DMAC_STEPSEL_16
+#define CONF_DMAC_STEPSEL_16 0
+#endif
+
+// Source Address Increment
+// Indicates whether the source address incrementation is enabled or not
+// dmac_srcinc_16
+#ifndef CONF_DMAC_SRCINC_16
+#define CONF_DMAC_SRCINC_16 0
+#endif
+
+// Destination Address Increment
+// Indicates whether the destination address incrementation is enabled or not
+// dmac_dstinc_16
+#ifndef CONF_DMAC_DSTINC_16
+#define CONF_DMAC_DSTINC_16 0
+#endif
+
+// Beat Size
+// <0=> 8-bit bus transfer
+// <1=> 16-bit bus transfer
+// <2=> 32-bit bus transfer
+// Defines the size of one beat
+// dmac_beatsize_16
+#ifndef CONF_DMAC_BEATSIZE_16
+#define CONF_DMAC_BEATSIZE_16 0
+#endif
+
+// Block Action
+// <0=> Channel will be disabled if it is the last block transfer in the transaction
+// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt
+// <2=> Channel suspend operation is complete
+// <3=> Both channel suspend operation and block interrupt
+// Defines the the DMAC should take after a block transfer has completed
+// dmac_blockact_16
+#ifndef CONF_DMAC_BLOCKACT_16
+#define CONF_DMAC_BLOCKACT_16 0
+#endif
+
+// Event Output Selection
+// <0=> Event generation disabled
+// <1=> Event strobe when block transfer complete
+// <3=> Event strobe when beat transfer complete
+// Defines the event output selection
+// dmac_evosel_16
+#ifndef CONF_DMAC_EVOSEL_16
+#define CONF_DMAC_EVOSEL_16 0
+#endif
+//
+
+// Channel 17 settings
+// dmac_channel_17_settings
+#ifndef CONF_DMAC_CHANNEL_17_SETTINGS
+#define CONF_DMAC_CHANNEL_17_SETTINGS 0
+#endif
+
+// Channel Run in Standby
+// Indicates whether channel 17 is running in standby mode or not
+// dmac_runstdby_17
+#ifndef CONF_DMAC_RUNSTDBY_17
+#define CONF_DMAC_RUNSTDBY_17 0
+#endif
+
+// Trigger action
+// <0=> One trigger required for each block transfer
+// <2=> One trigger required for each beat transfer
+// <3=> One trigger required for each transaction
+// Defines the trigger action used for a transfer
+// dmac_trigact_17
+#ifndef CONF_DMAC_TRIGACT_17
+#define CONF_DMAC_TRIGACT_17 0
+#endif
+
+// Trigger source
+// <0x00=> Only software/event triggers
+// <0x01=> RTC Time Stamp Trigger
+// <0x02=> DSU Debug Communication Channel 0 Trigger
+// <0x03=> DSU Debug Communication Channel 1 Trigger
+// <0x04=> SERCOM0 RX Trigger
+// <0x05=> SERCOM0 TX Trigger
+// <0x06=> SERCOM1 RX Trigger
+// <0x07=> SERCOM1 TX Trigger
+// <0x08=> SERCOM2 RX Trigger
+// <0x09=> SERCOM2 TX Trigger
+// <0x0A=> SERCOM3 RX Trigger
+// <0x0B=> SERCOM3 TX Trigger
+// <0x0C=> SERCOM4 RX Trigger
+// <0x0D=> SERCOM4 TX Trigger
+// <0x0E=> SERCOM5 RX Trigger
+// <0x0F=> SERCOM5 TX Trigger
+// <0x10=> SERCOM6 RX Trigger
+// <0x11=> SERCOM6 TX Trigger
+// <0x12=> SERCOM7 RX Trigger
+// <0x13=> SERCOM7 TX Trigger
+// <0x14=> CAN0 DEBUG Trigger
+// <0x15=> CAN1 DEBUG Trigger
+// <0x16=> TCC0 Overflow Trigger Trigger
+// <0x17=> TCC0 Match/Compare 0 Trigger Trigger
+// <0x18=> TCC0 Match/Compare 1 Trigger Trigger
+// <0x19=> TCC0 Match/Compare 2 Trigger Trigger
+// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger
+// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger
+// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger
+// <0x1D=> TCC1 Overflow Trigger Trigger
+// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger
+// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger
+// <0x20=> TCC1 Match/Compare 2 Trigger Trigger
+// <0x21=> TCC1 Match/Compare 3 Trigger Trigger
+// <0x22=> TCC2 Overflow Trigger Trigger
+// <0x23=> TCC2 Match/Compare 0 Trigger Trigger
+// <0x24=> TCC2 Match/Compare 1 Trigger Trigger
+// <0x25=> TCC2 Match/Compare 2 Trigger Trigger
+// <0x26=> TCC3 Overflow Trigger Trigger
+// <0x27=> TCC3 Match/Compare 0 Trigger Trigger
+// <0x28=> TCC3 Match/Compare 1 Trigger Trigger
+// <0x29=> TCC4 Overflow Trigger Trigger
+// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger
+// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger
+// <0x2C=> TC0 Overflow Trigger
+// <0x2D=> TC0 Match/Compare 0 Trigger
+// <0x2E=> TC0 Match/Compare 1 Trigger
+// <0x2F=> TC1 Overflow Trigger
+// <0x30=> TC1 Match/Compare 0 Trigger
+// <0x31=> TC1 Match/Compare 1 Trigger
+// <0x32=> TC2 Overflow Trigger
+// <0x33=> TC2 Match/Compare 0 Trigger
+// <0x34=> TC2 Match/Compare 1 Trigger
+// <0x35=> TC3 Overflow Trigger
+// <0x36=> TC3 Match/Compare 0 Trigger
+// <0x37=> TC3 Match/Compare 1 Trigger
+// <0x38=> TC4 Overflow Trigger
+// <0x39=> TC4 Match/Compare 0 Trigger
+// <0x3A=> TC4 Match/Compare 1 Trigger
+// <0x3B=> TC5 Overflow Trigger
+// <0x3C=> TC5 Match/Compare 0 Trigger
+// <0x3D=> TC5 Match/Compare 1 Trigger
+// <0x3E=> TC6 Overflow Trigger
+// <0x3F=> TC6 Match/Compare 0 Trigger
+// <0x40=> TC6 Match/Compare 1 Trigger
+// <0x41=> TC7 Overflow Trigger
+// <0x42=> TC7 Match/Compare 0 Trigger
+// <0x43=> TC7 Match/Compare 1 Trigger
+// <0x44=> ADC0 Result Ready Trigger
+// <0x45=> ADC0 Sequencing Trigger
+// <0x46=> ADC1 Result Ready Trigger
+// <0x47=> ADC1 Sequencing Trigger
+// <0x48=> DAC Empty 0 Trigger
+// <0x49=> DAC Empty 1 Trigger
+// <0x4A=> DAC Result Ready 0 Trigger
+// <0x4B=> DAC Result Ready 1 Trigger
+// <0x4C=> I2S Rx 0 Trigger
+// <0x4D=> I2S Rx 1 Trigger
+// <0x4E=> I2S Tx 0 Trigger
+// <0x4F=> I2S Tx 1 Trigger
+// <0x50=> PCC RX Trigger
+// <0x51=> AES Write Trigger
+// <0x52=> AES Read Trigger
+// <0x53=> QSPI Rx Trigger
+// <0x54=> QSPI Tx Trigger
+// Defines the peripheral trigger which is source of the transfer
+// dmac_trifsrc_17
+#ifndef CONF_DMAC_TRIGSRC_17
+#define CONF_DMAC_TRIGSRC_17 0
+#endif
+
+// Channel Arbitration Level
+// <0=> Channel priority 0
+// <1=> Channel priority 1
+// <2=> Channel priority 2
+// <3=> Channel priority 3
+// Defines the arbitration level for this channel
+// dmac_lvl_17
+#ifndef CONF_DMAC_LVL_17
+#define CONF_DMAC_LVL_17 0
+#endif
+
+// Channel Event Output
+// Indicates whether channel event generation is enabled or not
+// dmac_evoe_17
+#ifndef CONF_DMAC_EVOE_17
+#define CONF_DMAC_EVOE_17 0
+#endif
+
+// Channel Event Input
+// Indicates whether channel event reception is enabled or not
+// dmac_evie_17
+#ifndef CONF_DMAC_EVIE_17
+#define CONF_DMAC_EVIE_17 0
+#endif
+
+// Event Input Action
+// <0=> No action
+// <1=> Normal transfer and conditional transfer on strobe trigger
+// <2=> Conditional transfer trigger
+// <3=> Conditional block transfer
+// <4=> Channel suspend operation
+// <5=> Channel resume operation
+// <6=> Skip next block suspend action
+// Defines the event input action
+// dmac_evact_17
+#ifndef CONF_DMAC_EVACT_17
+#define CONF_DMAC_EVACT_17 0
+#endif
+
+// Address Increment Step Size
+// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1
+// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2
+// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4
+// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8
+// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16
+// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32
+// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64
+// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128
+// Defines the address increment step size, applies to source or destination address
+// dmac_stepsize_17
+#ifndef CONF_DMAC_STEPSIZE_17
+#define CONF_DMAC_STEPSIZE_17 0
+#endif
+
+// Step Selection
+// <0=> Step size settings apply to the destination address
+// <1=> Step size settings apply to the source address
+// Defines whether source or destination addresses are using the step size settings
+// dmac_stepsel_17
+#ifndef CONF_DMAC_STEPSEL_17
+#define CONF_DMAC_STEPSEL_17 0
+#endif
+
+// Source Address Increment
+// Indicates whether the source address incrementation is enabled or not
+// dmac_srcinc_17
+#ifndef CONF_DMAC_SRCINC_17
+#define CONF_DMAC_SRCINC_17 0
+#endif
+
+// Destination Address Increment
+// Indicates whether the destination address incrementation is enabled or not
+// dmac_dstinc_17
+#ifndef CONF_DMAC_DSTINC_17
+#define CONF_DMAC_DSTINC_17 0
+#endif
+
+// Beat Size
+// <0=> 8-bit bus transfer
+// <1=> 16-bit bus transfer
+// <2=> 32-bit bus transfer
+// Defines the size of one beat
+// dmac_beatsize_17
+#ifndef CONF_DMAC_BEATSIZE_17
+#define CONF_DMAC_BEATSIZE_17 0
+#endif
+
+// Block Action
+// <0=> Channel will be disabled if it is the last block transfer in the transaction
+// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt
+// <2=> Channel suspend operation is complete
+// <3=> Both channel suspend operation and block interrupt
+// Defines the the DMAC should take after a block transfer has completed
+// dmac_blockact_17
+#ifndef CONF_DMAC_BLOCKACT_17
+#define CONF_DMAC_BLOCKACT_17 0
+#endif
+
+// Event Output Selection
+// <0=> Event generation disabled
+// <1=> Event strobe when block transfer complete
+// <3=> Event strobe when beat transfer complete
+// Defines the event output selection
+// dmac_evosel_17
+#ifndef CONF_DMAC_EVOSEL_17
+#define CONF_DMAC_EVOSEL_17 0
+#endif
+//
+
+// Channel 18 settings
+// dmac_channel_18_settings
+#ifndef CONF_DMAC_CHANNEL_18_SETTINGS
+#define CONF_DMAC_CHANNEL_18_SETTINGS 0
+#endif
+
+// Channel Run in Standby
+// Indicates whether channel 18 is running in standby mode or not
+// dmac_runstdby_18
+#ifndef CONF_DMAC_RUNSTDBY_18
+#define CONF_DMAC_RUNSTDBY_18 0
+#endif
+
+// Trigger action
+// <0=> One trigger required for each block transfer
+// <2=> One trigger required for each beat transfer
+// <3=> One trigger required for each transaction
+// Defines the trigger action used for a transfer
+// dmac_trigact_18
+#ifndef CONF_DMAC_TRIGACT_18
+#define CONF_DMAC_TRIGACT_18 0
+#endif
+
+// Trigger source
+// <0x00=> Only software/event triggers
+// <0x01=> RTC Time Stamp Trigger
+// <0x02=> DSU Debug Communication Channel 0 Trigger
+// <0x03=> DSU Debug Communication Channel 1 Trigger
+// <0x04=> SERCOM0 RX Trigger
+// <0x05=> SERCOM0 TX Trigger
+// <0x06=> SERCOM1 RX Trigger
+// <0x07=> SERCOM1 TX Trigger
+// <0x08=> SERCOM2 RX Trigger
+// <0x09=> SERCOM2 TX Trigger
+// <0x0A=> SERCOM3 RX Trigger
+// <0x0B=> SERCOM3 TX Trigger
+// <0x0C=> SERCOM4 RX Trigger
+// <0x0D=> SERCOM4 TX Trigger
+// <0x0E=> SERCOM5 RX Trigger
+// <0x0F=> SERCOM5 TX Trigger
+// <0x10=> SERCOM6 RX Trigger
+// <0x11=> SERCOM6 TX Trigger
+// <0x12=> SERCOM7 RX Trigger
+// <0x13=> SERCOM7 TX Trigger
+// <0x14=> CAN0 DEBUG Trigger
+// <0x15=> CAN1 DEBUG Trigger
+// <0x16=> TCC0 Overflow Trigger Trigger
+// <0x17=> TCC0 Match/Compare 0 Trigger Trigger
+// <0x18=> TCC0 Match/Compare 1 Trigger Trigger
+// <0x19=> TCC0 Match/Compare 2 Trigger Trigger
+// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger
+// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger
+// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger
+// <0x1D=> TCC1 Overflow Trigger Trigger
+// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger
+// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger
+// <0x20=> TCC1 Match/Compare 2 Trigger Trigger
+// <0x21=> TCC1 Match/Compare 3 Trigger Trigger
+// <0x22=> TCC2 Overflow Trigger Trigger
+// <0x23=> TCC2 Match/Compare 0 Trigger Trigger
+// <0x24=> TCC2 Match/Compare 1 Trigger Trigger
+// <0x25=> TCC2 Match/Compare 2 Trigger Trigger
+// <0x26=> TCC3 Overflow Trigger Trigger
+// <0x27=> TCC3 Match/Compare 0 Trigger Trigger
+// <0x28=> TCC3 Match/Compare 1 Trigger Trigger
+// <0x29=> TCC4 Overflow Trigger Trigger
+// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger
+// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger
+// <0x2C=> TC0 Overflow Trigger
+// <0x2D=> TC0 Match/Compare 0 Trigger
+// <0x2E=> TC0 Match/Compare 1 Trigger
+// <0x2F=> TC1 Overflow Trigger
+// <0x30=> TC1 Match/Compare 0 Trigger
+// <0x31=> TC1 Match/Compare 1 Trigger
+// <0x32=> TC2 Overflow Trigger
+// <0x33=> TC2 Match/Compare 0 Trigger
+// <0x34=> TC2 Match/Compare 1 Trigger
+// <0x35=> TC3 Overflow Trigger
+// <0x36=> TC3 Match/Compare 0 Trigger
+// <0x37=> TC3 Match/Compare 1 Trigger
+// <0x38=> TC4 Overflow Trigger
+// <0x39=> TC4 Match/Compare 0 Trigger
+// <0x3A=> TC4 Match/Compare 1 Trigger
+// <0x3B=> TC5 Overflow Trigger
+// <0x3C=> TC5 Match/Compare 0 Trigger
+// <0x3D=> TC5 Match/Compare 1 Trigger
+// <0x3E=> TC6 Overflow Trigger
+// <0x3F=> TC6 Match/Compare 0 Trigger
+// <0x40=> TC6 Match/Compare 1 Trigger
+// <0x41=> TC7 Overflow Trigger
+// <0x42=> TC7 Match/Compare 0 Trigger
+// <0x43=> TC7 Match/Compare 1 Trigger
+// <0x44=> ADC0 Result Ready Trigger
+// <0x45=> ADC0 Sequencing Trigger
+// <0x46=> ADC1 Result Ready Trigger
+// <0x47=> ADC1 Sequencing Trigger
+// <0x48=> DAC Empty 0 Trigger
+// <0x49=> DAC Empty 1 Trigger
+// <0x4A=> DAC Result Ready 0 Trigger
+// <0x4B=> DAC Result Ready 1 Trigger
+// <0x4C=> I2S Rx 0 Trigger
+// <0x4D=> I2S Rx 1 Trigger
+// <0x4E=> I2S Tx 0 Trigger
+// <0x4F=> I2S Tx 1 Trigger
+// <0x50=> PCC RX Trigger
+// <0x51=> AES Write Trigger
+// <0x52=> AES Read Trigger
+// <0x53=> QSPI Rx Trigger
+// <0x54=> QSPI Tx Trigger
+// Defines the peripheral trigger which is source of the transfer
+// dmac_trifsrc_18
+#ifndef CONF_DMAC_TRIGSRC_18
+#define CONF_DMAC_TRIGSRC_18 0
+#endif
+
+// Channel Arbitration Level
+// <0=> Channel priority 0
+// <1=> Channel priority 1
+// <2=> Channel priority 2
+// <3=> Channel priority 3
+// Defines the arbitration level for this channel
+// dmac_lvl_18
+#ifndef CONF_DMAC_LVL_18
+#define CONF_DMAC_LVL_18 0
+#endif
+
+// Channel Event Output
+// Indicates whether channel event generation is enabled or not
+// dmac_evoe_18
+#ifndef CONF_DMAC_EVOE_18
+#define CONF_DMAC_EVOE_18 0
+#endif
+
+// Channel Event Input
+// Indicates whether channel event reception is enabled or not
+// dmac_evie_18
+#ifndef CONF_DMAC_EVIE_18
+#define CONF_DMAC_EVIE_18 0
+#endif
+
+// Event Input Action
+// <0=> No action
+// <1=> Normal transfer and conditional transfer on strobe trigger
+// <2=> Conditional transfer trigger
+// <3=> Conditional block transfer
+// <4=> Channel suspend operation
+// <5=> Channel resume operation
+// <6=> Skip next block suspend action
+// Defines the event input action
+// dmac_evact_18
+#ifndef CONF_DMAC_EVACT_18
+#define CONF_DMAC_EVACT_18 0
+#endif
+
+// Address Increment Step Size
+// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1
+// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2
+// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4
+// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8
+// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16
+// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32
+// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64
+// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128
+// Defines the address increment step size, applies to source or destination address
+// dmac_stepsize_18
+#ifndef CONF_DMAC_STEPSIZE_18
+#define CONF_DMAC_STEPSIZE_18 0
+#endif
+
+// Step Selection
+// <0=> Step size settings apply to the destination address
+// <1=> Step size settings apply to the source address
+// Defines whether source or destination addresses are using the step size settings
+// dmac_stepsel_18
+#ifndef CONF_DMAC_STEPSEL_18
+#define CONF_DMAC_STEPSEL_18 0
+#endif
+
+// Source Address Increment
+// Indicates whether the source address incrementation is enabled or not
+// dmac_srcinc_18
+#ifndef CONF_DMAC_SRCINC_18
+#define CONF_DMAC_SRCINC_18 0
+#endif
+
+// Destination Address Increment
+// Indicates whether the destination address incrementation is enabled or not
+// dmac_dstinc_18
+#ifndef CONF_DMAC_DSTINC_18
+#define CONF_DMAC_DSTINC_18 0
+#endif
+
+// Beat Size
+// <0=> 8-bit bus transfer
+// <1=> 16-bit bus transfer
+// <2=> 32-bit bus transfer
+// Defines the size of one beat
+// dmac_beatsize_18
+#ifndef CONF_DMAC_BEATSIZE_18
+#define CONF_DMAC_BEATSIZE_18 0
+#endif
+
+// Block Action
+// <0=> Channel will be disabled if it is the last block transfer in the transaction
+// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt
+// <2=> Channel suspend operation is complete
+// <3=> Both channel suspend operation and block interrupt
+// Defines the the DMAC should take after a block transfer has completed
+// dmac_blockact_18
+#ifndef CONF_DMAC_BLOCKACT_18
+#define CONF_DMAC_BLOCKACT_18 0
+#endif
+
+// Event Output Selection
+// <0=> Event generation disabled
+// <1=> Event strobe when block transfer complete
+// <3=> Event strobe when beat transfer complete
+// Defines the event output selection
+// dmac_evosel_18
+#ifndef CONF_DMAC_EVOSEL_18
+#define CONF_DMAC_EVOSEL_18 0
+#endif
+//
+
+// Channel 19 settings
+// dmac_channel_19_settings
+#ifndef CONF_DMAC_CHANNEL_19_SETTINGS
+#define CONF_DMAC_CHANNEL_19_SETTINGS 0
+#endif
+
+// Channel Run in Standby
+// Indicates whether channel 19 is running in standby mode or not
+// dmac_runstdby_19
+#ifndef CONF_DMAC_RUNSTDBY_19
+#define CONF_DMAC_RUNSTDBY_19 0
+#endif
+
+// Trigger action
+// <0=> One trigger required for each block transfer
+// <2=> One trigger required for each beat transfer
+// <3=> One trigger required for each transaction
+// Defines the trigger action used for a transfer
+// dmac_trigact_19
+#ifndef CONF_DMAC_TRIGACT_19
+#define CONF_DMAC_TRIGACT_19 0
+#endif
+
+// Trigger source
+// <0x00=> Only software/event triggers
+// <0x01=> RTC Time Stamp Trigger
+// <0x02=> DSU Debug Communication Channel 0 Trigger
+// <0x03=> DSU Debug Communication Channel 1 Trigger
+// <0x04=> SERCOM0 RX Trigger
+// <0x05=> SERCOM0 TX Trigger
+// <0x06=> SERCOM1 RX Trigger
+// <0x07=> SERCOM1 TX Trigger
+// <0x08=> SERCOM2 RX Trigger
+// <0x09=> SERCOM2 TX Trigger
+// <0x0A=> SERCOM3 RX Trigger
+// <0x0B=> SERCOM3 TX Trigger
+// <0x0C=> SERCOM4 RX Trigger
+// <0x0D=> SERCOM4 TX Trigger
+// <0x0E=> SERCOM5 RX Trigger
+// <0x0F=> SERCOM5 TX Trigger
+// <0x10=> SERCOM6 RX Trigger
+// <0x11=> SERCOM6 TX Trigger
+// <0x12=> SERCOM7 RX Trigger
+// <0x13=> SERCOM7 TX Trigger
+// <0x14=> CAN0 DEBUG Trigger
+// <0x15=> CAN1 DEBUG Trigger
+// <0x16=> TCC0 Overflow Trigger Trigger
+// <0x17=> TCC0 Match/Compare 0 Trigger Trigger
+// <0x18=> TCC0 Match/Compare 1 Trigger Trigger
+// <0x19=> TCC0 Match/Compare 2 Trigger Trigger
+// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger
+// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger
+// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger
+// <0x1D=> TCC1 Overflow Trigger Trigger
+// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger
+// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger
+// <0x20=> TCC1 Match/Compare 2 Trigger Trigger
+// <0x21=> TCC1 Match/Compare 3 Trigger Trigger
+// <0x22=> TCC2 Overflow Trigger Trigger
+// <0x23=> TCC2 Match/Compare 0 Trigger Trigger
+// <0x24=> TCC2 Match/Compare 1 Trigger Trigger
+// <0x25=> TCC2 Match/Compare 2 Trigger Trigger
+// <0x26=> TCC3 Overflow Trigger Trigger
+// <0x27=> TCC3 Match/Compare 0 Trigger Trigger
+// <0x28=> TCC3 Match/Compare 1 Trigger Trigger
+// <0x29=> TCC4 Overflow Trigger Trigger
+// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger
+// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger
+// <0x2C=> TC0 Overflow Trigger
+// <0x2D=> TC0 Match/Compare 0 Trigger
+// <0x2E=> TC0 Match/Compare 1 Trigger
+// <0x2F=> TC1 Overflow Trigger
+// <0x30=> TC1 Match/Compare 0 Trigger
+// <0x31=> TC1 Match/Compare 1 Trigger
+// <0x32=> TC2 Overflow Trigger
+// <0x33=> TC2 Match/Compare 0 Trigger
+// <0x34=> TC2 Match/Compare 1 Trigger
+// <0x35=> TC3 Overflow Trigger
+// <0x36=> TC3 Match/Compare 0 Trigger
+// <0x37=> TC3 Match/Compare 1 Trigger
+// <0x38=> TC4 Overflow Trigger
+// <0x39=> TC4 Match/Compare 0 Trigger
+// <0x3A=> TC4 Match/Compare 1 Trigger
+// <0x3B=> TC5 Overflow Trigger
+// <0x3C=> TC5 Match/Compare 0 Trigger
+// <0x3D=> TC5 Match/Compare 1 Trigger
+// <0x3E=> TC6 Overflow Trigger
+// <0x3F=> TC6 Match/Compare 0 Trigger
+// <0x40=> TC6 Match/Compare 1 Trigger
+// <0x41=> TC7 Overflow Trigger
+// <0x42=> TC7 Match/Compare 0 Trigger
+// <0x43=> TC7 Match/Compare 1 Trigger
+// <0x44=> ADC0 Result Ready Trigger
+// <0x45=> ADC0 Sequencing Trigger
+// <0x46=> ADC1 Result Ready Trigger
+// <0x47=> ADC1 Sequencing Trigger
+// <0x48=> DAC Empty 0 Trigger
+// <0x49=> DAC Empty 1 Trigger
+// <0x4A=> DAC Result Ready 0 Trigger
+// <0x4B=> DAC Result Ready 1 Trigger
+// <0x4C=> I2S Rx 0 Trigger
+// <0x4D=> I2S Rx 1 Trigger
+// <0x4E=> I2S Tx 0 Trigger
+// <0x4F=> I2S Tx 1 Trigger
+// <0x50=> PCC RX Trigger
+// <0x51=> AES Write Trigger
+// <0x52=> AES Read Trigger
+// <0x53=> QSPI Rx Trigger
+// <0x54=> QSPI Tx Trigger
+// Defines the peripheral trigger which is source of the transfer
+// dmac_trifsrc_19
+#ifndef CONF_DMAC_TRIGSRC_19
+#define CONF_DMAC_TRIGSRC_19 0
+#endif
+
+// Channel Arbitration Level
+// <0=> Channel priority 0
+// <1=> Channel priority 1
+// <2=> Channel priority 2
+// <3=> Channel priority 3
+// Defines the arbitration level for this channel
+// dmac_lvl_19
+#ifndef CONF_DMAC_LVL_19
+#define CONF_DMAC_LVL_19 0
+#endif
+
+// Channel Event Output
+// Indicates whether channel event generation is enabled or not
+// dmac_evoe_19
+#ifndef CONF_DMAC_EVOE_19
+#define CONF_DMAC_EVOE_19 0
+#endif
+
+// Channel Event Input
+// Indicates whether channel event reception is enabled or not
+// dmac_evie_19
+#ifndef CONF_DMAC_EVIE_19
+#define CONF_DMAC_EVIE_19 0
+#endif
+
+// Event Input Action
+// <0=> No action
+// <1=> Normal transfer and conditional transfer on strobe trigger
+// <2=> Conditional transfer trigger
+// <3=> Conditional block transfer
+// <4=> Channel suspend operation
+// <5=> Channel resume operation
+// <6=> Skip next block suspend action
+// Defines the event input action
+// dmac_evact_19
+#ifndef CONF_DMAC_EVACT_19
+#define CONF_DMAC_EVACT_19 0
+#endif
+
+// Address Increment Step Size
+// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1
+// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2
+// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4
+// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8
+// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16
+// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32
+// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64
+// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128
+// Defines the address increment step size, applies to source or destination address
+// dmac_stepsize_19
+#ifndef CONF_DMAC_STEPSIZE_19
+#define CONF_DMAC_STEPSIZE_19 0
+#endif
+
+// Step Selection
+// <0=> Step size settings apply to the destination address
+// <1=> Step size settings apply to the source address
+// Defines whether source or destination addresses are using the step size settings
+// dmac_stepsel_19
+#ifndef CONF_DMAC_STEPSEL_19
+#define CONF_DMAC_STEPSEL_19 0
+#endif
+
+// Source Address Increment
+// Indicates whether the source address incrementation is enabled or not
+// dmac_srcinc_19
+#ifndef CONF_DMAC_SRCINC_19
+#define CONF_DMAC_SRCINC_19 0
+#endif
+
+// Destination Address Increment
+// Indicates whether the destination address incrementation is enabled or not
+// dmac_dstinc_19
+#ifndef CONF_DMAC_DSTINC_19
+#define CONF_DMAC_DSTINC_19 0
+#endif
+
+// Beat Size
+// <0=> 8-bit bus transfer
+// <1=> 16-bit bus transfer
+// <2=> 32-bit bus transfer
+// Defines the size of one beat
+// dmac_beatsize_19
+#ifndef CONF_DMAC_BEATSIZE_19
+#define CONF_DMAC_BEATSIZE_19 0
+#endif
+
+// Block Action
+// <0=> Channel will be disabled if it is the last block transfer in the transaction
+// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt
+// <2=> Channel suspend operation is complete
+// <3=> Both channel suspend operation and block interrupt
+// Defines the the DMAC should take after a block transfer has completed
+// dmac_blockact_19
+#ifndef CONF_DMAC_BLOCKACT_19
+#define CONF_DMAC_BLOCKACT_19 0
+#endif
+
+// Event Output Selection
+// <0=> Event generation disabled
+// <1=> Event strobe when block transfer complete
+// <3=> Event strobe when beat transfer complete
+// Defines the event output selection
+// dmac_evosel_19
+#ifndef CONF_DMAC_EVOSEL_19
+#define CONF_DMAC_EVOSEL_19 0
+#endif
+//
+
+// Channel 20 settings
+// dmac_channel_20_settings
+#ifndef CONF_DMAC_CHANNEL_20_SETTINGS
+#define CONF_DMAC_CHANNEL_20_SETTINGS 0
+#endif
+
+// Channel Run in Standby
+// Indicates whether channel 20 is running in standby mode or not
+// dmac_runstdby_20
+#ifndef CONF_DMAC_RUNSTDBY_20
+#define CONF_DMAC_RUNSTDBY_20 0
+#endif
+
+// Trigger action
+// <0=> One trigger required for each block transfer
+// <2=> One trigger required for each beat transfer
+// <3=> One trigger required for each transaction
+// Defines the trigger action used for a transfer
+// dmac_trigact_20
+#ifndef CONF_DMAC_TRIGACT_20
+#define CONF_DMAC_TRIGACT_20 0
+#endif
+
+// Trigger source
+// <0x00=> Only software/event triggers
+// <0x01=> RTC Time Stamp Trigger
+// <0x02=> DSU Debug Communication Channel 0 Trigger
+// <0x03=> DSU Debug Communication Channel 1 Trigger
+// <0x04=> SERCOM0 RX Trigger
+// <0x05=> SERCOM0 TX Trigger
+// <0x06=> SERCOM1 RX Trigger
+// <0x07=> SERCOM1 TX Trigger
+// <0x08=> SERCOM2 RX Trigger
+// <0x09=> SERCOM2 TX Trigger
+// <0x0A=> SERCOM3 RX Trigger
+// <0x0B=> SERCOM3 TX Trigger
+// <0x0C=> SERCOM4 RX Trigger
+// <0x0D=> SERCOM4 TX Trigger
+// <0x0E=> SERCOM5 RX Trigger
+// <0x0F=> SERCOM5 TX Trigger
+// <0x10=> SERCOM6 RX Trigger
+// <0x11=> SERCOM6 TX Trigger
+// <0x12=> SERCOM7 RX Trigger
+// <0x13=> SERCOM7 TX Trigger
+// <0x14=> CAN0 DEBUG Trigger
+// <0x15=> CAN1 DEBUG Trigger
+// <0x16=> TCC0 Overflow Trigger Trigger
+// <0x17=> TCC0 Match/Compare 0 Trigger Trigger
+// <0x18=> TCC0 Match/Compare 1 Trigger Trigger
+// <0x19=> TCC0 Match/Compare 2 Trigger Trigger
+// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger
+// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger
+// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger
+// <0x1D=> TCC1 Overflow Trigger Trigger
+// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger
+// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger
+// <0x20=> TCC1 Match/Compare 2 Trigger Trigger
+// <0x21=> TCC1 Match/Compare 3 Trigger Trigger
+// <0x22=> TCC2 Overflow Trigger Trigger
+// <0x23=> TCC2 Match/Compare 0 Trigger Trigger
+// <0x24=> TCC2 Match/Compare 1 Trigger Trigger
+// <0x25=> TCC2 Match/Compare 2 Trigger Trigger
+// <0x26=> TCC3 Overflow Trigger Trigger
+// <0x27=> TCC3 Match/Compare 0 Trigger Trigger
+// <0x28=> TCC3 Match/Compare 1 Trigger Trigger
+// <0x29=> TCC4 Overflow Trigger Trigger
+// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger
+// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger
+// <0x2C=> TC0 Overflow Trigger
+// <0x2D=> TC0 Match/Compare 0 Trigger
+// <0x2E=> TC0 Match/Compare 1 Trigger
+// <0x2F=> TC1 Overflow Trigger
+// <0x30=> TC1 Match/Compare 0 Trigger
+// <0x31=> TC1 Match/Compare 1 Trigger
+// <0x32=> TC2 Overflow Trigger
+// <0x33=> TC2 Match/Compare 0 Trigger
+// <0x34=> TC2 Match/Compare 1 Trigger
+// <0x35=> TC3 Overflow Trigger
+// <0x36=> TC3 Match/Compare 0 Trigger
+// <0x37=> TC3 Match/Compare 1 Trigger
+// <0x38=> TC4 Overflow Trigger
+// <0x39=> TC4 Match/Compare 0 Trigger
+// <0x3A=> TC4 Match/Compare 1 Trigger
+// <0x3B=> TC5 Overflow Trigger
+// <0x3C=> TC5 Match/Compare 0 Trigger
+// <0x3D=> TC5 Match/Compare 1 Trigger
+// <0x3E=> TC6 Overflow Trigger
+// <0x3F=> TC6 Match/Compare 0 Trigger
+// <0x40=> TC6 Match/Compare 1 Trigger
+// <0x41=> TC7 Overflow Trigger
+// <0x42=> TC7 Match/Compare 0 Trigger
+// <0x43=> TC7 Match/Compare 1 Trigger
+// <0x44=> ADC0 Result Ready Trigger
+// <0x45=> ADC0 Sequencing Trigger
+// <0x46=> ADC1 Result Ready Trigger
+// <0x47=> ADC1 Sequencing Trigger
+// <0x48=> DAC Empty 0 Trigger
+// <0x49=> DAC Empty 1 Trigger
+// <0x4A=> DAC Result Ready 0 Trigger
+// <0x4B=> DAC Result Ready 1 Trigger
+// <0x4C=> I2S Rx 0 Trigger
+// <0x4D=> I2S Rx 1 Trigger
+// <0x4E=> I2S Tx 0 Trigger
+// <0x4F=> I2S Tx 1 Trigger
+// <0x50=> PCC RX Trigger
+// <0x51=> AES Write Trigger
+// <0x52=> AES Read Trigger
+// <0x53=> QSPI Rx Trigger
+// <0x54=> QSPI Tx Trigger
+// Defines the peripheral trigger which is source of the transfer
+// dmac_trifsrc_20
+#ifndef CONF_DMAC_TRIGSRC_20
+#define CONF_DMAC_TRIGSRC_20 0
+#endif
+
+// Channel Arbitration Level
+// <0=> Channel priority 0
+// <1=> Channel priority 1
+// <2=> Channel priority 2
+// <3=> Channel priority 3
+// Defines the arbitration level for this channel
+// dmac_lvl_20
+#ifndef CONF_DMAC_LVL_20
+#define CONF_DMAC_LVL_20 0
+#endif
+
+// Channel Event Output
+// Indicates whether channel event generation is enabled or not
+// dmac_evoe_20
+#ifndef CONF_DMAC_EVOE_20
+#define CONF_DMAC_EVOE_20 0
+#endif
+
+// Channel Event Input
+// Indicates whether channel event reception is enabled or not
+// dmac_evie_20
+#ifndef CONF_DMAC_EVIE_20
+#define CONF_DMAC_EVIE_20 0
+#endif
+
+// Event Input Action
+// <0=> No action
+// <1=> Normal transfer and conditional transfer on strobe trigger
+// <2=> Conditional transfer trigger
+// <3=> Conditional block transfer
+// <4=> Channel suspend operation
+// <5=> Channel resume operation
+// <6=> Skip next block suspend action
+// Defines the event input action
+// dmac_evact_20
+#ifndef CONF_DMAC_EVACT_20
+#define CONF_DMAC_EVACT_20 0
+#endif
+
+// Address Increment Step Size
+// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1
+// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2
+// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4
+// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8
+// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16
+// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32
+// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64
+// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128
+// Defines the address increment step size, applies to source or destination address
+// dmac_stepsize_20
+#ifndef CONF_DMAC_STEPSIZE_20
+#define CONF_DMAC_STEPSIZE_20 0
+#endif
+
+// Step Selection
+// <0=> Step size settings apply to the destination address
+// <1=> Step size settings apply to the source address
+// Defines whether source or destination addresses are using the step size settings
+// dmac_stepsel_20
+#ifndef CONF_DMAC_STEPSEL_20
+#define CONF_DMAC_STEPSEL_20 0
+#endif
+
+// Source Address Increment
+// Indicates whether the source address incrementation is enabled or not
+// dmac_srcinc_20
+#ifndef CONF_DMAC_SRCINC_20
+#define CONF_DMAC_SRCINC_20 0
+#endif
+
+// Destination Address Increment
+// Indicates whether the destination address incrementation is enabled or not
+// dmac_dstinc_20
+#ifndef CONF_DMAC_DSTINC_20
+#define CONF_DMAC_DSTINC_20 0
+#endif
+
+// Beat Size
+// <0=> 8-bit bus transfer
+// <1=> 16-bit bus transfer
+// <2=> 32-bit bus transfer
+// Defines the size of one beat
+// dmac_beatsize_20
+#ifndef CONF_DMAC_BEATSIZE_20
+#define CONF_DMAC_BEATSIZE_20 0
+#endif
+
+// Block Action
+// <0=> Channel will be disabled if it is the last block transfer in the transaction
+// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt
+// <2=> Channel suspend operation is complete
+// <3=> Both channel suspend operation and block interrupt
+// Defines the the DMAC should take after a block transfer has completed
+// dmac_blockact_20
+#ifndef CONF_DMAC_BLOCKACT_20
+#define CONF_DMAC_BLOCKACT_20 0
+#endif
+
+// Event Output Selection
+// <0=> Event generation disabled
+// <1=> Event strobe when block transfer complete
+// <3=> Event strobe when beat transfer complete
+// Defines the event output selection
+// dmac_evosel_20
+#ifndef CONF_DMAC_EVOSEL_20
+#define CONF_DMAC_EVOSEL_20 0
+#endif
+//
+
+// Channel 21 settings
+// dmac_channel_21_settings
+#ifndef CONF_DMAC_CHANNEL_21_SETTINGS
+#define CONF_DMAC_CHANNEL_21_SETTINGS 0
+#endif
+
+// Channel Run in Standby
+// Indicates whether channel 21 is running in standby mode or not
+// dmac_runstdby_21
+#ifndef CONF_DMAC_RUNSTDBY_21
+#define CONF_DMAC_RUNSTDBY_21 0
+#endif
+
+// Trigger action
+// <0=> One trigger required for each block transfer
+// <2=> One trigger required for each beat transfer
+// <3=> One trigger required for each transaction
+// Defines the trigger action used for a transfer
+// dmac_trigact_21
+#ifndef CONF_DMAC_TRIGACT_21
+#define CONF_DMAC_TRIGACT_21 0
+#endif
+
+// Trigger source
+// <0x00=> Only software/event triggers
+// <0x01=> RTC Time Stamp Trigger
+// <0x02=> DSU Debug Communication Channel 0 Trigger
+// <0x03=> DSU Debug Communication Channel 1 Trigger
+// <0x04=> SERCOM0 RX Trigger
+// <0x05=> SERCOM0 TX Trigger
+// <0x06=> SERCOM1 RX Trigger
+// <0x07=> SERCOM1 TX Trigger
+// <0x08=> SERCOM2 RX Trigger
+// <0x09=> SERCOM2 TX Trigger
+// <0x0A=> SERCOM3 RX Trigger
+// <0x0B=> SERCOM3 TX Trigger
+// <0x0C=> SERCOM4 RX Trigger
+// <0x0D=> SERCOM4 TX Trigger
+// <0x0E=> SERCOM5 RX Trigger
+// <0x0F=> SERCOM5 TX Trigger
+// <0x10=> SERCOM6 RX Trigger
+// <0x11=> SERCOM6 TX Trigger
+// <0x12=> SERCOM7 RX Trigger
+// <0x13=> SERCOM7 TX Trigger
+// <0x14=> CAN0 DEBUG Trigger
+// <0x15=> CAN1 DEBUG Trigger
+// <0x16=> TCC0 Overflow Trigger Trigger
+// <0x17=> TCC0 Match/Compare 0 Trigger Trigger
+// <0x18=> TCC0 Match/Compare 1 Trigger Trigger
+// <0x19=> TCC0 Match/Compare 2 Trigger Trigger
+// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger
+// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger
+// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger
+// <0x1D=> TCC1 Overflow Trigger Trigger
+// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger
+// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger
+// <0x20=> TCC1 Match/Compare 2 Trigger Trigger
+// <0x21=> TCC1 Match/Compare 3 Trigger Trigger
+// <0x22=> TCC2 Overflow Trigger Trigger
+// <0x23=> TCC2 Match/Compare 0 Trigger Trigger
+// <0x24=> TCC2 Match/Compare 1 Trigger Trigger
+// <0x25=> TCC2 Match/Compare 2 Trigger Trigger
+// <0x26=> TCC3 Overflow Trigger Trigger
+// <0x27=> TCC3 Match/Compare 0 Trigger Trigger
+// <0x28=> TCC3 Match/Compare 1 Trigger Trigger
+// <0x29=> TCC4 Overflow Trigger Trigger
+// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger
+// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger
+// <0x2C=> TC0 Overflow Trigger
+// <0x2D=> TC0 Match/Compare 0 Trigger
+// <0x2E=> TC0 Match/Compare 1 Trigger
+// <0x2F=> TC1 Overflow Trigger
+// <0x30=> TC1 Match/Compare 0 Trigger
+// <0x31=> TC1 Match/Compare 1 Trigger
+// <0x32=> TC2 Overflow Trigger
+// <0x33=> TC2 Match/Compare 0 Trigger
+// <0x34=> TC2 Match/Compare 1 Trigger
+// <0x35=> TC3 Overflow Trigger
+// <0x36=> TC3 Match/Compare 0 Trigger
+// <0x37=> TC3 Match/Compare 1 Trigger
+// <0x38=> TC4 Overflow Trigger
+// <0x39=> TC4 Match/Compare 0 Trigger
+// <0x3A=> TC4 Match/Compare 1 Trigger
+// <0x3B=> TC5 Overflow Trigger
+// <0x3C=> TC5 Match/Compare 0 Trigger
+// <0x3D=> TC5 Match/Compare 1 Trigger
+// <0x3E=> TC6 Overflow Trigger
+// <0x3F=> TC6 Match/Compare 0 Trigger
+// <0x40=> TC6 Match/Compare 1 Trigger
+// <0x41=> TC7 Overflow Trigger
+// <0x42=> TC7 Match/Compare 0 Trigger
+// <0x43=> TC7 Match/Compare 1 Trigger
+// <0x44=> ADC0 Result Ready Trigger
+// <0x45=> ADC0 Sequencing Trigger
+// <0x46=> ADC1 Result Ready Trigger
+// <0x47=> ADC1 Sequencing Trigger
+// <0x48=> DAC Empty 0 Trigger
+// <0x49=> DAC Empty 1 Trigger
+// <0x4A=> DAC Result Ready 0 Trigger
+// <0x4B=> DAC Result Ready 1 Trigger
+// <0x4C=> I2S Rx 0 Trigger
+// <0x4D=> I2S Rx 1 Trigger
+// <0x4E=> I2S Tx 0 Trigger
+// <0x4F=> I2S Tx 1 Trigger
+// <0x50=> PCC RX Trigger
+// <0x51=> AES Write Trigger
+// <0x52=> AES Read Trigger
+// <0x53=> QSPI Rx Trigger
+// <0x54=> QSPI Tx Trigger
+// Defines the peripheral trigger which is source of the transfer
+// dmac_trifsrc_21
+#ifndef CONF_DMAC_TRIGSRC_21
+#define CONF_DMAC_TRIGSRC_21 0
+#endif
+
+// Channel Arbitration Level
+// <0=> Channel priority 0
+// <1=> Channel priority 1
+// <2=> Channel priority 2
+// <3=> Channel priority 3
+// Defines the arbitration level for this channel
+// dmac_lvl_21
+#ifndef CONF_DMAC_LVL_21
+#define CONF_DMAC_LVL_21 0
+#endif
+
+// Channel Event Output
+// Indicates whether channel event generation is enabled or not
+// dmac_evoe_21
+#ifndef CONF_DMAC_EVOE_21
+#define CONF_DMAC_EVOE_21 0
+#endif
+
+// Channel Event Input
+// Indicates whether channel event reception is enabled or not
+// dmac_evie_21
+#ifndef CONF_DMAC_EVIE_21
+#define CONF_DMAC_EVIE_21 0
+#endif
+
+// Event Input Action
+// <0=> No action
+// <1=> Normal transfer and conditional transfer on strobe trigger
+// <2=> Conditional transfer trigger
+// <3=> Conditional block transfer
+// <4=> Channel suspend operation
+// <5=> Channel resume operation
+// <6=> Skip next block suspend action
+// Defines the event input action
+// dmac_evact_21
+#ifndef CONF_DMAC_EVACT_21
+#define CONF_DMAC_EVACT_21 0
+#endif
+
+// Address Increment Step Size
+// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1
+// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2
+// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4
+// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8
+// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16
+// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32
+// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64
+// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128
+// Defines the address increment step size, applies to source or destination address
+// dmac_stepsize_21
+#ifndef CONF_DMAC_STEPSIZE_21
+#define CONF_DMAC_STEPSIZE_21 0
+#endif
+
+// Step Selection
+// <0=> Step size settings apply to the destination address
+// <1=> Step size settings apply to the source address
+// Defines whether source or destination addresses are using the step size settings
+// dmac_stepsel_21
+#ifndef CONF_DMAC_STEPSEL_21
+#define CONF_DMAC_STEPSEL_21 0
+#endif
+
+// Source Address Increment
+// Indicates whether the source address incrementation is enabled or not
+// dmac_srcinc_21
+#ifndef CONF_DMAC_SRCINC_21
+#define CONF_DMAC_SRCINC_21 0
+#endif
+
+// Destination Address Increment
+// Indicates whether the destination address incrementation is enabled or not
+// dmac_dstinc_21
+#ifndef CONF_DMAC_DSTINC_21
+#define CONF_DMAC_DSTINC_21 0
+#endif
+
+// Beat Size
+// <0=> 8-bit bus transfer
+// <1=> 16-bit bus transfer
+// <2=> 32-bit bus transfer
+// Defines the size of one beat
+// dmac_beatsize_21
+#ifndef CONF_DMAC_BEATSIZE_21
+#define CONF_DMAC_BEATSIZE_21 0
+#endif
+
+// Block Action
+// <0=> Channel will be disabled if it is the last block transfer in the transaction
+// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt
+// <2=> Channel suspend operation is complete
+// <3=> Both channel suspend operation and block interrupt
+// Defines the the DMAC should take after a block transfer has completed
+// dmac_blockact_21
+#ifndef CONF_DMAC_BLOCKACT_21
+#define CONF_DMAC_BLOCKACT_21 0
+#endif
+
+// Event Output Selection
+// <0=> Event generation disabled
+// <1=> Event strobe when block transfer complete
+// <3=> Event strobe when beat transfer complete
+// Defines the event output selection
+// dmac_evosel_21
+#ifndef CONF_DMAC_EVOSEL_21
+#define CONF_DMAC_EVOSEL_21 0
+#endif
+//
+
+// Channel 22 settings
+// dmac_channel_22_settings
+#ifndef CONF_DMAC_CHANNEL_22_SETTINGS
+#define CONF_DMAC_CHANNEL_22_SETTINGS 0
+#endif
+
+// Channel Run in Standby
+// Indicates whether channel 22 is running in standby mode or not
+// dmac_runstdby_22
+#ifndef CONF_DMAC_RUNSTDBY_22
+#define CONF_DMAC_RUNSTDBY_22 0
+#endif
+
+// Trigger action
+// <0=> One trigger required for each block transfer
+// <2=> One trigger required for each beat transfer
+// <3=> One trigger required for each transaction
+// Defines the trigger action used for a transfer
+// dmac_trigact_22
+#ifndef CONF_DMAC_TRIGACT_22
+#define CONF_DMAC_TRIGACT_22 0
+#endif
+
+// Trigger source
+// <0x00=> Only software/event triggers
+// <0x01=> RTC Time Stamp Trigger
+// <0x02=> DSU Debug Communication Channel 0 Trigger
+// <0x03=> DSU Debug Communication Channel 1 Trigger
+// <0x04=> SERCOM0 RX Trigger
+// <0x05=> SERCOM0 TX Trigger
+// <0x06=> SERCOM1 RX Trigger
+// <0x07=> SERCOM1 TX Trigger
+// <0x08=> SERCOM2 RX Trigger
+// <0x09=> SERCOM2 TX Trigger
+// <0x0A=> SERCOM3 RX Trigger
+// <0x0B=> SERCOM3 TX Trigger
+// <0x0C=> SERCOM4 RX Trigger
+// <0x0D=> SERCOM4 TX Trigger
+// <0x0E=> SERCOM5 RX Trigger
+// <0x0F=> SERCOM5 TX Trigger
+// <0x10=> SERCOM6 RX Trigger
+// <0x11=> SERCOM6 TX Trigger
+// <0x12=> SERCOM7 RX Trigger
+// <0x13=> SERCOM7 TX Trigger
+// <0x14=> CAN0 DEBUG Trigger
+// <0x15=> CAN1 DEBUG Trigger
+// <0x16=> TCC0 Overflow Trigger Trigger
+// <0x17=> TCC0 Match/Compare 0 Trigger Trigger
+// <0x18=> TCC0 Match/Compare 1 Trigger Trigger
+// <0x19=> TCC0 Match/Compare 2 Trigger Trigger
+// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger
+// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger
+// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger
+// <0x1D=> TCC1 Overflow Trigger Trigger
+// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger
+// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger
+// <0x20=> TCC1 Match/Compare 2 Trigger Trigger
+// <0x21=> TCC1 Match/Compare 3 Trigger Trigger
+// <0x22=> TCC2 Overflow Trigger Trigger
+// <0x23=> TCC2 Match/Compare 0 Trigger Trigger
+// <0x24=> TCC2 Match/Compare 1 Trigger Trigger
+// <0x25=> TCC2 Match/Compare 2 Trigger Trigger
+// <0x26=> TCC3 Overflow Trigger Trigger
+// <0x27=> TCC3 Match/Compare 0 Trigger Trigger
+// <0x28=> TCC3 Match/Compare 1 Trigger Trigger
+// <0x29=> TCC4 Overflow Trigger Trigger
+// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger
+// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger
+// <0x2C=> TC0 Overflow Trigger
+// <0x2D=> TC0 Match/Compare 0 Trigger
+// <0x2E=> TC0 Match/Compare 1 Trigger
+// <0x2F=> TC1 Overflow Trigger
+// <0x30=> TC1 Match/Compare 0 Trigger
+// <0x31=> TC1 Match/Compare 1 Trigger
+// <0x32=> TC2 Overflow Trigger
+// <0x33=> TC2 Match/Compare 0 Trigger
+// <0x34=> TC2 Match/Compare 1 Trigger
+// <0x35=> TC3 Overflow Trigger
+// <0x36=> TC3 Match/Compare 0 Trigger
+// <0x37=> TC3 Match/Compare 1 Trigger
+// <0x38=> TC4 Overflow Trigger
+// <0x39=> TC4 Match/Compare 0 Trigger
+// <0x3A=> TC4 Match/Compare 1 Trigger
+// <0x3B=> TC5 Overflow Trigger
+// <0x3C=> TC5 Match/Compare 0 Trigger
+// <0x3D=> TC5 Match/Compare 1 Trigger
+// <0x3E=> TC6 Overflow Trigger
+// <0x3F=> TC6 Match/Compare 0 Trigger
+// <0x40=> TC6 Match/Compare 1 Trigger
+// <0x41=> TC7 Overflow Trigger
+// <0x42=> TC7 Match/Compare 0 Trigger
+// <0x43=> TC7 Match/Compare 1 Trigger
+// <0x44=> ADC0 Result Ready Trigger
+// <0x45=> ADC0 Sequencing Trigger
+// <0x46=> ADC1 Result Ready Trigger
+// <0x47=> ADC1 Sequencing Trigger
+// <0x48=> DAC Empty 0 Trigger
+// <0x49=> DAC Empty 1 Trigger
+// <0x4A=> DAC Result Ready 0 Trigger
+// <0x4B=> DAC Result Ready 1 Trigger
+// <0x4C=> I2S Rx 0 Trigger
+// <0x4D=> I2S Rx 1 Trigger
+// <0x4E=> I2S Tx 0 Trigger
+// <0x4F=> I2S Tx 1 Trigger
+// <0x50=> PCC RX Trigger
+// <0x51=> AES Write Trigger
+// <0x52=> AES Read Trigger
+// <0x53=> QSPI Rx Trigger
+// <0x54=> QSPI Tx Trigger
+// Defines the peripheral trigger which is source of the transfer
+// dmac_trifsrc_22
+#ifndef CONF_DMAC_TRIGSRC_22
+#define CONF_DMAC_TRIGSRC_22 0
+#endif
+
+// Channel Arbitration Level
+// <0=> Channel priority 0
+// <1=> Channel priority 1
+// <2=> Channel priority 2
+// <3=> Channel priority 3
+// Defines the arbitration level for this channel
+// dmac_lvl_22
+#ifndef CONF_DMAC_LVL_22
+#define CONF_DMAC_LVL_22 0
+#endif
+
+// Channel Event Output
+// Indicates whether channel event generation is enabled or not
+// dmac_evoe_22
+#ifndef CONF_DMAC_EVOE_22
+#define CONF_DMAC_EVOE_22 0
+#endif
+
+// Channel Event Input
+// Indicates whether channel event reception is enabled or not
+// dmac_evie_22
+#ifndef CONF_DMAC_EVIE_22
+#define CONF_DMAC_EVIE_22 0
+#endif
+
+// Event Input Action
+// <0=> No action
+// <1=> Normal transfer and conditional transfer on strobe trigger
+// <2=> Conditional transfer trigger
+// <3=> Conditional block transfer
+// <4=> Channel suspend operation
+// <5=> Channel resume operation
+// <6=> Skip next block suspend action
+// Defines the event input action
+// dmac_evact_22
+#ifndef CONF_DMAC_EVACT_22
+#define CONF_DMAC_EVACT_22 0
+#endif
+
+// Address Increment Step Size
+// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1
+// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2
+// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4
+// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8
+// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16
+// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32
+// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64
+// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128
+// Defines the address increment step size, applies to source or destination address
+// dmac_stepsize_22
+#ifndef CONF_DMAC_STEPSIZE_22
+#define CONF_DMAC_STEPSIZE_22 0
+#endif
+
+// Step Selection
+// <0=> Step size settings apply to the destination address
+// <1=> Step size settings apply to the source address
+// Defines whether source or destination addresses are using the step size settings
+// dmac_stepsel_22
+#ifndef CONF_DMAC_STEPSEL_22
+#define CONF_DMAC_STEPSEL_22 0
+#endif
+
+// Source Address Increment
+// Indicates whether the source address incrementation is enabled or not
+// dmac_srcinc_22
+#ifndef CONF_DMAC_SRCINC_22
+#define CONF_DMAC_SRCINC_22 0
+#endif
+
+// Destination Address Increment
+// Indicates whether the destination address incrementation is enabled or not
+// dmac_dstinc_22
+#ifndef CONF_DMAC_DSTINC_22
+#define CONF_DMAC_DSTINC_22 0
+#endif
+
+// Beat Size
+// <0=> 8-bit bus transfer
+// <1=> 16-bit bus transfer
+// <2=> 32-bit bus transfer
+// Defines the size of one beat
+// dmac_beatsize_22
+#ifndef CONF_DMAC_BEATSIZE_22
+#define CONF_DMAC_BEATSIZE_22 0
+#endif
+
+// Block Action
+// <0=> Channel will be disabled if it is the last block transfer in the transaction
+// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt
+// <2=> Channel suspend operation is complete
+// <3=> Both channel suspend operation and block interrupt
+// Defines the the DMAC should take after a block transfer has completed
+// dmac_blockact_22
+#ifndef CONF_DMAC_BLOCKACT_22
+#define CONF_DMAC_BLOCKACT_22 0
+#endif
+
+// Event Output Selection
+// <0=> Event generation disabled
+// <1=> Event strobe when block transfer complete
+// <3=> Event strobe when beat transfer complete
+// Defines the event output selection
+// dmac_evosel_22
+#ifndef CONF_DMAC_EVOSEL_22
+#define CONF_DMAC_EVOSEL_22 0
+#endif
+//
+
+// Channel 23 settings
+// dmac_channel_23_settings
+#ifndef CONF_DMAC_CHANNEL_23_SETTINGS
+#define CONF_DMAC_CHANNEL_23_SETTINGS 0
+#endif
+
+// Channel Run in Standby
+// Indicates whether channel 23 is running in standby mode or not
+// dmac_runstdby_23
+#ifndef CONF_DMAC_RUNSTDBY_23
+#define CONF_DMAC_RUNSTDBY_23 0
+#endif
+
+// Trigger action
+// <0=> One trigger required for each block transfer
+// <2=> One trigger required for each beat transfer
+// <3=> One trigger required for each transaction
+// Defines the trigger action used for a transfer
+// dmac_trigact_23
+#ifndef CONF_DMAC_TRIGACT_23
+#define CONF_DMAC_TRIGACT_23 0
+#endif
+
+// Trigger source
+// <0x00=> Only software/event triggers
+// <0x01=> RTC Time Stamp Trigger
+// <0x02=> DSU Debug Communication Channel 0 Trigger
+// <0x03=> DSU Debug Communication Channel 1 Trigger
+// <0x04=> SERCOM0 RX Trigger
+// <0x05=> SERCOM0 TX Trigger
+// <0x06=> SERCOM1 RX Trigger
+// <0x07=> SERCOM1 TX Trigger
+// <0x08=> SERCOM2 RX Trigger
+// <0x09=> SERCOM2 TX Trigger
+// <0x0A=> SERCOM3 RX Trigger
+// <0x0B=> SERCOM3 TX Trigger
+// <0x0C=> SERCOM4 RX Trigger
+// <0x0D=> SERCOM4 TX Trigger
+// <0x0E=> SERCOM5 RX Trigger
+// <0x0F=> SERCOM5 TX Trigger
+// <0x10=> SERCOM6 RX Trigger
+// <0x11=> SERCOM6 TX Trigger
+// <0x12=> SERCOM7 RX Trigger
+// <0x13=> SERCOM7 TX Trigger
+// <0x14=> CAN0 DEBUG Trigger
+// <0x15=> CAN1 DEBUG Trigger
+// <0x16=> TCC0 Overflow Trigger Trigger
+// <0x17=> TCC0 Match/Compare 0 Trigger Trigger
+// <0x18=> TCC0 Match/Compare 1 Trigger Trigger
+// <0x19=> TCC0 Match/Compare 2 Trigger Trigger
+// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger
+// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger
+// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger
+// <0x1D=> TCC1 Overflow Trigger Trigger
+// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger
+// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger
+// <0x20=> TCC1 Match/Compare 2 Trigger Trigger
+// <0x21=> TCC1 Match/Compare 3 Trigger Trigger
+// <0x22=> TCC2 Overflow Trigger Trigger
+// <0x23=> TCC2 Match/Compare 0 Trigger Trigger
+// <0x24=> TCC2 Match/Compare 1 Trigger Trigger
+// <0x25=> TCC2 Match/Compare 2 Trigger Trigger
+// <0x26=> TCC3 Overflow Trigger Trigger
+// <0x27=> TCC3 Match/Compare 0 Trigger Trigger
+// <0x28=> TCC3 Match/Compare 1 Trigger Trigger
+// <0x29=> TCC4 Overflow Trigger Trigger
+// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger
+// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger
+// <0x2C=> TC0 Overflow Trigger
+// <0x2D=> TC0 Match/Compare 0 Trigger
+// <0x2E=> TC0 Match/Compare 1 Trigger
+// <0x2F=> TC1 Overflow Trigger
+// <0x30=> TC1 Match/Compare 0 Trigger
+// <0x31=> TC1 Match/Compare 1 Trigger
+// <0x32=> TC2 Overflow Trigger
+// <0x33=> TC2 Match/Compare 0 Trigger
+// <0x34=> TC2 Match/Compare 1 Trigger
+// <0x35=> TC3 Overflow Trigger
+// <0x36=> TC3 Match/Compare 0 Trigger
+// <0x37=> TC3 Match/Compare 1 Trigger
+// <0x38=> TC4 Overflow Trigger
+// <0x39=> TC4 Match/Compare 0 Trigger
+// <0x3A=> TC4 Match/Compare 1 Trigger
+// <0x3B=> TC5 Overflow Trigger
+// <0x3C=> TC5 Match/Compare 0 Trigger
+// <0x3D=> TC5 Match/Compare 1 Trigger
+// <0x3E=> TC6 Overflow Trigger
+// <0x3F=> TC6 Match/Compare 0 Trigger
+// <0x40=> TC6 Match/Compare 1 Trigger
+// <0x41=> TC7 Overflow Trigger
+// <0x42=> TC7 Match/Compare 0 Trigger
+// <0x43=> TC7 Match/Compare 1 Trigger
+// <0x44=> ADC0 Result Ready Trigger
+// <0x45=> ADC0 Sequencing Trigger
+// <0x46=> ADC1 Result Ready Trigger
+// <0x47=> ADC1 Sequencing Trigger
+// <0x48=> DAC Empty 0 Trigger
+// <0x49=> DAC Empty 1 Trigger
+// <0x4A=> DAC Result Ready 0 Trigger
+// <0x4B=> DAC Result Ready 1 Trigger
+// <0x4C=> I2S Rx 0 Trigger
+// <0x4D=> I2S Rx 1 Trigger
+// <0x4E=> I2S Tx 0 Trigger
+// <0x4F=> I2S Tx 1 Trigger
+// <0x50=> PCC RX Trigger
+// <0x51=> AES Write Trigger
+// <0x52=> AES Read Trigger
+// <0x53=> QSPI Rx Trigger
+// <0x54=> QSPI Tx Trigger
+// Defines the peripheral trigger which is source of the transfer
+// dmac_trifsrc_23
+#ifndef CONF_DMAC_TRIGSRC_23
+#define CONF_DMAC_TRIGSRC_23 0
+#endif
+
+// Channel Arbitration Level
+// <0=> Channel priority 0
+// <1=> Channel priority 1
+// <2=> Channel priority 2
+// <3=> Channel priority 3
+// Defines the arbitration level for this channel
+// dmac_lvl_23
+#ifndef CONF_DMAC_LVL_23
+#define CONF_DMAC_LVL_23 0
+#endif
+
+// Channel Event Output
+// Indicates whether channel event generation is enabled or not
+// dmac_evoe_23
+#ifndef CONF_DMAC_EVOE_23
+#define CONF_DMAC_EVOE_23 0
+#endif
+
+// Channel Event Input
+// Indicates whether channel event reception is enabled or not
+// dmac_evie_23
+#ifndef CONF_DMAC_EVIE_23
+#define CONF_DMAC_EVIE_23 0
+#endif
+
+// Event Input Action
+// <0=> No action
+// <1=> Normal transfer and conditional transfer on strobe trigger
+// <2=> Conditional transfer trigger
+// <3=> Conditional block transfer
+// <4=> Channel suspend operation
+// <5=> Channel resume operation
+// <6=> Skip next block suspend action
+// Defines the event input action
+// dmac_evact_23
+#ifndef CONF_DMAC_EVACT_23
+#define CONF_DMAC_EVACT_23 0
+#endif
+
+// Address Increment Step Size
+// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1
+// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2
+// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4
+// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8
+// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16
+// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32
+// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64
+// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128
+// Defines the address increment step size, applies to source or destination address
+// dmac_stepsize_23
+#ifndef CONF_DMAC_STEPSIZE_23
+#define CONF_DMAC_STEPSIZE_23 0
+#endif
+
+// Step Selection
+// <0=> Step size settings apply to the destination address
+// <1=> Step size settings apply to the source address
+// Defines whether source or destination addresses are using the step size settings
+// dmac_stepsel_23
+#ifndef CONF_DMAC_STEPSEL_23
+#define CONF_DMAC_STEPSEL_23 0
+#endif
+
+// Source Address Increment
+// Indicates whether the source address incrementation is enabled or not
+// dmac_srcinc_23
+#ifndef CONF_DMAC_SRCINC_23
+#define CONF_DMAC_SRCINC_23 0
+#endif
+
+// Destination Address Increment
+// Indicates whether the destination address incrementation is enabled or not
+// dmac_dstinc_23
+#ifndef CONF_DMAC_DSTINC_23
+#define CONF_DMAC_DSTINC_23 0
+#endif
+
+// Beat Size
+// <0=> 8-bit bus transfer
+// <1=> 16-bit bus transfer
+// <2=> 32-bit bus transfer
+// Defines the size of one beat
+// dmac_beatsize_23
+#ifndef CONF_DMAC_BEATSIZE_23
+#define CONF_DMAC_BEATSIZE_23 0
+#endif
+
+// Block Action
+// <0=> Channel will be disabled if it is the last block transfer in the transaction
+// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt
+// <2=> Channel suspend operation is complete
+// <3=> Both channel suspend operation and block interrupt
+// Defines the the DMAC should take after a block transfer has completed
+// dmac_blockact_23
+#ifndef CONF_DMAC_BLOCKACT_23
+#define CONF_DMAC_BLOCKACT_23 0
+#endif
+
+// Event Output Selection
+// <0=> Event generation disabled
+// <1=> Event strobe when block transfer complete
+// <3=> Event strobe when beat transfer complete
+// Defines the event output selection
+// dmac_evosel_23
+#ifndef CONF_DMAC_EVOSEL_23
+#define CONF_DMAC_EVOSEL_23 0
+#endif
+//
+
+// Channel 24 settings
+// dmac_channel_24_settings
+#ifndef CONF_DMAC_CHANNEL_24_SETTINGS
+#define CONF_DMAC_CHANNEL_24_SETTINGS 0
+#endif
+
+// Channel Run in Standby
+// Indicates whether channel 24 is running in standby mode or not
+// dmac_runstdby_24
+#ifndef CONF_DMAC_RUNSTDBY_24
+#define CONF_DMAC_RUNSTDBY_24 0
+#endif
+
+// Trigger action
+// <0=> One trigger required for each block transfer
+// <2=> One trigger required for each beat transfer
+// <3=> One trigger required for each transaction
+// Defines the trigger action used for a transfer
+// dmac_trigact_24
+#ifndef CONF_DMAC_TRIGACT_24
+#define CONF_DMAC_TRIGACT_24 0
+#endif
+
+// Trigger source
+// <0x00=> Only software/event triggers
+// <0x01=> RTC Time Stamp Trigger
+// <0x02=> DSU Debug Communication Channel 0 Trigger
+// <0x03=> DSU Debug Communication Channel 1 Trigger
+// <0x04=> SERCOM0 RX Trigger
+// <0x05=> SERCOM0 TX Trigger
+// <0x06=> SERCOM1 RX Trigger
+// <0x07=> SERCOM1 TX Trigger
+// <0x08=> SERCOM2 RX Trigger
+// <0x09=> SERCOM2 TX Trigger
+// <0x0A=> SERCOM3 RX Trigger
+// <0x0B=> SERCOM3 TX Trigger
+// <0x0C=> SERCOM4 RX Trigger
+// <0x0D=> SERCOM4 TX Trigger
+// <0x0E=> SERCOM5 RX Trigger
+// <0x0F=> SERCOM5 TX Trigger
+// <0x10=> SERCOM6 RX Trigger
+// <0x11=> SERCOM6 TX Trigger
+// <0x12=> SERCOM7 RX Trigger
+// <0x13=> SERCOM7 TX Trigger
+// <0x14=> CAN0 DEBUG Trigger
+// <0x15=> CAN1 DEBUG Trigger
+// <0x16=> TCC0 Overflow Trigger Trigger
+// <0x17=> TCC0 Match/Compare 0 Trigger Trigger
+// <0x18=> TCC0 Match/Compare 1 Trigger Trigger
+// <0x19=> TCC0 Match/Compare 2 Trigger Trigger
+// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger
+// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger
+// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger
+// <0x1D=> TCC1 Overflow Trigger Trigger
+// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger
+// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger
+// <0x20=> TCC1 Match/Compare 2 Trigger Trigger
+// <0x21=> TCC1 Match/Compare 3 Trigger Trigger
+// <0x22=> TCC2 Overflow Trigger Trigger
+// <0x23=> TCC2 Match/Compare 0 Trigger Trigger
+// <0x24=> TCC2 Match/Compare 1 Trigger Trigger
+// <0x25=> TCC2 Match/Compare 2 Trigger Trigger
+// <0x26=> TCC3 Overflow Trigger Trigger
+// <0x27=> TCC3 Match/Compare 0 Trigger Trigger
+// <0x28=> TCC3 Match/Compare 1 Trigger Trigger
+// <0x29=> TCC4 Overflow Trigger Trigger
+// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger
+// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger
+// <0x2C=> TC0 Overflow Trigger
+// <0x2D=> TC0 Match/Compare 0 Trigger
+// <0x2E=> TC0 Match/Compare 1 Trigger
+// <0x2F=> TC1 Overflow Trigger
+// <0x30=> TC1 Match/Compare 0 Trigger
+// <0x31=> TC1 Match/Compare 1 Trigger
+// <0x32=> TC2 Overflow Trigger
+// <0x33=> TC2 Match/Compare 0 Trigger
+// <0x34=> TC2 Match/Compare 1 Trigger
+// <0x35=> TC3 Overflow Trigger
+// <0x36=> TC3 Match/Compare 0 Trigger
+// <0x37=> TC3 Match/Compare 1 Trigger
+// <0x38=> TC4 Overflow Trigger
+// <0x39=> TC4 Match/Compare 0 Trigger
+// <0x3A=> TC4 Match/Compare 1 Trigger
+// <0x3B=> TC5 Overflow Trigger
+// <0x3C=> TC5 Match/Compare 0 Trigger
+// <0x3D=> TC5 Match/Compare 1 Trigger
+// <0x3E=> TC6 Overflow Trigger
+// <0x3F=> TC6 Match/Compare 0 Trigger
+// <0x40=> TC6 Match/Compare 1 Trigger
+// <0x41=> TC7 Overflow Trigger
+// <0x42=> TC7 Match/Compare 0 Trigger
+// <0x43=> TC7 Match/Compare 1 Trigger
+// <0x44=> ADC0 Result Ready Trigger
+// <0x45=> ADC0 Sequencing Trigger
+// <0x46=> ADC1 Result Ready Trigger
+// <0x47=> ADC1 Sequencing Trigger
+// <0x48=> DAC Empty 0 Trigger
+// <0x49=> DAC Empty 1 Trigger
+// <0x4A=> DAC Result Ready 0 Trigger
+// <0x4B=> DAC Result Ready 1 Trigger
+// <0x4C=> I2S Rx 0 Trigger
+// <0x4D=> I2S Rx 1 Trigger
+// <0x4E=> I2S Tx 0 Trigger
+// <0x4F=> I2S Tx 1 Trigger
+// <0x50=> PCC RX Trigger
+// <0x51=> AES Write Trigger
+// <0x52=> AES Read Trigger
+// <0x53=> QSPI Rx Trigger
+// <0x54=> QSPI Tx Trigger
+// Defines the peripheral trigger which is source of the transfer
+// dmac_trifsrc_24
+#ifndef CONF_DMAC_TRIGSRC_24
+#define CONF_DMAC_TRIGSRC_24 0
+#endif
+
+// Channel Arbitration Level
+// <0=> Channel priority 0
+// <1=> Channel priority 1
+// <2=> Channel priority 2
+// <3=> Channel priority 3
+// Defines the arbitration level for this channel
+// dmac_lvl_24
+#ifndef CONF_DMAC_LVL_24
+#define CONF_DMAC_LVL_24 0
+#endif
+
+// Channel Event Output
+// Indicates whether channel event generation is enabled or not
+// dmac_evoe_24
+#ifndef CONF_DMAC_EVOE_24
+#define CONF_DMAC_EVOE_24 0
+#endif
+
+// Channel Event Input
+// Indicates whether channel event reception is enabled or not
+// dmac_evie_24
+#ifndef CONF_DMAC_EVIE_24
+#define CONF_DMAC_EVIE_24 0
+#endif
+
+// Event Input Action
+// <0=> No action
+// <1=> Normal transfer and conditional transfer on strobe trigger
+// <2=> Conditional transfer trigger
+// <3=> Conditional block transfer
+// <4=> Channel suspend operation
+// <5=> Channel resume operation
+// <6=> Skip next block suspend action
+// Defines the event input action
+// dmac_evact_24
+#ifndef CONF_DMAC_EVACT_24
+#define CONF_DMAC_EVACT_24 0
+#endif
+
+// Address Increment Step Size
+// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1
+// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2
+// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4
+// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8
+// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16
+// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32
+// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64
+// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128
+// Defines the address increment step size, applies to source or destination address
+// dmac_stepsize_24
+#ifndef CONF_DMAC_STEPSIZE_24
+#define CONF_DMAC_STEPSIZE_24 0
+#endif
+
+// Step Selection
+// <0=> Step size settings apply to the destination address
+// <1=> Step size settings apply to the source address
+// Defines whether source or destination addresses are using the step size settings
+// dmac_stepsel_24
+#ifndef CONF_DMAC_STEPSEL_24
+#define CONF_DMAC_STEPSEL_24 0
+#endif
+
+// Source Address Increment
+// Indicates whether the source address incrementation is enabled or not
+// dmac_srcinc_24
+#ifndef CONF_DMAC_SRCINC_24
+#define CONF_DMAC_SRCINC_24 0
+#endif
+
+// Destination Address Increment
+// Indicates whether the destination address incrementation is enabled or not
+// dmac_dstinc_24
+#ifndef CONF_DMAC_DSTINC_24
+#define CONF_DMAC_DSTINC_24 0
+#endif
+
+// Beat Size
+// <0=> 8-bit bus transfer
+// <1=> 16-bit bus transfer
+// <2=> 32-bit bus transfer
+// Defines the size of one beat
+// dmac_beatsize_24
+#ifndef CONF_DMAC_BEATSIZE_24
+#define CONF_DMAC_BEATSIZE_24 0
+#endif
+
+// Block Action
+// <0=> Channel will be disabled if it is the last block transfer in the transaction
+// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt
+// <2=> Channel suspend operation is complete
+// <3=> Both channel suspend operation and block interrupt
+// Defines the the DMAC should take after a block transfer has completed
+// dmac_blockact_24
+#ifndef CONF_DMAC_BLOCKACT_24
+#define CONF_DMAC_BLOCKACT_24 0
+#endif
+
+// Event Output Selection
+// <0=> Event generation disabled
+// <1=> Event strobe when block transfer complete
+// <3=> Event strobe when beat transfer complete
+// Defines the event output selection
+// dmac_evosel_24
+#ifndef CONF_DMAC_EVOSEL_24
+#define CONF_DMAC_EVOSEL_24 0
+#endif
+//
+
+// Channel 25 settings
+// dmac_channel_25_settings
+#ifndef CONF_DMAC_CHANNEL_25_SETTINGS
+#define CONF_DMAC_CHANNEL_25_SETTINGS 0
+#endif
+
+// Channel Run in Standby
+// Indicates whether channel 25 is running in standby mode or not
+// dmac_runstdby_25
+#ifndef CONF_DMAC_RUNSTDBY_25
+#define CONF_DMAC_RUNSTDBY_25 0
+#endif
+
+// Trigger action
+// <0=> One trigger required for each block transfer
+// <2=> One trigger required for each beat transfer
+// <3=> One trigger required for each transaction
+// Defines the trigger action used for a transfer
+// dmac_trigact_25
+#ifndef CONF_DMAC_TRIGACT_25
+#define CONF_DMAC_TRIGACT_25 0
+#endif
+
+// Trigger source
+// <0x00=> Only software/event triggers
+// <0x01=> RTC Time Stamp Trigger
+// <0x02=> DSU Debug Communication Channel 0 Trigger
+// <0x03=> DSU Debug Communication Channel 1 Trigger
+// <0x04=> SERCOM0 RX Trigger
+// <0x05=> SERCOM0 TX Trigger
+// <0x06=> SERCOM1 RX Trigger
+// <0x07=> SERCOM1 TX Trigger
+// <0x08=> SERCOM2 RX Trigger
+// <0x09=> SERCOM2 TX Trigger
+// <0x0A=> SERCOM3 RX Trigger
+// <0x0B=> SERCOM3 TX Trigger
+// <0x0C=> SERCOM4 RX Trigger
+// <0x0D=> SERCOM4 TX Trigger
+// <0x0E=> SERCOM5 RX Trigger
+// <0x0F=> SERCOM5 TX Trigger
+// <0x10=> SERCOM6 RX Trigger
+// <0x11=> SERCOM6 TX Trigger
+// <0x12=> SERCOM7 RX Trigger
+// <0x13=> SERCOM7 TX Trigger
+// <0x14=> CAN0 DEBUG Trigger
+// <0x15=> CAN1 DEBUG Trigger
+// <0x16=> TCC0 Overflow Trigger Trigger
+// <0x17=> TCC0 Match/Compare 0 Trigger Trigger
+// <0x18=> TCC0 Match/Compare 1 Trigger Trigger
+// <0x19=> TCC0 Match/Compare 2 Trigger Trigger
+// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger
+// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger
+// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger
+// <0x1D=> TCC1 Overflow Trigger Trigger
+// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger
+// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger
+// <0x20=> TCC1 Match/Compare 2 Trigger Trigger
+// <0x21=> TCC1 Match/Compare 3 Trigger Trigger
+// <0x22=> TCC2 Overflow Trigger Trigger
+// <0x23=> TCC2 Match/Compare 0 Trigger Trigger
+// <0x24=> TCC2 Match/Compare 1 Trigger Trigger
+// <0x25=> TCC2 Match/Compare 2 Trigger Trigger
+// <0x26=> TCC3 Overflow Trigger Trigger
+// <0x27=> TCC3 Match/Compare 0 Trigger Trigger
+// <0x28=> TCC3 Match/Compare 1 Trigger Trigger
+// <0x29=> TCC4 Overflow Trigger Trigger
+// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger
+// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger
+// <0x2C=> TC0 Overflow Trigger
+// <0x2D=> TC0 Match/Compare 0 Trigger
+// <0x2E=> TC0 Match/Compare 1 Trigger
+// <0x2F=> TC1 Overflow Trigger
+// <0x30=> TC1 Match/Compare 0 Trigger
+// <0x31=> TC1 Match/Compare 1 Trigger
+// <0x32=> TC2 Overflow Trigger
+// <0x33=> TC2 Match/Compare 0 Trigger
+// <0x34=> TC2 Match/Compare 1 Trigger
+// <0x35=> TC3 Overflow Trigger
+// <0x36=> TC3 Match/Compare 0 Trigger
+// <0x37=> TC3 Match/Compare 1 Trigger
+// <0x38=> TC4 Overflow Trigger
+// <0x39=> TC4 Match/Compare 0 Trigger
+// <0x3A=> TC4 Match/Compare 1 Trigger
+// <0x3B=> TC5 Overflow Trigger
+// <0x3C=> TC5 Match/Compare 0 Trigger
+// <0x3D=> TC5 Match/Compare 1 Trigger
+// <0x3E=> TC6 Overflow Trigger
+// <0x3F=> TC6 Match/Compare 0 Trigger
+// <0x40=> TC6 Match/Compare 1 Trigger
+// <0x41=> TC7 Overflow Trigger
+// <0x42=> TC7 Match/Compare 0 Trigger
+// <0x43=> TC7 Match/Compare 1 Trigger
+// <0x44=> ADC0 Result Ready Trigger
+// <0x45=> ADC0 Sequencing Trigger
+// <0x46=> ADC1 Result Ready Trigger
+// <0x47=> ADC1 Sequencing Trigger
+// <0x48=> DAC Empty 0 Trigger
+// <0x49=> DAC Empty 1 Trigger
+// <0x4A=> DAC Result Ready 0 Trigger
+// <0x4B=> DAC Result Ready 1 Trigger
+// <0x4C=> I2S Rx 0 Trigger
+// <0x4D=> I2S Rx 1 Trigger
+// <0x4E=> I2S Tx 0 Trigger
+// <0x4F=> I2S Tx 1 Trigger
+// <0x50=> PCC RX Trigger
+// <0x51=> AES Write Trigger
+// <0x52=> AES Read Trigger
+// <0x53=> QSPI Rx Trigger
+// <0x54=> QSPI Tx Trigger
+// Defines the peripheral trigger which is source of the transfer
+// dmac_trifsrc_25
+#ifndef CONF_DMAC_TRIGSRC_25
+#define CONF_DMAC_TRIGSRC_25 0
+#endif
+
+// Channel Arbitration Level
+// <0=> Channel priority 0
+// <1=> Channel priority 1
+// <2=> Channel priority 2
+// <3=> Channel priority 3
+// Defines the arbitration level for this channel
+// dmac_lvl_25
+#ifndef CONF_DMAC_LVL_25
+#define CONF_DMAC_LVL_25 0
+#endif
+
+// Channel Event Output
+// Indicates whether channel event generation is enabled or not
+// dmac_evoe_25
+#ifndef CONF_DMAC_EVOE_25
+#define CONF_DMAC_EVOE_25 0
+#endif
+
+// Channel Event Input
+// Indicates whether channel event reception is enabled or not
+// dmac_evie_25
+#ifndef CONF_DMAC_EVIE_25
+#define CONF_DMAC_EVIE_25 0
+#endif
+
+// Event Input Action
+// <0=> No action
+// <1=> Normal transfer and conditional transfer on strobe trigger
+// <2=> Conditional transfer trigger
+// <3=> Conditional block transfer
+// <4=> Channel suspend operation
+// <5=> Channel resume operation
+// <6=> Skip next block suspend action
+// Defines the event input action
+// dmac_evact_25
+#ifndef CONF_DMAC_EVACT_25
+#define CONF_DMAC_EVACT_25 0
+#endif
+
+// Address Increment Step Size
+// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1
+// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2
+// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4
+// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8
+// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16
+// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32
+// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64
+// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128
+// Defines the address increment step size, applies to source or destination address
+// dmac_stepsize_25
+#ifndef CONF_DMAC_STEPSIZE_25
+#define CONF_DMAC_STEPSIZE_25 0
+#endif
+
+// Step Selection
+// <0=> Step size settings apply to the destination address
+// <1=> Step size settings apply to the source address
+// Defines whether source or destination addresses are using the step size settings
+// dmac_stepsel_25
+#ifndef CONF_DMAC_STEPSEL_25
+#define CONF_DMAC_STEPSEL_25 0
+#endif
+
+// Source Address Increment
+// Indicates whether the source address incrementation is enabled or not
+// dmac_srcinc_25
+#ifndef CONF_DMAC_SRCINC_25
+#define CONF_DMAC_SRCINC_25 0
+#endif
+
+// Destination Address Increment
+// Indicates whether the destination address incrementation is enabled or not
+// dmac_dstinc_25
+#ifndef CONF_DMAC_DSTINC_25
+#define CONF_DMAC_DSTINC_25 0
+#endif
+
+// Beat Size
+// <0=> 8-bit bus transfer
+// <1=> 16-bit bus transfer
+// <2=> 32-bit bus transfer
+// Defines the size of one beat
+// dmac_beatsize_25
+#ifndef CONF_DMAC_BEATSIZE_25
+#define CONF_DMAC_BEATSIZE_25 0
+#endif
+
+// Block Action
+// <0=> Channel will be disabled if it is the last block transfer in the transaction
+// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt
+// <2=> Channel suspend operation is complete
+// <3=> Both channel suspend operation and block interrupt
+// Defines the the DMAC should take after a block transfer has completed
+// dmac_blockact_25
+#ifndef CONF_DMAC_BLOCKACT_25
+#define CONF_DMAC_BLOCKACT_25 0
+#endif
+
+// Event Output Selection
+// <0=> Event generation disabled
+// <1=> Event strobe when block transfer complete
+// <3=> Event strobe when beat transfer complete
+// Defines the event output selection
+// dmac_evosel_25
+#ifndef CONF_DMAC_EVOSEL_25
+#define CONF_DMAC_EVOSEL_25 0
+#endif
+//
+
+// Channel 26 settings
+// dmac_channel_26_settings
+#ifndef CONF_DMAC_CHANNEL_26_SETTINGS
+#define CONF_DMAC_CHANNEL_26_SETTINGS 0
+#endif
+
+// Channel Run in Standby
+// Indicates whether channel 26 is running in standby mode or not
+// dmac_runstdby_26
+#ifndef CONF_DMAC_RUNSTDBY_26
+#define CONF_DMAC_RUNSTDBY_26 0
+#endif
+
+// Trigger action
+// <0=> One trigger required for each block transfer
+// <2=> One trigger required for each beat transfer
+// <3=> One trigger required for each transaction
+// Defines the trigger action used for a transfer
+// dmac_trigact_26
+#ifndef CONF_DMAC_TRIGACT_26
+#define CONF_DMAC_TRIGACT_26 0
+#endif
+
+// Trigger source
+// <0x00=> Only software/event triggers
+// <0x01=> RTC Time Stamp Trigger
+// <0x02=> DSU Debug Communication Channel 0 Trigger
+// <0x03=> DSU Debug Communication Channel 1 Trigger
+// <0x04=> SERCOM0 RX Trigger
+// <0x05=> SERCOM0 TX Trigger
+// <0x06=> SERCOM1 RX Trigger
+// <0x07=> SERCOM1 TX Trigger
+// <0x08=> SERCOM2 RX Trigger
+// <0x09=> SERCOM2 TX Trigger
+// <0x0A=> SERCOM3 RX Trigger
+// <0x0B=> SERCOM3 TX Trigger
+// <0x0C=> SERCOM4 RX Trigger
+// <0x0D=> SERCOM4 TX Trigger
+// <0x0E=> SERCOM5 RX Trigger
+// <0x0F=> SERCOM5 TX Trigger
+// <0x10=> SERCOM6 RX Trigger
+// <0x11=> SERCOM6 TX Trigger
+// <0x12=> SERCOM7 RX Trigger
+// <0x13=> SERCOM7 TX Trigger
+// <0x14=> CAN0 DEBUG Trigger
+// <0x15=> CAN1 DEBUG Trigger
+// <0x16=> TCC0 Overflow Trigger Trigger
+// <0x17=> TCC0 Match/Compare 0 Trigger Trigger
+// <0x18=> TCC0 Match/Compare 1 Trigger Trigger
+// <0x19=> TCC0 Match/Compare 2 Trigger Trigger
+// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger
+// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger
+// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger
+// <0x1D=> TCC1 Overflow Trigger Trigger
+// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger
+// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger
+// <0x20=> TCC1 Match/Compare 2 Trigger Trigger
+// <0x21=> TCC1 Match/Compare 3 Trigger Trigger
+// <0x22=> TCC2 Overflow Trigger Trigger
+// <0x23=> TCC2 Match/Compare 0 Trigger Trigger
+// <0x24=> TCC2 Match/Compare 1 Trigger Trigger
+// <0x25=> TCC2 Match/Compare 2 Trigger Trigger
+// <0x26=> TCC3 Overflow Trigger Trigger
+// <0x27=> TCC3 Match/Compare 0 Trigger Trigger
+// <0x28=> TCC3 Match/Compare 1 Trigger Trigger
+// <0x29=> TCC4 Overflow Trigger Trigger
+// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger
+// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger
+// <0x2C=> TC0 Overflow Trigger
+// <0x2D=> TC0 Match/Compare 0 Trigger
+// <0x2E=> TC0 Match/Compare 1 Trigger
+// <0x2F=> TC1 Overflow Trigger
+// <0x30=> TC1 Match/Compare 0 Trigger
+// <0x31=> TC1 Match/Compare 1 Trigger
+// <0x32=> TC2 Overflow Trigger
+// <0x33=> TC2 Match/Compare 0 Trigger
+// <0x34=> TC2 Match/Compare 1 Trigger
+// <0x35=> TC3 Overflow Trigger
+// <0x36=> TC3 Match/Compare 0 Trigger
+// <0x37=> TC3 Match/Compare 1 Trigger
+// <0x38=> TC4 Overflow Trigger
+// <0x39=> TC4 Match/Compare 0 Trigger
+// <0x3A=> TC4 Match/Compare 1 Trigger
+// <0x3B=> TC5 Overflow Trigger
+// <0x3C=> TC5 Match/Compare 0 Trigger
+// <0x3D=> TC5 Match/Compare 1 Trigger
+// <0x3E=> TC6 Overflow Trigger
+// <0x3F=> TC6 Match/Compare 0 Trigger
+// <0x40=> TC6 Match/Compare 1 Trigger
+// <0x41=> TC7 Overflow Trigger
+// <0x42=> TC7 Match/Compare 0 Trigger
+// <0x43=> TC7 Match/Compare 1 Trigger
+// <0x44=> ADC0 Result Ready Trigger
+// <0x45=> ADC0 Sequencing Trigger
+// <0x46=> ADC1 Result Ready Trigger
+// <0x47=> ADC1 Sequencing Trigger
+// <0x48=> DAC Empty 0 Trigger
+// <0x49=> DAC Empty 1 Trigger
+// <0x4A=> DAC Result Ready 0 Trigger
+// <0x4B=> DAC Result Ready 1 Trigger
+// <0x4C=> I2S Rx 0 Trigger
+// <0x4D=> I2S Rx 1 Trigger
+// <0x4E=> I2S Tx 0 Trigger
+// <0x4F=> I2S Tx 1 Trigger
+// <0x50=> PCC RX Trigger
+// <0x51=> AES Write Trigger
+// <0x52=> AES Read Trigger
+// <0x53=> QSPI Rx Trigger
+// <0x54=> QSPI Tx Trigger
+// Defines the peripheral trigger which is source of the transfer
+// dmac_trifsrc_26
+#ifndef CONF_DMAC_TRIGSRC_26
+#define CONF_DMAC_TRIGSRC_26 0
+#endif
+
+// Channel Arbitration Level
+// <0=> Channel priority 0
+// <1=> Channel priority 1
+// <2=> Channel priority 2
+// <3=> Channel priority 3
+// Defines the arbitration level for this channel
+// dmac_lvl_26
+#ifndef CONF_DMAC_LVL_26
+#define CONF_DMAC_LVL_26 0
+#endif
+
+// Channel Event Output
+// Indicates whether channel event generation is enabled or not
+// dmac_evoe_26
+#ifndef CONF_DMAC_EVOE_26
+#define CONF_DMAC_EVOE_26 0
+#endif
+
+// Channel Event Input
+// Indicates whether channel event reception is enabled or not
+// dmac_evie_26
+#ifndef CONF_DMAC_EVIE_26
+#define CONF_DMAC_EVIE_26 0
+#endif
+
+// Event Input Action
+// <0=> No action
+// <1=> Normal transfer and conditional transfer on strobe trigger
+// <2=> Conditional transfer trigger
+// <3=> Conditional block transfer
+// <4=> Channel suspend operation
+// <5=> Channel resume operation
+// <6=> Skip next block suspend action
+// Defines the event input action
+// dmac_evact_26
+#ifndef CONF_DMAC_EVACT_26
+#define CONF_DMAC_EVACT_26 0
+#endif
+
+// Address Increment Step Size
+// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1
+// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2
+// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4
+// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8
+// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16
+// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32
+// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64
+// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128
+// Defines the address increment step size, applies to source or destination address
+// dmac_stepsize_26
+#ifndef CONF_DMAC_STEPSIZE_26
+#define CONF_DMAC_STEPSIZE_26 0
+#endif
+
+// Step Selection
+// <0=> Step size settings apply to the destination address
+// <1=> Step size settings apply to the source address
+// Defines whether source or destination addresses are using the step size settings
+// dmac_stepsel_26
+#ifndef CONF_DMAC_STEPSEL_26
+#define CONF_DMAC_STEPSEL_26 0
+#endif
+
+// Source Address Increment
+// Indicates whether the source address incrementation is enabled or not
+// dmac_srcinc_26
+#ifndef CONF_DMAC_SRCINC_26
+#define CONF_DMAC_SRCINC_26 0
+#endif
+
+// Destination Address Increment
+// Indicates whether the destination address incrementation is enabled or not
+// dmac_dstinc_26
+#ifndef CONF_DMAC_DSTINC_26
+#define CONF_DMAC_DSTINC_26 0
+#endif
+
+// Beat Size
+// <0=> 8-bit bus transfer
+// <1=> 16-bit bus transfer
+// <2=> 32-bit bus transfer
+// Defines the size of one beat
+// dmac_beatsize_26
+#ifndef CONF_DMAC_BEATSIZE_26
+#define CONF_DMAC_BEATSIZE_26 0
+#endif
+
+// Block Action
+// <0=> Channel will be disabled if it is the last block transfer in the transaction
+// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt
+// <2=> Channel suspend operation is complete
+// <3=> Both channel suspend operation and block interrupt
+// Defines the the DMAC should take after a block transfer has completed
+// dmac_blockact_26
+#ifndef CONF_DMAC_BLOCKACT_26
+#define CONF_DMAC_BLOCKACT_26 0
+#endif
+
+// Event Output Selection
+// <0=> Event generation disabled
+// <1=> Event strobe when block transfer complete
+// <3=> Event strobe when beat transfer complete
+// Defines the event output selection
+// dmac_evosel_26
+#ifndef CONF_DMAC_EVOSEL_26
+#define CONF_DMAC_EVOSEL_26 0
+#endif
+//
+
+// Channel 27 settings
+// dmac_channel_27_settings
+#ifndef CONF_DMAC_CHANNEL_27_SETTINGS
+#define CONF_DMAC_CHANNEL_27_SETTINGS 0
+#endif
+
+// Channel Run in Standby
+// Indicates whether channel 27 is running in standby mode or not
+// dmac_runstdby_27
+#ifndef CONF_DMAC_RUNSTDBY_27
+#define CONF_DMAC_RUNSTDBY_27 0
+#endif
+
+// Trigger action
+// <0=> One trigger required for each block transfer
+// <2=> One trigger required for each beat transfer
+// <3=> One trigger required for each transaction
+// Defines the trigger action used for a transfer
+// dmac_trigact_27
+#ifndef CONF_DMAC_TRIGACT_27
+#define CONF_DMAC_TRIGACT_27 0
+#endif
+
+// Trigger source
+// <0x00=> Only software/event triggers
+// <0x01=> RTC Time Stamp Trigger
+// <0x02=> DSU Debug Communication Channel 0 Trigger
+// <0x03=> DSU Debug Communication Channel 1 Trigger
+// <0x04=> SERCOM0 RX Trigger
+// <0x05=> SERCOM0 TX Trigger
+// <0x06=> SERCOM1 RX Trigger
+// <0x07=> SERCOM1 TX Trigger
+// <0x08=> SERCOM2 RX Trigger
+// <0x09=> SERCOM2 TX Trigger
+// <0x0A=> SERCOM3 RX Trigger
+// <0x0B=> SERCOM3 TX Trigger
+// <0x0C=> SERCOM4 RX Trigger
+// <0x0D=> SERCOM4 TX Trigger
+// <0x0E=> SERCOM5 RX Trigger
+// <0x0F=> SERCOM5 TX Trigger
+// <0x10=> SERCOM6 RX Trigger
+// <0x11=> SERCOM6 TX Trigger
+// <0x12=> SERCOM7 RX Trigger
+// <0x13=> SERCOM7 TX Trigger
+// <0x14=> CAN0 DEBUG Trigger
+// <0x15=> CAN1 DEBUG Trigger
+// <0x16=> TCC0 Overflow Trigger Trigger
+// <0x17=> TCC0 Match/Compare 0 Trigger Trigger
+// <0x18=> TCC0 Match/Compare 1 Trigger Trigger
+// <0x19=> TCC0 Match/Compare 2 Trigger Trigger
+// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger
+// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger
+// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger
+// <0x1D=> TCC1 Overflow Trigger Trigger
+// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger
+// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger
+// <0x20=> TCC1 Match/Compare 2 Trigger Trigger
+// <0x21=> TCC1 Match/Compare 3 Trigger Trigger
+// <0x22=> TCC2 Overflow Trigger Trigger
+// <0x23=> TCC2 Match/Compare 0 Trigger Trigger
+// <0x24=> TCC2 Match/Compare 1 Trigger Trigger
+// <0x25=> TCC2 Match/Compare 2 Trigger Trigger
+// <0x26=> TCC3 Overflow Trigger Trigger
+// <0x27=> TCC3 Match/Compare 0 Trigger Trigger
+// <0x28=> TCC3 Match/Compare 1 Trigger Trigger
+// <0x29=> TCC4 Overflow Trigger Trigger
+// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger
+// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger
+// <0x2C=> TC0 Overflow Trigger
+// <0x2D=> TC0 Match/Compare 0 Trigger
+// <0x2E=> TC0 Match/Compare 1 Trigger
+// <0x2F=> TC1 Overflow Trigger
+// <0x30=> TC1 Match/Compare 0 Trigger
+// <0x31=> TC1 Match/Compare 1 Trigger
+// <0x32=> TC2 Overflow Trigger
+// <0x33=> TC2 Match/Compare 0 Trigger
+// <0x34=> TC2 Match/Compare 1 Trigger
+// <0x35=> TC3 Overflow Trigger
+// <0x36=> TC3 Match/Compare 0 Trigger
+// <0x37=> TC3 Match/Compare 1 Trigger
+// <0x38=> TC4 Overflow Trigger
+// <0x39=> TC4 Match/Compare 0 Trigger
+// <0x3A=> TC4 Match/Compare 1 Trigger
+// <0x3B=> TC5 Overflow Trigger
+// <0x3C=> TC5 Match/Compare 0 Trigger
+// <0x3D=> TC5 Match/Compare 1 Trigger
+// <0x3E=> TC6 Overflow Trigger
+// <0x3F=> TC6 Match/Compare 0 Trigger
+// <0x40=> TC6 Match/Compare 1 Trigger
+// <0x41=> TC7 Overflow Trigger
+// <0x42=> TC7 Match/Compare 0 Trigger
+// <0x43=> TC7 Match/Compare 1 Trigger
+// <0x44=> ADC0 Result Ready Trigger
+// <0x45=> ADC0 Sequencing Trigger
+// <0x46=> ADC1 Result Ready Trigger
+// <0x47=> ADC1 Sequencing Trigger
+// <0x48=> DAC Empty 0 Trigger
+// <0x49=> DAC Empty 1 Trigger
+// <0x4A=> DAC Result Ready 0 Trigger
+// <0x4B=> DAC Result Ready 1 Trigger
+// <0x4C=> I2S Rx 0 Trigger
+// <0x4D=> I2S Rx 1 Trigger
+// <0x4E=> I2S Tx 0 Trigger
+// <0x4F=> I2S Tx 1 Trigger
+// <0x50=> PCC RX Trigger
+// <0x51=> AES Write Trigger
+// <0x52=> AES Read Trigger
+// <0x53=> QSPI Rx Trigger
+// <0x54=> QSPI Tx Trigger
+// Defines the peripheral trigger which is source of the transfer
+// dmac_trifsrc_27
+#ifndef CONF_DMAC_TRIGSRC_27
+#define CONF_DMAC_TRIGSRC_27 0
+#endif
+
+// Channel Arbitration Level
+// <0=> Channel priority 0
+// <1=> Channel priority 1
+// <2=> Channel priority 2
+// <3=> Channel priority 3
+// Defines the arbitration level for this channel
+// dmac_lvl_27
+#ifndef CONF_DMAC_LVL_27
+#define CONF_DMAC_LVL_27 0
+#endif
+
+// Channel Event Output
+// Indicates whether channel event generation is enabled or not
+// dmac_evoe_27
+#ifndef CONF_DMAC_EVOE_27
+#define CONF_DMAC_EVOE_27 0
+#endif
+
+// Channel Event Input
+// Indicates whether channel event reception is enabled or not
+// dmac_evie_27
+#ifndef CONF_DMAC_EVIE_27
+#define CONF_DMAC_EVIE_27 0
+#endif
+
+// Event Input Action
+// <0=> No action
+// <1=> Normal transfer and conditional transfer on strobe trigger
+// <2=> Conditional transfer trigger
+// <3=> Conditional block transfer
+// <4=> Channel suspend operation
+// <5=> Channel resume operation
+// <6=> Skip next block suspend action
+// Defines the event input action
+// dmac_evact_27
+#ifndef CONF_DMAC_EVACT_27
+#define CONF_DMAC_EVACT_27 0
+#endif
+
+// Address Increment Step Size
+// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1
+// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2
+// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4
+// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8
+// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16
+// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32
+// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64
+// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128
+// Defines the address increment step size, applies to source or destination address
+// dmac_stepsize_27
+#ifndef CONF_DMAC_STEPSIZE_27
+#define CONF_DMAC_STEPSIZE_27 0
+#endif
+
+// Step Selection
+// <0=> Step size settings apply to the destination address
+// <1=> Step size settings apply to the source address
+// Defines whether source or destination addresses are using the step size settings
+// dmac_stepsel_27
+#ifndef CONF_DMAC_STEPSEL_27
+#define CONF_DMAC_STEPSEL_27 0
+#endif
+
+// Source Address Increment
+// Indicates whether the source address incrementation is enabled or not
+// dmac_srcinc_27
+#ifndef CONF_DMAC_SRCINC_27
+#define CONF_DMAC_SRCINC_27 0
+#endif
+
+// Destination Address Increment
+// Indicates whether the destination address incrementation is enabled or not
+// dmac_dstinc_27
+#ifndef CONF_DMAC_DSTINC_27
+#define CONF_DMAC_DSTINC_27 0
+#endif
+
+// Beat Size
+// <0=> 8-bit bus transfer
+// <1=> 16-bit bus transfer
+// <2=> 32-bit bus transfer
+// Defines the size of one beat
+// dmac_beatsize_27
+#ifndef CONF_DMAC_BEATSIZE_27
+#define CONF_DMAC_BEATSIZE_27 0
+#endif
+
+// Block Action
+// <0=> Channel will be disabled if it is the last block transfer in the transaction
+// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt
+// <2=> Channel suspend operation is complete
+// <3=> Both channel suspend operation and block interrupt
+// Defines the the DMAC should take after a block transfer has completed
+// dmac_blockact_27
+#ifndef CONF_DMAC_BLOCKACT_27
+#define CONF_DMAC_BLOCKACT_27 0
+#endif
+
+// Event Output Selection
+// <0=> Event generation disabled
+// <1=> Event strobe when block transfer complete
+// <3=> Event strobe when beat transfer complete
+// Defines the event output selection
+// dmac_evosel_27
+#ifndef CONF_DMAC_EVOSEL_27
+#define CONF_DMAC_EVOSEL_27 0
+#endif
+//
+
+// Channel 28 settings
+// dmac_channel_28_settings
+#ifndef CONF_DMAC_CHANNEL_28_SETTINGS
+#define CONF_DMAC_CHANNEL_28_SETTINGS 0
+#endif
+
+// Channel Run in Standby
+// Indicates whether channel 28 is running in standby mode or not
+// dmac_runstdby_28
+#ifndef CONF_DMAC_RUNSTDBY_28
+#define CONF_DMAC_RUNSTDBY_28 0
+#endif
+
+// Trigger action
+// <0=> One trigger required for each block transfer
+// <2=> One trigger required for each beat transfer
+// <3=> One trigger required for each transaction
+// Defines the trigger action used for a transfer
+// dmac_trigact_28
+#ifndef CONF_DMAC_TRIGACT_28
+#define CONF_DMAC_TRIGACT_28 0
+#endif
+
+// Trigger source
+// <0x00=> Only software/event triggers
+// <0x01=> RTC Time Stamp Trigger
+// <0x02=> DSU Debug Communication Channel 0 Trigger
+// <0x03=> DSU Debug Communication Channel 1 Trigger
+// <0x04=> SERCOM0 RX Trigger
+// <0x05=> SERCOM0 TX Trigger
+// <0x06=> SERCOM1 RX Trigger
+// <0x07=> SERCOM1 TX Trigger
+// <0x08=> SERCOM2 RX Trigger
+// <0x09=> SERCOM2 TX Trigger
+// <0x0A=> SERCOM3 RX Trigger
+// <0x0B=> SERCOM3 TX Trigger
+// <0x0C=> SERCOM4 RX Trigger
+// <0x0D=> SERCOM4 TX Trigger
+// <0x0E=> SERCOM5 RX Trigger
+// <0x0F=> SERCOM5 TX Trigger
+// <0x10=> SERCOM6 RX Trigger
+// <0x11=> SERCOM6 TX Trigger
+// <0x12=> SERCOM7 RX Trigger
+// <0x13=> SERCOM7 TX Trigger
+// <0x14=> CAN0 DEBUG Trigger
+// <0x15=> CAN1 DEBUG Trigger
+// <0x16=> TCC0 Overflow Trigger Trigger
+// <0x17=> TCC0 Match/Compare 0 Trigger Trigger
+// <0x18=> TCC0 Match/Compare 1 Trigger Trigger
+// <0x19=> TCC0 Match/Compare 2 Trigger Trigger
+// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger
+// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger
+// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger
+// <0x1D=> TCC1 Overflow Trigger Trigger
+// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger
+// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger
+// <0x20=> TCC1 Match/Compare 2 Trigger Trigger
+// <0x21=> TCC1 Match/Compare 3 Trigger Trigger
+// <0x22=> TCC2 Overflow Trigger Trigger
+// <0x23=> TCC2 Match/Compare 0 Trigger Trigger
+// <0x24=> TCC2 Match/Compare 1 Trigger Trigger
+// <0x25=> TCC2 Match/Compare 2 Trigger Trigger
+// <0x26=> TCC3 Overflow Trigger Trigger
+// <0x27=> TCC3 Match/Compare 0 Trigger Trigger
+// <0x28=> TCC3 Match/Compare 1 Trigger Trigger
+// <0x29=> TCC4 Overflow Trigger Trigger
+// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger
+// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger
+// <0x2C=> TC0 Overflow Trigger
+// <0x2D=> TC0 Match/Compare 0 Trigger
+// <0x2E=> TC0 Match/Compare 1 Trigger
+// <0x2F=> TC1 Overflow Trigger
+// <0x30=> TC1 Match/Compare 0 Trigger
+// <0x31=> TC1 Match/Compare 1 Trigger
+// <0x32=> TC2 Overflow Trigger
+// <0x33=> TC2 Match/Compare 0 Trigger
+// <0x34=> TC2 Match/Compare 1 Trigger
+// <0x35=> TC3 Overflow Trigger
+// <0x36=> TC3 Match/Compare 0 Trigger
+// <0x37=> TC3 Match/Compare 1 Trigger
+// <0x38=> TC4 Overflow Trigger
+// <0x39=> TC4 Match/Compare 0 Trigger
+// <0x3A=> TC4 Match/Compare 1 Trigger
+// <0x3B=> TC5 Overflow Trigger
+// <0x3C=> TC5 Match/Compare 0 Trigger
+// <0x3D=> TC5 Match/Compare 1 Trigger
+// <0x3E=> TC6 Overflow Trigger
+// <0x3F=> TC6 Match/Compare 0 Trigger
+// <0x40=> TC6 Match/Compare 1 Trigger
+// <0x41=> TC7 Overflow Trigger
+// <0x42=> TC7 Match/Compare 0 Trigger
+// <0x43=> TC7 Match/Compare 1 Trigger
+// <0x44=> ADC0 Result Ready Trigger
+// <0x45=> ADC0 Sequencing Trigger
+// <0x46=> ADC1 Result Ready Trigger
+// <0x47=> ADC1 Sequencing Trigger
+// <0x48=> DAC Empty 0 Trigger
+// <0x49=> DAC Empty 1 Trigger
+// <0x4A=> DAC Result Ready 0 Trigger
+// <0x4B=> DAC Result Ready 1 Trigger
+// <0x4C=> I2S Rx 0 Trigger
+// <0x4D=> I2S Rx 1 Trigger
+// <0x4E=> I2S Tx 0 Trigger
+// <0x4F=> I2S Tx 1 Trigger
+// <0x50=> PCC RX Trigger
+// <0x51=> AES Write Trigger
+// <0x52=> AES Read Trigger
+// <0x53=> QSPI Rx Trigger
+// <0x54=> QSPI Tx Trigger
+// Defines the peripheral trigger which is source of the transfer
+// dmac_trifsrc_28
+#ifndef CONF_DMAC_TRIGSRC_28
+#define CONF_DMAC_TRIGSRC_28 0
+#endif
+
+// Channel Arbitration Level
+// <0=> Channel priority 0
+// <1=> Channel priority 1
+// <2=> Channel priority 2
+// <3=> Channel priority 3
+// Defines the arbitration level for this channel
+// dmac_lvl_28
+#ifndef CONF_DMAC_LVL_28
+#define CONF_DMAC_LVL_28 0
+#endif
+
+// Channel Event Output
+// Indicates whether channel event generation is enabled or not
+// dmac_evoe_28
+#ifndef CONF_DMAC_EVOE_28
+#define CONF_DMAC_EVOE_28 0
+#endif
+
+// Channel Event Input
+// Indicates whether channel event reception is enabled or not
+// dmac_evie_28
+#ifndef CONF_DMAC_EVIE_28
+#define CONF_DMAC_EVIE_28 0
+#endif
+
+// Event Input Action
+// <0=> No action
+// <1=> Normal transfer and conditional transfer on strobe trigger
+// <2=> Conditional transfer trigger
+// <3=> Conditional block transfer
+// <4=> Channel suspend operation
+// <5=> Channel resume operation
+// <6=> Skip next block suspend action
+// Defines the event input action
+// dmac_evact_28
+#ifndef CONF_DMAC_EVACT_28
+#define CONF_DMAC_EVACT_28 0
+#endif
+
+// Address Increment Step Size
+// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1
+// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2
+// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4
+// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8
+// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16
+// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32
+// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64
+// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128
+// Defines the address increment step size, applies to source or destination address
+// dmac_stepsize_28
+#ifndef CONF_DMAC_STEPSIZE_28
+#define CONF_DMAC_STEPSIZE_28 0
+#endif
+
+// Step Selection
+// <0=> Step size settings apply to the destination address
+// <1=> Step size settings apply to the source address
+// Defines whether source or destination addresses are using the step size settings
+// dmac_stepsel_28
+#ifndef CONF_DMAC_STEPSEL_28
+#define CONF_DMAC_STEPSEL_28 0
+#endif
+
+// Source Address Increment
+// Indicates whether the source address incrementation is enabled or not
+// dmac_srcinc_28
+#ifndef CONF_DMAC_SRCINC_28
+#define CONF_DMAC_SRCINC_28 0
+#endif
+
+// Destination Address Increment
+// Indicates whether the destination address incrementation is enabled or not
+// dmac_dstinc_28
+#ifndef CONF_DMAC_DSTINC_28
+#define CONF_DMAC_DSTINC_28 0
+#endif
+
+// Beat Size
+// <0=> 8-bit bus transfer
+// <1=> 16-bit bus transfer
+// <2=> 32-bit bus transfer
+// Defines the size of one beat
+// dmac_beatsize_28
+#ifndef CONF_DMAC_BEATSIZE_28
+#define CONF_DMAC_BEATSIZE_28 0
+#endif
+
+// Block Action
+// <0=> Channel will be disabled if it is the last block transfer in the transaction
+// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt
+// <2=> Channel suspend operation is complete
+// <3=> Both channel suspend operation and block interrupt
+// Defines the the DMAC should take after a block transfer has completed
+// dmac_blockact_28
+#ifndef CONF_DMAC_BLOCKACT_28
+#define CONF_DMAC_BLOCKACT_28 0
+#endif
+
+// Event Output Selection
+// <0=> Event generation disabled
+// <1=> Event strobe when block transfer complete
+// <3=> Event strobe when beat transfer complete
+// Defines the event output selection
+// dmac_evosel_28
+#ifndef CONF_DMAC_EVOSEL_28
+#define CONF_DMAC_EVOSEL_28 0
+#endif
+//
+
+// Channel 29 settings
+// dmac_channel_29_settings
+#ifndef CONF_DMAC_CHANNEL_29_SETTINGS
+#define CONF_DMAC_CHANNEL_29_SETTINGS 0
+#endif
+
+// Channel Run in Standby
+// Indicates whether channel 29 is running in standby mode or not
+// dmac_runstdby_29
+#ifndef CONF_DMAC_RUNSTDBY_29
+#define CONF_DMAC_RUNSTDBY_29 0
+#endif
+
+// Trigger action
+// <0=> One trigger required for each block transfer
+// <2=> One trigger required for each beat transfer
+// <3=> One trigger required for each transaction
+// Defines the trigger action used for a transfer
+// dmac_trigact_29
+#ifndef CONF_DMAC_TRIGACT_29
+#define CONF_DMAC_TRIGACT_29 0
+#endif
+
+// Trigger source
+// <0x00=> Only software/event triggers
+// <0x01=> RTC Time Stamp Trigger
+// <0x02=> DSU Debug Communication Channel 0 Trigger
+// <0x03=> DSU Debug Communication Channel 1 Trigger
+// <0x04=> SERCOM0 RX Trigger
+// <0x05=> SERCOM0 TX Trigger
+// <0x06=> SERCOM1 RX Trigger
+// <0x07=> SERCOM1 TX Trigger
+// <0x08=> SERCOM2 RX Trigger
+// <0x09=> SERCOM2 TX Trigger
+// <0x0A=> SERCOM3 RX Trigger
+// <0x0B=> SERCOM3 TX Trigger
+// <0x0C=> SERCOM4 RX Trigger
+// <0x0D=> SERCOM4 TX Trigger
+// <0x0E=> SERCOM5 RX Trigger
+// <0x0F=> SERCOM5 TX Trigger
+// <0x10=> SERCOM6 RX Trigger
+// <0x11=> SERCOM6 TX Trigger
+// <0x12=> SERCOM7 RX Trigger
+// <0x13=> SERCOM7 TX Trigger
+// <0x14=> CAN0 DEBUG Trigger
+// <0x15=> CAN1 DEBUG Trigger
+// <0x16=> TCC0 Overflow Trigger Trigger
+// <0x17=> TCC0 Match/Compare 0 Trigger Trigger
+// <0x18=> TCC0 Match/Compare 1 Trigger Trigger
+// <0x19=> TCC0 Match/Compare 2 Trigger Trigger
+// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger
+// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger
+// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger
+// <0x1D=> TCC1 Overflow Trigger Trigger
+// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger
+// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger
+// <0x20=> TCC1 Match/Compare 2 Trigger Trigger
+// <0x21=> TCC1 Match/Compare 3 Trigger Trigger
+// <0x22=> TCC2 Overflow Trigger Trigger
+// <0x23=> TCC2 Match/Compare 0 Trigger Trigger
+// <0x24=> TCC2 Match/Compare 1 Trigger Trigger
+// <0x25=> TCC2 Match/Compare 2 Trigger Trigger
+// <0x26=> TCC3 Overflow Trigger Trigger
+// <0x27=> TCC3 Match/Compare 0 Trigger Trigger
+// <0x28=> TCC3 Match/Compare 1 Trigger Trigger
+// <0x29=> TCC4 Overflow Trigger Trigger
+// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger
+// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger
+// <0x2C=> TC0 Overflow Trigger
+// <0x2D=> TC0 Match/Compare 0 Trigger
+// <0x2E=> TC0 Match/Compare 1 Trigger
+// <0x2F=> TC1 Overflow Trigger
+// <0x30=> TC1 Match/Compare 0 Trigger
+// <0x31=> TC1 Match/Compare 1 Trigger
+// <0x32=> TC2 Overflow Trigger
+// <0x33=> TC2 Match/Compare 0 Trigger
+// <0x34=> TC2 Match/Compare 1 Trigger
+// <0x35=> TC3 Overflow Trigger
+// <0x36=> TC3 Match/Compare 0 Trigger
+// <0x37=> TC3 Match/Compare 1 Trigger
+// <0x38=> TC4 Overflow Trigger
+// <0x39=> TC4 Match/Compare 0 Trigger
+// <0x3A=> TC4 Match/Compare 1 Trigger
+// <0x3B=> TC5 Overflow Trigger
+// <0x3C=> TC5 Match/Compare 0 Trigger
+// <0x3D=> TC5 Match/Compare 1 Trigger
+// <0x3E=> TC6 Overflow Trigger
+// <0x3F=> TC6 Match/Compare 0 Trigger
+// <0x40=> TC6 Match/Compare 1 Trigger
+// <0x41=> TC7 Overflow Trigger
+// <0x42=> TC7 Match/Compare 0 Trigger
+// <0x43=> TC7 Match/Compare 1 Trigger
+// <0x44=> ADC0 Result Ready Trigger
+// <0x45=> ADC0 Sequencing Trigger
+// <0x46=> ADC1 Result Ready Trigger
+// <0x47=> ADC1 Sequencing Trigger
+// <0x48=> DAC Empty 0 Trigger
+// <0x49=> DAC Empty 1 Trigger
+// <0x4A=> DAC Result Ready 0 Trigger
+// <0x4B=> DAC Result Ready 1 Trigger
+// <0x4C=> I2S Rx 0 Trigger
+// <0x4D=> I2S Rx 1 Trigger
+// <0x4E=> I2S Tx 0 Trigger
+// <0x4F=> I2S Tx 1 Trigger
+// <0x50=> PCC RX Trigger
+// <0x51=> AES Write Trigger
+// <0x52=> AES Read Trigger
+// <0x53=> QSPI Rx Trigger
+// <0x54=> QSPI Tx Trigger
+// Defines the peripheral trigger which is source of the transfer
+// dmac_trifsrc_29
+#ifndef CONF_DMAC_TRIGSRC_29
+#define CONF_DMAC_TRIGSRC_29 0
+#endif
+
+// Channel Arbitration Level
+// <0=> Channel priority 0
+// <1=> Channel priority 1
+// <2=> Channel priority 2
+// <3=> Channel priority 3
+// Defines the arbitration level for this channel
+// dmac_lvl_29
+#ifndef CONF_DMAC_LVL_29
+#define CONF_DMAC_LVL_29 0
+#endif
+
+// Channel Event Output
+// Indicates whether channel event generation is enabled or not
+// dmac_evoe_29
+#ifndef CONF_DMAC_EVOE_29
+#define CONF_DMAC_EVOE_29 0
+#endif
+
+// Channel Event Input
+// Indicates whether channel event reception is enabled or not
+// dmac_evie_29
+#ifndef CONF_DMAC_EVIE_29
+#define CONF_DMAC_EVIE_29 0
+#endif
+
+// Event Input Action
+// <0=> No action
+// <1=> Normal transfer and conditional transfer on strobe trigger
+// <2=> Conditional transfer trigger
+// <3=> Conditional block transfer
+// <4=> Channel suspend operation
+// <5=> Channel resume operation
+// <6=> Skip next block suspend action
+// Defines the event input action
+// dmac_evact_29
+#ifndef CONF_DMAC_EVACT_29
+#define CONF_DMAC_EVACT_29 0
+#endif
+
+// Address Increment Step Size
+// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1
+// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2
+// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4
+// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8
+// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16
+// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32
+// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64
+// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128
+// Defines the address increment step size, applies to source or destination address
+// dmac_stepsize_29
+#ifndef CONF_DMAC_STEPSIZE_29
+#define CONF_DMAC_STEPSIZE_29 0
+#endif
+
+// Step Selection
+// <0=> Step size settings apply to the destination address
+// <1=> Step size settings apply to the source address
+// Defines whether source or destination addresses are using the step size settings
+// dmac_stepsel_29
+#ifndef CONF_DMAC_STEPSEL_29
+#define CONF_DMAC_STEPSEL_29 0
+#endif
+
+// Source Address Increment
+// Indicates whether the source address incrementation is enabled or not
+// dmac_srcinc_29
+#ifndef CONF_DMAC_SRCINC_29
+#define CONF_DMAC_SRCINC_29 0
+#endif
+
+// Destination Address Increment
+// Indicates whether the destination address incrementation is enabled or not
+// dmac_dstinc_29
+#ifndef CONF_DMAC_DSTINC_29
+#define CONF_DMAC_DSTINC_29 0
+#endif
+
+// Beat Size
+// <0=> 8-bit bus transfer
+// <1=> 16-bit bus transfer
+// <2=> 32-bit bus transfer
+// Defines the size of one beat
+// dmac_beatsize_29
+#ifndef CONF_DMAC_BEATSIZE_29
+#define CONF_DMAC_BEATSIZE_29 0
+#endif
+
+// Block Action
+// <0=> Channel will be disabled if it is the last block transfer in the transaction
+// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt
+// <2=> Channel suspend operation is complete
+// <3=> Both channel suspend operation and block interrupt
+// Defines the the DMAC should take after a block transfer has completed
+// dmac_blockact_29
+#ifndef CONF_DMAC_BLOCKACT_29
+#define CONF_DMAC_BLOCKACT_29 0
+#endif
+
+// Event Output Selection
+// <0=> Event generation disabled
+// <1=> Event strobe when block transfer complete
+// <3=> Event strobe when beat transfer complete
+// Defines the event output selection
+// dmac_evosel_29
+#ifndef CONF_DMAC_EVOSEL_29
+#define CONF_DMAC_EVOSEL_29 0
+#endif
+//
+
+// Channel 30 settings
+// dmac_channel_30_settings
+#ifndef CONF_DMAC_CHANNEL_30_SETTINGS
+#define CONF_DMAC_CHANNEL_30_SETTINGS 0
+#endif
+
+// Channel Run in Standby
+// Indicates whether channel 30 is running in standby mode or not
+// dmac_runstdby_30
+#ifndef CONF_DMAC_RUNSTDBY_30
+#define CONF_DMAC_RUNSTDBY_30 0
+#endif
+
+// Trigger action
+// <0=> One trigger required for each block transfer
+// <2=> One trigger required for each beat transfer
+// <3=> One trigger required for each transaction
+// Defines the trigger action used for a transfer
+// dmac_trigact_30
+#ifndef CONF_DMAC_TRIGACT_30
+#define CONF_DMAC_TRIGACT_30 0
+#endif
+
+// Trigger source
+// <0x00=> Only software/event triggers
+// <0x01=> RTC Time Stamp Trigger
+// <0x02=> DSU Debug Communication Channel 0 Trigger
+// <0x03=> DSU Debug Communication Channel 1 Trigger
+// <0x04=> SERCOM0 RX Trigger
+// <0x05=> SERCOM0 TX Trigger
+// <0x06=> SERCOM1 RX Trigger
+// <0x07=> SERCOM1 TX Trigger
+// <0x08=> SERCOM2 RX Trigger
+// <0x09=> SERCOM2 TX Trigger
+// <0x0A=> SERCOM3 RX Trigger
+// <0x0B=> SERCOM3 TX Trigger
+// <0x0C=> SERCOM4 RX Trigger
+// <0x0D=> SERCOM4 TX Trigger
+// <0x0E=> SERCOM5 RX Trigger
+// <0x0F=> SERCOM5 TX Trigger
+// <0x10=> SERCOM6 RX Trigger
+// <0x11=> SERCOM6 TX Trigger
+// <0x12=> SERCOM7 RX Trigger
+// <0x13=> SERCOM7 TX Trigger
+// <0x14=> CAN0 DEBUG Trigger
+// <0x15=> CAN1 DEBUG Trigger
+// <0x16=> TCC0 Overflow Trigger Trigger
+// <0x17=> TCC0 Match/Compare 0 Trigger Trigger
+// <0x18=> TCC0 Match/Compare 1 Trigger Trigger
+// <0x19=> TCC0 Match/Compare 2 Trigger Trigger
+// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger
+// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger
+// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger
+// <0x1D=> TCC1 Overflow Trigger Trigger
+// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger
+// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger
+// <0x20=> TCC1 Match/Compare 2 Trigger Trigger
+// <0x21=> TCC1 Match/Compare 3 Trigger Trigger
+// <0x22=> TCC2 Overflow Trigger Trigger
+// <0x23=> TCC2 Match/Compare 0 Trigger Trigger
+// <0x24=> TCC2 Match/Compare 1 Trigger Trigger
+// <0x25=> TCC2 Match/Compare 2 Trigger Trigger
+// <0x26=> TCC3 Overflow Trigger Trigger
+// <0x27=> TCC3 Match/Compare 0 Trigger Trigger
+// <0x28=> TCC3 Match/Compare 1 Trigger Trigger
+// <0x29=> TCC4 Overflow Trigger Trigger
+// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger
+// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger
+// <0x2C=> TC0 Overflow Trigger
+// <0x2D=> TC0 Match/Compare 0 Trigger
+// <0x2E=> TC0 Match/Compare 1 Trigger
+// <0x2F=> TC1 Overflow Trigger
+// <0x30=> TC1 Match/Compare 0 Trigger
+// <0x31=> TC1 Match/Compare 1 Trigger
+// <0x32=> TC2 Overflow Trigger
+// <0x33=> TC2 Match/Compare 0 Trigger
+// <0x34=> TC2 Match/Compare 1 Trigger
+// <0x35=> TC3 Overflow Trigger
+// <0x36=> TC3 Match/Compare 0 Trigger
+// <0x37=> TC3 Match/Compare 1 Trigger
+// <0x38=> TC4 Overflow Trigger
+// <0x39=> TC4 Match/Compare 0 Trigger
+// <0x3A=> TC4 Match/Compare 1 Trigger
+// <0x3B=> TC5 Overflow Trigger
+// <0x3C=> TC5 Match/Compare 0 Trigger
+// <0x3D=> TC5 Match/Compare 1 Trigger
+// <0x3E=> TC6 Overflow Trigger
+// <0x3F=> TC6 Match/Compare 0 Trigger
+// <0x40=> TC6 Match/Compare 1 Trigger
+// <0x41=> TC7 Overflow Trigger
+// <0x42=> TC7 Match/Compare 0 Trigger
+// <0x43=> TC7 Match/Compare 1 Trigger
+// <0x44=> ADC0 Result Ready Trigger
+// <0x45=> ADC0 Sequencing Trigger
+// <0x46=> ADC1 Result Ready Trigger
+// <0x47=> ADC1 Sequencing Trigger
+// <0x48=> DAC Empty 0 Trigger
+// <0x49=> DAC Empty 1 Trigger
+// <0x4A=> DAC Result Ready 0 Trigger
+// <0x4B=> DAC Result Ready 1 Trigger
+// <0x4C=> I2S Rx 0 Trigger
+// <0x4D=> I2S Rx 1 Trigger
+// <0x4E=> I2S Tx 0 Trigger
+// <0x4F=> I2S Tx 1 Trigger
+// <0x50=> PCC RX Trigger
+// <0x51=> AES Write Trigger
+// <0x52=> AES Read Trigger
+// <0x53=> QSPI Rx Trigger
+// <0x54=> QSPI Tx Trigger
+// Defines the peripheral trigger which is source of the transfer
+// dmac_trifsrc_30
+#ifndef CONF_DMAC_TRIGSRC_30
+#define CONF_DMAC_TRIGSRC_30 0
+#endif
+
+// Channel Arbitration Level
+// <0=> Channel priority 0
+// <1=> Channel priority 1
+// <2=> Channel priority 2
+// <3=> Channel priority 3
+// Defines the arbitration level for this channel
+// dmac_lvl_30
+#ifndef CONF_DMAC_LVL_30
+#define CONF_DMAC_LVL_30 0
+#endif
+
+// Channel Event Output
+// Indicates whether channel event generation is enabled or not
+// dmac_evoe_30
+#ifndef CONF_DMAC_EVOE_30
+#define CONF_DMAC_EVOE_30 0
+#endif
+
+// Channel Event Input
+// Indicates whether channel event reception is enabled or not
+// dmac_evie_30
+#ifndef CONF_DMAC_EVIE_30
+#define CONF_DMAC_EVIE_30 0
+#endif
+
+// Event Input Action
+// <0=> No action
+// <1=> Normal transfer and conditional transfer on strobe trigger
+// <2=> Conditional transfer trigger
+// <3=> Conditional block transfer
+// <4=> Channel suspend operation
+// <5=> Channel resume operation
+// <6=> Skip next block suspend action
+// Defines the event input action
+// dmac_evact_30
+#ifndef CONF_DMAC_EVACT_30
+#define CONF_DMAC_EVACT_30 0
+#endif
+
+// Address Increment Step Size
+// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1
+// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2
+// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4
+// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8
+// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16
+// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32
+// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64
+// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128
+// Defines the address increment step size, applies to source or destination address
+// dmac_stepsize_30
+#ifndef CONF_DMAC_STEPSIZE_30
+#define CONF_DMAC_STEPSIZE_30 0
+#endif
+
+// Step Selection
+// <0=> Step size settings apply to the destination address
+// <1=> Step size settings apply to the source address
+// Defines whether source or destination addresses are using the step size settings
+// dmac_stepsel_30
+#ifndef CONF_DMAC_STEPSEL_30
+#define CONF_DMAC_STEPSEL_30 0
+#endif
+
+// Source Address Increment
+// Indicates whether the source address incrementation is enabled or not
+// dmac_srcinc_30
+#ifndef CONF_DMAC_SRCINC_30
+#define CONF_DMAC_SRCINC_30 0
+#endif
+
+// Destination Address Increment
+// Indicates whether the destination address incrementation is enabled or not
+// dmac_dstinc_30
+#ifndef CONF_DMAC_DSTINC_30
+#define CONF_DMAC_DSTINC_30 0
+#endif
+
+// Beat Size
+// <0=> 8-bit bus transfer
+// <1=> 16-bit bus transfer
+// <2=> 32-bit bus transfer
+// Defines the size of one beat
+// dmac_beatsize_30
+#ifndef CONF_DMAC_BEATSIZE_30
+#define CONF_DMAC_BEATSIZE_30 0
+#endif
+
+// Block Action
+// <0=> Channel will be disabled if it is the last block transfer in the transaction
+// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt
+// <2=> Channel suspend operation is complete
+// <3=> Both channel suspend operation and block interrupt
+// Defines the the DMAC should take after a block transfer has completed
+// dmac_blockact_30
+#ifndef CONF_DMAC_BLOCKACT_30
+#define CONF_DMAC_BLOCKACT_30 0
+#endif
+
+// Event Output Selection
+// <0=> Event generation disabled
+// <1=> Event strobe when block transfer complete
+// <3=> Event strobe when beat transfer complete
+// Defines the event output selection
+// dmac_evosel_30
+#ifndef CONF_DMAC_EVOSEL_30
+#define CONF_DMAC_EVOSEL_30 0
+#endif
+//
+
+// Channel 31 settings
+// dmac_channel_31_settings
+#ifndef CONF_DMAC_CHANNEL_31_SETTINGS
+#define CONF_DMAC_CHANNEL_31_SETTINGS 0
+#endif
+
+// Channel Run in Standby
+// Indicates whether channel 31 is running in standby mode or not
+// dmac_runstdby_31
+#ifndef CONF_DMAC_RUNSTDBY_31
+#define CONF_DMAC_RUNSTDBY_31 0
+#endif
+
+// Trigger action
+// <0=> One trigger required for each block transfer
+// <2=> One trigger required for each beat transfer
+// <3=> One trigger required for each transaction
+// Defines the trigger action used for a transfer
+// dmac_trigact_31
+#ifndef CONF_DMAC_TRIGACT_31
+#define CONF_DMAC_TRIGACT_31 0
+#endif
+
+// Trigger source
+// <0x00=> Only software/event triggers
+// <0x01=> RTC Time Stamp Trigger
+// <0x02=> DSU Debug Communication Channel 0 Trigger
+// <0x03=> DSU Debug Communication Channel 1 Trigger
+// <0x04=> SERCOM0 RX Trigger
+// <0x05=> SERCOM0 TX Trigger
+// <0x06=> SERCOM1 RX Trigger
+// <0x07=> SERCOM1 TX Trigger
+// <0x08=> SERCOM2 RX Trigger
+// <0x09=> SERCOM2 TX Trigger
+// <0x0A=> SERCOM3 RX Trigger
+// <0x0B=> SERCOM3 TX Trigger
+// <0x0C=> SERCOM4 RX Trigger
+// <0x0D=> SERCOM4 TX Trigger
+// <0x0E=> SERCOM5 RX Trigger
+// <0x0F=> SERCOM5 TX Trigger
+// <0x10=> SERCOM6 RX Trigger
+// <0x11=> SERCOM6 TX Trigger
+// <0x12=> SERCOM7 RX Trigger
+// <0x13=> SERCOM7 TX Trigger
+// <0x14=> CAN0 DEBUG Trigger
+// <0x15=> CAN1 DEBUG Trigger
+// <0x16=> TCC0 Overflow Trigger Trigger
+// <0x17=> TCC0 Match/Compare 0 Trigger Trigger
+// <0x18=> TCC0 Match/Compare 1 Trigger Trigger
+// <0x19=> TCC0 Match/Compare 2 Trigger Trigger
+// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger
+// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger
+// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger
+// <0x1D=> TCC1 Overflow Trigger Trigger
+// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger
+// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger
+// <0x20=> TCC1 Match/Compare 2 Trigger Trigger
+// <0x21=> TCC1 Match/Compare 3 Trigger Trigger
+// <0x22=> TCC2 Overflow Trigger Trigger
+// <0x23=> TCC2 Match/Compare 0 Trigger Trigger
+// <0x24=> TCC2 Match/Compare 1 Trigger Trigger
+// <0x25=> TCC2 Match/Compare 2 Trigger Trigger
+// <0x26=> TCC3 Overflow Trigger Trigger
+// <0x27=> TCC3 Match/Compare 0 Trigger Trigger
+// <0x28=> TCC3 Match/Compare 1 Trigger Trigger
+// <0x29=> TCC4 Overflow Trigger Trigger
+// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger
+// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger
+// <0x2C=> TC0 Overflow Trigger
+// <0x2D=> TC0 Match/Compare 0 Trigger
+// <0x2E=> TC0 Match/Compare 1 Trigger
+// <0x2F=> TC1 Overflow Trigger
+// <0x30=> TC1 Match/Compare 0 Trigger
+// <0x31=> TC1 Match/Compare 1 Trigger
+// <0x32=> TC2 Overflow Trigger
+// <0x33=> TC2 Match/Compare 0 Trigger
+// <0x34=> TC2 Match/Compare 1 Trigger
+// <0x35=> TC3 Overflow Trigger
+// <0x36=> TC3 Match/Compare 0 Trigger
+// <0x37=> TC3 Match/Compare 1 Trigger
+// <0x38=> TC4 Overflow Trigger
+// <0x39=> TC4 Match/Compare 0 Trigger
+// <0x3A=> TC4 Match/Compare 1 Trigger
+// <0x3B=> TC5 Overflow Trigger
+// <0x3C=> TC5 Match/Compare 0 Trigger
+// <0x3D=> TC5 Match/Compare 1 Trigger
+// <0x3E=> TC6 Overflow Trigger
+// <0x3F=> TC6 Match/Compare 0 Trigger
+// <0x40=> TC6 Match/Compare 1 Trigger
+// <0x41=> TC7 Overflow Trigger
+// <0x42=> TC7 Match/Compare 0 Trigger
+// <0x43=> TC7 Match/Compare 1 Trigger
+// <0x44=> ADC0 Result Ready Trigger
+// <0x45=> ADC0 Sequencing Trigger
+// <0x46=> ADC1 Result Ready Trigger
+// <0x47=> ADC1 Sequencing Trigger
+// <0x48=> DAC Empty 0 Trigger
+// <0x49=> DAC Empty 1 Trigger
+// <0x4A=> DAC Result Ready 0 Trigger
+// <0x4B=> DAC Result Ready 1 Trigger
+// <0x4C=> I2S Rx 0 Trigger
+// <0x4D=> I2S Rx 1 Trigger
+// <0x4E=> I2S Tx 0 Trigger
+// <0x4F=> I2S Tx 1 Trigger
+// <0x50=> PCC RX Trigger
+// <0x51=> AES Write Trigger
+// <0x52=> AES Read Trigger
+// <0x53=> QSPI Rx Trigger
+// <0x54=> QSPI Tx Trigger
+// Defines the peripheral trigger which is source of the transfer
+// dmac_trifsrc_31
+#ifndef CONF_DMAC_TRIGSRC_31
+#define CONF_DMAC_TRIGSRC_31 0
+#endif
+
+// Channel Arbitration Level
+// <0=> Channel priority 0
+// <1=> Channel priority 1
+// <2=> Channel priority 2
+// <3=> Channel priority 3
+// Defines the arbitration level for this channel
+// dmac_lvl_31
+#ifndef CONF_DMAC_LVL_31
+#define CONF_DMAC_LVL_31 0
+#endif
+
+// Channel Event Output
+// Indicates whether channel event generation is enabled or not
+// dmac_evoe_31
+#ifndef CONF_DMAC_EVOE_31
+#define CONF_DMAC_EVOE_31 0
+#endif
+
+// Channel Event Input
+// Indicates whether channel event reception is enabled or not
+// dmac_evie_31
+#ifndef CONF_DMAC_EVIE_31
+#define CONF_DMAC_EVIE_31 0
+#endif
+
+// Event Input Action
+// <0=> No action
+// <1=> Normal transfer and conditional transfer on strobe trigger
+// <2=> Conditional transfer trigger
+// <3=> Conditional block transfer
+// <4=> Channel suspend operation
+// <5=> Channel resume operation
+// <6=> Skip next block suspend action
+// Defines the event input action
+// dmac_evact_31
+#ifndef CONF_DMAC_EVACT_31
+#define CONF_DMAC_EVACT_31 0
+#endif
+
+// Address Increment Step Size
+// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1
+// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2
+// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4
+// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8
+// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16
+// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32
+// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64
+// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128
+// Defines the address increment step size, applies to source or destination address
+// dmac_stepsize_31
+#ifndef CONF_DMAC_STEPSIZE_31
+#define CONF_DMAC_STEPSIZE_31 0
+#endif
+
+// Step Selection
+// <0=> Step size settings apply to the destination address
+// <1=> Step size settings apply to the source address
+// Defines whether source or destination addresses are using the step size settings
+// dmac_stepsel_31
+#ifndef CONF_DMAC_STEPSEL_31
+#define CONF_DMAC_STEPSEL_31 0
+#endif
+
+// Source Address Increment
+// Indicates whether the source address incrementation is enabled or not
+// dmac_srcinc_31
+#ifndef CONF_DMAC_SRCINC_31
+#define CONF_DMAC_SRCINC_31 0
+#endif
+
+// Destination Address Increment
+// Indicates whether the destination address incrementation is enabled or not
+// dmac_dstinc_31
+#ifndef CONF_DMAC_DSTINC_31
+#define CONF_DMAC_DSTINC_31 0
+#endif
+
+// Beat Size
+// <0=> 8-bit bus transfer
+// <1=> 16-bit bus transfer
+// <2=> 32-bit bus transfer
+// Defines the size of one beat
+// dmac_beatsize_31
+#ifndef CONF_DMAC_BEATSIZE_31
+#define CONF_DMAC_BEATSIZE_31 0
+#endif
+
+// Block Action
+// <0=> Channel will be disabled if it is the last block transfer in the transaction
+// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt
+// <2=> Channel suspend operation is complete
+// <3=> Both channel suspend operation and block interrupt
+// Defines the the DMAC should take after a block transfer has completed
+// dmac_blockact_31
+#ifndef CONF_DMAC_BLOCKACT_31
+#define CONF_DMAC_BLOCKACT_31 0
+#endif
+
+// Event Output Selection
+// <0=> Event generation disabled
+// <1=> Event strobe when block transfer complete
+// <3=> Event strobe when beat transfer complete
+// Defines the event output selection
+// dmac_evosel_31
+#ifndef CONF_DMAC_EVOSEL_31
+#define CONF_DMAC_EVOSEL_31 0
+#endif
+//
+
+//
+
+// <<< end of configuration section >>>
+
+#endif // HPL_DMAC_CONFIG_H
diff --git a/Examples/AS5048A_test/AS5048A_test/Config/hpl_gclk_config.h b/Examples/AS5048A_test/AS5048A_test/Config/hpl_gclk_config.h
new file mode 100644
index 0000000..85a5631
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/Config/hpl_gclk_config.h
@@ -0,0 +1,920 @@
+/* Auto-generated config file hpl_gclk_config.h */
+#ifndef HPL_GCLK_CONFIG_H
+#define HPL_GCLK_CONFIG_H
+
+// <<< Use Configuration Wizard in Context Menu >>>
+
+// Generic clock generator 0 configuration
+// Indicates whether generic clock 0 configuration is enabled or not
+// enable_gclk_gen_0
+#ifndef CONF_GCLK_GENERATOR_0_CONFIG
+#define CONF_GCLK_GENERATOR_0_CONFIG 1
+#endif
+
+// Generic Clock Generator Control
+// Generic clock generator 0 source
+// External Crystal Oscillator 8-48MHz (XOSC0)
+// External Crystal Oscillator 8-48MHz (XOSC1)
+// Generic clock generator input pad
+// Generic clock generator 1
+// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
+// 32kHz External Crystal Oscillator (XOSC32K)
+// Digital Frequency Locked Loop (DFLL48M)
+// Digital Phase Locked Loop (DPLL0)
+// Digital Phase Locked Loop (DPLL1)
+// This defines the clock source for generic clock generator 0
+// gclk_gen_0_oscillator
+#ifndef CONF_GCLK_GEN_0_SOURCE
+#define CONF_GCLK_GEN_0_SOURCE GCLK_GENCTRL_SRC_XOSC1
+#endif
+
+// Run in Standby
+// Indicates whether Run in Standby is enabled or not
+// gclk_arch_gen_0_runstdby
+#ifndef CONF_GCLK_GEN_0_RUNSTDBY
+#define CONF_GCLK_GEN_0_RUNSTDBY 0
+#endif
+
+// Divide Selection
+// Indicates whether Divide Selection is enabled or not
+// gclk_gen_0_div_sel
+#ifndef CONF_GCLK_GEN_0_DIVSEL
+#define CONF_GCLK_GEN_0_DIVSEL 0
+#endif
+
+// Output Enable
+// Indicates whether Output Enable is enabled or not
+// gclk_arch_gen_0_oe
+#ifndef CONF_GCLK_GEN_0_OE
+#define CONF_GCLK_GEN_0_OE 0
+#endif
+
+// Output Off Value
+// Indicates whether Output Off Value is enabled or not
+// gclk_arch_gen_0_oov
+#ifndef CONF_GCLK_GEN_0_OOV
+#define CONF_GCLK_GEN_0_OOV 0
+#endif
+
+// Improve Duty Cycle
+// Indicates whether Improve Duty Cycle is enabled or not
+// gclk_arch_gen_0_idc
+#ifndef CONF_GCLK_GEN_0_IDC
+#define CONF_GCLK_GEN_0_IDC 0
+#endif
+
+// Generic Clock Generator Enable
+// Indicates whether Generic Clock Generator Enable is enabled or not
+// gclk_arch_gen_0_enable
+#ifndef CONF_GCLK_GEN_0_GENEN
+#define CONF_GCLK_GEN_0_GENEN 1
+#endif
+//
+
+// Generic Clock Generator Division
+// Generic clock generator 0 division <0x0000-0xFFFF>
+// gclk_gen_0_div
+#ifndef CONF_GCLK_GEN_0_DIV
+#define CONF_GCLK_GEN_0_DIV 1
+#endif
+//
+//
+
+// Generic clock generator 1 configuration
+// Indicates whether generic clock 1 configuration is enabled or not
+// enable_gclk_gen_1
+#ifndef CONF_GCLK_GENERATOR_1_CONFIG
+#define CONF_GCLK_GENERATOR_1_CONFIG 0
+#endif
+
+// Generic Clock Generator Control
+// Generic clock generator 1 source
+// External Crystal Oscillator 8-48MHz (XOSC0)
+// External Crystal Oscillator 8-48MHz (XOSC1)
+// Generic clock generator input pad
+// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
+// 32kHz External Crystal Oscillator (XOSC32K)
+// Digital Frequency Locked Loop (DFLL48M)
+// Digital Phase Locked Loop (DPLL0)
+// Digital Phase Locked Loop (DPLL1)
+// This defines the clock source for generic clock generator 1
+// gclk_gen_1_oscillator
+#ifndef CONF_GCLK_GEN_1_SOURCE
+#define CONF_GCLK_GEN_1_SOURCE GCLK_GENCTRL_SRC_DFLL
+#endif
+
+// Run in Standby
+// Indicates whether Run in Standby is enabled or not
+// gclk_arch_gen_1_runstdby
+#ifndef CONF_GCLK_GEN_1_RUNSTDBY
+#define CONF_GCLK_GEN_1_RUNSTDBY 0
+#endif
+
+// Divide Selection
+// Indicates whether Divide Selection is enabled or not
+// gclk_gen_1_div_sel
+#ifndef CONF_GCLK_GEN_1_DIVSEL
+#define CONF_GCLK_GEN_1_DIVSEL 0
+#endif
+
+// Output Enable
+// Indicates whether Output Enable is enabled or not
+// gclk_arch_gen_1_oe
+#ifndef CONF_GCLK_GEN_1_OE
+#define CONF_GCLK_GEN_1_OE 0
+#endif
+
+// Output Off Value
+// Indicates whether Output Off Value is enabled or not
+// gclk_arch_gen_1_oov
+#ifndef CONF_GCLK_GEN_1_OOV
+#define CONF_GCLK_GEN_1_OOV 0
+#endif
+
+// Improve Duty Cycle
+// Indicates whether Improve Duty Cycle is enabled or not
+// gclk_arch_gen_1_idc
+#ifndef CONF_GCLK_GEN_1_IDC
+#define CONF_GCLK_GEN_1_IDC 0
+#endif
+
+// Generic Clock Generator Enable
+// Indicates whether Generic Clock Generator Enable is enabled or not
+// gclk_arch_gen_1_enable
+#ifndef CONF_GCLK_GEN_1_GENEN
+#define CONF_GCLK_GEN_1_GENEN 0
+#endif
+//
+
+// Generic Clock Generator Division
+// Generic clock generator 1 division <0x0000-0xFFFF>
+// gclk_gen_1_div
+#ifndef CONF_GCLK_GEN_1_DIV
+#define CONF_GCLK_GEN_1_DIV 1
+#endif
+//
+//
+
+// Generic clock generator 2 configuration
+// Indicates whether generic clock 2 configuration is enabled or not
+// enable_gclk_gen_2
+#ifndef CONF_GCLK_GENERATOR_2_CONFIG
+#define CONF_GCLK_GENERATOR_2_CONFIG 0
+#endif
+
+// Generic Clock Generator Control
+// Generic clock generator 2 source
+// External Crystal Oscillator 8-48MHz (XOSC0)
+// External Crystal Oscillator 8-48MHz (XOSC1)
+// Generic clock generator input pad
+// Generic clock generator 1
+// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
+// 32kHz External Crystal Oscillator (XOSC32K)
+// Digital Frequency Locked Loop (DFLL48M)
+// Digital Phase Locked Loop (DPLL0)
+// Digital Phase Locked Loop (DPLL1)
+// This defines the clock source for generic clock generator 2
+// gclk_gen_2_oscillator
+#ifndef CONF_GCLK_GEN_2_SOURCE
+#define CONF_GCLK_GEN_2_SOURCE GCLK_GENCTRL_SRC_XOSC1
+#endif
+
+// Run in Standby
+// Indicates whether Run in Standby is enabled or not
+// gclk_arch_gen_2_runstdby
+#ifndef CONF_GCLK_GEN_2_RUNSTDBY
+#define CONF_GCLK_GEN_2_RUNSTDBY 0
+#endif
+
+// Divide Selection
+// Indicates whether Divide Selection is enabled or not
+// gclk_gen_2_div_sel
+#ifndef CONF_GCLK_GEN_2_DIVSEL
+#define CONF_GCLK_GEN_2_DIVSEL 1
+#endif
+
+// Output Enable
+// Indicates whether Output Enable is enabled or not
+// gclk_arch_gen_2_oe
+#ifndef CONF_GCLK_GEN_2_OE
+#define CONF_GCLK_GEN_2_OE 0
+#endif
+
+// Output Off Value
+// Indicates whether Output Off Value is enabled or not
+// gclk_arch_gen_2_oov
+#ifndef CONF_GCLK_GEN_2_OOV
+#define CONF_GCLK_GEN_2_OOV 0
+#endif
+
+// Improve Duty Cycle
+// Indicates whether Improve Duty Cycle is enabled or not
+// gclk_arch_gen_2_idc
+#ifndef CONF_GCLK_GEN_2_IDC
+#define CONF_GCLK_GEN_2_IDC 0
+#endif
+
+// Generic Clock Generator Enable
+// Indicates whether Generic Clock Generator Enable is enabled or not
+// gclk_arch_gen_2_enable
+#ifndef CONF_GCLK_GEN_2_GENEN
+#define CONF_GCLK_GEN_2_GENEN 0
+#endif
+//
+
+// Generic Clock Generator Division
+// Generic clock generator 2 division <0x0000-0xFFFF>
+// gclk_gen_2_div
+#ifndef CONF_GCLK_GEN_2_DIV
+#define CONF_GCLK_GEN_2_DIV 1
+#endif
+//
+//
+
+// Generic clock generator 3 configuration
+// Indicates whether generic clock 3 configuration is enabled or not
+// enable_gclk_gen_3
+#ifndef CONF_GCLK_GENERATOR_3_CONFIG
+#define CONF_GCLK_GENERATOR_3_CONFIG 0
+#endif
+
+// Generic Clock Generator Control
+// Generic clock generator 3 source
+// External Crystal Oscillator 8-48MHz (XOSC0)
+// External Crystal Oscillator 8-48MHz (XOSC1)
+// Generic clock generator input pad
+// Generic clock generator 1
+// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
+// 32kHz External Crystal Oscillator (XOSC32K)
+// Digital Frequency Locked Loop (DFLL48M)
+// Digital Phase Locked Loop (DPLL0)
+// Digital Phase Locked Loop (DPLL1)
+// This defines the clock source for generic clock generator 3
+// gclk_gen_3_oscillator
+#ifndef CONF_GCLK_GEN_3_SOURCE
+#define CONF_GCLK_GEN_3_SOURCE GCLK_GENCTRL_SRC_XOSC32K
+#endif
+
+// Run in Standby
+// Indicates whether Run in Standby is enabled or not
+// gclk_arch_gen_3_runstdby
+#ifndef CONF_GCLK_GEN_3_RUNSTDBY
+#define CONF_GCLK_GEN_3_RUNSTDBY 0
+#endif
+
+// Divide Selection
+// Indicates whether Divide Selection is enabled or not
+// gclk_gen_3_div_sel
+#ifndef CONF_GCLK_GEN_3_DIVSEL
+#define CONF_GCLK_GEN_3_DIVSEL 0
+#endif
+
+// Output Enable
+// Indicates whether Output Enable is enabled or not
+// gclk_arch_gen_3_oe
+#ifndef CONF_GCLK_GEN_3_OE
+#define CONF_GCLK_GEN_3_OE 0
+#endif
+
+// Output Off Value
+// Indicates whether Output Off Value is enabled or not
+// gclk_arch_gen_3_oov
+#ifndef CONF_GCLK_GEN_3_OOV
+#define CONF_GCLK_GEN_3_OOV 0
+#endif
+
+// Improve Duty Cycle
+// Indicates whether Improve Duty Cycle is enabled or not
+// gclk_arch_gen_3_idc
+#ifndef CONF_GCLK_GEN_3_IDC
+#define CONF_GCLK_GEN_3_IDC 0
+#endif
+
+// Generic Clock Generator Enable
+// Indicates whether Generic Clock Generator Enable is enabled or not
+// gclk_arch_gen_3_enable
+#ifndef CONF_GCLK_GEN_3_GENEN
+#define CONF_GCLK_GEN_3_GENEN 0
+#endif
+//
+
+// Generic Clock Generator Division
+// Generic clock generator 3 division <0x0000-0xFFFF>
+// gclk_gen_3_div
+#ifndef CONF_GCLK_GEN_3_DIV
+#define CONF_GCLK_GEN_3_DIV 1
+#endif
+//
+//
+
+// Generic clock generator 4 configuration
+// Indicates whether generic clock 4 configuration is enabled or not
+// enable_gclk_gen_4
+#ifndef CONF_GCLK_GENERATOR_4_CONFIG
+#define CONF_GCLK_GENERATOR_4_CONFIG 0
+#endif
+
+// Generic Clock Generator Control
+// Generic clock generator 4 source
+// External Crystal Oscillator 8-48MHz (XOSC0)
+// External Crystal Oscillator 8-48MHz (XOSC1)
+// Generic clock generator input pad
+// Generic clock generator 1
+// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
+// 32kHz External Crystal Oscillator (XOSC32K)
+// Digital Frequency Locked Loop (DFLL48M)
+// Digital Phase Locked Loop (DPLL0)
+// Digital Phase Locked Loop (DPLL1)
+// This defines the clock source for generic clock generator 4
+// gclk_gen_4_oscillator
+#ifndef CONF_GCLK_GEN_4_SOURCE
+#define CONF_GCLK_GEN_4_SOURCE GCLK_GENCTRL_SRC_XOSC1
+#endif
+
+// Run in Standby
+// Indicates whether Run in Standby is enabled or not
+// gclk_arch_gen_4_runstdby
+#ifndef CONF_GCLK_GEN_4_RUNSTDBY
+#define CONF_GCLK_GEN_4_RUNSTDBY 0
+#endif
+
+// Divide Selection
+// Indicates whether Divide Selection is enabled or not
+// gclk_gen_4_div_sel
+#ifndef CONF_GCLK_GEN_4_DIVSEL
+#define CONF_GCLK_GEN_4_DIVSEL 0
+#endif
+
+// Output Enable
+// Indicates whether Output Enable is enabled or not
+// gclk_arch_gen_4_oe
+#ifndef CONF_GCLK_GEN_4_OE
+#define CONF_GCLK_GEN_4_OE 0
+#endif
+
+// Output Off Value
+// Indicates whether Output Off Value is enabled or not
+// gclk_arch_gen_4_oov
+#ifndef CONF_GCLK_GEN_4_OOV
+#define CONF_GCLK_GEN_4_OOV 0
+#endif
+
+// Improve Duty Cycle
+// Indicates whether Improve Duty Cycle is enabled or not
+// gclk_arch_gen_4_idc
+#ifndef CONF_GCLK_GEN_4_IDC
+#define CONF_GCLK_GEN_4_IDC 0
+#endif
+
+// Generic Clock Generator Enable
+// Indicates whether Generic Clock Generator Enable is enabled or not
+// gclk_arch_gen_4_enable
+#ifndef CONF_GCLK_GEN_4_GENEN
+#define CONF_GCLK_GEN_4_GENEN 0
+#endif
+//
+
+// Generic Clock Generator Division
+// Generic clock generator 4 division <0x0000-0xFFFF>
+// gclk_gen_4_div
+#ifndef CONF_GCLK_GEN_4_DIV
+#define CONF_GCLK_GEN_4_DIV 1
+#endif
+//
+//
+
+// Generic clock generator 5 configuration
+// Indicates whether generic clock 5 configuration is enabled or not
+// enable_gclk_gen_5
+#ifndef CONF_GCLK_GENERATOR_5_CONFIG
+#define CONF_GCLK_GENERATOR_5_CONFIG 0
+#endif
+
+// Generic Clock Generator Control
+// Generic clock generator 5 source
+// External Crystal Oscillator 8-48MHz (XOSC0)
+// External Crystal Oscillator 8-48MHz (XOSC1)
+// Generic clock generator input pad
+// Generic clock generator 1
+// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
+// 32kHz External Crystal Oscillator (XOSC32K)
+// Digital Frequency Locked Loop (DFLL48M)
+// Digital Phase Locked Loop (DPLL0)
+// Digital Phase Locked Loop (DPLL1)
+// This defines the clock source for generic clock generator 5
+// gclk_gen_5_oscillator
+#ifndef CONF_GCLK_GEN_5_SOURCE
+#define CONF_GCLK_GEN_5_SOURCE GCLK_GENCTRL_SRC_XOSC1
+#endif
+
+// Run in Standby
+// Indicates whether Run in Standby is enabled or not
+// gclk_arch_gen_5_runstdby
+#ifndef CONF_GCLK_GEN_5_RUNSTDBY
+#define CONF_GCLK_GEN_5_RUNSTDBY 0
+#endif
+
+// Divide Selection
+// Indicates whether Divide Selection is enabled or not
+// gclk_gen_5_div_sel
+#ifndef CONF_GCLK_GEN_5_DIVSEL
+#define CONF_GCLK_GEN_5_DIVSEL 0
+#endif
+
+// Output Enable
+// Indicates whether Output Enable is enabled or not
+// gclk_arch_gen_5_oe
+#ifndef CONF_GCLK_GEN_5_OE
+#define CONF_GCLK_GEN_5_OE 0
+#endif
+
+// Output Off Value
+// Indicates whether Output Off Value is enabled or not
+// gclk_arch_gen_5_oov
+#ifndef CONF_GCLK_GEN_5_OOV
+#define CONF_GCLK_GEN_5_OOV 0
+#endif
+
+// Improve Duty Cycle
+// Indicates whether Improve Duty Cycle is enabled or not
+// gclk_arch_gen_5_idc
+#ifndef CONF_GCLK_GEN_5_IDC
+#define CONF_GCLK_GEN_5_IDC 0
+#endif
+
+// Generic Clock Generator Enable
+// Indicates whether Generic Clock Generator Enable is enabled or not
+// gclk_arch_gen_5_enable
+#ifndef CONF_GCLK_GEN_5_GENEN
+#define CONF_GCLK_GEN_5_GENEN 0
+#endif
+//
+
+// Generic Clock Generator Division
+// Generic clock generator 5 division <0x0000-0xFFFF>
+// gclk_gen_5_div
+#ifndef CONF_GCLK_GEN_5_DIV
+#define CONF_GCLK_GEN_5_DIV 1
+#endif
+//
+//
+
+// Generic clock generator 6 configuration
+// Indicates whether generic clock 6 configuration is enabled or not
+// enable_gclk_gen_6
+#ifndef CONF_GCLK_GENERATOR_6_CONFIG
+#define CONF_GCLK_GENERATOR_6_CONFIG 0
+#endif
+
+// Generic Clock Generator Control
+// Generic clock generator 6 source
+// External Crystal Oscillator 8-48MHz (XOSC0)
+// External Crystal Oscillator 8-48MHz (XOSC1)
+// Generic clock generator input pad
+// Generic clock generator 1
+// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
+// 32kHz External Crystal Oscillator (XOSC32K)
+// Digital Frequency Locked Loop (DFLL48M)
+// Digital Phase Locked Loop (DPLL0)
+// Digital Phase Locked Loop (DPLL1)
+// This defines the clock source for generic clock generator 6
+// gclk_gen_6_oscillator
+#ifndef CONF_GCLK_GEN_6_SOURCE
+#define CONF_GCLK_GEN_6_SOURCE GCLK_GENCTRL_SRC_XOSC1
+#endif
+
+// Run in Standby
+// Indicates whether Run in Standby is enabled or not
+// gclk_arch_gen_6_runstdby
+#ifndef CONF_GCLK_GEN_6_RUNSTDBY
+#define CONF_GCLK_GEN_6_RUNSTDBY 0
+#endif
+
+// Divide Selection
+// Indicates whether Divide Selection is enabled or not
+// gclk_gen_6_div_sel
+#ifndef CONF_GCLK_GEN_6_DIVSEL
+#define CONF_GCLK_GEN_6_DIVSEL 0
+#endif
+
+// Output Enable
+// Indicates whether Output Enable is enabled or not
+// gclk_arch_gen_6_oe
+#ifndef CONF_GCLK_GEN_6_OE
+#define CONF_GCLK_GEN_6_OE 0
+#endif
+
+// Output Off Value
+// Indicates whether Output Off Value is enabled or not
+// gclk_arch_gen_6_oov
+#ifndef CONF_GCLK_GEN_6_OOV
+#define CONF_GCLK_GEN_6_OOV 0
+#endif
+
+// Improve Duty Cycle
+// Indicates whether Improve Duty Cycle is enabled or not
+// gclk_arch_gen_6_idc
+#ifndef CONF_GCLK_GEN_6_IDC
+#define CONF_GCLK_GEN_6_IDC 0
+#endif
+
+// Generic Clock Generator Enable
+// Indicates whether Generic Clock Generator Enable is enabled or not
+// gclk_arch_gen_6_enable
+#ifndef CONF_GCLK_GEN_6_GENEN
+#define CONF_GCLK_GEN_6_GENEN 0
+#endif
+//
+
+// Generic Clock Generator Division
+// Generic clock generator 6 division <0x0000-0xFFFF>
+// gclk_gen_6_div
+#ifndef CONF_GCLK_GEN_6_DIV
+#define CONF_GCLK_GEN_6_DIV 1
+#endif
+//
+//
+
+// Generic clock generator 7 configuration
+// Indicates whether generic clock 7 configuration is enabled or not
+// enable_gclk_gen_7
+#ifndef CONF_GCLK_GENERATOR_7_CONFIG
+#define CONF_GCLK_GENERATOR_7_CONFIG 0
+#endif
+
+// Generic Clock Generator Control
+// Generic clock generator 7 source
+// External Crystal Oscillator 8-48MHz (XOSC0)
+// External Crystal Oscillator 8-48MHz (XOSC1)
+// Generic clock generator input pad
+// Generic clock generator 1
+// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
+// 32kHz External Crystal Oscillator (XOSC32K)
+// Digital Frequency Locked Loop (DFLL48M)
+// Digital Phase Locked Loop (DPLL0)
+// Digital Phase Locked Loop (DPLL1)
+// This defines the clock source for generic clock generator 7
+// gclk_gen_7_oscillator
+#ifndef CONF_GCLK_GEN_7_SOURCE
+#define CONF_GCLK_GEN_7_SOURCE GCLK_GENCTRL_SRC_XOSC1
+#endif
+
+// Run in Standby
+// Indicates whether Run in Standby is enabled or not
+// gclk_arch_gen_7_runstdby
+#ifndef CONF_GCLK_GEN_7_RUNSTDBY
+#define CONF_GCLK_GEN_7_RUNSTDBY 0
+#endif
+
+// Divide Selection
+// Indicates whether Divide Selection is enabled or not
+// gclk_gen_7_div_sel
+#ifndef CONF_GCLK_GEN_7_DIVSEL
+#define CONF_GCLK_GEN_7_DIVSEL 0
+#endif
+
+// Output Enable
+// Indicates whether Output Enable is enabled or not
+// gclk_arch_gen_7_oe
+#ifndef CONF_GCLK_GEN_7_OE
+#define CONF_GCLK_GEN_7_OE 0
+#endif
+
+// Output Off Value
+// Indicates whether Output Off Value is enabled or not
+// gclk_arch_gen_7_oov
+#ifndef CONF_GCLK_GEN_7_OOV
+#define CONF_GCLK_GEN_7_OOV 0
+#endif
+
+// Improve Duty Cycle
+// Indicates whether Improve Duty Cycle is enabled or not
+// gclk_arch_gen_7_idc
+#ifndef CONF_GCLK_GEN_7_IDC
+#define CONF_GCLK_GEN_7_IDC 0
+#endif
+
+// Generic Clock Generator Enable
+// Indicates whether Generic Clock Generator Enable is enabled or not
+// gclk_arch_gen_7_enable
+#ifndef CONF_GCLK_GEN_7_GENEN
+#define CONF_GCLK_GEN_7_GENEN 0
+#endif
+//
+
+// Generic Clock Generator Division
+// Generic clock generator 7 division <0x0000-0xFFFF>
+// gclk_gen_7_div
+#ifndef CONF_GCLK_GEN_7_DIV
+#define CONF_GCLK_GEN_7_DIV 1
+#endif
+//
+//
+
+// Generic clock generator 8 configuration
+// Indicates whether generic clock 8 configuration is enabled or not
+// enable_gclk_gen_8
+#ifndef CONF_GCLK_GENERATOR_8_CONFIG
+#define CONF_GCLK_GENERATOR_8_CONFIG 0
+#endif
+
+// Generic Clock Generator Control
+// Generic clock generator 8 source
+// External Crystal Oscillator 8-48MHz (XOSC0)
+// External Crystal Oscillator 8-48MHz (XOSC1)
+// Generic clock generator input pad
+// Generic clock generator 1
+// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
+// 32kHz External Crystal Oscillator (XOSC32K)
+// Digital Frequency Locked Loop (DFLL48M)
+// Digital Phase Locked Loop (DPLL0)
+// Digital Phase Locked Loop (DPLL1)
+// This defines the clock source for generic clock generator 8
+// gclk_gen_8_oscillator
+#ifndef CONF_GCLK_GEN_8_SOURCE
+#define CONF_GCLK_GEN_8_SOURCE GCLK_GENCTRL_SRC_XOSC1
+#endif
+
+// Run in Standby
+// Indicates whether Run in Standby is enabled or not
+// gclk_arch_gen_8_runstdby
+#ifndef CONF_GCLK_GEN_8_RUNSTDBY
+#define CONF_GCLK_GEN_8_RUNSTDBY 0
+#endif
+
+// Divide Selection
+// Indicates whether Divide Selection is enabled or not
+// gclk_gen_8_div_sel
+#ifndef CONF_GCLK_GEN_8_DIVSEL
+#define CONF_GCLK_GEN_8_DIVSEL 0
+#endif
+
+// Output Enable
+// Indicates whether Output Enable is enabled or not
+// gclk_arch_gen_8_oe
+#ifndef CONF_GCLK_GEN_8_OE
+#define CONF_GCLK_GEN_8_OE 0
+#endif
+
+// Output Off Value
+// Indicates whether Output Off Value is enabled or not
+// gclk_arch_gen_8_oov
+#ifndef CONF_GCLK_GEN_8_OOV
+#define CONF_GCLK_GEN_8_OOV 0
+#endif
+
+// Improve Duty Cycle
+// Indicates whether Improve Duty Cycle is enabled or not
+// gclk_arch_gen_8_idc
+#ifndef CONF_GCLK_GEN_8_IDC
+#define CONF_GCLK_GEN_8_IDC 0
+#endif
+
+// Generic Clock Generator Enable
+// Indicates whether Generic Clock Generator Enable is enabled or not
+// gclk_arch_gen_8_enable
+#ifndef CONF_GCLK_GEN_8_GENEN
+#define CONF_GCLK_GEN_8_GENEN 0
+#endif
+//
+
+// Generic Clock Generator Division
+// Generic clock generator 8 division <0x0000-0xFFFF>
+// gclk_gen_8_div
+#ifndef CONF_GCLK_GEN_8_DIV
+#define CONF_GCLK_GEN_8_DIV 1
+#endif
+//
+//
+
+// Generic clock generator 9 configuration
+// Indicates whether generic clock 9 configuration is enabled or not
+// enable_gclk_gen_9
+#ifndef CONF_GCLK_GENERATOR_9_CONFIG
+#define CONF_GCLK_GENERATOR_9_CONFIG 0
+#endif
+
+// Generic Clock Generator Control
+// Generic clock generator 9 source
+// External Crystal Oscillator 8-48MHz (XOSC0)
+// External Crystal Oscillator 8-48MHz (XOSC1)
+// Generic clock generator input pad
+// Generic clock generator 1
+// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
+// 32kHz External Crystal Oscillator (XOSC32K)
+// Digital Frequency Locked Loop (DFLL48M)
+// Digital Phase Locked Loop (DPLL0)
+// Digital Phase Locked Loop (DPLL1)
+// This defines the clock source for generic clock generator 9
+// gclk_gen_9_oscillator
+#ifndef CONF_GCLK_GEN_9_SOURCE
+#define CONF_GCLK_GEN_9_SOURCE GCLK_GENCTRL_SRC_XOSC1
+#endif
+
+// Run in Standby
+// Indicates whether Run in Standby is enabled or not
+// gclk_arch_gen_9_runstdby
+#ifndef CONF_GCLK_GEN_9_RUNSTDBY
+#define CONF_GCLK_GEN_9_RUNSTDBY 0
+#endif
+
+// Divide Selection
+// Indicates whether Divide Selection is enabled or not
+// gclk_gen_9_div_sel
+#ifndef CONF_GCLK_GEN_9_DIVSEL
+#define CONF_GCLK_GEN_9_DIVSEL 0
+#endif
+
+// Output Enable
+// Indicates whether Output Enable is enabled or not
+// gclk_arch_gen_9_oe
+#ifndef CONF_GCLK_GEN_9_OE
+#define CONF_GCLK_GEN_9_OE 0
+#endif
+
+// Output Off Value
+// Indicates whether Output Off Value is enabled or not
+// gclk_arch_gen_9_oov
+#ifndef CONF_GCLK_GEN_9_OOV
+#define CONF_GCLK_GEN_9_OOV 0
+#endif
+
+// Improve Duty Cycle
+// Indicates whether Improve Duty Cycle is enabled or not
+// gclk_arch_gen_9_idc
+#ifndef CONF_GCLK_GEN_9_IDC
+#define CONF_GCLK_GEN_9_IDC 0
+#endif
+
+// Generic Clock Generator Enable
+// Indicates whether Generic Clock Generator Enable is enabled or not
+// gclk_arch_gen_9_enable
+#ifndef CONF_GCLK_GEN_9_GENEN
+#define CONF_GCLK_GEN_9_GENEN 0
+#endif
+//
+
+// Generic Clock Generator Division
+// Generic clock generator 9 division <0x0000-0xFFFF>
+// gclk_gen_9_div
+#ifndef CONF_GCLK_GEN_9_DIV
+#define CONF_GCLK_GEN_9_DIV 1
+#endif
+//
+//
+
+// Generic clock generator 10 configuration
+// Indicates whether generic clock 10 configuration is enabled or not
+// enable_gclk_gen_10
+#ifndef CONF_GCLK_GENERATOR_10_CONFIG
+#define CONF_GCLK_GENERATOR_10_CONFIG 0
+#endif
+
+// Generic Clock Generator Control
+// Generic clock generator 10 source
+// External Crystal Oscillator 8-48MHz (XOSC0)
+// External Crystal Oscillator 8-48MHz (XOSC1)
+// Generic clock generator input pad
+// Generic clock generator 1
+// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
+// 32kHz External Crystal Oscillator (XOSC32K)
+// Digital Frequency Locked Loop (DFLL48M)
+// Digital Phase Locked Loop (DPLL0)
+// Digital Phase Locked Loop (DPLL1)
+// This defines the clock source for generic clock generator 10
+// gclk_gen_10_oscillator
+#ifndef CONF_GCLK_GEN_10_SOURCE
+#define CONF_GCLK_GEN_10_SOURCE GCLK_GENCTRL_SRC_XOSC1
+#endif
+
+// Run in Standby
+// Indicates whether Run in Standby is enabled or not
+// gclk_arch_gen_10_runstdby
+#ifndef CONF_GCLK_GEN_10_RUNSTDBY
+#define CONF_GCLK_GEN_10_RUNSTDBY 0
+#endif
+
+// Divide Selection
+// Indicates whether Divide Selection is enabled or not
+// gclk_gen_10_div_sel
+#ifndef CONF_GCLK_GEN_10_DIVSEL
+#define CONF_GCLK_GEN_10_DIVSEL 0
+#endif
+
+// Output Enable
+// Indicates whether Output Enable is enabled or not
+// gclk_arch_gen_10_oe
+#ifndef CONF_GCLK_GEN_10_OE
+#define CONF_GCLK_GEN_10_OE 0
+#endif
+
+// Output Off Value
+// Indicates whether Output Off Value is enabled or not
+// gclk_arch_gen_10_oov
+#ifndef CONF_GCLK_GEN_10_OOV
+#define CONF_GCLK_GEN_10_OOV 0
+#endif
+
+// Improve Duty Cycle
+// Indicates whether Improve Duty Cycle is enabled or not
+// gclk_arch_gen_10_idc
+#ifndef CONF_GCLK_GEN_10_IDC
+#define CONF_GCLK_GEN_10_IDC 0
+#endif
+
+// Generic Clock Generator Enable
+// Indicates whether Generic Clock Generator Enable is enabled or not
+// gclk_arch_gen_10_enable
+#ifndef CONF_GCLK_GEN_10_GENEN
+#define CONF_GCLK_GEN_10_GENEN 0
+#endif
+//
+
+// Generic Clock Generator Division
+// Generic clock generator 10 division <0x0000-0xFFFF>
+// gclk_gen_10_div
+#ifndef CONF_GCLK_GEN_10_DIV
+#define CONF_GCLK_GEN_10_DIV 1
+#endif
+//
+//
+
+// Generic clock generator 11 configuration
+// Indicates whether generic clock 11 configuration is enabled or not
+// enable_gclk_gen_11
+#ifndef CONF_GCLK_GENERATOR_11_CONFIG
+#define CONF_GCLK_GENERATOR_11_CONFIG 0
+#endif
+
+// Generic Clock Generator Control
+// Generic clock generator 11 source
+// External Crystal Oscillator 8-48MHz (XOSC0)
+// External Crystal Oscillator 8-48MHz (XOSC1)
+// Generic clock generator input pad
+// Generic clock generator 1
+// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
+// 32kHz External Crystal Oscillator (XOSC32K)
+// Digital Frequency Locked Loop (DFLL48M)
+// Digital Phase Locked Loop (DPLL0)
+// Digital Phase Locked Loop (DPLL1)
+// This defines the clock source for generic clock generator 11
+// gclk_gen_11_oscillator
+#ifndef CONF_GCLK_GEN_11_SOURCE
+#define CONF_GCLK_GEN_11_SOURCE GCLK_GENCTRL_SRC_XOSC1
+#endif
+
+// Run in Standby
+// Indicates whether Run in Standby is enabled or not
+// gclk_arch_gen_11_runstdby
+#ifndef CONF_GCLK_GEN_11_RUNSTDBY
+#define CONF_GCLK_GEN_11_RUNSTDBY 0
+#endif
+
+// Divide Selection
+// Indicates whether Divide Selection is enabled or not
+// gclk_gen_11_div_sel
+#ifndef CONF_GCLK_GEN_11_DIVSEL
+#define CONF_GCLK_GEN_11_DIVSEL 0
+#endif
+
+// Output Enable
+// Indicates whether Output Enable is enabled or not
+// gclk_arch_gen_11_oe
+#ifndef CONF_GCLK_GEN_11_OE
+#define CONF_GCLK_GEN_11_OE 0
+#endif
+
+// Output Off Value
+// Indicates whether Output Off Value is enabled or not
+// gclk_arch_gen_11_oov
+#ifndef CONF_GCLK_GEN_11_OOV
+#define CONF_GCLK_GEN_11_OOV 0
+#endif
+
+// Improve Duty Cycle
+// Indicates whether Improve Duty Cycle is enabled or not
+// gclk_arch_gen_11_idc
+#ifndef CONF_GCLK_GEN_11_IDC
+#define CONF_GCLK_GEN_11_IDC 0
+#endif
+
+// Generic Clock Generator Enable
+// Indicates whether Generic Clock Generator Enable is enabled or not
+// gclk_arch_gen_11_enable
+#ifndef CONF_GCLK_GEN_11_GENEN
+#define CONF_GCLK_GEN_11_GENEN 0
+#endif
+//
+
+// Generic Clock Generator Division
+// Generic clock generator 11 division <0x0000-0xFFFF>
+// gclk_gen_11_div
+#ifndef CONF_GCLK_GEN_11_DIV
+#define CONF_GCLK_GEN_11_DIV 1
+#endif
+//
+//
+
+// <<< end of configuration section >>>
+
+#endif // HPL_GCLK_CONFIG_H
diff --git a/Examples/AS5048A_test/AS5048A_test/Config/hpl_mclk_config.h b/Examples/AS5048A_test/AS5048A_test/Config/hpl_mclk_config.h
new file mode 100644
index 0000000..a5a7de5
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/Config/hpl_mclk_config.h
@@ -0,0 +1,104 @@
+/* Auto-generated config file hpl_mclk_config.h */
+#ifndef HPL_MCLK_CONFIG_H
+#define HPL_MCLK_CONFIG_H
+
+// <<< Use Configuration Wizard in Context Menu >>>
+
+#include
+
+// System Configuration
+// Indicates whether configuration for system is enabled or not
+// enable_cpu_clock
+#ifndef CONF_SYSTEM_CONFIG
+#define CONF_SYSTEM_CONFIG 1
+#endif
+
+// Basic settings
+// CPU Clock source
+// Generic clock generator 0
+// This defines the clock source for the CPU
+// cpu_clock_source
+#ifndef CONF_CPU_SRC
+#define CONF_CPU_SRC GCLK_PCHCTRL_GEN_GCLK0_Val
+#endif
+
+// CPU Clock Division Factor
+// 1
+// 2
+// 4
+// 8
+// 16
+// 32
+// 64
+// 128
+// Prescalar for CPU clock
+// cpu_div
+#ifndef CONF_MCLK_CPUDIV
+#define CONF_MCLK_CPUDIV MCLK_CPUDIV_DIV_DIV1_Val
+#endif
+// Low Power Clock Division
+// Divide by 1
+// Divide by 2
+// Divide by 4
+// Divide by 8
+// Divide by 16
+// Divide by 32
+// Divide by 64
+// Divide by 128
+// mclk_arch_lpdiv
+#ifndef CONF_MCLK_LPDIV
+#define CONF_MCLK_LPDIV MCLK_LPDIV_LPDIV_DIV4_Val
+#endif
+
+// Backup Clock Division
+// Divide by 1
+// Divide by 2
+// Divide by 4
+// Divide by 8
+// Divide by 16
+// Divide by 32
+// Divide by 64
+// Divide by 128
+// mclk_arch_bupdiv
+#ifndef CONF_MCLK_BUPDIV
+#define CONF_MCLK_BUPDIV MCLK_BUPDIV_BUPDIV_DIV8_Val
+#endif
+// High-Speed Clock Division
+// Divide by 1
+// mclk_arch_hsdiv
+#ifndef CONF_MCLK_HSDIV
+#define CONF_MCLK_HSDIV MCLK_HSDIV_DIV_DIV1_Val
+#endif
+//
+
+// NVM Settings
+// NVM Wait States
+// These bits select the number of wait states for a read operation.
+// <0=> 0
+// <1=> 1
+// <2=> 2
+// <3=> 3
+// <4=> 4
+// <5=> 5
+// <6=> 6
+// <7=> 7
+// <8=> 8
+// <9=> 9
+// <10=> 10
+// <11=> 11
+// <12=> 12
+// <13=> 13
+// <14=> 14
+// <15=> 15
+// nvm_wait_states
+#ifndef CONF_NVM_WAIT_STATE
+#define CONF_NVM_WAIT_STATE 0
+#endif
+
+//
+
+//
+
+// <<< end of configuration section >>>
+
+#endif // HPL_MCLK_CONFIG_H
diff --git a/Examples/AS5048A_test/AS5048A_test/Config/hpl_osc32kctrl_config.h b/Examples/AS5048A_test/AS5048A_test/Config/hpl_osc32kctrl_config.h
new file mode 100644
index 0000000..e7fddd2
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/Config/hpl_osc32kctrl_config.h
@@ -0,0 +1,165 @@
+/* Auto-generated config file hpl_osc32kctrl_config.h */
+#ifndef HPL_OSC32KCTRL_CONFIG_H
+#define HPL_OSC32KCTRL_CONFIG_H
+
+// <<< Use Configuration Wizard in Context Menu >>>
+
+// RTC Source configuration
+// enable_rtc_source
+#ifndef CONF_RTCCTRL_CONFIG
+#define CONF_RTCCTRL_CONFIG 0
+#endif
+
+// RTC source control
+// RTC Clock Source Selection
+// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K)
+// 32kHz External Crystal Oscillator (XOSC32K)
+// This defines the clock source for RTC
+// rtc_source_oscillator
+#ifndef CONF_RTCCTRL_SRC
+#define CONF_RTCCTRL_SRC GCLK_GENCTRL_SRC_OSCULP32K
+#endif
+
+// Use 1 kHz output
+// rtc_1khz_selection
+#ifndef CONF_RTCCTRL_1KHZ
+
+#define CONF_RTCCTRL_1KHZ 0
+
+#endif
+
+#if CONF_RTCCTRL_SRC == GCLK_GENCTRL_SRC_OSCULP32K
+#define CONF_RTCCTRL (CONF_RTCCTRL_1KHZ ? OSC32KCTRL_RTCCTRL_RTCSEL_ULP1K_Val : OSC32KCTRL_RTCCTRL_RTCSEL_ULP32K_Val)
+#elif CONF_RTCCTRL_SRC == GCLK_GENCTRL_SRC_XOSC32K
+#define CONF_RTCCTRL (CONF_RTCCTRL_1KHZ ? OSC32KCTRL_RTCCTRL_RTCSEL_XOSC1K_Val : OSC32KCTRL_RTCCTRL_RTCSEL_XOSC32K_Val)
+#else
+#error unexpected CONF_RTCCTRL_SRC
+#endif
+
+//
+//
+
+// 32kHz External Crystal Oscillator Configuration
+// Indicates whether configuration for External 32K Osc is enabled or not
+// enable_xosc32k
+#ifndef CONF_XOSC32K_CONFIG
+#define CONF_XOSC32K_CONFIG 0
+#endif
+
+// 32kHz External Crystal Oscillator Control
+// Oscillator enable
+// Indicates whether 32kHz External Crystal Oscillator is enabled or not
+// xosc32k_arch_enable
+#ifndef CONF_XOSC32K_ENABLE
+#define CONF_XOSC32K_ENABLE 0
+#endif
+
+// Start-Up Time
+// <0x0=>62592us
+// <0x1=>125092us
+// <0x2=>500092us
+// <0x3=>1000092us
+// <0x4=>2000092us
+// <0x5=>4000092us
+// <0x6=>8000092us
+// xosc32k_arch_startup
+#ifndef CONF_XOSC32K_STARTUP
+#define CONF_XOSC32K_STARTUP 0x0
+#endif
+
+// On Demand Control
+// Indicates whether On Demand Control is enabled or not
+// xosc32k_arch_ondemand
+#ifndef CONF_XOSC32K_ONDEMAND
+#define CONF_XOSC32K_ONDEMAND 1
+#endif
+
+// Run in Standby
+// Indicates whether Run in Standby is enabled or not
+// xosc32k_arch_runstdby
+#ifndef CONF_XOSC32K_RUNSTDBY
+#define CONF_XOSC32K_RUNSTDBY 0
+#endif
+
+// 1kHz Output Enable
+// Indicates whether 1kHz Output is enabled or not
+// xosc32k_arch_en1k
+#ifndef CONF_XOSC32K_EN1K
+#define CONF_XOSC32K_EN1K 0
+#endif
+
+// 32kHz Output Enable
+// Indicates whether 32kHz Output is enabled or not
+// xosc32k_arch_en32k
+#ifndef CONF_XOSC32K_EN32K
+#define CONF_XOSC32K_EN32K 0
+#endif
+
+// Clock Switch Back
+// Indicates whether Clock Switch Back is enabled or not
+// xosc32k_arch_swben
+#ifndef CONF_XOSC32K_SWBEN
+#define CONF_XOSC32K_SWBEN 0
+#endif
+
+// Clock Failure Detector
+// Indicates whether Clock Failure Detector is enabled or not
+// xosc32k_arch_cfden
+#ifndef CONF_XOSC32K_CFDEN
+#define CONF_XOSC32K_CFDEN 0
+#endif
+
+// Clock Failure Detector Event Out
+// Indicates whether Clock Failure Detector Event Out is enabled or not
+// xosc32k_arch_cfdeo
+#ifndef CONF_XOSC32K_CFDEO
+#define CONF_XOSC32K_CFDEO 0
+#endif
+
+// Crystal connected to XIN32/XOUT32 Enable
+// Indicates whether the connections between the I/O pads and the external clock or crystal oscillator is enabled or not
+// xosc32k_arch_xtalen
+#ifndef CONF_XOSC32K_XTALEN
+#define CONF_XOSC32K_XTALEN 1
+#endif
+
+// Control Gain Mode
+// <0x0=>Low Power mode
+// <0x1=>Standard mode
+// <0x2=>High Speed mode
+// xosc32k_arch_cgm
+#ifndef CONF_XOSC32K_CGM
+#define CONF_XOSC32K_CGM 0x1
+#endif
+
+//
+//
+
+// 32kHz Ultra Low Power Internal Oscillator Configuration
+// Indicates whether configuration for OSCULP32K is enabled or not
+// enable_osculp32k
+#ifndef CONF_OSCULP32K_CONFIG
+#define CONF_OSCULP32K_CONFIG 1
+#endif
+
+// 32kHz Ultra Low Power Internal Oscillator Control
+
+// Oscillator Calibration Control
+// Indicates whether Oscillator Calibration is enabled or not
+// osculp32k_calib_enable
+#ifndef CONF_OSCULP32K_CALIB_ENABLE
+#define CONF_OSCULP32K_CALIB_ENABLE 0
+#endif
+
+// Oscillator Calibration <0x0-0x3F>
+// osculp32k_calib
+#ifndef CONF_OSCULP32K_CALIB
+#define CONF_OSCULP32K_CALIB 0x0
+#endif
+
+//
+//
+
+// <<< end of configuration section >>>
+
+#endif // HPL_OSC32KCTRL_CONFIG_H
diff --git a/Examples/AS5048A_test/AS5048A_test/Config/hpl_oscctrl_config.h b/Examples/AS5048A_test/AS5048A_test/Config/hpl_oscctrl_config.h
new file mode 100644
index 0000000..bb1a5dc
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/Config/hpl_oscctrl_config.h
@@ -0,0 +1,640 @@
+/* Auto-generated config file hpl_oscctrl_config.h */
+#ifndef HPL_OSCCTRL_CONFIG_H
+#define HPL_OSCCTRL_CONFIG_H
+
+// <<< Use Configuration Wizard in Context Menu >>>
+
+// External Multipurpose Crystal Oscillator Configuration
+// Indicates whether configuration for XOSC0 is enabled or not
+// enable_xosc0
+#ifndef CONF_XOSC0_CONFIG
+#define CONF_XOSC0_CONFIG 0
+#endif
+
+// Frequency <8000000-48000000>
+// Oscillation frequency of the resonator connected to the External Multipurpose Crystal Oscillator.
+// xosc0_frequency
+#ifndef CONF_XOSC_FREQUENCY
+#define CONF_XOSC0_FREQUENCY 12000000
+#endif
+
+// External Multipurpose Crystal Oscillator Control
+// Oscillator enable
+// Indicates whether External Multipurpose Crystal Oscillator is enabled or not
+// xosc0_arch_enable
+#ifndef CONF_XOSC0_ENABLE
+#define CONF_XOSC0_ENABLE 0
+#endif
+
+// Start-Up Time
+// <0x0=>31us
+// <0x1=>61us
+// <0x2=>122us
+// <0x3=>244us
+// <0x4=>488us
+// <0x5=>977us
+// <0x6=>1953us
+// <0x7=>3906us
+// <0x8=>7813us
+// <0x9=>15625us
+// <0xA=>31250us
+// <0xB=>62500us
+// <0xC=>125000us
+// <0xD=>250000us
+// <0xE=>500000us
+// <0xF=>1000000us
+// xosc0_arch_startup
+#ifndef CONF_XOSC0_STARTUP
+#define CONF_XOSC0_STARTUP 0
+#endif
+
+// Clock Switch Back
+// Indicates whether Clock Switch Back is enabled or not
+// xosc0_arch_swben
+#ifndef CONF_XOSC0_SWBEN
+#define CONF_XOSC0_SWBEN 0
+#endif
+
+// Clock Failure Detector
+// Indicates whether Clock Failure Detector is enabled or not
+// xosc0_arch_cfden
+#ifndef CONF_XOSC0_CFDEN
+#define CONF_XOSC0_CFDEN 0
+#endif
+
+// Automatic Loop Control Enable
+// Indicates whether Automatic Loop Control is enabled or not
+// xosc0_arch_enalc
+#ifndef CONF_XOSC0_ENALC
+#define CONF_XOSC0_ENALC 0
+#endif
+
+// Low Buffer Gain Enable
+// Indicates whether Low Buffer Gain is enabled or not
+// xosc0_arch_lowbufgain
+#ifndef CONF_XOSC0_LOWBUFGAIN
+#define CONF_XOSC0_LOWBUFGAIN 0
+#endif
+
+// On Demand Control
+// Indicates whether On Demand Control is enabled or not
+// xosc0_arch_ondemand
+#ifndef CONF_XOSC0_ONDEMAND
+#define CONF_XOSC0_ONDEMAND 0
+#endif
+
+// Run in Standby
+// Indicates whether Run in Standby is enabled or not
+// xosc0_arch_runstdby
+#ifndef CONF_XOSC0_RUNSTDBY
+#define CONF_XOSC0_RUNSTDBY 0
+#endif
+
+// Crystal connected to XIN/XOUT Enable
+// Indicates whether the connections between the I/O pads and the external clock or crystal oscillator is enabled or not
+// xosc0_arch_xtalen
+#ifndef CONF_XOSC0_XTALEN
+#define CONF_XOSC0_XTALEN 0
+#endif
+//
+//
+
+#if CONF_XOSC0_FREQUENCY >= 32000000
+#define CONF_XOSC0_CFDPRESC 0x0
+#define CONF_XOSC0_IMULT 0x7
+#define CONF_XOSC0_IPTAT 0x3
+#elif CONF_XOSC0_FREQUENCY >= 24000000
+#define CONF_XOSC0_CFDPRESC 0x1
+#define CONF_XOSC0_IMULT 0x6
+#define CONF_XOSC0_IPTAT 0x3
+#elif CONF_XOSC0_FREQUENCY >= 16000000
+#define CONF_XOSC0_CFDPRESC 0x2
+#define CONF_XOSC0_IMULT 0x5
+#define CONF_XOSC0_IPTAT 0x3
+#elif CONF_XOSC0_FREQUENCY >= 8000000
+#define CONF_XOSC0_CFDPRESC 0x3
+#define CONF_XOSC0_IMULT 0x4
+#define CONF_XOSC0_IPTAT 0x3
+#endif
+
+// External Multipurpose Crystal Oscillator Configuration
+// Indicates whether configuration for XOSC1 is enabled or not
+// enable_xosc1
+#ifndef CONF_XOSC1_CONFIG
+#define CONF_XOSC1_CONFIG 1
+#endif
+
+// Frequency <8000000-48000000>
+// Oscillation frequency of the resonator connected to the External Multipurpose Crystal Oscillator.
+// xosc1_frequency
+#ifndef CONF_XOSC_FREQUENCY
+#define CONF_XOSC1_FREQUENCY 12000000
+#endif
+
+// External Multipurpose Crystal Oscillator Control
+// Oscillator enable
+// Indicates whether External Multipurpose Crystal Oscillator is enabled or not
+// xosc1_arch_enable
+#ifndef CONF_XOSC1_ENABLE
+#define CONF_XOSC1_ENABLE 1
+#endif
+
+// Start-Up Time
+// <0x0=>31us
+// <0x1=>61us
+// <0x2=>122us
+// <0x3=>244us
+// <0x4=>488us
+// <0x5=>977us
+// <0x6=>1953us
+// <0x7=>3906us
+// <0x8=>7813us
+// <0x9=>15625us
+// <0xA=>31250us
+// <0xB=>62500us
+// <0xC=>125000us
+// <0xD=>250000us
+// <0xE=>500000us
+// <0xF=>1000000us
+// xosc1_arch_startup
+#ifndef CONF_XOSC1_STARTUP
+#define CONF_XOSC1_STARTUP 0
+#endif
+
+// Clock Switch Back
+// Indicates whether Clock Switch Back is enabled or not
+// xosc1_arch_swben
+#ifndef CONF_XOSC1_SWBEN
+#define CONF_XOSC1_SWBEN 0
+#endif
+
+// Clock Failure Detector
+// Indicates whether Clock Failure Detector is enabled or not
+// xosc1_arch_cfden
+#ifndef CONF_XOSC1_CFDEN
+#define CONF_XOSC1_CFDEN 0
+#endif
+
+// Automatic Loop Control Enable
+// Indicates whether Automatic Loop Control is enabled or not
+// xosc1_arch_enalc
+#ifndef CONF_XOSC1_ENALC
+#define CONF_XOSC1_ENALC 0
+#endif
+
+// Low Buffer Gain Enable
+// Indicates whether Low Buffer Gain is enabled or not
+// xosc1_arch_lowbufgain
+#ifndef CONF_XOSC1_LOWBUFGAIN
+#define CONF_XOSC1_LOWBUFGAIN 0
+#endif
+
+// On Demand Control
+// Indicates whether On Demand Control is enabled or not
+// xosc1_arch_ondemand
+#ifndef CONF_XOSC1_ONDEMAND
+#define CONF_XOSC1_ONDEMAND 0
+#endif
+
+// Run in Standby
+// Indicates whether Run in Standby is enabled or not
+// xosc1_arch_runstdby
+#ifndef CONF_XOSC1_RUNSTDBY
+#define CONF_XOSC1_RUNSTDBY 0
+#endif
+
+// Crystal connected to XIN/XOUT Enable
+// Indicates whether the connections between the I/O pads and the external clock or crystal oscillator is enabled or not
+// xosc1_arch_xtalen
+#ifndef CONF_XOSC1_XTALEN
+#define CONF_XOSC1_XTALEN 1
+#endif
+//
+//
+
+#if CONF_XOSC1_FREQUENCY >= 32000000
+#define CONF_XOSC1_CFDPRESC 0x0
+#define CONF_XOSC1_IMULT 0x7
+#define CONF_XOSC1_IPTAT 0x3
+#elif CONF_XOSC1_FREQUENCY >= 24000000
+#define CONF_XOSC1_CFDPRESC 0x1
+#define CONF_XOSC1_IMULT 0x6
+#define CONF_XOSC1_IPTAT 0x3
+#elif CONF_XOSC1_FREQUENCY >= 16000000
+#define CONF_XOSC1_CFDPRESC 0x2
+#define CONF_XOSC1_IMULT 0x5
+#define CONF_XOSC1_IPTAT 0x3
+#elif CONF_XOSC1_FREQUENCY >= 8000000
+#define CONF_XOSC1_CFDPRESC 0x3
+#define CONF_XOSC1_IMULT 0x4
+#define CONF_XOSC1_IPTAT 0x3
+#endif
+
+// DFLL Configuration
+// Indicates whether configuration for DFLL is enabled or not
+// enable_dfll
+#ifndef CONF_DFLL_CONFIG
+#define CONF_DFLL_CONFIG 0
+#endif
+
+// Reference Clock Source
+// Generic clock generator 0
+// Generic clock generator 1
+// Generic clock generator 2
+// Generic clock generator 3
+// Generic clock generator 4
+// Generic clock generator 5
+// Generic clock generator 6
+// Generic clock generator 7
+// Generic clock generator 8
+// Generic clock generator 9
+// Generic clock generator 10
+// Generic clock generator 11
+// Select the clock source
+// dfll_ref_clock
+#ifndef CONF_DFLL_GCLK
+#define CONF_DFLL_GCLK GCLK_PCHCTRL_GEN_GCLK3_Val
+#endif
+
+// Digital Frequency Locked Loop Control
+// DFLL Enable
+// Indicates whether DFLL is enabled or not
+// dfll_arch_enable
+#ifndef CONF_DFLL_ENABLE
+#define CONF_DFLL_ENABLE 0
+#endif
+
+// On Demand Control
+// Indicates whether On Demand Control is enabled or not
+// dfll_arch_ondemand
+#ifndef CONF_DFLL_ONDEMAND
+#define CONF_DFLL_ONDEMAND 0
+#endif
+
+// Run in Standby
+// Indicates whether Run in Standby is enabled or not
+// dfll_arch_runstdby
+#ifndef CONF_DFLL_RUNSTDBY
+#define CONF_DFLL_RUNSTDBY 0
+#endif
+
+// USB Clock Recovery Mode
+// Indicates whether USB Clock Recovery Mode is enabled or not
+// dfll_arch_usbcrm
+#ifndef CONF_DFLL_USBCRM
+#define CONF_DFLL_USBCRM 0
+#endif
+
+// Wait Lock
+// Indicates whether Wait Lock is enabled or not
+// dfll_arch_waitlock
+#ifndef CONF_DFLL_WAITLOCK
+#define CONF_DFLL_WAITLOCK 1
+#endif
+
+// Bypass Coarse Lock
+// Indicates whether Bypass Coarse Lock is enabled or not
+// dfll_arch_bplckc
+#ifndef CONF_DFLL_BPLCKC
+#define CONF_DFLL_BPLCKC 0
+#endif
+
+// Quick Lock Disable
+// Indicates whether Quick Lock Disable is enabled or not
+// dfll_arch_qldis
+#ifndef CONF_DFLL_QLDIS
+#define CONF_DFLL_QLDIS 0
+#endif
+
+// Chill Cycle Disable
+// Indicates whether Chill Cycle Disable is enabled or not
+// dfll_arch_ccdis
+#ifndef CONF_DFLL_CCDIS
+#define CONF_DFLL_CCDIS 0
+#endif
+
+// Lose Lock After Wake
+// Indicates whether Lose Lock After Wake is enabled or not
+// dfll_arch_llaw
+#ifndef CONF_DFLL_LLAW
+#define CONF_DFLL_LLAW 0
+#endif
+
+// Stable DFLL Frequency
+// Indicates whether Stable DFLL Frequency is enabled or not
+// dfll_arch_stable
+#ifndef CONF_DFLL_STABLE
+#define CONF_DFLL_STABLE 0
+#endif
+
+// Operating Mode Selection
+// <0=>Open Loop Mode
+// <1=>Closed Loop Mode
+// dfll_mode
+#ifndef CONF_DFLL_MODE
+#define CONF_DFLL_MODE 0x0
+#endif
+
+// Coarse Maximum Step <0x0-0x1F>
+// dfll_arch_cstep
+#ifndef CONF_DFLL_CSTEP
+#define CONF_DFLL_CSTEP 0x1
+#endif
+
+// Fine Maximum Step <0x0-0xFF>
+// dfll_arch_fstep
+#ifndef CONF_DFLL_FSTEP
+#define CONF_DFLL_FSTEP 0x1
+#endif
+
+// DFLL Multiply Factor <0x0-0xFFFF>
+// dfll_mul
+#ifndef CONF_DFLL_MUL
+#define CONF_DFLL_MUL 0x0
+#endif
+
+// DFLL Calibration Overwrite
+// Indicates whether Overwrite Calibration value of DFLL
+// dfll_arch_calibration
+#ifndef CONF_DFLL_OVERWRITE_CALIBRATION
+#define CONF_DFLL_OVERWRITE_CALIBRATION 0
+#endif
+
+// Coarse Value <0x0-0x3F>
+// dfll_arch_coarse
+#ifndef CONF_DFLL_COARSE
+#define CONF_DFLL_COARSE (0x1f / 4)
+#endif
+
+// Fine Value <0x0-0xFF>
+// dfll_arch_fine
+#ifndef CONF_DFLL_FINE
+#define CONF_DFLL_FINE (0x80)
+#endif
+
+//
+
+//
+
+//
+
+// FDPLL0 Configuration
+// Indicates whether configuration for FDPLL0 is enabled or not
+// enable_fdpll0
+#ifndef CONF_FDPLL0_CONFIG
+#define CONF_FDPLL0_CONFIG 0
+#endif
+
+// Reference Clock Source
+// 32kHz External Crystal Oscillator (XOSC32K)
+// External Crystal Oscillator 8-48MHz (XOSC0)
+// External Crystal Oscillator 8-48MHz (XOSC1)
+// Generic clock generator 0
+// Generic clock generator 1
+// Generic clock generator 2
+// Generic clock generator 3
+// Generic clock generator 4
+// Generic clock generator 5
+// Generic clock generator 6
+// Generic clock generator 7
+// Generic clock generator 8
+// Generic clock generator 9
+// Generic clock generator 10
+// Generic clock generator 11
+// Select the clock source.
+// fdpll0_ref_clock
+#ifndef CONF_FDPLL0_GCLK
+#define CONF_FDPLL0_GCLK GCLK_GENCTRL_SRC_XOSC32K
+#endif
+
+// Digital Phase Locked Loop Control
+// Enable
+// Indicates whether Digital Phase Locked Loop is enabled or not
+// fdpll0_arch_enable
+#ifndef CONF_FDPLL0_ENABLE
+#define CONF_FDPLL0_ENABLE 0
+#endif
+
+// On Demand Control
+// Indicates whether On Demand Control is enabled or not
+// fdpll0_arch_ondemand
+#ifndef CONF_FDPLL0_ONDEMAND
+#define CONF_FDPLL0_ONDEMAND 0
+#endif
+
+// Run in Standby
+// Indicates whether Run in Standby is enabled or not
+// fdpll0_arch_runstdby
+#ifndef CONF_FDPLL0_RUNSTDBY
+#define CONF_FDPLL0_RUNSTDBY 0
+#endif
+
+// Loop Divider Ratio Fractional Part <0x0-0x1F>
+// Value of LDRFRAC is calculated using Fclk_dpll=Fckr*(LDR+1+LDRFRAC/32) formula as given in datasheet. This value is directly written in to DPLLRATIO register
+// fdpll0_ldrfrac
+#ifndef CONF_FDPLL0_LDRFRAC
+#define CONF_FDPLL0_LDRFRAC 0xd
+#endif
+
+// Loop Divider Ratio Integer Part <0x0-0x1FFF>
+// Value of LDR is calculated using Fclk_dpll=Fckr*(LDR+1+LDRFRAC/32) formula as given in datasheet. This value is directly written in to DPLLRATIO register
+// fdpll0_ldr
+#ifndef CONF_FDPLL0_LDR
+#define CONF_FDPLL0_LDR 0x5b7
+#endif
+
+// Clock Divider <0x0-0x7FF>
+// This Clock divider is only for XOSC clock input to DPLL
+// fdpll0_clock_div
+#ifndef CONF_FDPLL0_DIV
+#define CONF_FDPLL0_DIV 0x0
+#endif
+
+// DCO Filter Enable
+// Indicates whether DCO Filter Enable is enabled or not
+// fdpll0_arch_dcoen
+#ifndef CONF_FDPLL0_DCOEN
+#define CONF_FDPLL0_DCOEN 0
+#endif
+
+// Sigma-Delta DCO Filter Selection <0x0-0x7>
+// fdpll0_clock_dcofilter
+#ifndef CONF_FDPLL0_DCOFILTER
+#define CONF_FDPLL0_DCOFILTER 0x0
+#endif
+
+// Lock Bypass
+// Indicates whether Lock Bypass is enabled or not
+// fdpll0_arch_lbypass
+#ifndef CONF_FDPLL0_LBYPASS
+#define CONF_FDPLL0_LBYPASS 0
+#endif
+
+// Lock Time
+// <0x0=>No time-out, automatic lock
+// <0x4=>The Time-out if no lock within 800 us
+// <0x5=>The Time-out if no lock within 900 us
+// <0x6=>The Time-out if no lock within 1 ms
+// <0x7=>The Time-out if no lock within 11 ms
+// fdpll0_arch_ltime
+#ifndef CONF_FDPLL0_LTIME
+#define CONF_FDPLL0_LTIME 0x0
+#endif
+
+// Reference Clock Selection
+// <0x0=>GCLK clock reference
+// <0x1=>XOSC32K clock reference
+// <0x2=>XOSC0 clock reference
+// <0x3=>XOSC1 clock reference
+// fdpll0_arch_refclk
+#ifndef CONF_FDPLL0_REFCLK
+#define CONF_FDPLL0_REFCLK 0x1
+#endif
+
+// Wake Up Fast
+// Indicates whether Wake Up Fast is enabled or not
+// fdpll0_arch_wuf
+#ifndef CONF_FDPLL0_WUF
+#define CONF_FDPLL0_WUF 0
+#endif
+
+// Proportional Integral Filter Selection <0x0-0xF>
+// fdpll0_arch_filter
+#ifndef CONF_FDPLL0_FILTER
+#define CONF_FDPLL0_FILTER 0x0
+#endif
+
+//
+//
+// FDPLL1 Configuration
+// Indicates whether configuration for FDPLL1 is enabled or not
+// enable_fdpll1
+#ifndef CONF_FDPLL1_CONFIG
+#define CONF_FDPLL1_CONFIG 0
+#endif
+
+// Reference Clock Source
+// 32kHz External Crystal Oscillator (XOSC32K)
+// External Crystal Oscillator 8-48MHz (XOSC0)
+// External Crystal Oscillator 8-48MHz (XOSC1)
+// Generic clock generator 0
+// Generic clock generator 1
+// Generic clock generator 2
+// Generic clock generator 3
+// Generic clock generator 4
+// Generic clock generator 5
+// Generic clock generator 6
+// Generic clock generator 7
+// Generic clock generator 8
+// Generic clock generator 9
+// Generic clock generator 10
+// Generic clock generator 11
+// Select the clock source.
+// fdpll1_ref_clock
+#ifndef CONF_FDPLL1_GCLK
+#define CONF_FDPLL1_GCLK GCLK_GENCTRL_SRC_XOSC32K
+#endif
+
+// Digital Phase Locked Loop Control
+// Enable
+// Indicates whether Digital Phase Locked Loop is enabled or not
+// fdpll1_arch_enable
+#ifndef CONF_FDPLL1_ENABLE
+#define CONF_FDPLL1_ENABLE 0
+#endif
+
+// On Demand Control
+// Indicates whether On Demand Control is enabled or not
+// fdpll1_arch_ondemand
+#ifndef CONF_FDPLL1_ONDEMAND
+#define CONF_FDPLL1_ONDEMAND 0
+#endif
+
+// Run in Standby
+// Indicates whether Run in Standby is enabled or not
+// fdpll1_arch_runstdby
+#ifndef CONF_FDPLL1_RUNSTDBY
+#define CONF_FDPLL1_RUNSTDBY 0
+#endif
+
+// Loop Divider Ratio Fractional Part <0x0-0x1F>
+// Value of LDRFRAC is calculated using Fclk_dpll=Fckr*(LDR+1+LDRFRAC/32) formula as given in datasheet. This value is directly written in to DPLLRATIO register
+// fdpll1_ldrfrac
+#ifndef CONF_FDPLL1_LDRFRAC
+#define CONF_FDPLL1_LDRFRAC 0xd
+#endif
+
+// Loop Divider Ratio Integer Part <0x0-0x1FFF>
+// Value of LDR is calculated using Fclk_dpll=Fckr*(LDR+1+LDRFRAC/32) formula as given in datasheet. This value is directly written in to DPLLRATIO register
+// fdpll1_ldr
+#ifndef CONF_FDPLL1_LDR
+#define CONF_FDPLL1_LDR 0x5b7
+#endif
+
+// Clock Divider <0x0-0x7FF>
+// This Clock divider is only for XOSC clock input to DPLL
+// fdpll1_clock_div
+#ifndef CONF_FDPLL1_DIV
+#define CONF_FDPLL1_DIV 0x0
+#endif
+
+// DCO Filter Enable
+// Indicates whether DCO Filter Enable is enabled or not
+// fdpll1_arch_dcoen
+#ifndef CONF_FDPLL1_DCOEN
+#define CONF_FDPLL1_DCOEN 0
+#endif
+
+// Sigma-Delta DCO Filter Selection <0x0-0x7>
+// fdpll1_clock_dcofilter
+#ifndef CONF_FDPLL1_DCOFILTER
+#define CONF_FDPLL1_DCOFILTER 0x0
+#endif
+
+// Lock Bypass
+// Indicates whether Lock Bypass is enabled or not
+// fdpll1_arch_lbypass
+#ifndef CONF_FDPLL1_LBYPASS
+#define CONF_FDPLL1_LBYPASS 0
+#endif
+
+// Lock Time
+// <0x0=>No time-out, automatic lock
+// <0x4=>The Time-out if no lock within 800 us
+// <0x5=>The Time-out if no lock within 900 us
+// <0x6=>The Time-out if no lock within 1 ms
+// <0x7=>The Time-out if no lock within 11 ms
+// fdpll1_arch_ltime
+#ifndef CONF_FDPLL1_LTIME
+#define CONF_FDPLL1_LTIME 0x0
+#endif
+
+// Reference Clock Selection
+// <0x0=>GCLK clock reference
+// <0x1=>XOSC32K clock reference
+// <0x2=>XOSC0 clock reference
+// <0x3=>XOSC1 clock reference
+// fdpll1_arch_refclk
+#ifndef CONF_FDPLL1_REFCLK
+#define CONF_FDPLL1_REFCLK 0x1
+#endif
+
+// Wake Up Fast
+// Indicates whether Wake Up Fast is enabled or not
+// fdpll1_arch_wuf
+#ifndef CONF_FDPLL1_WUF
+#define CONF_FDPLL1_WUF 0
+#endif
+
+// Proportional Integral Filter Selection <0x0-0xF>
+// fdpll1_arch_filter
+#ifndef CONF_FDPLL1_FILTER
+#define CONF_FDPLL1_FILTER 0x0
+#endif
+
+//
+//
+
+// <<< end of configuration section >>>
+
+#endif // HPL_OSCCTRL_CONFIG_H
diff --git a/Examples/AS5048A_test/AS5048A_test/Config/hpl_port_config.h b/Examples/AS5048A_test/AS5048A_test/Config/hpl_port_config.h
new file mode 100644
index 0000000..b5315f0
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/Config/hpl_port_config.h
@@ -0,0 +1,522 @@
+/* Auto-generated config file hpl_port_config.h */
+#ifndef HPL_PORT_CONFIG_H
+#define HPL_PORT_CONFIG_H
+
+// <<< Use Configuration Wizard in Context Menu >>>
+
+// PORT Input Event 0 configuration
+// enable_port_input_event_0
+#ifndef CONF_PORT_EVCTRL_PORT_0
+#define CONF_PORT_EVCTRL_PORT_0 0
+#endif
+
+// PORT Input Event 0 configuration on PORT A
+
+// PORTA Input Event 0 Enable
+// The event action will be triggered on any incoming event if PORT A Input Event 0 configuration is enabled
+// porta_input_event_enable_0
+#ifndef CONF_PORTA_EVCTRL_PORTEI_0
+#define CONF_PORTA_EVCTRL_PORTEI_0 0x0
+#endif
+
+// PORTA Event 0 Pin Identifier <0x00-0x1F>
+// These bits define the I/O pin from port A on which the event action will be performed
+// porta_event_pin_identifier_0
+#ifndef CONF_PORTA_EVCTRL_PID_0
+#define CONF_PORTA_EVCTRL_PID_0 0x0
+#endif
+
+// PORTA Event 0 Action
+// <0=> Output register of pin will be set to level of event
+// <1=> Set output register of pin on event
+// <2=> Clear output register of pin on event
+// <3=> Toggle output register of pin on event
+// These bits define the event action the PORT A will perform on event input 0
+// porta_event_action_0
+#ifndef CONF_PORTA_EVCTRL_EVACT_0
+#define CONF_PORTA_EVCTRL_EVACT_0 0
+#endif
+
+//
+// PORT Input Event 0 configuration on PORT B
+
+// PORTB Input Event 0 Enable
+// The event action will be triggered on any incoming event if PORT B Input Event 0 configuration is enabled
+// portb_input_event_enable_0
+#ifndef CONF_PORTB_EVCTRL_PORTEI_0
+#define CONF_PORTB_EVCTRL_PORTEI_0 0x0
+#endif
+
+// PORTB Event 0 Pin Identifier <0x00-0x1F>
+// These bits define the I/O pin from port B on which the event action will be performed
+// portb_event_pin_identifier_0
+#ifndef CONF_PORTB_EVCTRL_PID_0
+#define CONF_PORTB_EVCTRL_PID_0 0x0
+#endif
+
+// PORTB Event 0 Action
+// <0=> Output register of pin will be set to level of event
+// <1=> Set output register of pin on event
+// <2=> Clear output register of pin on event
+// <3=> Toggle output register of pin on event
+// These bits define the event action the PORT B will perform on event input 0
+// portb_event_action_0
+#ifndef CONF_PORTB_EVCTRL_EVACT_0
+#define CONF_PORTB_EVCTRL_EVACT_0 0
+#endif
+
+//
+// PORT Input Event 0 configuration on PORT C
+
+// PORTC Input Event 0 Enable
+// The event action will be triggered on any incoming event if PORT C Input Event 0 configuration is enabled
+// portc_input_event_enable_0
+#ifndef CONF_PORTC_EVCTRL_PORTEI_0
+#define CONF_PORTC_EVCTRL_PORTEI_0 0x0
+#endif
+
+// PORTC Event 0 Pin Identifier <0x00-0x1F>
+// These bits define the I/O pin from port C on which the event action will be performed
+// portc_event_pin_identifier_0
+#ifndef CONF_PORTC_EVCTRL_PID_0
+#define CONF_PORTC_EVCTRL_PID_0 0x0
+#endif
+
+// PORTC Event 0 Action
+// <0=> Output register of pin will be set to level of event
+// <1=> Set output register of pin on event
+// <2=> Clear output register of pin on event
+// <3=> Toggle output register of pin on event
+// These bits define the event action the PORT C will perform on event input 0
+// portc_event_action_0
+#ifndef CONF_PORTC_EVCTRL_EVACT_0
+#define CONF_PORTC_EVCTRL_EVACT_0 0
+#endif
+
+//
+// PORT Input Event 0 configuration on PORT D
+
+// PORTD Input Event 0 Enable
+// The event action will be triggered on any incoming event if PORT D Input Event 0 configuration is enabled
+// portd_input_event_enable_0
+#ifndef CONF_PORTD_EVCTRL_PORTEI_0
+#define CONF_PORTD_EVCTRL_PORTEI_0 0x0
+#endif
+
+// PORTD Event 0 Pin Identifier <0x00-0x1F>
+// These bits define the I/O pin from port D on which the event action will be performed
+// portd_event_pin_identifier_0
+#ifndef CONF_PORTD_EVCTRL_PID_0
+#define CONF_PORTD_EVCTRL_PID_0 0x0
+#endif
+
+// PORTD Event 0 Action
+// <0=> Output register of pin will be set to level of event
+// <1=> Set output register of pin on event
+// <2=> Clear output register of pin on event
+// <3=> Toggle output register of pin on event
+// These bits define the event action the PORT D will perform on event input 0
+// portd_event_action_0
+#ifndef CONF_PORTD_EVCTRL_EVACT_0
+#define CONF_PORTD_EVCTRL_EVACT_0 0
+#endif
+
+//
+
+//
+
+// PORT Input Event 1 configuration
+// enable_port_input_event_1
+#ifndef CONF_PORT_EVCTRL_PORT_1
+#define CONF_PORT_EVCTRL_PORT_1 0
+#endif
+
+// PORT Input Event 1 configuration on PORT A
+
+// PORTA Input Event 1 Enable
+// The event action will be triggered on any incoming event if PORT A Input Event 1 configuration is enabled
+// porta_input_event_enable_1
+#ifndef CONF_PORTA_EVCTRL_PORTEI_1
+#define CONF_PORTA_EVCTRL_PORTEI_1 0x0
+#endif
+
+// PORTA Event 1 Pin Identifier <0x00-0x1F>
+// These bits define the I/O pin from port A on which the event action will be performed
+// porta_event_pin_identifier_1
+#ifndef CONF_PORTA_EVCTRL_PID_1
+#define CONF_PORTA_EVCTRL_PID_1 0x0
+#endif
+
+// PORTA Event 1 Action
+// <0=> Output register of pin will be set to level of event
+// <1=> Set output register of pin on event
+// <2=> Clear output register of pin on event
+// <3=> Toggle output register of pin on event
+// These bits define the event action the PORT A will perform on event input 1
+// porta_event_action_1
+#ifndef CONF_PORTA_EVCTRL_EVACT_1
+#define CONF_PORTA_EVCTRL_EVACT_1 0
+#endif
+
+//
+// PORT Input Event 1 configuration on PORT B
+
+// PORTB Input Event 1 Enable
+// The event action will be triggered on any incoming event if PORT B Input Event 1 configuration is enabled
+// portb_input_event_enable_1
+#ifndef CONF_PORTB_EVCTRL_PORTEI_1
+#define CONF_PORTB_EVCTRL_PORTEI_1 0x0
+#endif
+
+// PORTB Event 1 Pin Identifier <0x00-0x1F>
+// These bits define the I/O pin from port B on which the event action will be performed
+// portb_event_pin_identifier_1
+#ifndef CONF_PORTB_EVCTRL_PID_1
+#define CONF_PORTB_EVCTRL_PID_1 0x0
+#endif
+
+// PORTB Event 1 Action
+// <0=> Output register of pin will be set to level of event
+// <1=> Set output register of pin on event
+// <2=> Clear output register of pin on event
+// <3=> Toggle output register of pin on event
+// These bits define the event action the PORT B will perform on event input 1
+// portb_event_action_1
+#ifndef CONF_PORTB_EVCTRL_EVACT_1
+#define CONF_PORTB_EVCTRL_EVACT_1 0
+#endif
+
+//
+// PORT Input Event 1 configuration on PORT C
+
+// PORTC Input Event 1 Enable
+// The event action will be triggered on any incoming event if PORT C Input Event 1 configuration is enabled
+// portc_input_event_enable_1
+#ifndef CONF_PORTC_EVCTRL_PORTEI_1
+#define CONF_PORTC_EVCTRL_PORTEI_1 0x0
+#endif
+
+// PORTC Event 1 Pin Identifier <0x00-0x1F>
+// These bits define the I/O pin from port C on which the event action will be performed
+// portc_event_pin_identifier_1
+#ifndef CONF_PORTC_EVCTRL_PID_1
+#define CONF_PORTC_EVCTRL_PID_1 0x0
+#endif
+
+// PORTC Event 1 Action
+// <0=> Output register of pin will be set to level of event
+// <1=> Set output register of pin on event
+// <2=> Clear output register of pin on event
+// <3=> Toggle output register of pin on event
+// These bits define the event action the PORT C will perform on event input 1
+// portc_event_action_1
+#ifndef CONF_PORTC_EVCTRL_EVACT_1
+#define CONF_PORTC_EVCTRL_EVACT_1 0
+#endif
+
+//
+// PORT Input Event 1 configuration on PORT D
+
+// PORTD Input Event 1 Enable
+// The event action will be triggered on any incoming event if PORT D Input Event 1 configuration is enabled
+// portd_input_event_enable_1
+#ifndef CONF_PORTD_EVCTRL_PORTEI_1
+#define CONF_PORTD_EVCTRL_PORTEI_1 0x0
+#endif
+
+// PORTD Event 1 Pin Identifier <0x00-0x1F>
+// These bits define the I/O pin from port D on which the event action will be performed
+// portd_event_pin_identifier_1
+#ifndef CONF_PORTD_EVCTRL_PID_1
+#define CONF_PORTD_EVCTRL_PID_1 0x0
+#endif
+
+// PORTD Event 1 Action
+// <0=> Output register of pin will be set to level of event
+// <1=> Set output register of pin on event
+// <2=> Clear output register of pin on event
+// <3=> Toggle output register of pin on event
+// These bits define the event action the PORT D will perform on event input 1
+// portd_event_action_1
+#ifndef CONF_PORTD_EVCTRL_EVACT_1
+#define CONF_PORTD_EVCTRL_EVACT_1 0
+#endif
+
+//
+
+//
+
+// PORT Input Event 2 configuration
+// enable_port_input_event_2
+#ifndef CONF_PORT_EVCTRL_PORT_2
+#define CONF_PORT_EVCTRL_PORT_2 0
+#endif
+
+// PORT Input Event 2 configuration on PORT A
+
+// PORTA Input Event 2 Enable
+// The event action will be triggered on any incoming event if PORT A Input Event 2 configuration is enabled
+// porta_input_event_enable_2
+#ifndef CONF_PORTA_EVCTRL_PORTEI_2
+#define CONF_PORTA_EVCTRL_PORTEI_2 0x0
+#endif
+
+// PORTA Event 2 Pin Identifier <0x00-0x1F>
+// These bits define the I/O pin from port A on which the event action will be performed
+// porta_event_pin_identifier_2
+#ifndef CONF_PORTA_EVCTRL_PID_2
+#define CONF_PORTA_EVCTRL_PID_2 0x0
+#endif
+
+// PORTA Event 2 Action
+// <0=> Output register of pin will be set to level of event
+// <1=> Set output register of pin on event
+// <2=> Clear output register of pin on event
+// <3=> Toggle output register of pin on event
+// These bits define the event action the PORT A will perform on event input 2
+// porta_event_action_2
+#ifndef CONF_PORTA_EVCTRL_EVACT_2
+#define CONF_PORTA_EVCTRL_EVACT_2 0
+#endif
+
+//
+// PORT Input Event 2 configuration on PORT B
+
+// PORTB Input Event 2 Enable
+// The event action will be triggered on any incoming event if PORT B Input Event 2 configuration is enabled
+// portb_input_event_enable_2
+#ifndef CONF_PORTB_EVCTRL_PORTEI_2
+#define CONF_PORTB_EVCTRL_PORTEI_2 0x0
+#endif
+
+// PORTB Event 2 Pin Identifier <0x00-0x1F>
+// These bits define the I/O pin from port B on which the event action will be performed
+// portb_event_pin_identifier_2
+#ifndef CONF_PORTB_EVCTRL_PID_2
+#define CONF_PORTB_EVCTRL_PID_2 0x0
+#endif
+
+// PORTB Event 2 Action
+// <0=> Output register of pin will be set to level of event
+// <1=> Set output register of pin on event
+// <2=> Clear output register of pin on event
+// <3=> Toggle output register of pin on event
+// These bits define the event action the PORT B will perform on event input 2
+// portb_event_action_2
+#ifndef CONF_PORTB_EVCTRL_EVACT_2
+#define CONF_PORTB_EVCTRL_EVACT_2 0
+#endif
+
+//
+// PORT Input Event 2 configuration on PORT C
+
+// PORTC Input Event 2 Enable
+// The event action will be triggered on any incoming event if PORT C Input Event 2 configuration is enabled
+// portc_input_event_enable_2
+#ifndef CONF_PORTC_EVCTRL_PORTEI_2
+#define CONF_PORTC_EVCTRL_PORTEI_2 0x0
+#endif
+
+// PORTC Event 2 Pin Identifier <0x00-0x1F>
+// These bits define the I/O pin from port C on which the event action will be performed
+// portc_event_pin_identifier_2
+#ifndef CONF_PORTC_EVCTRL_PID_2
+#define CONF_PORTC_EVCTRL_PID_2 0x0
+#endif
+
+// PORTC Event 2 Action
+// <0=> Output register of pin will be set to level of event
+// <1=> Set output register of pin on event
+// <2=> Clear output register of pin on event
+// <3=> Toggle output register of pin on event
+// These bits define the event action the PORT C will perform on event input 2
+// portc_event_action_2
+#ifndef CONF_PORTC_EVCTRL_EVACT_2
+#define CONF_PORTC_EVCTRL_EVACT_2 0
+#endif
+
+//
+// PORT Input Event 2 configuration on PORT D
+
+// PORTD Input Event 2 Enable
+// The event action will be triggered on any incoming event if PORT D Input Event 2 configuration is enabled
+// portd_input_event_enable_2
+#ifndef CONF_PORTD_EVCTRL_PORTEI_2
+#define CONF_PORTD_EVCTRL_PORTEI_2 0x0
+#endif
+
+// PORTD Event 2 Pin Identifier <0x00-0x1F>
+// These bits define the I/O pin from port D on which the event action will be performed
+// portd_event_pin_identifier_2
+#ifndef CONF_PORTD_EVCTRL_PID_2
+#define CONF_PORTD_EVCTRL_PID_2 0x0
+#endif
+
+// PORTD Event 2 Action
+// <0=> Output register of pin will be set to level of event
+// <1=> Set output register of pin on event
+// <2=> Clear output register of pin on event
+// <3=> Toggle output register of pin on event
+// These bits define the event action the PORT D will perform on event input 2
+// portd_event_action_2
+#ifndef CONF_PORTD_EVCTRL_EVACT_2
+#define CONF_PORTD_EVCTRL_EVACT_2 0
+#endif
+
+//
+
+//
+
+// PORT Input Event 3 configuration
+// enable_port_input_event_3
+#ifndef CONF_PORT_EVCTRL_PORT_3
+#define CONF_PORT_EVCTRL_PORT_3 0
+#endif
+
+// PORT Input Event 3 configuration on PORT A
+
+// PORTA Input Event 3 Enable
+// The event action will be triggered on any incoming event if PORT A Input Event 3 configuration is enabled
+// porta_input_event_enable_3
+#ifndef CONF_PORTA_EVCTRL_PORTEI_3
+#define CONF_PORTA_EVCTRL_PORTEI_3 0x0
+#endif
+
+// PORTA Event 3 Pin Identifier <0x00-0x1F>
+// These bits define the I/O pin from port A on which the event action will be performed
+// porta_event_pin_identifier_3
+#ifndef CONF_PORTA_EVCTRL_PID_3
+#define CONF_PORTA_EVCTRL_PID_3 0x0
+#endif
+
+// PORTA Event 3 Action
+// <0=> Output register of pin will be set to level of event
+// <1=> Set output register of pin on event
+// <2=> Clear output register of pin on event
+// <3=> Toggle output register of pin on event
+// These bits define the event action the PORT A will perform on event input 3
+// porta_event_action_3
+#ifndef CONF_PORTA_EVCTRL_EVACT_3
+#define CONF_PORTA_EVCTRL_EVACT_3 0
+#endif
+
+//
+// PORT Input Event 3 configuration on PORT B
+
+// PORTB Input Event 3 Enable
+// The event action will be triggered on any incoming event if PORT B Input Event 3 configuration is enabled
+// portb_input_event_enable_3
+#ifndef CONF_PORTB_EVCTRL_PORTEI_3
+#define CONF_PORTB_EVCTRL_PORTEI_3 0x0
+#endif
+
+// PORTB Event 3 Pin Identifier <0x00-0x1F>
+// These bits define the I/O pin from port B on which the event action will be performed
+// portb_event_pin_identifier_3
+#ifndef CONF_PORTB_EVCTRL_PID_3
+#define CONF_PORTB_EVCTRL_PID_3 0x0
+#endif
+
+// PORTB Event 3 Action
+// <0=> Output register of pin will be set to level of event
+// <1=> Set output register of pin on event
+// <2=> Clear output register of pin on event
+// <3=> Toggle output register of pin on event
+// These bits define the event action the PORT B will perform on event input 3
+// portb_event_action_3
+#ifndef CONF_PORTB_EVCTRL_EVACT_3
+#define CONF_PORTB_EVCTRL_EVACT_3 0
+#endif
+
+//
+// PORT Input Event 3 configuration on PORT C
+
+// PORTC Input Event 3 Enable
+// The event action will be triggered on any incoming event if PORT C Input Event 3 configuration is enabled
+// portc_input_event_enable_3
+#ifndef CONF_PORTC_EVCTRL_PORTEI_3
+#define CONF_PORTC_EVCTRL_PORTEI_3 0x0
+#endif
+
+// PORTC Event 3 Pin Identifier <0x00-0x1F>
+// These bits define the I/O pin from port C on which the event action will be performed
+// portc_event_pin_identifier_3
+#ifndef CONF_PORTC_EVCTRL_PID_3
+#define CONF_PORTC_EVCTRL_PID_3 0x0
+#endif
+
+// PORTC Event 3 Action
+// <0=> Output register of pin will be set to level of event
+// <1=> Set output register of pin on event
+// <2=> Clear output register of pin on event
+// <3=> Toggle output register of pin on event
+// These bits define the event action the PORT C will perform on event input 3
+// portc_event_action_3
+#ifndef CONF_PORTC_EVCTRL_EVACT_3
+#define CONF_PORTC_EVCTRL_EVACT_3 0
+#endif
+
+//
+// PORT Input Event 3 configuration on PORT D
+
+// PORTD Input Event 3 Enable
+// The event action will be triggered on any incoming event if PORT D Input Event 3 configuration is enabled
+// portd_input_event_enable_3
+#ifndef CONF_PORTD_EVCTRL_PORTEI_3
+#define CONF_PORTD_EVCTRL_PORTEI_3 0x0
+#endif
+
+// PORTD Event 3 Pin Identifier <0x00-0x1F>
+// These bits define the I/O pin from port D on which the event action will be performed
+// portd_event_pin_identifier_3
+#ifndef CONF_PORTD_EVCTRL_PID_3
+#define CONF_PORTD_EVCTRL_PID_3 0x0
+#endif
+
+// PORTD Event 3 Action
+// <0=> Output register of pin will be set to level of event
+// <1=> Set output register of pin on event
+// <2=> Clear output register of pin on event
+// <3=> Toggle output register of pin on event
+// These bits define the event action the PORT D will perform on event input 3
+// portd_event_action_3
+#ifndef CONF_PORTD_EVCTRL_EVACT_3
+#define CONF_PORTD_EVCTRL_EVACT_3 0
+#endif
+
+//
+
+//
+
+#define CONF_PORTA_EVCTRL \
+ (0 | PORT_EVCTRL_EVACT0(CONF_PORTA_EVCTRL_EVACT_0) | CONF_PORTA_EVCTRL_PORTEI_0 << PORT_EVCTRL_PORTEI0_Pos \
+ | PORT_EVCTRL_PID0(CONF_PORTA_EVCTRL_PID_0) | PORT_EVCTRL_EVACT1(CONF_PORTA_EVCTRL_EVACT_1) \
+ | CONF_PORTA_EVCTRL_PORTEI_1 << PORT_EVCTRL_PORTEI1_Pos | PORT_EVCTRL_PID1(CONF_PORTA_EVCTRL_PID_1) \
+ | PORT_EVCTRL_EVACT2(CONF_PORTA_EVCTRL_EVACT_2) | CONF_PORTA_EVCTRL_PORTEI_2 << PORT_EVCTRL_PORTEI2_Pos \
+ | PORT_EVCTRL_PID2(CONF_PORTA_EVCTRL_PID_2) | PORT_EVCTRL_EVACT3(CONF_PORTA_EVCTRL_EVACT_3) \
+ | CONF_PORTA_EVCTRL_PORTEI_3 << PORT_EVCTRL_PORTEI3_Pos | PORT_EVCTRL_PID3(CONF_PORTA_EVCTRL_PID_3))
+#define CONF_PORTB_EVCTRL \
+ (0 | PORT_EVCTRL_EVACT0(CONF_PORTB_EVCTRL_EVACT_0) | CONF_PORTB_EVCTRL_PORTEI_0 << PORT_EVCTRL_PORTEI0_Pos \
+ | PORT_EVCTRL_PID0(CONF_PORTB_EVCTRL_PID_0) | PORT_EVCTRL_EVACT1(CONF_PORTB_EVCTRL_EVACT_1) \
+ | CONF_PORTB_EVCTRL_PORTEI_1 << PORT_EVCTRL_PORTEI1_Pos | PORT_EVCTRL_PID1(CONF_PORTB_EVCTRL_PID_1) \
+ | PORT_EVCTRL_EVACT2(CONF_PORTB_EVCTRL_EVACT_2) | CONF_PORTB_EVCTRL_PORTEI_2 << PORT_EVCTRL_PORTEI2_Pos \
+ | PORT_EVCTRL_PID2(CONF_PORTB_EVCTRL_PID_2) | PORT_EVCTRL_EVACT3(CONF_PORTB_EVCTRL_EVACT_3) \
+ | CONF_PORTB_EVCTRL_PORTEI_3 << PORT_EVCTRL_PORTEI3_Pos | PORT_EVCTRL_PID3(CONF_PORTB_EVCTRL_PID_3))
+#define CONF_PORTC_EVCTRL \
+ (0 | PORT_EVCTRL_EVACT0(CONF_PORTC_EVCTRL_EVACT_0) | CONF_PORTC_EVCTRL_PORTEI_0 << PORT_EVCTRL_PORTEI0_Pos \
+ | PORT_EVCTRL_PID0(CONF_PORTC_EVCTRL_PID_0) | PORT_EVCTRL_EVACT1(CONF_PORTC_EVCTRL_EVACT_1) \
+ | CONF_PORTC_EVCTRL_PORTEI_1 << PORT_EVCTRL_PORTEI1_Pos | PORT_EVCTRL_PID1(CONF_PORTC_EVCTRL_PID_1) \
+ | PORT_EVCTRL_EVACT2(CONF_PORTC_EVCTRL_EVACT_2) | CONF_PORTC_EVCTRL_PORTEI_2 << PORT_EVCTRL_PORTEI2_Pos \
+ | PORT_EVCTRL_PID2(CONF_PORTC_EVCTRL_PID_2) | PORT_EVCTRL_EVACT3(CONF_PORTC_EVCTRL_EVACT_3) \
+ | CONF_PORTC_EVCTRL_PORTEI_3 << PORT_EVCTRL_PORTEI3_Pos | PORT_EVCTRL_PID3(CONF_PORTC_EVCTRL_PID_3))
+#define CONF_PORTD_EVCTRL \
+ (0 | PORT_EVCTRL_EVACT0(CONF_PORTD_EVCTRL_EVACT_0) | CONF_PORTD_EVCTRL_PORTEI_0 << PORT_EVCTRL_PORTEI0_Pos \
+ | PORT_EVCTRL_PID0(CONF_PORTD_EVCTRL_PID_0) | PORT_EVCTRL_EVACT1(CONF_PORTD_EVCTRL_EVACT_1) \
+ | CONF_PORTD_EVCTRL_PORTEI_1 << PORT_EVCTRL_PORTEI1_Pos | PORT_EVCTRL_PID1(CONF_PORTD_EVCTRL_PID_1) \
+ | PORT_EVCTRL_EVACT2(CONF_PORTD_EVCTRL_EVACT_2) | CONF_PORTD_EVCTRL_PORTEI_2 << PORT_EVCTRL_PORTEI2_Pos \
+ | PORT_EVCTRL_PID2(CONF_PORTD_EVCTRL_PID_2) | PORT_EVCTRL_EVACT3(CONF_PORTD_EVCTRL_EVACT_3) \
+ | CONF_PORTD_EVCTRL_PORTEI_3 << PORT_EVCTRL_PORTEI3_Pos | PORT_EVCTRL_PID3(CONF_PORTD_EVCTRL_PID_3))
+
+// <<< end of configuration section >>>
+
+#endif // HPL_PORT_CONFIG_H
diff --git a/Examples/AS5048A_test/AS5048A_test/Config/hpl_sercom_config.h b/Examples/AS5048A_test/AS5048A_test/Config/hpl_sercom_config.h
new file mode 100644
index 0000000..b545338
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/Config/hpl_sercom_config.h
@@ -0,0 +1,437 @@
+/* Auto-generated config file hpl_sercom_config.h */
+#ifndef HPL_SERCOM_CONFIG_H
+#define HPL_SERCOM_CONFIG_H
+
+// <<< Use Configuration Wizard in Context Menu >>>
+
+#include
+
+#ifndef CONF_SERCOM_2_USART_ENABLE
+#define CONF_SERCOM_2_USART_ENABLE 1
+#endif
+
+// Basic Configuration
+
+// Receive buffer enable
+// Enable input buffer in SERCOM module
+// usart_rx_enable
+#ifndef CONF_SERCOM_2_USART_RXEN
+#define CONF_SERCOM_2_USART_RXEN 1
+#endif
+
+// Transmitt buffer enable
+// Enable output buffer in SERCOM module
+// usart_tx_enable
+#ifndef CONF_SERCOM_2_USART_TXEN
+#define CONF_SERCOM_2_USART_TXEN 1
+#endif
+
+// Frame parity
+// <0x0=>No parity
+// <0x1=>Even parity
+// <0x2=>Odd parity
+// Parity bit mode for USART frame
+// usart_parity
+#ifndef CONF_SERCOM_2_USART_PARITY
+#define CONF_SERCOM_2_USART_PARITY 0x0
+#endif
+
+// Character Size
+// <0x0=>8 bits
+// <0x1=>9 bits
+// <0x5=>5 bits
+// <0x6=>6 bits
+// <0x7=>7 bits
+// Data character size in USART frame
+// usart_character_size
+#ifndef CONF_SERCOM_2_USART_CHSIZE
+#define CONF_SERCOM_2_USART_CHSIZE 0x0
+#endif
+
+// Stop Bit
+// <0=>One stop bit
+// <1=>Two stop bits
+// Number of stop bits in USART frame
+// usart_stop_bit
+#ifndef CONF_SERCOM_2_USART_SBMODE
+#define CONF_SERCOM_2_USART_SBMODE 0
+#endif
+
+// Baud rate <1-6250000>
+// USART baud rate setting
+// usart_baud_rate
+#ifndef CONF_SERCOM_2_USART_BAUD
+#define CONF_SERCOM_2_USART_BAUD 9600
+#endif
+
+//
+
+// Advanced configuration
+// usart_advanced
+#ifndef CONF_SERCOM_2_USART_ADVANCED_CONFIG
+#define CONF_SERCOM_2_USART_ADVANCED_CONFIG 0
+#endif
+
+// Run in stand-by
+// Keep the module running in standby sleep mode
+// usart_arch_runstdby
+#ifndef CONF_SERCOM_2_USART_RUNSTDBY
+#define CONF_SERCOM_2_USART_RUNSTDBY 0
+#endif
+
+// Immediate Buffer Overflow Notification
+// Controls when the BUFOVF status bit is asserted
+// usart_arch_ibon
+#ifndef CONF_SERCOM_2_USART_IBON
+#define CONF_SERCOM_2_USART_IBON 0
+#endif
+
+// Start of Frame Detection Enable
+// Will wake the device from any sleep mode if usart_init and usart_enable was run priort to going to sleep. (receive buffer must be enabled)
+// usart_arch_sfde
+#ifndef CONF_SERCOM_2_USART_SFDE
+#define CONF_SERCOM_2_USART_SFDE 0
+#endif
+
+// Collision Detection Enable
+// Collision detection enable
+// usart_arch_cloden
+#ifndef CONF_SERCOM_2_USART_CLODEN
+#define CONF_SERCOM_2_USART_CLODEN 0
+#endif
+
+// Operating Mode
+// <0x0=>USART with external clock
+// <0x1=>USART with internal clock
+// Drive the shift register by an internal clock generated by the baud rate generator or an external clock supplied on the XCK pin.
+// usart_arch_clock_mode
+#ifndef CONF_SERCOM_2_USART_MODE
+#define CONF_SERCOM_2_USART_MODE 0x1
+#endif
+
+// Sample Rate
+// <0x0=>16x arithmetic
+// <0x1=>16x fractional
+// <0x2=>8x arithmetic
+// <0x3=>8x fractional
+// <0x4=>3x arithmetic
+// How many over-sampling bits used when sampling data state
+// usart_arch_sampr
+#ifndef CONF_SERCOM_2_USART_SAMPR
+#define CONF_SERCOM_2_USART_SAMPR 0x0
+#endif
+
+// Sample Adjustment
+// <0x0=>7-8-9 (3-4-5 8-bit over-sampling)
+// <0x1=>9-10-11 (4-5-6 8-bit over-sampling)
+// <0x2=>11-12-13 (5-6-7 8-bit over-sampling)
+// <0x3=>13-14-15 (6-7-8 8-bit over-sampling)
+// Adjust which samples to use for data sampling in asynchronous mode
+// usart_arch_sampa
+#ifndef CONF_SERCOM_2_USART_SAMPA
+#define CONF_SERCOM_2_USART_SAMPA 0x0
+#endif
+
+// Fractional Part <0-7>
+// Fractional part of the baud rate if baud rate generator is in fractional mode
+// usart_arch_fractional
+#ifndef CONF_SERCOM_2_USART_FRACTIONAL
+#define CONF_SERCOM_2_USART_FRACTIONAL 0x0
+#endif
+
+// Data Order
+// <0=>MSB is transmitted first
+// <1=>LSB is transmitted first
+// Data order of the data bits in the frame
+// usart_arch_dord
+#ifndef CONF_SERCOM_2_USART_DORD
+#define CONF_SERCOM_2_USART_DORD 1
+#endif
+
+// Does not do anything in UART mode
+#define CONF_SERCOM_2_USART_CPOL 0
+
+// Encoding Format
+// <0=>No encoding
+// <1=>IrDA encoded
+// usart_arch_enc
+#ifndef CONF_SERCOM_2_USART_ENC
+#define CONF_SERCOM_2_USART_ENC 0
+#endif
+
+// LIN Slave Enable
+// Break Character Detection and Auto-Baud/LIN Slave Enable.
+// Additional setting needed: 16x sample rate using fractional baud rate generation (CTRLA.SAMPR = 1).
+// <0=>Disable
+// <1=>Enable
+// usart_arch_lin_slave_enable
+#ifndef CONF_SERCOM_2_USART_LIN_SLAVE_ENABLE
+#define CONF_SERCOM_2_USART_LIN_SLAVE_ENABLE 0
+#endif
+
+// Debug Stop Mode
+// Behavior of the baud-rate generator when CPU is halted by external debugger.
+// <0=>Keep running
+// <1=>Halt
+// usart_arch_dbgstop
+#ifndef CONF_SERCOM_2_USART_DEBUG_STOP_MODE
+#define CONF_SERCOM_2_USART_DEBUG_STOP_MODE 0
+#endif
+
+//
+
+#ifndef CONF_SERCOM_2_USART_INACK
+#define CONF_SERCOM_2_USART_INACK 0x0
+#endif
+
+#ifndef CONF_SERCOM_2_USART_DSNACK
+#define CONF_SERCOM_2_USART_DSNACK 0x0
+#endif
+
+#ifndef CONF_SERCOM_2_USART_MAXITER
+#define CONF_SERCOM_2_USART_MAXITER 0x7
+#endif
+
+#ifndef CONF_SERCOM_2_USART_GTIME
+#define CONF_SERCOM_2_USART_GTIME 0x2
+#endif
+
+#define CONF_SERCOM_2_USART_RXINV 0x0
+#define CONF_SERCOM_2_USART_TXINV 0x0
+
+#ifndef CONF_SERCOM_2_USART_CMODE
+#define CONF_SERCOM_2_USART_CMODE 0
+#endif
+
+#ifndef CONF_SERCOM_2_USART_RXPO
+#define CONF_SERCOM_2_USART_RXPO 1 /* RX is on PIN_PB24 */
+#endif
+
+#ifndef CONF_SERCOM_2_USART_TXPO
+#define CONF_SERCOM_2_USART_TXPO 0 /* TX is on PIN_PB25 */
+#endif
+
+/* Set correct parity settings in register interface based on PARITY setting */
+#if CONF_SERCOM_2_USART_LIN_SLAVE_ENABLE == 1
+#if CONF_SERCOM_2_USART_PARITY == 0
+#define CONF_SERCOM_2_USART_PMODE 0
+#define CONF_SERCOM_2_USART_FORM 4
+#else
+#define CONF_SERCOM_2_USART_PMODE CONF_SERCOM_2_USART_PARITY - 1
+#define CONF_SERCOM_2_USART_FORM 5
+#endif
+#else /* #if CONF_SERCOM_2_USART_LIN_SLAVE_ENABLE == 0 */
+#if CONF_SERCOM_2_USART_PARITY == 0
+#define CONF_SERCOM_2_USART_PMODE 0
+#define CONF_SERCOM_2_USART_FORM 0
+#else
+#define CONF_SERCOM_2_USART_PMODE CONF_SERCOM_2_USART_PARITY - 1
+#define CONF_SERCOM_2_USART_FORM 1
+#endif
+#endif
+
+// Calculate BAUD register value in UART mode
+#if CONF_SERCOM_2_USART_SAMPR == 0
+#ifndef CONF_SERCOM_2_USART_BAUD_RATE
+#define CONF_SERCOM_2_USART_BAUD_RATE \
+ 65536 - ((65536 * 16.0f * CONF_SERCOM_2_USART_BAUD) / CONF_GCLK_SERCOM2_CORE_FREQUENCY)
+#endif
+#ifndef CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH
+#define CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH 0
+#endif
+#elif CONF_SERCOM_2_USART_SAMPR == 1
+#ifndef CONF_SERCOM_2_USART_BAUD_RATE
+#define CONF_SERCOM_2_USART_BAUD_RATE \
+ ((CONF_GCLK_SERCOM2_CORE_FREQUENCY) / (CONF_SERCOM_2_USART_BAUD * 16)) - (CONF_SERCOM_2_USART_FRACTIONAL / 8)
+#endif
+#ifndef CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH
+#define CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH 0
+#endif
+#elif CONF_SERCOM_2_USART_SAMPR == 2
+#ifndef CONF_SERCOM_2_USART_BAUD_RATE
+#define CONF_SERCOM_2_USART_BAUD_RATE \
+ 65536 - ((65536 * 8.0f * CONF_SERCOM_2_USART_BAUD) / CONF_GCLK_SERCOM2_CORE_FREQUENCY)
+#endif
+#ifndef CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH
+#define CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH 0
+#endif
+#elif CONF_SERCOM_2_USART_SAMPR == 3
+#ifndef CONF_SERCOM_2_USART_BAUD_RATE
+#define CONF_SERCOM_2_USART_BAUD_RATE \
+ ((CONF_GCLK_SERCOM2_CORE_FREQUENCY) / (CONF_SERCOM_2_USART_BAUD * 8)) - (CONF_SERCOM_2_USART_FRACTIONAL / 8)
+#endif
+#ifndef CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH
+#define CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH 0
+#endif
+#elif CONF_SERCOM_2_USART_SAMPR == 4
+#ifndef CONF_SERCOM_2_USART_BAUD_RATE
+#define CONF_SERCOM_2_USART_BAUD_RATE \
+ 65536 - ((65536 * 3.0f * CONF_SERCOM_2_USART_BAUD) / CONF_GCLK_SERCOM2_CORE_FREQUENCY)
+#endif
+#ifndef CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH
+#define CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH 0
+#endif
+#endif
+
+#include
+
+// Enable configuration of module
+#ifndef CONF_SERCOM_4_SPI_ENABLE
+#define CONF_SERCOM_4_SPI_ENABLE 1
+#endif
+
+// Set module in SPI Master mode
+#ifndef CONF_SERCOM_4_SPI_MODE
+#define CONF_SERCOM_4_SPI_MODE 0x03
+#endif
+
+// Basic Configuration
+
+// Receive buffer enable
+// Enable receive buffer to receive data from slave (RXEN)
+// spi_master_rx_enable
+#ifndef CONF_SERCOM_4_SPI_RXEN
+#define CONF_SERCOM_4_SPI_RXEN 0x1
+#endif
+
+// Character Size
+// Bit size for all characters sent over the SPI bus (CHSIZE)
+// <0x0=>8 bits
+// <0x1=>9 bits
+// spi_master_character_size
+#ifndef CONF_SERCOM_4_SPI_CHSIZE
+#define CONF_SERCOM_4_SPI_CHSIZE 0x0
+#endif
+// Baud rate <1-18000000>
+// The SPI data transfer rate
+// spi_master_baud_rate
+#ifndef CONF_SERCOM_4_SPI_BAUD
+#define CONF_SERCOM_4_SPI_BAUD 1000000
+#endif
+
+//
+
+// Advanced Configuration
+// spi_master_advanced
+#ifndef CONF_SERCOM_4_SPI_ADVANCED
+#define CONF_SERCOM_4_SPI_ADVANCED 0
+#endif
+
+// Dummy byte <0x00-0x1ff>
+// spi_master_dummybyte
+// Dummy byte used when reading data from the slave without sending any data
+#ifndef CONF_SERCOM_4_SPI_DUMMYBYTE
+#define CONF_SERCOM_4_SPI_DUMMYBYTE 0x1ff
+#endif
+
+// Data Order
+// <0=>MSB first
+// <1=>LSB first
+// I least significant or most significant bit is shifted out first (DORD)
+// spi_master_arch_dord
+#ifndef CONF_SERCOM_4_SPI_DORD
+#define CONF_SERCOM_4_SPI_DORD 0x0
+#endif
+
+// Clock Polarity
+// <0=>SCK is low when idle
+// <1=>SCK is high when idle
+// Determines if the leading edge is rising or falling with a corresponding opposite edge at the trailing edge. (CPOL)
+// spi_master_arch_cpol
+#ifndef CONF_SERCOM_4_SPI_CPOL
+#define CONF_SERCOM_4_SPI_CPOL 0x0
+#endif
+
+// Clock Phase
+// <0x0=>Sample input on leading edge
+// <0x1=>Sample input on trailing edge
+// Determines if input data is sampled on leading or trailing SCK edge. (CPHA)
+// spi_master_arch_cpha
+#ifndef CONF_SERCOM_4_SPI_CPHA
+#define CONF_SERCOM_4_SPI_CPHA 0x0
+#endif
+
+// Immediate Buffer Overflow Notification
+// Controls when OVF is asserted (IBON)
+// <0x0=>In data stream
+// <0x1=>On buffer overflow
+// spi_master_arch_ibon
+#ifndef CONF_SERCOM_4_SPI_IBON
+#define CONF_SERCOM_4_SPI_IBON 0x0
+#endif
+
+// Run in stand-by
+// Module stays active in stand-by sleep mode. (RUNSTDBY)
+// spi_master_arch_runstdby
+#ifndef CONF_SERCOM_4_SPI_RUNSTDBY
+#define CONF_SERCOM_4_SPI_RUNSTDBY 0x0
+#endif
+
+// Debug Stop Mode
+// Behavior of the baud-rate generator when CPU is halted by external debugger. (DBGSTOP)
+// <0=>Keep running
+// <1=>Halt
+// spi_master_arch_dbgstop
+#ifndef CONF_SERCOM_4_SPI_DBGSTOP
+#define CONF_SERCOM_4_SPI_DBGSTOP 0
+#endif
+
+//
+
+// Address mode disabled in master mode
+#ifndef CONF_SERCOM_4_SPI_AMODE_EN
+#define CONF_SERCOM_4_SPI_AMODE_EN 0
+#endif
+
+#ifndef CONF_SERCOM_4_SPI_AMODE
+#define CONF_SERCOM_4_SPI_AMODE 0
+#endif
+
+#ifndef CONF_SERCOM_4_SPI_ADDR
+#define CONF_SERCOM_4_SPI_ADDR 0
+#endif
+
+#ifndef CONF_SERCOM_4_SPI_ADDRMASK
+#define CONF_SERCOM_4_SPI_ADDRMASK 0
+#endif
+
+#ifndef CONF_SERCOM_4_SPI_SSDE
+#define CONF_SERCOM_4_SPI_SSDE 0
+#endif
+
+#ifndef CONF_SERCOM_4_SPI_MSSEN
+#define CONF_SERCOM_4_SPI_MSSEN 0x0
+#endif
+
+#ifndef CONF_SERCOM_4_SPI_PLOADEN
+#define CONF_SERCOM_4_SPI_PLOADEN 0
+#endif
+
+// Receive Data Pinout
+// <0x0=>PAD[0]
+// <0x1=>PAD[1]
+// <0x2=>PAD[2]
+// <0x3=>PAD[3]
+// spi_master_rxpo
+#ifndef CONF_SERCOM_4_SPI_RXPO
+#define CONF_SERCOM_4_SPI_RXPO 3
+#endif
+
+// Transmit Data Pinout
+// <0x0=>PAD[0,1]_DO_SCK
+// <0x1=>PAD[2,3]_DO_SCK
+// <0x2=>PAD[3,1]_DO_SCK
+// <0x3=>PAD[0,3]_DO_SCK
+// spi_master_txpo
+#ifndef CONF_SERCOM_4_SPI_TXPO
+#define CONF_SERCOM_4_SPI_TXPO 0
+#endif
+
+// Calculate baud register value from requested baudrate value
+#ifndef CONF_SERCOM_4_SPI_BAUD_RATE
+#define CONF_SERCOM_4_SPI_BAUD_RATE ((float)CONF_GCLK_SERCOM4_CORE_FREQUENCY / (float)(2 * CONF_SERCOM_4_SPI_BAUD)) - 1
+#endif
+
+// <<< end of configuration section >>>
+
+#endif // HPL_SERCOM_CONFIG_H
diff --git a/Examples/AS5048A_test/AS5048A_test/Config/peripheral_clk_config.h b/Examples/AS5048A_test/AS5048A_test/Config/peripheral_clk_config.h
new file mode 100644
index 0000000..0be3043
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/Config/peripheral_clk_config.h
@@ -0,0 +1,177 @@
+/* Auto-generated config file peripheral_clk_config.h */
+#ifndef PERIPHERAL_CLK_CONFIG_H
+#define PERIPHERAL_CLK_CONFIG_H
+
+// <<< Use Configuration Wizard in Context Menu >>>
+
+/**
+ * \def CONF_CPU_FREQUENCY
+ * \brief CPU's Clock frequency
+ */
+#ifndef CONF_CPU_FREQUENCY
+#define CONF_CPU_FREQUENCY 12000000
+#endif
+
+// Core Clock Source
+// core_gclk_selection
+
+// Generic clock generator 0
+
+// Generic clock generator 1
+
+// Generic clock generator 2
+
+// Generic clock generator 3
+
+// Generic clock generator 4
+
+// Generic clock generator 5
+
+// Generic clock generator 6
+
+// Generic clock generator 7
+
+// Generic clock generator 8
+
+// Generic clock generator 9
+
+// Generic clock generator 10
+
+// Generic clock generator 11
+
+// Select the clock source for CORE.
+#ifndef CONF_GCLK_SERCOM2_CORE_SRC
+#define CONF_GCLK_SERCOM2_CORE_SRC GCLK_PCHCTRL_GEN_GCLK0_Val
+#endif
+
+// Slow Clock Source
+// slow_gclk_selection
+
+// Generic clock generator 0
+
+// Generic clock generator 1
+
+// Generic clock generator 2
+
+// Generic clock generator 3
+
+// Generic clock generator 4
+
+// Generic clock generator 5
+
+// Generic clock generator 6
+
+// Generic clock generator 7
+
+// Generic clock generator 8
+
+// Generic clock generator 9
+
+// Generic clock generator 10
+
+// Generic clock generator 11
+
+// Select the slow clock source.
+#ifndef CONF_GCLK_SERCOM2_SLOW_SRC
+#define CONF_GCLK_SERCOM2_SLOW_SRC GCLK_PCHCTRL_GEN_GCLK3_Val
+#endif
+
+/**
+ * \def CONF_GCLK_SERCOM2_CORE_FREQUENCY
+ * \brief SERCOM2's Core Clock frequency
+ */
+#ifndef CONF_GCLK_SERCOM2_CORE_FREQUENCY
+#define CONF_GCLK_SERCOM2_CORE_FREQUENCY 12000000
+#endif
+
+/**
+ * \def CONF_GCLK_SERCOM2_SLOW_FREQUENCY
+ * \brief SERCOM2's Slow Clock frequency
+ */
+#ifndef CONF_GCLK_SERCOM2_SLOW_FREQUENCY
+#define CONF_GCLK_SERCOM2_SLOW_FREQUENCY 32768
+#endif
+
+// Core Clock Source
+// core_gclk_selection
+
+// Generic clock generator 0
+
+// Generic clock generator 1
+
+// Generic clock generator 2
+
+// Generic clock generator 3
+
+// Generic clock generator 4
+
+// Generic clock generator 5
+
+// Generic clock generator 6
+
+// Generic clock generator 7
+
+// Generic clock generator 8
+
+// Generic clock generator 9
+
+// Generic clock generator 10
+
+// Generic clock generator 11
+
+// Select the clock source for CORE.
+#ifndef CONF_GCLK_SERCOM4_CORE_SRC
+#define CONF_GCLK_SERCOM4_CORE_SRC GCLK_PCHCTRL_GEN_GCLK0_Val
+#endif
+
+// Slow Clock Source
+// slow_gclk_selection
+
+// Generic clock generator 0
+
+// Generic clock generator 1
+
+// Generic clock generator 2
+
+// Generic clock generator 3
+
+// Generic clock generator 4
+
+// Generic clock generator 5
+
+// Generic clock generator 6
+
+// Generic clock generator 7
+
+// Generic clock generator 8
+
+// Generic clock generator 9
+
+// Generic clock generator 10
+
+// Generic clock generator 11
+
+// Select the slow clock source.
+#ifndef CONF_GCLK_SERCOM4_SLOW_SRC
+#define CONF_GCLK_SERCOM4_SLOW_SRC GCLK_PCHCTRL_GEN_GCLK3_Val
+#endif
+
+/**
+ * \def CONF_GCLK_SERCOM4_CORE_FREQUENCY
+ * \brief SERCOM4's Core Clock frequency
+ */
+#ifndef CONF_GCLK_SERCOM4_CORE_FREQUENCY
+#define CONF_GCLK_SERCOM4_CORE_FREQUENCY 12000000
+#endif
+
+/**
+ * \def CONF_GCLK_SERCOM4_SLOW_FREQUENCY
+ * \brief SERCOM4's Slow Clock frequency
+ */
+#ifndef CONF_GCLK_SERCOM4_SLOW_FREQUENCY
+#define CONF_GCLK_SERCOM4_SLOW_FREQUENCY 32768
+#endif
+
+// <<< end of configuration section >>>
+
+#endif // PERIPHERAL_CLK_CONFIG_H
diff --git a/Examples/AS5048A_test/AS5048A_test/Config/stdio_redirect_config.h b/Examples/AS5048A_test/AS5048A_test/Config/stdio_redirect_config.h
new file mode 100644
index 0000000..3515c0c
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/Config/stdio_redirect_config.h
@@ -0,0 +1,9 @@
+/* Auto-generated config file stdio_redirect_config.h */
+#ifndef STDIO_REDIRECT_CONFIG_H
+#define STDIO_REDIRECT_CONFIG_H
+
+// <<< Use Configuration Wizard in Context Menu >>>
+
+// <<< end of configuration section >>>
+
+#endif // STDIO_REDIRECT_CONFIG_H
diff --git a/Examples/AS5048A_test/AS5048A_test/Default.xml b/Examples/AS5048A_test/AS5048A_test/Default.xml
new file mode 100644
index 0000000..8b9dc9c
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/Default.xml
@@ -0,0 +1,475 @@
+
+
+
+
+
+
+ DebugLevel
+ None
+
+
+ IncludePaths
+ NDEBUG
+
+
+ MiscellaneousSettings
+ -std=gnu99
+
+
+ OptimizationLevel
+ Optimize for size (-Os)
+
+
+ SymbolDefines
+ NDEBUG
+
+
+ SymbolUndefines
+
+
+
+ Verbose
+ False
+
+
+ WarningsAsErrors
+ False
+
+
+ armgcc.compiler.general.CLanguageExp
+ True
+
+
+ armgcc.compiler.general.ChangeDefaultCharTypeUnsigned
+ False
+
+
+ armgcc.compiler.general.ChangeDefaultBitFieldUnsigned
+ False
+
+
+ armgcc.compiler.general.processormode
+
+
+
+ armgcc.compiler.preprocessor.DoNotSearchSystemDirectories
+ False
+
+
+ armgcc.compiler.preprocessor.PreprocessOnly
+ False
+
+
+ armgcc.compiler.symbols.Default
+
+
+
+ armgcc.compiler.directories.DefaultIncludePath
+ True
+
+
+ armgcc.compiler.optimization.OtherFlags
+
+
+
+ armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection
+ True
+
+
+ armgcc.compiler.optimization.PrepareDataForGarbageCollection
+ False
+
+
+ armgcc.compiler.optimization.EnableUnsafeMatchOptimizations
+ False
+
+
+ armgcc.compiler.optimization.EnableFastMath
+ False
+
+
+ armgcc.compiler.optimization.GeneratePositionIndependentCode
+ False
+
+
+ armgcc.compiler.optimization.EnableLongCalls
+ True
+
+
+ armgcc.compiler.optimization.OtherDebuggingFlags
+
+
+
+ armgcc.compiler.optimization.GenerateGprofInformation
+ False
+
+
+ armgcc.compiler.optimization.GenerateProfInformation
+ False
+
+
+ armgcc.compiler.warnings.AllWarnings
+ True
+
+
+ armgcc.compiler.warnings.ExtraWarnings
+ False
+
+
+ armgcc.compiler.warnings.Undefined
+ False
+
+
+ armgcc.compiler.warnings.CheckSyntaxOnly
+ False
+
+
+ armgcc.compiler.warnings.Pedantic
+ False
+
+
+ armgcc.compiler.warnings.PedanticWarningsAsErrors
+ False
+
+
+ armgcc.compiler.warnings.InhibitAllWarnings
+ False
+
+
+ armgcc.compiler.miscellaneous.Device
+ True
+
+
+ armgcc.compiler.miscellaneous.CompileOnly
+ True
+
+
+ armgcc.compiler.miscellaneous.SupportAnsiPrograms
+ False
+
+
+ armgcc.compiler.miscellaneous.MakeFileDependent
+ True
+
+
+
+
+ Libraries
+ libm
+
+
+ LibrarySearchPath
+ $(ProjectDir)\Device_Startup
+
+
+ MiscellaneousSettings
+ -Tsame54p20a_flash.ld
+
+
+ armgcc.linker.general.DoNotUseStandardStartFiles
+ False
+
+
+ armgcc.linker.general.DoNotUseDefaultLibraries
+ False
+
+
+ armgcc.linker.general.NoStartupOrDefaultLibs
+ False
+
+
+ armgcc.linker.general.OmitAllSymbolInformation
+ False
+
+
+ armgcc.linker.general.NoSharedLibraries
+ False
+
+
+ armgcc.linker.general.GenerateMAPFile
+ True
+
+
+ armgcc.linker.general.UseNewlibNano
+ False
+
+
+ armgcc.linker.general.AdditionalSpecs
+ None
+
+
+ armgcc.linker.optimization.GarbageCollectUnusedSections
+ True
+
+
+ armgcc.linker.optimization.EnableUnsafeMatchOptimizations
+ False
+
+
+ armgcc.linker.optimization.EnableFastMath
+ False
+
+
+ armgcc.linker.optimization.GeneratePositionIndependentCode
+ False
+
+
+ armgcc.linker.memorysettings.Flash
+
+
+
+ armgcc.linker.memorysettings.Sram
+
+
+
+ armgcc.linker.memorysettings.ExternalRAM
+
+
+
+ armgcc.linker.miscellaneous.OtherOptions
+
+
+
+ armgcc.linker.miscellaneous.OtherObjects
+
+
+
+ Release
+
+
+
+
+ DebugLevel
+ Maximum (-g3)
+
+
+ IncludePaths
+ DEBUG
+
+
+ MiscellaneousSettings
+ -std=gnu99
+
+
+ OptimizationLevel
+ Optimize debugging experience (-Og)
+
+
+ SymbolDefines
+ DEBUG
+
+
+ SymbolUndefines
+
+
+
+ Verbose
+ False
+
+
+ WarningsAsErrors
+ False
+
+
+ armgcc.compiler.general.CLanguageExp
+ True
+
+
+ armgcc.compiler.general.ChangeDefaultCharTypeUnsigned
+ False
+
+
+ armgcc.compiler.general.ChangeDefaultBitFieldUnsigned
+ False
+
+
+ armgcc.compiler.general.processormode
+
+
+
+ armgcc.compiler.preprocessor.DoNotSearchSystemDirectories
+ False
+
+
+ armgcc.compiler.preprocessor.PreprocessOnly
+ False
+
+
+ armgcc.compiler.symbols.Default
+
+
+
+ armgcc.compiler.directories.DefaultIncludePath
+ True
+
+
+ armgcc.compiler.optimization.OtherFlags
+
+
+
+ armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection
+ True
+
+
+ armgcc.compiler.optimization.PrepareDataForGarbageCollection
+ False
+
+
+ armgcc.compiler.optimization.EnableUnsafeMatchOptimizations
+ False
+
+
+ armgcc.compiler.optimization.EnableFastMath
+ False
+
+
+ armgcc.compiler.optimization.GeneratePositionIndependentCode
+ False
+
+
+ armgcc.compiler.optimization.EnableLongCalls
+ True
+
+
+ armgcc.compiler.optimization.OtherDebuggingFlags
+
+
+
+ armgcc.compiler.optimization.GenerateGprofInformation
+ False
+
+
+ armgcc.compiler.optimization.GenerateProfInformation
+ False
+
+
+ armgcc.compiler.warnings.AllWarnings
+ True
+
+
+ armgcc.compiler.warnings.ExtraWarnings
+ False
+
+
+ armgcc.compiler.warnings.Undefined
+ False
+
+
+ armgcc.compiler.warnings.CheckSyntaxOnly
+ False
+
+
+ armgcc.compiler.warnings.Pedantic
+ False
+
+
+ armgcc.compiler.warnings.PedanticWarningsAsErrors
+ False
+
+
+ armgcc.compiler.warnings.InhibitAllWarnings
+ False
+
+
+ armgcc.compiler.miscellaneous.Device
+ True
+
+
+ armgcc.compiler.miscellaneous.CompileOnly
+ True
+
+
+ armgcc.compiler.miscellaneous.SupportAnsiPrograms
+ False
+
+
+ armgcc.compiler.miscellaneous.MakeFileDependent
+ True
+
+
+
+
+ Libraries
+ libm
+
+
+ LibrarySearchPath
+ $(ProjectDir)\Device_Startup
+
+
+ MiscellaneousSettings
+ -Tsame54p20a_flash.ld
+
+
+ armgcc.linker.general.DoNotUseStandardStartFiles
+ False
+
+
+ armgcc.linker.general.DoNotUseDefaultLibraries
+ False
+
+
+ armgcc.linker.general.NoStartupOrDefaultLibs
+ False
+
+
+ armgcc.linker.general.OmitAllSymbolInformation
+ False
+
+
+ armgcc.linker.general.NoSharedLibraries
+ False
+
+
+ armgcc.linker.general.GenerateMAPFile
+ True
+
+
+ armgcc.linker.general.UseNewlibNano
+ False
+
+
+ armgcc.linker.general.AdditionalSpecs
+ None
+
+
+ armgcc.linker.optimization.GarbageCollectUnusedSections
+ True
+
+
+ armgcc.linker.optimization.EnableUnsafeMatchOptimizations
+ False
+
+
+ armgcc.linker.optimization.EnableFastMath
+ False
+
+
+ armgcc.linker.optimization.GeneratePositionIndependentCode
+ False
+
+
+ armgcc.linker.memorysettings.Flash
+
+
+
+ armgcc.linker.memorysettings.Sram
+
+
+
+ armgcc.linker.memorysettings.ExternalRAM
+
+
+
+ armgcc.linker.miscellaneous.OtherOptions
+
+
+
+ armgcc.linker.miscellaneous.OtherObjects
+
+
+
+ Debug
+
+
+
\ No newline at end of file
diff --git a/Examples/AS5048A_test/AS5048A_test/Device_Startup/same54p20a_flash.ld b/Examples/AS5048A_test/AS5048A_test/Device_Startup/same54p20a_flash.ld
new file mode 100644
index 0000000..97072bf
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/Device_Startup/same54p20a_flash.ld
@@ -0,0 +1,163 @@
+/**
+ * \file
+ *
+ * \brief Linker script for running in internal FLASH on the SAME54P20A
+ *
+ * Copyright (c) 2019 Microchip Technology Inc.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the Licence at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * \asf_license_stop
+ *
+ */
+
+
+OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
+OUTPUT_ARCH(arm)
+SEARCH_DIR(.)
+
+/* Memory Spaces Definitions */
+MEMORY
+{
+ rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00100000
+ ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00040000
+ bkupram (rwx) : ORIGIN = 0x47000000, LENGTH = 0x00002000
+ qspi (rwx) : ORIGIN = 0x04000000, LENGTH = 0x01000000
+}
+
+/* The stack size used by the application. NOTE: you need to adjust according to your application. */
+STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x10000;
+
+/* Section Definitions */
+SECTIONS
+{
+ .text :
+ {
+ . = ALIGN(4);
+ _sfixed = .;
+ KEEP(*(.vectors .vectors.*))
+ *(.text .text.* .gnu.linkonce.t.*)
+ *(.glue_7t) *(.glue_7)
+ *(.rodata .rodata* .gnu.linkonce.r.*)
+ *(.ARM.extab* .gnu.linkonce.armextab.*)
+
+ /* Support C constructors, and C destructors in both user code
+ and the C library. This also provides support for C++ code. */
+ . = ALIGN(4);
+ KEEP(*(.init))
+ . = ALIGN(4);
+ __preinit_array_start = .;
+ KEEP (*(.preinit_array))
+ __preinit_array_end = .;
+
+ . = ALIGN(4);
+ __init_array_start = .;
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ __init_array_end = .;
+
+ . = ALIGN(4);
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*crtend.o(.ctors))
+
+ . = ALIGN(4);
+ KEEP(*(.fini))
+
+ . = ALIGN(4);
+ __fini_array_start = .;
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ __fini_array_end = .;
+
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*crtend.o(.dtors))
+
+ . = ALIGN(4);
+ _efixed = .; /* End of text section */
+ } > rom
+
+ /* .ARM.exidx is sorted, so has to go in its own output section. */
+ PROVIDE_HIDDEN (__exidx_start = .);
+ .ARM.exidx :
+ {
+ *(.ARM.exidx* .gnu.linkonce.armexidx.*)
+ } > rom
+ PROVIDE_HIDDEN (__exidx_end = .);
+
+ . = ALIGN(4);
+ _etext = .;
+
+ .relocate : AT (_etext)
+ {
+ . = ALIGN(4);
+ _srelocate = .;
+ *(.ramfunc .ramfunc.*);
+ *(.data .data.*);
+ . = ALIGN(4);
+ _erelocate = .;
+ } > ram
+
+ .bkupram (NOLOAD):
+ {
+ . = ALIGN(8);
+ _sbkupram = .;
+ *(.bkupram .bkupram.*);
+ . = ALIGN(8);
+ _ebkupram = .;
+ } > bkupram
+
+ .qspi (NOLOAD):
+ {
+ . = ALIGN(8);
+ _sqspi = .;
+ *(.qspi .qspi.*);
+ . = ALIGN(8);
+ _eqspi = .;
+ } > qspi
+
+ /* .bss section which is used for uninitialized data */
+ .bss (NOLOAD) :
+ {
+ . = ALIGN(4);
+ _sbss = . ;
+ _szero = .;
+ *(.bss .bss.*)
+ *(COMMON)
+ . = ALIGN(4);
+ _ebss = . ;
+ _ezero = .;
+ } > ram
+
+ /* stack section */
+ .stack (NOLOAD):
+ {
+ . = ALIGN(8);
+ _sstack = .;
+ . = . + STACK_SIZE;
+ . = ALIGN(8);
+ _estack = .;
+ } > ram
+
+ . = ALIGN(4);
+ _end = . ;
+}
diff --git a/Examples/AS5048A_test/AS5048A_test/Device_Startup/same54p20a_sram.ld b/Examples/AS5048A_test/AS5048A_test/Device_Startup/same54p20a_sram.ld
new file mode 100644
index 0000000..6219f4a
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/Device_Startup/same54p20a_sram.ld
@@ -0,0 +1,162 @@
+/**
+ * \file
+ *
+ * \brief Linker script for running in internal SRAM on the SAME54P20A
+ *
+ * Copyright (c) 2019 Microchip Technology Inc.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the Licence at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * \asf_license_stop
+ *
+ */
+
+
+OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
+OUTPUT_ARCH(arm)
+SEARCH_DIR(.)
+
+/* Memory Spaces Definitions */
+MEMORY
+{
+ ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00040000
+ bkupram (rwx) : ORIGIN = 0x47000000, LENGTH = 0x00002000
+ qspi (rwx) : ORIGIN = 0x04000000, LENGTH = 0x01000000
+}
+
+/* The stack size used by the application. NOTE: you need to adjust according to your application. */
+STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x10000;
+
+/* Section Definitions */
+SECTIONS
+{
+ .text :
+ {
+ . = ALIGN(4);
+ _sfixed = .;
+ KEEP(*(.vectors .vectors.*))
+ *(.text .text.* .gnu.linkonce.t.*)
+ *(.glue_7t) *(.glue_7)
+ *(.rodata .rodata* .gnu.linkonce.r.*)
+ *(.ARM.extab* .gnu.linkonce.armextab.*)
+
+ /* Support C constructors, and C destructors in both user code
+ and the C library. This also provides support for C++ code. */
+ . = ALIGN(4);
+ KEEP(*(.init))
+ . = ALIGN(4);
+ __preinit_array_start = .;
+ KEEP (*(.preinit_array))
+ __preinit_array_end = .;
+
+ . = ALIGN(4);
+ __init_array_start = .;
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ __init_array_end = .;
+
+ . = ALIGN(4);
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*crtend.o(.ctors))
+
+ . = ALIGN(4);
+ KEEP(*(.fini))
+
+ . = ALIGN(4);
+ __fini_array_start = .;
+ KEEP (*(.fini_array))
+ KEEP (*(SORT(.fini_array.*)))
+ __fini_array_end = .;
+
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*crtend.o(.dtors))
+
+ . = ALIGN(4);
+ _efixed = .; /* End of text section */
+ } > ram
+
+ /* .ARM.exidx is sorted, so has to go in its own output section. */
+ PROVIDE_HIDDEN (__exidx_start = .);
+ .ARM.exidx :
+ {
+ *(.ARM.exidx* .gnu.linkonce.armexidx.*)
+ } > ram
+ PROVIDE_HIDDEN (__exidx_end = .);
+
+ . = ALIGN(4);
+ _etext = .;
+
+ .relocate : AT (_etext)
+ {
+ . = ALIGN(4);
+ _srelocate = .;
+ *(.ramfunc .ramfunc.*);
+ *(.data .data.*);
+ . = ALIGN(4);
+ _erelocate = .;
+ } > ram
+
+ .bkupram (NOLOAD):
+ {
+ . = ALIGN(8);
+ _sbkupram = .;
+ *(.bkupram .bkupram.*);
+ . = ALIGN(8);
+ _ebkupram = .;
+ } > bkupram
+
+ .qspi (NOLOAD):
+ {
+ . = ALIGN(8);
+ _sqspi = .;
+ *(.qspi .qspi.*);
+ . = ALIGN(8);
+ _eqspi = .;
+ } > qspi
+
+ /* .bss section which is used for uninitialized data */
+ .bss (NOLOAD) :
+ {
+ . = ALIGN(4);
+ _sbss = . ;
+ _szero = .;
+ *(.bss .bss.*)
+ *(COMMON)
+ . = ALIGN(4);
+ _ebss = . ;
+ _ezero = .;
+ } > ram
+
+ /* stack section */
+ .stack (NOLOAD):
+ {
+ . = ALIGN(8);
+ _sstack = .;
+ . = . + STACK_SIZE;
+ . = ALIGN(8);
+ _estack = .;
+ } > ram
+
+ . = ALIGN(4);
+ _end = . ;
+}
diff --git a/Examples/AS5048A_test/AS5048A_test/Device_Startup/startup_same54.c b/Examples/AS5048A_test/AS5048A_test/Device_Startup/startup_same54.c
new file mode 100644
index 0000000..32efc2c
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/Device_Startup/startup_same54.c
@@ -0,0 +1,546 @@
+/**
+ * \file
+ *
+ * \brief gcc starttup file for SAME54
+ *
+ * Copyright (c) 2019 Microchip Technology Inc.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the Licence at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#include "same54.h"
+
+/* Initialize segments */
+extern uint32_t _sfixed;
+extern uint32_t _efixed;
+extern uint32_t _etext;
+extern uint32_t _srelocate;
+extern uint32_t _erelocate;
+extern uint32_t _szero;
+extern uint32_t _ezero;
+extern uint32_t _sstack;
+extern uint32_t _estack;
+
+/** \cond DOXYGEN_SHOULD_SKIP_THIS */
+int main(void);
+/** \endcond */
+
+void __libc_init_array(void);
+
+/* Default empty handler */
+void Dummy_Handler(void);
+
+/* Cortex-M4 core handlers */
+void NonMaskableInt_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+void HardFault_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+void MemManagement_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+void BusFault_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+void UsageFault_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+void SVCall_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+void DebugMonitor_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+void PendSV_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+void SysTick_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+
+/* Peripherals handlers */
+void PM_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+void MCLK_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+void OSCCTRL_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* OSCCTRL_XOSCFAIL_0, OSCCTRL_XOSCRDY_0 */
+void OSCCTRL_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* OSCCTRL_XOSCFAIL_1, OSCCTRL_XOSCRDY_1 */
+void OSCCTRL_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* OSCCTRL_DFLLLOCKC, OSCCTRL_DFLLLOCKF, OSCCTRL_DFLLOOB, OSCCTRL_DFLLRCS, OSCCTRL_DFLLRDY */
+void OSCCTRL_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* OSCCTRL_DPLLLCKF_0, OSCCTRL_DPLLLCKR_0, OSCCTRL_DPLLLDRTO_0, OSCCTRL_DPLLLTO_0 */
+void OSCCTRL_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* OSCCTRL_DPLLLCKF_1, OSCCTRL_DPLLLCKR_1, OSCCTRL_DPLLLDRTO_1, OSCCTRL_DPLLLTO_1 */
+void OSC32KCTRL_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+void SUPC_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SUPC_B12SRDY, SUPC_B33SRDY, SUPC_BOD12RDY, SUPC_BOD33RDY, SUPC_VCORERDY, SUPC_VREGRDY */
+void SUPC_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SUPC_BOD12DET, SUPC_BOD33DET */
+void WDT_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+void RTC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+void EIC_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_0 */
+void EIC_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_1 */
+void EIC_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_2 */
+void EIC_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_3 */
+void EIC_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_4 */
+void EIC_5_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_5 */
+void EIC_6_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_6 */
+void EIC_7_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_7 */
+void EIC_8_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_8 */
+void EIC_9_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_9 */
+void EIC_10_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_10 */
+void EIC_11_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_11 */
+void EIC_12_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_12 */
+void EIC_13_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_13 */
+void EIC_14_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_14 */
+void EIC_15_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_15 */
+void FREQM_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+void NVMCTRL_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* NVMCTRL_0, NVMCTRL_1, NVMCTRL_2, NVMCTRL_3, NVMCTRL_4, NVMCTRL_5, NVMCTRL_6, NVMCTRL_7 */
+void NVMCTRL_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* NVMCTRL_10, NVMCTRL_8, NVMCTRL_9 */
+void DMAC_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DMAC_SUSP_0, DMAC_TCMPL_0, DMAC_TERR_0 */
+void DMAC_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DMAC_SUSP_1, DMAC_TCMPL_1, DMAC_TERR_1 */
+void DMAC_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DMAC_SUSP_2, DMAC_TCMPL_2, DMAC_TERR_2 */
+void DMAC_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DMAC_SUSP_3, DMAC_TCMPL_3, DMAC_TERR_3 */
+void DMAC_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DMAC_SUSP_10, DMAC_SUSP_11, DMAC_SUSP_12, DMAC_SUSP_13, DMAC_SUSP_14, DMAC_SUSP_15, DMAC_SUSP_16, DMAC_SUSP_17, DMAC_SUSP_18, DMAC_SUSP_19, DMAC_SUSP_20, DMAC_SUSP_21, DMAC_SUSP_22, DMAC_SUSP_23, DMAC_SUSP_24, DMAC_SUSP_25, DMAC_SUSP_26, DMAC_SUSP_27, DMAC_SUSP_28, DMAC_SUSP_29, DMAC_SUSP_30, DMAC_SUSP_31, DMAC_SUSP_4, DMAC_SUSP_5, DMAC_SUSP_6, DMAC_SUSP_7, DMAC_SUSP_8, DMAC_SUSP_9, DMAC_TCMPL_10, DMAC_TCMPL_11, DMAC_TCMPL_12, DMAC_TCMPL_13, DMAC_TCMPL_14, DMAC_TCMPL_15, DMAC_TCMPL_16, DMAC_TCMPL_17, DMAC_TCMPL_18, DMAC_TCMPL_19, DMAC_TCMPL_20, DMAC_TCMPL_21, DMAC_TCMPL_22, DMAC_TCMPL_23, DMAC_TCMPL_24, DMAC_TCMPL_25, DMAC_TCMPL_26, DMAC_TCMPL_27, DMAC_TCMPL_28, DMAC_TCMPL_29, DMAC_TCMPL_30, DMAC_TCMPL_31, DMAC_TCMPL_4, DMAC_TCMPL_5, DMAC_TCMPL_6, DMAC_TCMPL_7, DMAC_TCMPL_8, DMAC_TCMPL_9, DMAC_TERR_10, DMAC_TERR_11, DMAC_TERR_12, DMAC_TERR_13, DMAC_TERR_14, DMAC_TERR_15, DMAC_TERR_16, DMAC_TERR_17, DMAC_TERR_18, DMAC_TERR_19, DMAC_TERR_20, DMAC_TERR_21, DMAC_TERR_22, DMAC_TERR_23, DMAC_TERR_24, DMAC_TERR_25, DMAC_TERR_26, DMAC_TERR_27, DMAC_TERR_28, DMAC_TERR_29, DMAC_TERR_30, DMAC_TERR_31, DMAC_TERR_4, DMAC_TERR_5, DMAC_TERR_6, DMAC_TERR_7, DMAC_TERR_8, DMAC_TERR_9 */
+void EVSYS_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EVSYS_EVD_0, EVSYS_OVR_0 */
+void EVSYS_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EVSYS_EVD_1, EVSYS_OVR_1 */
+void EVSYS_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EVSYS_EVD_2, EVSYS_OVR_2 */
+void EVSYS_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EVSYS_EVD_3, EVSYS_OVR_3 */
+void EVSYS_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EVSYS_EVD_10, EVSYS_EVD_11, EVSYS_EVD_4, EVSYS_EVD_5, EVSYS_EVD_6, EVSYS_EVD_7, EVSYS_EVD_8, EVSYS_EVD_9, EVSYS_OVR_10, EVSYS_OVR_11, EVSYS_OVR_4, EVSYS_OVR_5, EVSYS_OVR_6, EVSYS_OVR_7, EVSYS_OVR_8, EVSYS_OVR_9 */
+void PAC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+void RAMECC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+void SERCOM0_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM0_0 */
+void SERCOM0_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM0_1 */
+void SERCOM0_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM0_2 */
+void SERCOM0_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM0_3, SERCOM0_4, SERCOM0_5, SERCOM0_6 */
+void SERCOM1_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM1_0 */
+void SERCOM1_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM1_1 */
+void SERCOM1_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM1_2 */
+void SERCOM1_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM1_3, SERCOM1_4, SERCOM1_5, SERCOM1_6 */
+void SERCOM2_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM2_0 */
+void SERCOM2_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM2_1 */
+void SERCOM2_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM2_2 */
+void SERCOM2_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM2_3, SERCOM2_4, SERCOM2_5, SERCOM2_6 */
+void SERCOM3_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM3_0 */
+void SERCOM3_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM3_1 */
+void SERCOM3_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM3_2 */
+void SERCOM3_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM3_3, SERCOM3_4, SERCOM3_5, SERCOM3_6 */
+#ifdef ID_SERCOM4
+void SERCOM4_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM4_0 */
+void SERCOM4_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM4_1 */
+void SERCOM4_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM4_2 */
+void SERCOM4_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM4_3, SERCOM4_4, SERCOM4_5, SERCOM4_6 */
+#endif
+#ifdef ID_SERCOM5
+void SERCOM5_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM5_0 */
+void SERCOM5_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM5_1 */
+void SERCOM5_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM5_2 */
+void SERCOM5_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM5_3, SERCOM5_4, SERCOM5_5, SERCOM5_6 */
+#endif
+#ifdef ID_SERCOM6
+void SERCOM6_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM6_0 */
+void SERCOM6_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM6_1 */
+void SERCOM6_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM6_2 */
+void SERCOM6_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM6_3, SERCOM6_4, SERCOM6_5, SERCOM6_6 */
+#endif
+#ifdef ID_SERCOM7
+void SERCOM7_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM7_0 */
+void SERCOM7_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM7_1 */
+void SERCOM7_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM7_2 */
+void SERCOM7_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM7_3, SERCOM7_4, SERCOM7_5, SERCOM7_6 */
+#endif
+#ifdef ID_CAN0
+void CAN0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+#endif
+#ifdef ID_CAN1
+void CAN1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+#endif
+#ifdef ID_USB
+void USB_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* USB_EORSM_DNRSM, USB_EORST_RST, USB_LPMSUSP_DDISC, USB_LPM_DCONN, USB_MSOF, USB_RAMACER, USB_RXSTP_TXSTP_0, USB_RXSTP_TXSTP_1, USB_RXSTP_TXSTP_2, USB_RXSTP_TXSTP_3, USB_RXSTP_TXSTP_4, USB_RXSTP_TXSTP_5, USB_RXSTP_TXSTP_6, USB_RXSTP_TXSTP_7, USB_STALL0_STALL_0, USB_STALL0_STALL_1, USB_STALL0_STALL_2, USB_STALL0_STALL_3, USB_STALL0_STALL_4, USB_STALL0_STALL_5, USB_STALL0_STALL_6, USB_STALL0_STALL_7, USB_STALL1_0, USB_STALL1_1, USB_STALL1_2, USB_STALL1_3, USB_STALL1_4, USB_STALL1_5, USB_STALL1_6, USB_STALL1_7, USB_SUSPEND, USB_TRFAIL0_TRFAIL_0, USB_TRFAIL0_TRFAIL_1, USB_TRFAIL0_TRFAIL_2, USB_TRFAIL0_TRFAIL_3, USB_TRFAIL0_TRFAIL_4, USB_TRFAIL0_TRFAIL_5, USB_TRFAIL0_TRFAIL_6, USB_TRFAIL0_TRFAIL_7, USB_TRFAIL1_PERR_0, USB_TRFAIL1_PERR_1, USB_TRFAIL1_PERR_2, USB_TRFAIL1_PERR_3, USB_TRFAIL1_PERR_4, USB_TRFAIL1_PERR_5, USB_TRFAIL1_PERR_6, USB_TRFAIL1_PERR_7, USB_UPRSM, USB_WAKEUP */
+void USB_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* USB_SOF_HSOF */
+void USB_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* USB_TRCPT0_0, USB_TRCPT0_1, USB_TRCPT0_2, USB_TRCPT0_3, USB_TRCPT0_4, USB_TRCPT0_5, USB_TRCPT0_6, USB_TRCPT0_7 */
+void USB_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* USB_TRCPT1_0, USB_TRCPT1_1, USB_TRCPT1_2, USB_TRCPT1_3, USB_TRCPT1_4, USB_TRCPT1_5, USB_TRCPT1_6, USB_TRCPT1_7 */
+#endif
+#ifdef ID_GMAC
+void GMAC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+#endif
+void TCC0_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC0_CNT_A, TCC0_DFS_A, TCC0_ERR_A, TCC0_FAULT0_A, TCC0_FAULT1_A, TCC0_FAULTA_A, TCC0_FAULTB_A, TCC0_OVF, TCC0_TRG, TCC0_UFS_A */
+void TCC0_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC0_MC_0 */
+void TCC0_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC0_MC_1 */
+void TCC0_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC0_MC_2 */
+void TCC0_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC0_MC_3 */
+void TCC0_5_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC0_MC_4 */
+void TCC0_6_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC0_MC_5 */
+void TCC1_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC1_CNT_A, TCC1_DFS_A, TCC1_ERR_A, TCC1_FAULT0_A, TCC1_FAULT1_A, TCC1_FAULTA_A, TCC1_FAULTB_A, TCC1_OVF, TCC1_TRG, TCC1_UFS_A */
+void TCC1_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC1_MC_0 */
+void TCC1_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC1_MC_1 */
+void TCC1_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC1_MC_2 */
+void TCC1_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC1_MC_3 */
+void TCC2_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC2_CNT_A, TCC2_DFS_A, TCC2_ERR_A, TCC2_FAULT0_A, TCC2_FAULT1_A, TCC2_FAULTA_A, TCC2_FAULTB_A, TCC2_OVF, TCC2_TRG, TCC2_UFS_A */
+void TCC2_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC2_MC_0 */
+void TCC2_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC2_MC_1 */
+void TCC2_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC2_MC_2 */
+#ifdef ID_TCC3
+void TCC3_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC3_CNT_A, TCC3_DFS_A, TCC3_ERR_A, TCC3_FAULT0_A, TCC3_FAULT1_A, TCC3_FAULTA_A, TCC3_FAULTB_A, TCC3_OVF, TCC3_TRG, TCC3_UFS_A */
+void TCC3_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC3_MC_0 */
+void TCC3_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC3_MC_1 */
+#endif
+#ifdef ID_TCC4
+void TCC4_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC4_CNT_A, TCC4_DFS_A, TCC4_ERR_A, TCC4_FAULT0_A, TCC4_FAULT1_A, TCC4_FAULTA_A, TCC4_FAULTB_A, TCC4_OVF, TCC4_TRG, TCC4_UFS_A */
+void TCC4_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC4_MC_0 */
+void TCC4_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC4_MC_1 */
+#endif
+void TC0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+void TC1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+void TC2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+void TC3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+#ifdef ID_TC4
+void TC4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+#endif
+#ifdef ID_TC5
+void TC5_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+#endif
+#ifdef ID_TC6
+void TC6_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+#endif
+#ifdef ID_TC7
+void TC7_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+#endif
+void PDEC_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* PDEC_DIR_A, PDEC_ERR_A, PDEC_OVF, PDEC_VLC_A */
+void PDEC_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* PDEC_MC_0 */
+void PDEC_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* PDEC_MC_1 */
+void ADC0_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* ADC0_OVERRUN, ADC0_WINMON */
+void ADC0_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* ADC0_RESRDY */
+void ADC1_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* ADC1_OVERRUN, ADC1_WINMON */
+void ADC1_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* ADC1_RESRDY */
+void AC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+void DAC_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DAC_OVERRUN_A_0, DAC_OVERRUN_A_1, DAC_UNDERRUN_A_0, DAC_UNDERRUN_A_1 */
+void DAC_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DAC_EMPTY_0 */
+void DAC_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DAC_EMPTY_1 */
+void DAC_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DAC_RESRDY_0 */
+void DAC_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DAC_RESRDY_1 */
+#ifdef ID_I2S
+void I2S_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+#endif
+void PCC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+void AES_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+void TRNG_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+#ifdef ID_ICM
+void ICM_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+#endif
+#ifdef ID_PUKCC
+void PUKCC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+#endif
+void QSPI_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+#ifdef ID_SDHC0
+void SDHC0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+#endif
+#ifdef ID_SDHC1
+void SDHC1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+#endif
+
+/* Exception Table */
+__attribute__ ((section(".vectors")))
+const DeviceVectors exception_table = {
+
+ /* Configure Initial Stack Pointer, using linker-generated symbols */
+ .pvStack = (void*) (&_estack),
+
+ .pfnReset_Handler = (void*) Reset_Handler,
+ .pfnNonMaskableInt_Handler = (void*) NonMaskableInt_Handler,
+ .pfnHardFault_Handler = (void*) HardFault_Handler,
+ .pfnMemManagement_Handler = (void*) MemManagement_Handler,
+ .pfnBusFault_Handler = (void*) BusFault_Handler,
+ .pfnUsageFault_Handler = (void*) UsageFault_Handler,
+ .pvReservedM9 = (void*) (0UL), /* Reserved */
+ .pvReservedM8 = (void*) (0UL), /* Reserved */
+ .pvReservedM7 = (void*) (0UL), /* Reserved */
+ .pvReservedM6 = (void*) (0UL), /* Reserved */
+ .pfnSVCall_Handler = (void*) SVCall_Handler,
+ .pfnDebugMonitor_Handler = (void*) DebugMonitor_Handler,
+ .pvReservedM3 = (void*) (0UL), /* Reserved */
+ .pfnPendSV_Handler = (void*) PendSV_Handler,
+ .pfnSysTick_Handler = (void*) SysTick_Handler,
+
+ /* Configurable interrupts */
+ .pfnPM_Handler = (void*) PM_Handler, /* 0 Power Manager */
+ .pfnMCLK_Handler = (void*) MCLK_Handler, /* 1 Main Clock */
+ .pfnOSCCTRL_0_Handler = (void*) OSCCTRL_0_Handler, /* 2 OSCCTRL_XOSCFAIL_0, OSCCTRL_XOSCRDY_0 */
+ .pfnOSCCTRL_1_Handler = (void*) OSCCTRL_1_Handler, /* 3 OSCCTRL_XOSCFAIL_1, OSCCTRL_XOSCRDY_1 */
+ .pfnOSCCTRL_2_Handler = (void*) OSCCTRL_2_Handler, /* 4 OSCCTRL_DFLLLOCKC, OSCCTRL_DFLLLOCKF, OSCCTRL_DFLLOOB, OSCCTRL_DFLLRCS, OSCCTRL_DFLLRDY */
+ .pfnOSCCTRL_3_Handler = (void*) OSCCTRL_3_Handler, /* 5 OSCCTRL_DPLLLCKF_0, OSCCTRL_DPLLLCKR_0, OSCCTRL_DPLLLDRTO_0, OSCCTRL_DPLLLTO_0 */
+ .pfnOSCCTRL_4_Handler = (void*) OSCCTRL_4_Handler, /* 6 OSCCTRL_DPLLLCKF_1, OSCCTRL_DPLLLCKR_1, OSCCTRL_DPLLLDRTO_1, OSCCTRL_DPLLLTO_1 */
+ .pfnOSC32KCTRL_Handler = (void*) OSC32KCTRL_Handler, /* 7 32kHz Oscillators Control */
+ .pfnSUPC_0_Handler = (void*) SUPC_0_Handler, /* 8 SUPC_B12SRDY, SUPC_B33SRDY, SUPC_BOD12RDY, SUPC_BOD33RDY, SUPC_VCORERDY, SUPC_VREGRDY */
+ .pfnSUPC_1_Handler = (void*) SUPC_1_Handler, /* 9 SUPC_BOD12DET, SUPC_BOD33DET */
+ .pfnWDT_Handler = (void*) WDT_Handler, /* 10 Watchdog Timer */
+ .pfnRTC_Handler = (void*) RTC_Handler, /* 11 Real-Time Counter */
+ .pfnEIC_0_Handler = (void*) EIC_0_Handler, /* 12 EIC_EXTINT_0 */
+ .pfnEIC_1_Handler = (void*) EIC_1_Handler, /* 13 EIC_EXTINT_1 */
+ .pfnEIC_2_Handler = (void*) EIC_2_Handler, /* 14 EIC_EXTINT_2 */
+ .pfnEIC_3_Handler = (void*) EIC_3_Handler, /* 15 EIC_EXTINT_3 */
+ .pfnEIC_4_Handler = (void*) EIC_4_Handler, /* 16 EIC_EXTINT_4 */
+ .pfnEIC_5_Handler = (void*) EIC_5_Handler, /* 17 EIC_EXTINT_5 */
+ .pfnEIC_6_Handler = (void*) EIC_6_Handler, /* 18 EIC_EXTINT_6 */
+ .pfnEIC_7_Handler = (void*) EIC_7_Handler, /* 19 EIC_EXTINT_7 */
+ .pfnEIC_8_Handler = (void*) EIC_8_Handler, /* 20 EIC_EXTINT_8 */
+ .pfnEIC_9_Handler = (void*) EIC_9_Handler, /* 21 EIC_EXTINT_9 */
+ .pfnEIC_10_Handler = (void*) EIC_10_Handler, /* 22 EIC_EXTINT_10 */
+ .pfnEIC_11_Handler = (void*) EIC_11_Handler, /* 23 EIC_EXTINT_11 */
+ .pfnEIC_12_Handler = (void*) EIC_12_Handler, /* 24 EIC_EXTINT_12 */
+ .pfnEIC_13_Handler = (void*) EIC_13_Handler, /* 25 EIC_EXTINT_13 */
+ .pfnEIC_14_Handler = (void*) EIC_14_Handler, /* 26 EIC_EXTINT_14 */
+ .pfnEIC_15_Handler = (void*) EIC_15_Handler, /* 27 EIC_EXTINT_15 */
+ .pfnFREQM_Handler = (void*) FREQM_Handler, /* 28 Frequency Meter */
+ .pfnNVMCTRL_0_Handler = (void*) NVMCTRL_0_Handler, /* 29 NVMCTRL_0, NVMCTRL_1, NVMCTRL_2, NVMCTRL_3, NVMCTRL_4, NVMCTRL_5, NVMCTRL_6, NVMCTRL_7 */
+ .pfnNVMCTRL_1_Handler = (void*) NVMCTRL_1_Handler, /* 30 NVMCTRL_10, NVMCTRL_8, NVMCTRL_9 */
+ .pfnDMAC_0_Handler = (void*) DMAC_0_Handler, /* 31 DMAC_SUSP_0, DMAC_TCMPL_0, DMAC_TERR_0 */
+ .pfnDMAC_1_Handler = (void*) DMAC_1_Handler, /* 32 DMAC_SUSP_1, DMAC_TCMPL_1, DMAC_TERR_1 */
+ .pfnDMAC_2_Handler = (void*) DMAC_2_Handler, /* 33 DMAC_SUSP_2, DMAC_TCMPL_2, DMAC_TERR_2 */
+ .pfnDMAC_3_Handler = (void*) DMAC_3_Handler, /* 34 DMAC_SUSP_3, DMAC_TCMPL_3, DMAC_TERR_3 */
+ .pfnDMAC_4_Handler = (void*) DMAC_4_Handler, /* 35 DMAC_SUSP_10, DMAC_SUSP_11, DMAC_SUSP_12, DMAC_SUSP_13, DMAC_SUSP_14, DMAC_SUSP_15, DMAC_SUSP_16, DMAC_SUSP_17, DMAC_SUSP_18, DMAC_SUSP_19, DMAC_SUSP_20, DMAC_SUSP_21, DMAC_SUSP_22, DMAC_SUSP_23, DMAC_SUSP_24, DMAC_SUSP_25, DMAC_SUSP_26, DMAC_SUSP_27, DMAC_SUSP_28, DMAC_SUSP_29, DMAC_SUSP_30, DMAC_SUSP_31, DMAC_SUSP_4, DMAC_SUSP_5, DMAC_SUSP_6, DMAC_SUSP_7, DMAC_SUSP_8, DMAC_SUSP_9, DMAC_TCMPL_10, DMAC_TCMPL_11, DMAC_TCMPL_12, DMAC_TCMPL_13, DMAC_TCMPL_14, DMAC_TCMPL_15, DMAC_TCMPL_16, DMAC_TCMPL_17, DMAC_TCMPL_18, DMAC_TCMPL_19, DMAC_TCMPL_20, DMAC_TCMPL_21, DMAC_TCMPL_22, DMAC_TCMPL_23, DMAC_TCMPL_24, DMAC_TCMPL_25, DMAC_TCMPL_26, DMAC_TCMPL_27, DMAC_TCMPL_28, DMAC_TCMPL_29, DMAC_TCMPL_30, DMAC_TCMPL_31, DMAC_TCMPL_4, DMAC_TCMPL_5, DMAC_TCMPL_6, DMAC_TCMPL_7, DMAC_TCMPL_8, DMAC_TCMPL_9, DMAC_TERR_10, DMAC_TERR_11, DMAC_TERR_12, DMAC_TERR_13, DMAC_TERR_14, DMAC_TERR_15, DMAC_TERR_16, DMAC_TERR_17, DMAC_TERR_18, DMAC_TERR_19, DMAC_TERR_20, DMAC_TERR_21, DMAC_TERR_22, DMAC_TERR_23, DMAC_TERR_24, DMAC_TERR_25, DMAC_TERR_26, DMAC_TERR_27, DMAC_TERR_28, DMAC_TERR_29, DMAC_TERR_30, DMAC_TERR_31, DMAC_TERR_4, DMAC_TERR_5, DMAC_TERR_6, DMAC_TERR_7, DMAC_TERR_8, DMAC_TERR_9 */
+ .pfnEVSYS_0_Handler = (void*) EVSYS_0_Handler, /* 36 EVSYS_EVD_0, EVSYS_OVR_0 */
+ .pfnEVSYS_1_Handler = (void*) EVSYS_1_Handler, /* 37 EVSYS_EVD_1, EVSYS_OVR_1 */
+ .pfnEVSYS_2_Handler = (void*) EVSYS_2_Handler, /* 38 EVSYS_EVD_2, EVSYS_OVR_2 */
+ .pfnEVSYS_3_Handler = (void*) EVSYS_3_Handler, /* 39 EVSYS_EVD_3, EVSYS_OVR_3 */
+ .pfnEVSYS_4_Handler = (void*) EVSYS_4_Handler, /* 40 EVSYS_EVD_10, EVSYS_EVD_11, EVSYS_EVD_4, EVSYS_EVD_5, EVSYS_EVD_6, EVSYS_EVD_7, EVSYS_EVD_8, EVSYS_EVD_9, EVSYS_OVR_10, EVSYS_OVR_11, EVSYS_OVR_4, EVSYS_OVR_5, EVSYS_OVR_6, EVSYS_OVR_7, EVSYS_OVR_8, EVSYS_OVR_9 */
+ .pfnPAC_Handler = (void*) PAC_Handler, /* 41 Peripheral Access Controller */
+ .pvReserved42 = (void*) (0UL), /* 42 Reserved */
+ .pvReserved43 = (void*) (0UL), /* 43 Reserved */
+ .pvReserved44 = (void*) (0UL), /* 44 Reserved */
+ .pfnRAMECC_Handler = (void*) RAMECC_Handler, /* 45 RAM ECC */
+ .pfnSERCOM0_0_Handler = (void*) SERCOM0_0_Handler, /* 46 SERCOM0_0 */
+ .pfnSERCOM0_1_Handler = (void*) SERCOM0_1_Handler, /* 47 SERCOM0_1 */
+ .pfnSERCOM0_2_Handler = (void*) SERCOM0_2_Handler, /* 48 SERCOM0_2 */
+ .pfnSERCOM0_3_Handler = (void*) SERCOM0_3_Handler, /* 49 SERCOM0_3, SERCOM0_4, SERCOM0_5, SERCOM0_6 */
+ .pfnSERCOM1_0_Handler = (void*) SERCOM1_0_Handler, /* 50 SERCOM1_0 */
+ .pfnSERCOM1_1_Handler = (void*) SERCOM1_1_Handler, /* 51 SERCOM1_1 */
+ .pfnSERCOM1_2_Handler = (void*) SERCOM1_2_Handler, /* 52 SERCOM1_2 */
+ .pfnSERCOM1_3_Handler = (void*) SERCOM1_3_Handler, /* 53 SERCOM1_3, SERCOM1_4, SERCOM1_5, SERCOM1_6 */
+ .pfnSERCOM2_0_Handler = (void*) SERCOM2_0_Handler, /* 54 SERCOM2_0 */
+ .pfnSERCOM2_1_Handler = (void*) SERCOM2_1_Handler, /* 55 SERCOM2_1 */
+ .pfnSERCOM2_2_Handler = (void*) SERCOM2_2_Handler, /* 56 SERCOM2_2 */
+ .pfnSERCOM2_3_Handler = (void*) SERCOM2_3_Handler, /* 57 SERCOM2_3, SERCOM2_4, SERCOM2_5, SERCOM2_6 */
+ .pfnSERCOM3_0_Handler = (void*) SERCOM3_0_Handler, /* 58 SERCOM3_0 */
+ .pfnSERCOM3_1_Handler = (void*) SERCOM3_1_Handler, /* 59 SERCOM3_1 */
+ .pfnSERCOM3_2_Handler = (void*) SERCOM3_2_Handler, /* 60 SERCOM3_2 */
+ .pfnSERCOM3_3_Handler = (void*) SERCOM3_3_Handler, /* 61 SERCOM3_3, SERCOM3_4, SERCOM3_5, SERCOM3_6 */
+#ifdef ID_SERCOM4
+ .pfnSERCOM4_0_Handler = (void*) SERCOM4_0_Handler, /* 62 SERCOM4_0 */
+ .pfnSERCOM4_1_Handler = (void*) SERCOM4_1_Handler, /* 63 SERCOM4_1 */
+ .pfnSERCOM4_2_Handler = (void*) SERCOM4_2_Handler, /* 64 SERCOM4_2 */
+ .pfnSERCOM4_3_Handler = (void*) SERCOM4_3_Handler, /* 65 SERCOM4_3, SERCOM4_4, SERCOM4_5, SERCOM4_6 */
+#else
+ .pvReserved62 = (void*) (0UL), /* 62 Reserved */
+ .pvReserved63 = (void*) (0UL), /* 63 Reserved */
+ .pvReserved64 = (void*) (0UL), /* 64 Reserved */
+ .pvReserved65 = (void*) (0UL), /* 65 Reserved */
+#endif
+#ifdef ID_SERCOM5
+ .pfnSERCOM5_0_Handler = (void*) SERCOM5_0_Handler, /* 66 SERCOM5_0 */
+ .pfnSERCOM5_1_Handler = (void*) SERCOM5_1_Handler, /* 67 SERCOM5_1 */
+ .pfnSERCOM5_2_Handler = (void*) SERCOM5_2_Handler, /* 68 SERCOM5_2 */
+ .pfnSERCOM5_3_Handler = (void*) SERCOM5_3_Handler, /* 69 SERCOM5_3, SERCOM5_4, SERCOM5_5, SERCOM5_6 */
+#else
+ .pvReserved66 = (void*) (0UL), /* 66 Reserved */
+ .pvReserved67 = (void*) (0UL), /* 67 Reserved */
+ .pvReserved68 = (void*) (0UL), /* 68 Reserved */
+ .pvReserved69 = (void*) (0UL), /* 69 Reserved */
+#endif
+#ifdef ID_SERCOM6
+ .pfnSERCOM6_0_Handler = (void*) SERCOM6_0_Handler, /* 70 SERCOM6_0 */
+ .pfnSERCOM6_1_Handler = (void*) SERCOM6_1_Handler, /* 71 SERCOM6_1 */
+ .pfnSERCOM6_2_Handler = (void*) SERCOM6_2_Handler, /* 72 SERCOM6_2 */
+ .pfnSERCOM6_3_Handler = (void*) SERCOM6_3_Handler, /* 73 SERCOM6_3, SERCOM6_4, SERCOM6_5, SERCOM6_6 */
+#else
+ .pvReserved70 = (void*) (0UL), /* 70 Reserved */
+ .pvReserved71 = (void*) (0UL), /* 71 Reserved */
+ .pvReserved72 = (void*) (0UL), /* 72 Reserved */
+ .pvReserved73 = (void*) (0UL), /* 73 Reserved */
+#endif
+#ifdef ID_SERCOM7
+ .pfnSERCOM7_0_Handler = (void*) SERCOM7_0_Handler, /* 74 SERCOM7_0 */
+ .pfnSERCOM7_1_Handler = (void*) SERCOM7_1_Handler, /* 75 SERCOM7_1 */
+ .pfnSERCOM7_2_Handler = (void*) SERCOM7_2_Handler, /* 76 SERCOM7_2 */
+ .pfnSERCOM7_3_Handler = (void*) SERCOM7_3_Handler, /* 77 SERCOM7_3, SERCOM7_4, SERCOM7_5, SERCOM7_6 */
+#else
+ .pvReserved74 = (void*) (0UL), /* 74 Reserved */
+ .pvReserved75 = (void*) (0UL), /* 75 Reserved */
+ .pvReserved76 = (void*) (0UL), /* 76 Reserved */
+ .pvReserved77 = (void*) (0UL), /* 77 Reserved */
+#endif
+#ifdef ID_CAN0
+ .pfnCAN0_Handler = (void*) CAN0_Handler, /* 78 Control Area Network 0 */
+#else
+ .pvReserved78 = (void*) (0UL), /* 78 Reserved */
+#endif
+#ifdef ID_CAN1
+ .pfnCAN1_Handler = (void*) CAN1_Handler, /* 79 Control Area Network 1 */
+#else
+ .pvReserved79 = (void*) (0UL), /* 79 Reserved */
+#endif
+#ifdef ID_USB
+ .pfnUSB_0_Handler = (void*) USB_0_Handler, /* 80 USB_EORSM_DNRSM, USB_EORST_RST, USB_LPMSUSP_DDISC, USB_LPM_DCONN, USB_MSOF, USB_RAMACER, USB_RXSTP_TXSTP_0, USB_RXSTP_TXSTP_1, USB_RXSTP_TXSTP_2, USB_RXSTP_TXSTP_3, USB_RXSTP_TXSTP_4, USB_RXSTP_TXSTP_5, USB_RXSTP_TXSTP_6, USB_RXSTP_TXSTP_7, USB_STALL0_STALL_0, USB_STALL0_STALL_1, USB_STALL0_STALL_2, USB_STALL0_STALL_3, USB_STALL0_STALL_4, USB_STALL0_STALL_5, USB_STALL0_STALL_6, USB_STALL0_STALL_7, USB_STALL1_0, USB_STALL1_1, USB_STALL1_2, USB_STALL1_3, USB_STALL1_4, USB_STALL1_5, USB_STALL1_6, USB_STALL1_7, USB_SUSPEND, USB_TRFAIL0_TRFAIL_0, USB_TRFAIL0_TRFAIL_1, USB_TRFAIL0_TRFAIL_2, USB_TRFAIL0_TRFAIL_3, USB_TRFAIL0_TRFAIL_4, USB_TRFAIL0_TRFAIL_5, USB_TRFAIL0_TRFAIL_6, USB_TRFAIL0_TRFAIL_7, USB_TRFAIL1_PERR_0, USB_TRFAIL1_PERR_1, USB_TRFAIL1_PERR_2, USB_TRFAIL1_PERR_3, USB_TRFAIL1_PERR_4, USB_TRFAIL1_PERR_5, USB_TRFAIL1_PERR_6, USB_TRFAIL1_PERR_7, USB_UPRSM, USB_WAKEUP */
+ .pfnUSB_1_Handler = (void*) USB_1_Handler, /* 81 USB_SOF_HSOF */
+ .pfnUSB_2_Handler = (void*) USB_2_Handler, /* 82 USB_TRCPT0_0, USB_TRCPT0_1, USB_TRCPT0_2, USB_TRCPT0_3, USB_TRCPT0_4, USB_TRCPT0_5, USB_TRCPT0_6, USB_TRCPT0_7 */
+ .pfnUSB_3_Handler = (void*) USB_3_Handler, /* 83 USB_TRCPT1_0, USB_TRCPT1_1, USB_TRCPT1_2, USB_TRCPT1_3, USB_TRCPT1_4, USB_TRCPT1_5, USB_TRCPT1_6, USB_TRCPT1_7 */
+#else
+ .pvReserved80 = (void*) (0UL), /* 80 Reserved */
+ .pvReserved81 = (void*) (0UL), /* 81 Reserved */
+ .pvReserved82 = (void*) (0UL), /* 82 Reserved */
+ .pvReserved83 = (void*) (0UL), /* 83 Reserved */
+#endif
+#ifdef ID_GMAC
+ .pfnGMAC_Handler = (void*) GMAC_Handler, /* 84 Ethernet MAC */
+#else
+ .pvReserved84 = (void*) (0UL), /* 84 Reserved */
+#endif
+ .pfnTCC0_0_Handler = (void*) TCC0_0_Handler, /* 85 TCC0_CNT_A, TCC0_DFS_A, TCC0_ERR_A, TCC0_FAULT0_A, TCC0_FAULT1_A, TCC0_FAULTA_A, TCC0_FAULTB_A, TCC0_OVF, TCC0_TRG, TCC0_UFS_A */
+ .pfnTCC0_1_Handler = (void*) TCC0_1_Handler, /* 86 TCC0_MC_0 */
+ .pfnTCC0_2_Handler = (void*) TCC0_2_Handler, /* 87 TCC0_MC_1 */
+ .pfnTCC0_3_Handler = (void*) TCC0_3_Handler, /* 88 TCC0_MC_2 */
+ .pfnTCC0_4_Handler = (void*) TCC0_4_Handler, /* 89 TCC0_MC_3 */
+ .pfnTCC0_5_Handler = (void*) TCC0_5_Handler, /* 90 TCC0_MC_4 */
+ .pfnTCC0_6_Handler = (void*) TCC0_6_Handler, /* 91 TCC0_MC_5 */
+ .pfnTCC1_0_Handler = (void*) TCC1_0_Handler, /* 92 TCC1_CNT_A, TCC1_DFS_A, TCC1_ERR_A, TCC1_FAULT0_A, TCC1_FAULT1_A, TCC1_FAULTA_A, TCC1_FAULTB_A, TCC1_OVF, TCC1_TRG, TCC1_UFS_A */
+ .pfnTCC1_1_Handler = (void*) TCC1_1_Handler, /* 93 TCC1_MC_0 */
+ .pfnTCC1_2_Handler = (void*) TCC1_2_Handler, /* 94 TCC1_MC_1 */
+ .pfnTCC1_3_Handler = (void*) TCC1_3_Handler, /* 95 TCC1_MC_2 */
+ .pfnTCC1_4_Handler = (void*) TCC1_4_Handler, /* 96 TCC1_MC_3 */
+ .pfnTCC2_0_Handler = (void*) TCC2_0_Handler, /* 97 TCC2_CNT_A, TCC2_DFS_A, TCC2_ERR_A, TCC2_FAULT0_A, TCC2_FAULT1_A, TCC2_FAULTA_A, TCC2_FAULTB_A, TCC2_OVF, TCC2_TRG, TCC2_UFS_A */
+ .pfnTCC2_1_Handler = (void*) TCC2_1_Handler, /* 98 TCC2_MC_0 */
+ .pfnTCC2_2_Handler = (void*) TCC2_2_Handler, /* 99 TCC2_MC_1 */
+ .pfnTCC2_3_Handler = (void*) TCC2_3_Handler, /* 100 TCC2_MC_2 */
+#ifdef ID_TCC3
+ .pfnTCC3_0_Handler = (void*) TCC3_0_Handler, /* 101 TCC3_CNT_A, TCC3_DFS_A, TCC3_ERR_A, TCC3_FAULT0_A, TCC3_FAULT1_A, TCC3_FAULTA_A, TCC3_FAULTB_A, TCC3_OVF, TCC3_TRG, TCC3_UFS_A */
+ .pfnTCC3_1_Handler = (void*) TCC3_1_Handler, /* 102 TCC3_MC_0 */
+ .pfnTCC3_2_Handler = (void*) TCC3_2_Handler, /* 103 TCC3_MC_1 */
+#else
+ .pvReserved101 = (void*) (0UL), /* 101 Reserved */
+ .pvReserved102 = (void*) (0UL), /* 102 Reserved */
+ .pvReserved103 = (void*) (0UL), /* 103 Reserved */
+#endif
+#ifdef ID_TCC4
+ .pfnTCC4_0_Handler = (void*) TCC4_0_Handler, /* 104 TCC4_CNT_A, TCC4_DFS_A, TCC4_ERR_A, TCC4_FAULT0_A, TCC4_FAULT1_A, TCC4_FAULTA_A, TCC4_FAULTB_A, TCC4_OVF, TCC4_TRG, TCC4_UFS_A */
+ .pfnTCC4_1_Handler = (void*) TCC4_1_Handler, /* 105 TCC4_MC_0 */
+ .pfnTCC4_2_Handler = (void*) TCC4_2_Handler, /* 106 TCC4_MC_1 */
+#else
+ .pvReserved104 = (void*) (0UL), /* 104 Reserved */
+ .pvReserved105 = (void*) (0UL), /* 105 Reserved */
+ .pvReserved106 = (void*) (0UL), /* 106 Reserved */
+#endif
+ .pfnTC0_Handler = (void*) TC0_Handler, /* 107 Basic Timer Counter 0 */
+ .pfnTC1_Handler = (void*) TC1_Handler, /* 108 Basic Timer Counter 1 */
+ .pfnTC2_Handler = (void*) TC2_Handler, /* 109 Basic Timer Counter 2 */
+ .pfnTC3_Handler = (void*) TC3_Handler, /* 110 Basic Timer Counter 3 */
+#ifdef ID_TC4
+ .pfnTC4_Handler = (void*) TC4_Handler, /* 111 Basic Timer Counter 4 */
+#else
+ .pvReserved111 = (void*) (0UL), /* 111 Reserved */
+#endif
+#ifdef ID_TC5
+ .pfnTC5_Handler = (void*) TC5_Handler, /* 112 Basic Timer Counter 5 */
+#else
+ .pvReserved112 = (void*) (0UL), /* 112 Reserved */
+#endif
+#ifdef ID_TC6
+ .pfnTC6_Handler = (void*) TC6_Handler, /* 113 Basic Timer Counter 6 */
+#else
+ .pvReserved113 = (void*) (0UL), /* 113 Reserved */
+#endif
+#ifdef ID_TC7
+ .pfnTC7_Handler = (void*) TC7_Handler, /* 114 Basic Timer Counter 7 */
+#else
+ .pvReserved114 = (void*) (0UL), /* 114 Reserved */
+#endif
+ .pfnPDEC_0_Handler = (void*) PDEC_0_Handler, /* 115 PDEC_DIR_A, PDEC_ERR_A, PDEC_OVF, PDEC_VLC_A */
+ .pfnPDEC_1_Handler = (void*) PDEC_1_Handler, /* 116 PDEC_MC_0 */
+ .pfnPDEC_2_Handler = (void*) PDEC_2_Handler, /* 117 PDEC_MC_1 */
+ .pfnADC0_0_Handler = (void*) ADC0_0_Handler, /* 118 ADC0_OVERRUN, ADC0_WINMON */
+ .pfnADC0_1_Handler = (void*) ADC0_1_Handler, /* 119 ADC0_RESRDY */
+ .pfnADC1_0_Handler = (void*) ADC1_0_Handler, /* 120 ADC1_OVERRUN, ADC1_WINMON */
+ .pfnADC1_1_Handler = (void*) ADC1_1_Handler, /* 121 ADC1_RESRDY */
+ .pfnAC_Handler = (void*) AC_Handler, /* 122 Analog Comparators */
+ .pfnDAC_0_Handler = (void*) DAC_0_Handler, /* 123 DAC_OVERRUN_A_0, DAC_OVERRUN_A_1, DAC_UNDERRUN_A_0, DAC_UNDERRUN_A_1 */
+ .pfnDAC_1_Handler = (void*) DAC_1_Handler, /* 124 DAC_EMPTY_0 */
+ .pfnDAC_2_Handler = (void*) DAC_2_Handler, /* 125 DAC_EMPTY_1 */
+ .pfnDAC_3_Handler = (void*) DAC_3_Handler, /* 126 DAC_RESRDY_0 */
+ .pfnDAC_4_Handler = (void*) DAC_4_Handler, /* 127 DAC_RESRDY_1 */
+#ifdef ID_I2S
+ .pfnI2S_Handler = (void*) I2S_Handler, /* 128 Inter-IC Sound Interface */
+#else
+ .pvReserved128 = (void*) (0UL), /* 128 Reserved */
+#endif
+ .pfnPCC_Handler = (void*) PCC_Handler, /* 129 Parallel Capture Controller */
+ .pfnAES_Handler = (void*) AES_Handler, /* 130 Advanced Encryption Standard */
+ .pfnTRNG_Handler = (void*) TRNG_Handler, /* 131 True Random Generator */
+#ifdef ID_ICM
+ .pfnICM_Handler = (void*) ICM_Handler, /* 132 Integrity Check Monitor */
+#else
+ .pvReserved132 = (void*) (0UL), /* 132 Reserved */
+#endif
+#ifdef ID_PUKCC
+ .pfnPUKCC_Handler = (void*) PUKCC_Handler, /* 133 PUblic-Key Cryptography Controller */
+#else
+ .pvReserved133 = (void*) (0UL), /* 133 Reserved */
+#endif
+ .pfnQSPI_Handler = (void*) QSPI_Handler, /* 134 Quad SPI interface */
+#ifdef ID_SDHC0
+ .pfnSDHC0_Handler = (void*) SDHC0_Handler, /* 135 SD/MMC Host Controller 0 */
+#else
+ .pvReserved135 = (void*) (0UL), /* 135 Reserved */
+#endif
+#ifdef ID_SDHC1
+ .pfnSDHC1_Handler = (void*) SDHC1_Handler /* 136 SD/MMC Host Controller 1 */
+#else
+ .pvReserved136 = (void*) (0UL) /* 136 Reserved */
+#endif
+};
+
+/**
+ * \brief This is the code that gets called on processor reset.
+ * To initialize the device, and call the main() routine.
+ */
+void Reset_Handler(void)
+{
+ uint32_t *pSrc, *pDest;
+
+ /* Initialize the relocate segment */
+ pSrc = &_etext;
+ pDest = &_srelocate;
+
+ if (pSrc != pDest) {
+ for (; pDest < &_erelocate;) {
+ *pDest++ = *pSrc++;
+ }
+ }
+
+ /* Clear the zero segment */
+ for (pDest = &_szero; pDest < &_ezero;) {
+ *pDest++ = 0;
+ }
+
+ /* Set the vector table base address */
+ pSrc = (uint32_t *) & _sfixed;
+ SCB->VTOR = ((uint32_t) pSrc & SCB_VTOR_TBLOFF_Msk);
+
+#if __FPU_USED
+ /* Enable FPU */
+ SCB->CPACR |= (0xFu << 20);
+ __DSB();
+ __ISB();
+#endif
+
+ /* Initialize the C library */
+ __libc_init_array();
+
+ /* Branch to main function */
+ main();
+
+ /* Infinite loop */
+ while (1);
+}
+
+/**
+ * \brief Default interrupt handler for unused IRQs.
+ */
+void Dummy_Handler(void)
+{
+ while (1) {
+ }
+}
diff --git a/Examples/AS5048A_test/AS5048A_test/Device_Startup/system_same54.c b/Examples/AS5048A_test/AS5048A_test/Device_Startup/system_same54.c
new file mode 100644
index 0000000..d3d5c22
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/Device_Startup/system_same54.c
@@ -0,0 +1,64 @@
+/**
+ * \file
+ *
+ * \brief Low-level initialization functions called upon chip startup.
+ *
+ * Copyright (c) 2019 Microchip Technology Inc.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the Licence at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#include "same54.h"
+
+/**
+ * Initial system clock frequency. The System RC Oscillator (RCSYS) provides
+ * the source for the main clock at chip startup.
+ */
+#define __SYSTEM_CLOCK (48000000)
+
+uint32_t SystemCoreClock = __SYSTEM_CLOCK;/*!< System Clock Frequency (Core Clock)*/
+
+/**
+ * Initialize the system
+ *
+ * @brief Setup the microcontroller system.
+ * Initialize the System and update the SystemCoreClock variable.
+ */
+void SystemInit(void)
+{
+ // Keep the default device state after reset
+ SystemCoreClock = __SYSTEM_CLOCK;
+ return;
+}
+
+/**
+ * Update SystemCoreClock variable
+ *
+ * @brief Updates the SystemCoreClock with current core Clock
+ * retrieved from cpu registers.
+ */
+void SystemCoreClockUpdate(void)
+{
+ // Not implemented
+ SystemCoreClock = __SYSTEM_CLOCK;
+ return;
+}
diff --git a/Examples/AS5048A_test/AS5048A_test/atmel_start.c b/Examples/AS5048A_test/AS5048A_test/atmel_start.c
new file mode 100644
index 0000000..12895d0
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/atmel_start.c
@@ -0,0 +1,10 @@
+#include
+
+/**
+ * Initializes MCU, drivers and middleware in the project
+ **/
+void atmel_start_init(void)
+{
+ system_init();
+ stdio_redirect_init();
+}
diff --git a/Examples/AS5048A_test/AS5048A_test/atmel_start.h b/Examples/AS5048A_test/AS5048A_test/atmel_start.h
new file mode 100644
index 0000000..ace35cf
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/atmel_start.h
@@ -0,0 +1,19 @@
+#ifndef ATMEL_START_H_INCLUDED
+#define ATMEL_START_H_INCLUDED
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "driver_init.h"
+#include "stdio_start.h"
+
+/**
+ * Initializes MCU, drivers and middleware in the project
+ **/
+void atmel_start_init(void);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/Examples/AS5048A_test/AS5048A_test/atmel_start_pins.h b/Examples/AS5048A_test/AS5048A_test/atmel_start_pins.h
new file mode 100644
index 0000000..7948f03
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/atmel_start_pins.h
@@ -0,0 +1,37 @@
+/*
+ * Code generated from Atmel Start.
+ *
+ * This file will be overwritten when reconfiguring your Atmel Start project.
+ * Please copy examples or other code you want to keep to a separate file
+ * to avoid losing it when reconfiguring.
+ */
+#ifndef ATMEL_START_PINS_H_INCLUDED
+#define ATMEL_START_PINS_H_INCLUDED
+
+#include
+
+// SAME54 has 14 pin functions
+
+#define GPIO_PIN_FUNCTION_A 0
+#define GPIO_PIN_FUNCTION_B 1
+#define GPIO_PIN_FUNCTION_C 2
+#define GPIO_PIN_FUNCTION_D 3
+#define GPIO_PIN_FUNCTION_E 4
+#define GPIO_PIN_FUNCTION_F 5
+#define GPIO_PIN_FUNCTION_G 6
+#define GPIO_PIN_FUNCTION_H 7
+#define GPIO_PIN_FUNCTION_I 8
+#define GPIO_PIN_FUNCTION_J 9
+#define GPIO_PIN_FUNCTION_K 10
+#define GPIO_PIN_FUNCTION_L 11
+#define GPIO_PIN_FUNCTION_M 12
+#define GPIO_PIN_FUNCTION_N 13
+
+#define UART_RX GPIO(GPIO_PORTB, 24)
+#define UART_TX GPIO(GPIO_PORTB, 25)
+#define SPI_SCK GPIO(GPIO_PORTB, 26)
+#define SPI_MOSI GPIO(GPIO_PORTB, 27)
+#define SPI_SS GPIO(GPIO_PORTB, 28)
+#define SPI_MISO GPIO(GPIO_PORTB, 29)
+
+#endif // ATMEL_START_PINS_H_INCLUDED
diff --git a/Examples/AS5048A_test/AS5048A_test/documentation/stdio.rst b/Examples/AS5048A_test/AS5048A_test/documentation/stdio.rst
new file mode 100644
index 0000000..2864b49
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/documentation/stdio.rst
@@ -0,0 +1,34 @@
+STDIO redirection
+=================
+
+The STDIO redirection provides means to redirect standard input/output to HAL
+IO.
+
+On initialization, the HAL IO descriptor is assigned so that all input and
+output is redirected to access it. The IO descriptor can also be changed
+through stdio_io_set_io(). All stdin or stdout access is redirected to the
+IO descriptor. When the IO descriptor is set to NULL, all input and output
+are discarded.
+
+For GCC redirection, the stdout and stdin buffer are turned off, the
+standard _read() and _write() are overridden.
+
+For IAR redirection, the __read() and __write() are overridden.
+
+For Keil redirection, the Retarget.c are modified to override fputc(), fgetc(),
+etc.
+
+Features
+--------
+
+* Standard input/output redirection (e.g., printf to EDBG COM port)
+
+Dependencies
+------------
+
+* HAL IO driver
+
+Limitations
+-----------
+
+* IO read/write operation should be synchronous
diff --git a/Examples/AS5048A_test/AS5048A_test/driver_init.c b/Examples/AS5048A_test/AS5048A_test/driver_init.c
new file mode 100644
index 0000000..3814a37
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/driver_init.c
@@ -0,0 +1,118 @@
+/*
+ * Code generated from Atmel Start.
+ *
+ * This file will be overwritten when reconfiguring your Atmel Start project.
+ * Please copy examples or other code you want to keep to a separate file
+ * to avoid losing it when reconfiguring.
+ */
+
+#include "driver_init.h"
+#include
+#include
+#include
+
+struct spi_m_sync_descriptor SPI_0;
+
+struct usart_sync_descriptor TARGET_IO;
+
+void TARGET_IO_PORT_init(void)
+{
+
+ gpio_set_pin_function(UART_TX, PINMUX_PB25D_SERCOM2_PAD0);
+
+ gpio_set_pin_function(UART_RX, PINMUX_PB24D_SERCOM2_PAD1);
+}
+
+void TARGET_IO_CLOCK_init(void)
+{
+ hri_gclk_write_PCHCTRL_reg(GCLK, SERCOM2_GCLK_ID_CORE, CONF_GCLK_SERCOM2_CORE_SRC | (1 << GCLK_PCHCTRL_CHEN_Pos));
+ hri_gclk_write_PCHCTRL_reg(GCLK, SERCOM2_GCLK_ID_SLOW, CONF_GCLK_SERCOM2_SLOW_SRC | (1 << GCLK_PCHCTRL_CHEN_Pos));
+
+ hri_mclk_set_APBBMASK_SERCOM2_bit(MCLK);
+}
+
+void TARGET_IO_init(void)
+{
+ TARGET_IO_CLOCK_init();
+ usart_sync_init(&TARGET_IO, SERCOM2, (void *)NULL);
+ TARGET_IO_PORT_init();
+}
+
+void SPI_0_PORT_init(void)
+{
+
+ gpio_set_pin_level(SPI_MOSI,
+ // Initial level
+ // pad_initial_level
+ // Low
+ // High
+ false);
+
+ // Set pin direction to output
+ gpio_set_pin_direction(SPI_MOSI, GPIO_DIRECTION_OUT);
+
+ gpio_set_pin_function(SPI_MOSI, PINMUX_PB27D_SERCOM4_PAD0);
+
+ gpio_set_pin_level(SPI_SCK,
+ // Initial level
+ // pad_initial_level
+ // Low
+ // High
+ false);
+
+ // Set pin direction to output
+ gpio_set_pin_direction(SPI_SCK, GPIO_DIRECTION_OUT);
+
+ gpio_set_pin_function(SPI_SCK, PINMUX_PB26D_SERCOM4_PAD1);
+
+ // Set pin direction to input
+ gpio_set_pin_direction(SPI_MISO, GPIO_DIRECTION_IN);
+
+ gpio_set_pin_pull_mode(SPI_MISO,
+ // Pull configuration
+ // pad_pull_config
+ // Off
+ // Pull-up
+ // Pull-down
+ GPIO_PULL_OFF);
+
+ gpio_set_pin_function(SPI_MISO, PINMUX_PB29D_SERCOM4_PAD3);
+}
+
+void SPI_0_CLOCK_init(void)
+{
+ hri_gclk_write_PCHCTRL_reg(GCLK, SERCOM4_GCLK_ID_CORE, CONF_GCLK_SERCOM4_CORE_SRC | (1 << GCLK_PCHCTRL_CHEN_Pos));
+ hri_gclk_write_PCHCTRL_reg(GCLK, SERCOM4_GCLK_ID_SLOW, CONF_GCLK_SERCOM4_SLOW_SRC | (1 << GCLK_PCHCTRL_CHEN_Pos));
+
+ hri_mclk_set_APBDMASK_SERCOM4_bit(MCLK);
+}
+
+void SPI_0_init(void)
+{
+ SPI_0_CLOCK_init();
+ spi_m_sync_init(&SPI_0, SERCOM4);
+ SPI_0_PORT_init();
+}
+
+void system_init(void)
+{
+ init_mcu();
+
+ // GPIO on PB28
+
+ gpio_set_pin_level(SPI_SS,
+ // Initial level
+ // pad_initial_level
+ // Low
+ // High
+ true);
+
+ // Set pin direction to output
+ gpio_set_pin_direction(SPI_SS, GPIO_DIRECTION_OUT);
+
+ gpio_set_pin_function(SPI_SS, GPIO_PIN_FUNCTION_OFF);
+
+ TARGET_IO_init();
+
+ SPI_0_init();
+}
diff --git a/Examples/AS5048A_test/AS5048A_test/driver_init.h b/Examples/AS5048A_test/AS5048A_test/driver_init.h
new file mode 100644
index 0000000..8a485c0
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/driver_init.h
@@ -0,0 +1,47 @@
+/*
+ * Code generated from Atmel Start.
+ *
+ * This file will be overwritten when reconfiguring your Atmel Start project.
+ * Please copy examples or other code you want to keep to a separate file
+ * to avoid losing it when reconfiguring.
+ */
+#ifndef DRIVER_INIT_INCLUDED
+#define DRIVER_INIT_INCLUDED
+
+#include "atmel_start_pins.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+
+extern struct usart_sync_descriptor TARGET_IO;
+extern struct spi_m_sync_descriptor SPI_0;
+
+void TARGET_IO_PORT_init(void);
+void TARGET_IO_CLOCK_init(void);
+void TARGET_IO_init(void);
+
+void SPI_0_PORT_init(void);
+void SPI_0_CLOCK_init(void);
+void SPI_0_init(void);
+
+/**
+ * \brief Perform system initialization, initialize pins and clocks for
+ * peripherals
+ */
+void system_init(void);
+
+#ifdef __cplusplus
+}
+#endif
+#endif // DRIVER_INIT_INCLUDED
diff --git a/Examples/AS5048A_test/AS5048A_test/examples/driver_examples.c b/Examples/AS5048A_test/AS5048A_test/examples/driver_examples.c
new file mode 100644
index 0000000..458ba0c
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/examples/driver_examples.c
@@ -0,0 +1,37 @@
+/*
+ * Code generated from Atmel Start.
+ *
+ * This file will be overwritten when reconfiguring your Atmel Start project.
+ * Please copy examples or other code you want to keep to a separate file
+ * to avoid losing it when reconfiguring.
+ */
+
+#include "driver_examples.h"
+#include "driver_init.h"
+#include "utils.h"
+
+/**
+ * Example of using TARGET_IO to write "Hello World" using the IO abstraction.
+ */
+void TARGET_IO_example(void)
+{
+ struct io_descriptor *io;
+ usart_sync_get_io_descriptor(&TARGET_IO, &io);
+ usart_sync_enable(&TARGET_IO);
+
+ io_write(io, (uint8_t *)"Hello World!", 12);
+}
+
+/**
+ * Example of using SPI_0 to write "Hello World" using the IO abstraction.
+ */
+static uint8_t example_SPI_0[12] = "Hello World!";
+
+void SPI_0_example(void)
+{
+ struct io_descriptor *io;
+ spi_m_sync_get_io_descriptor(&SPI_0, &io);
+
+ spi_m_sync_enable(&SPI_0);
+ io_write(io, example_SPI_0, 12);
+}
diff --git a/Examples/AS5048A_test/AS5048A_test/examples/driver_examples.h b/Examples/AS5048A_test/AS5048A_test/examples/driver_examples.h
new file mode 100644
index 0000000..745c3df
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/examples/driver_examples.h
@@ -0,0 +1,20 @@
+/*
+ * Code generated from Atmel Start.
+ *
+ * This file will be overwritten when reconfiguring your Atmel Start project.
+ * Please copy examples or other code you want to keep to a separate file
+ * to avoid losing it when reconfiguring.
+ */
+#ifndef DRIVER_EXAMPLES_H_INCLUDED
+#define DRIVER_EXAMPLES_H_INCLUDED
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void TARGET_IO_example(void);
+
+#ifdef __cplusplus
+}
+#endif
+#endif // DRIVER_EXAMPLES_H_INCLUDED
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/documentation/spi_master_sync.rst b/Examples/AS5048A_test/AS5048A_test/hal/documentation/spi_master_sync.rst
new file mode 100644
index 0000000..4fbe45e
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/documentation/spi_master_sync.rst
@@ -0,0 +1,51 @@
+The SPI Master Synchronous Driver
+=================================
+
+The serial peripheral interface (SPI) is a synchronous serial communication
+interface.
+
+SPI devices communicate in full duplex mode using a master-slave
+architecture with a single master. The master device originates the frame for
+reading and writing. Multiple slave devices are supported through selection
+with individual slave select (SS) lines.
+
+Features
+--------
+
+* Initialization/de-initialization
+* Enabling/disabling
+* Control of the following settings:
+
+ * Baudrate
+ * SPI mode
+ * Character size
+ * Data order
+* Data transfer: transmission, reception and full-duplex
+
+Applications
+------------
+
+Send/receive/exchange data with a SPI slave device. E.g., serial flash, SD card,
+LCD controller, etc.
+
+Dependencies
+------------
+
+SPI master capable hardware
+
+Concurrency
+-----------
+
+N/A
+
+Limitations
+-----------
+
+The slave select (SS) is not automatically inserted during read/write/transfer,
+user must use I/O to control the devices' SS.
+
+Known issues and workarounds
+----------------------------
+
+N/A
+
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/documentation/usart_sync.rst b/Examples/AS5048A_test/AS5048A_test/hal/documentation/usart_sync.rst
new file mode 100644
index 0000000..15e4b13
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/documentation/usart_sync.rst
@@ -0,0 +1,58 @@
+The USART Synchronous Driver
+============================
+
+The universal synchronous and asynchronous receiver and transmitter
+(USART) is usually used to transfer data from one device to the other.
+
+User can set action for flow control pins by function usart_set_flow_control,
+if the flow control is enabled. All the available states are defined in union
+usart_flow_control_state.
+
+Note that user can set state of flow control pins only if automatic support of
+the flow control is not supported by the hardware.
+
+Features
+--------
+
+* Initialization/de-initialization
+* Enabling/disabling
+* Control of the following settings:
+
+ * Baudrate
+ * UART or USRT communication mode
+ * Character size
+ * Data order
+ * Flow control
+* Data transfer: transmission, reception
+
+Applications
+------------
+
+They are commonly used in a terminal application or low-speed communication
+between devices.
+
+Dependencies
+------------
+
+USART capable hardware.
+
+Concurrency
+-----------
+
+Write buffer should not be changed while data is being sent.
+
+
+Limitations
+-----------
+
+* The driver does not support 9-bit character size.
+* The "USART with ISO7816" mode can be only used in ISO7816 capable devices.
+ And the SCK pin can't be set directly. Application can use a GCLK output PIN
+ to generate SCK. For example to communicate with a SMARTCARD with ISO7816
+ (F = 372 ; D = 1), and baudrate=9600, the SCK pin output frequency should be
+ config as 372*9600=3571200Hz. More information can be refer to ISO7816 Specification.
+
+Known issues and workarounds
+----------------------------
+
+N/A
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hal_atomic.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hal_atomic.h
new file mode 100644
index 0000000..82151fc
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hal_atomic.h
@@ -0,0 +1,120 @@
+/**
+ * \file
+ *
+ * \brief Critical sections related functionality declaration.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _HAL_ATOMIC_H_INCLUDED
+#define _HAL_ATOMIC_H_INCLUDED
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \addtogroup doc_driver_hal_helper_atomic
+ *
+ *@{
+ */
+
+/**
+ * \brief Type for the register holding global interrupt enable flag
+ */
+typedef uint32_t hal_atomic_t;
+
+/**
+ * \brief Helper macro for entering critical sections
+ *
+ * This macro is recommended to be used instead of a direct call
+ * hal_enterCritical() function to enter critical
+ * sections. No semicolon is required after the macro.
+ *
+ * \section atomic_usage Usage Example
+ * \code
+ * CRITICAL_SECTION_ENTER()
+ * Critical code
+ * CRITICAL_SECTION_LEAVE()
+ * \endcode
+ */
+#define CRITICAL_SECTION_ENTER() \
+ { \
+ volatile hal_atomic_t __atomic; \
+ atomic_enter_critical(&__atomic);
+
+/**
+ * \brief Helper macro for leaving critical sections
+ *
+ * This macro is recommended to be used instead of a direct call
+ * hal_leaveCritical() function to leave critical
+ * sections. No semicolon is required after the macro.
+ */
+#define CRITICAL_SECTION_LEAVE() \
+ atomic_leave_critical(&__atomic); \
+ }
+
+/**
+ * \brief Disable interrupts, enter critical section
+ *
+ * Disables global interrupts. Supports nested critical sections,
+ * so that global interrupts are only re-enabled
+ * upon leaving the outermost nested critical section.
+ *
+ * \param[out] atomic The pointer to a variable to store the value of global
+ * interrupt enable flag
+ */
+void atomic_enter_critical(hal_atomic_t volatile *atomic);
+
+/**
+ * \brief Exit atomic section
+ *
+ * Enables global interrupts. Supports nested critical sections,
+ * so that global interrupts are only re-enabled
+ * upon leaving the outermost nested critical section.
+ *
+ * \param[in] atomic The pointer to a variable, which stores the latest stored
+ * value of the global interrupt enable flag
+ */
+void atomic_leave_critical(hal_atomic_t volatile *atomic);
+
+/**
+ * \brief Retrieve the current driver version
+ *
+ * \return Current driver version.
+ */
+uint32_t atomic_get_version(void);
+/**@}*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _HAL_ATOMIC_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hal_cache.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hal_cache.h
new file mode 100644
index 0000000..071486b
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hal_cache.h
@@ -0,0 +1,96 @@
+/**
+ * \file
+ *
+ * \brief HAL cache functionality implementation.
+ *
+ * Copyright (c)2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+/*
+ * Support and FAQ: visit Microchip Support
+ */
+
+#ifndef HAL_CACHE_H_
+#define HAL_CACHE_H_
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \brief Enable cache module
+ *
+ * \param[in] pointer pointing to the starting address of cache module
+ *
+ * \return status of operation
+ */
+int32_t cache_enable(const void *hw);
+
+/**
+ * \brief Disable cache module
+ *
+ * \param[in] pointer pointing to the starting address of cache module
+ *
+ * \return status of operation
+ */
+int32_t cache_disable(const void *hw);
+
+/**
+ * \brief Initialize cache module
+ *
+ * This function initialize cache module configuration.
+ *
+ * \return status of operation
+ */
+int32_t cache_init(void);
+
+/**
+ * \brief Configure cache module
+ *
+ * \param[in] pointer pointing to the starting address of cache module
+ * \param[in] cache configuration structure pointer
+ *
+ * \return status of operation
+ */
+int32_t cache_configure(const void *hw, struct _cache_cfg *cache);
+
+/**
+ * \brief Invalidate entire cache entries
+ *
+ * \param[in] pointer pointing to the starting address of cache module
+ *
+ * \return status of operation
+ */
+int32_t cache_invalidate_all(const void *hw);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* HAL_CACHE_H_ */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hal_delay.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hal_delay.h
new file mode 100644
index 0000000..9d4aa5c
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hal_delay.h
@@ -0,0 +1,89 @@
+/**
+ * \file
+ *
+ * \brief HAL delay related functionality declaration.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#include
+#include
+#include
+
+#ifndef _HAL_DELAY_H_INCLUDED
+#define _HAL_DELAY_H_INCLUDED
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \addtogroup doc_driver_hal_delay Delay Driver
+ *
+ *@{
+ */
+
+/**
+ * \brief Initialize Delay driver
+ *
+ * \param[in] hw The pointer to hardware instance
+ */
+void delay_init(void *const hw);
+
+/**
+ * \brief Perform delay in us
+ *
+ * This function performs delay for the given amount of microseconds.
+ *
+ * \param[in] us The amount delay in us
+ */
+void delay_us(const uint16_t us);
+
+/**
+ * \brief Perform delay in ms
+ *
+ * This function performs delay for the given amount of milliseconds.
+ *
+ * \param[in] ms The amount delay in ms
+ */
+void delay_ms(const uint16_t ms);
+
+/**
+ * \brief Retrieve the current driver version
+ *
+ * \return Current driver version.
+ */
+uint32_t delay_get_version(void);
+
+/**@}*/
+#ifdef __cplusplus
+}
+#endif
+#endif /* _HAL_DELAY_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hal_gpio.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hal_gpio.h
new file mode 100644
index 0000000..fbfa2d4
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hal_gpio.h
@@ -0,0 +1,201 @@
+/**
+ * \file
+ *
+ * \brief Port
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ */
+#ifndef _HAL_GPIO_INCLUDED_
+#define _HAL_GPIO_INCLUDED_
+
+#include
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \brief Set gpio pull mode
+ *
+ * Set pin pull mode, non existing pull modes throws an fatal assert
+ *
+ * \param[in] pin The pin number for device
+ * \param[in] pull_mode GPIO_PULL_DOWN = Pull pin low with internal resistor
+ * GPIO_PULL_UP = Pull pin high with internal resistor
+ * GPIO_PULL_OFF = Disable pin pull mode
+ */
+static inline void gpio_set_pin_pull_mode(const uint8_t pin, const enum gpio_pull_mode pull_mode)
+{
+ _gpio_set_pin_pull_mode((enum gpio_port)GPIO_PORT(pin), pin & 0x1F, pull_mode);
+}
+
+/**
+ * \brief Set pin function
+ *
+ * Select which function a pin will be used for
+ *
+ * \param[in] pin The pin number for device
+ * \param[in] function The pin function is given by a 32-bit wide bitfield
+ * found in the header files for the device
+ *
+ */
+static inline void gpio_set_pin_function(const uint32_t pin, uint32_t function)
+{
+ _gpio_set_pin_function(pin, function);
+}
+
+/**
+ * \brief Set port data direction
+ *
+ * Select if the pin data direction is input, output or disabled.
+ * If disabled state is not possible, this function throws an assert.
+ *
+ * \param[in] port Ports are grouped into groups of maximum 32 pins,
+ * GPIO_PORTA = group 0, GPIO_PORTB = group 1, etc
+ * \param[in] mask Bit mask where 1 means apply direction setting to the
+ * corresponding pin
+ * \param[in] direction GPIO_DIRECTION_IN = Data direction in
+ * GPIO_DIRECTION_OUT = Data direction out
+ * GPIO_DIRECTION_OFF = Disables the pin
+ * (low power state)
+ */
+static inline void gpio_set_port_direction(const enum gpio_port port, const uint32_t mask,
+ const enum gpio_direction direction)
+{
+ _gpio_set_direction(port, mask, direction);
+}
+
+/**
+ * \brief Set gpio data direction
+ *
+ * Select if the pin data direction is input, output or disabled.
+ * If disabled state is not possible, this function throws an assert.
+ *
+ * \param[in] pin The pin number for device
+ * \param[in] direction GPIO_DIRECTION_IN = Data direction in
+ * GPIO_DIRECTION_OUT = Data direction out
+ * GPIO_DIRECTION_OFF = Disables the pin
+ * (low power state)
+ */
+static inline void gpio_set_pin_direction(const uint8_t pin, const enum gpio_direction direction)
+{
+ _gpio_set_direction((enum gpio_port)GPIO_PORT(pin), 1U << GPIO_PIN(pin), direction);
+}
+
+/**
+ * \brief Set port level
+ *
+ * Sets output level on the pins defined by the bit mask
+ *
+ * \param[in] port Ports are grouped into groups of maximum 32 pins,
+ * GPIO_PORTA = group 0, GPIO_PORTB = group 1, etc
+ * \param[in] mask Bit mask where 1 means apply port level to the corresponding
+ * pin
+ * \param[in] level true = Pin levels set to "high" state
+ * false = Pin levels set to "low" state
+ */
+static inline void gpio_set_port_level(const enum gpio_port port, const uint32_t mask, const bool level)
+{
+ _gpio_set_level(port, mask, level);
+}
+
+/**
+ * \brief Set gpio level
+ *
+ * Sets output level on a pin
+ *
+ * \param[in] pin The pin number for device
+ * \param[in] level true = Pin level set to "high" state
+ * false = Pin level set to "low" state
+ */
+static inline void gpio_set_pin_level(const uint8_t pin, const bool level)
+{
+ _gpio_set_level((enum gpio_port)GPIO_PORT(pin), 1U << GPIO_PIN(pin), level);
+}
+
+/**
+ * \brief Toggle out level on pins
+ *
+ * Toggle the pin levels on pins defined by bit mask
+ *
+ * \param[in] port Ports are grouped into groups of maximum 32 pins,
+ * GPIO_PORTA = group 0, GPIO_PORTB = group 1, etc
+ * \param[in] mask Bit mask where 1 means toggle pin level to the corresponding
+ * pin
+ */
+static inline void gpio_toggle_port_level(const enum gpio_port port, const uint32_t mask)
+{
+ _gpio_toggle_level(port, mask);
+}
+
+/**
+ * \brief Toggle output level on pin
+ *
+ * Toggle the pin levels on pins defined by bit mask
+ *
+ * \param[in] pin The pin number for device
+ */
+static inline void gpio_toggle_pin_level(const uint8_t pin)
+{
+ _gpio_toggle_level((enum gpio_port)GPIO_PORT(pin), 1U << GPIO_PIN(pin));
+}
+
+/**
+ * \brief Get input level on pins
+ *
+ * Read the input level on pins connected to a port
+ *
+ * \param[in] port Ports are grouped into groups of maximum 32 pins,
+ * GPIO_PORTA = group 0, GPIO_PORTB = group 1, etc
+ */
+static inline uint32_t gpio_get_port_level(const enum gpio_port port)
+{
+ return _gpio_get_level(port);
+}
+
+/**
+ * \brief Get level on pin
+ *
+ * Reads the level on pins connected to a port
+ *
+ * \param[in] pin The pin number for device
+ */
+static inline bool gpio_get_pin_level(const uint8_t pin)
+{
+ return (bool)(_gpio_get_level((enum gpio_port)GPIO_PORT(pin)) & (0x01U << GPIO_PIN(pin)));
+}
+/**
+ * \brief Get current driver version
+ */
+uint32_t gpio_get_version(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hal_init.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hal_init.h
new file mode 100644
index 0000000..d7bc6fe
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hal_init.h
@@ -0,0 +1,72 @@
+/**
+ * \file
+ *
+ * \brief HAL initialization related functionality declaration.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _HAL_INIT_H_INCLUDED
+#define _HAL_INIT_H_INCLUDED
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \addtogroup doc_driver_hal_helper_init Init Driver
+ *
+ *@{
+ */
+
+/**
+ * \brief Initialize the hardware abstraction layer
+ *
+ * This function calls the various initialization functions.
+ * Currently the following initialization functions are supported:
+ * - System clock initialization
+ */
+static inline void init_mcu(void)
+{
+ _init_chip();
+}
+
+/**
+ * \brief Retrieve the current driver version
+ *
+ * \return Current driver version.
+ */
+uint32_t init_get_version(void);
+
+/**@}*/
+#ifdef __cplusplus
+}
+#endif
+#endif /* _HAL_INIT_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hal_io.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hal_io.h
new file mode 100644
index 0000000..f50401d
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hal_io.h
@@ -0,0 +1,110 @@
+/**
+ * \file
+ *
+ * \brief I/O related functionality declaration.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _HAL_IO_INCLUDED
+#define _HAL_IO_INCLUDED
+
+/**
+ * \addtogroup doc_driver_hal_helper_io I/O Driver
+ *
+ *@{
+ */
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \brief I/O descriptor
+ *
+ * The I/O descriptor forward declaration.
+ */
+struct io_descriptor;
+
+/**
+ * \brief I/O write function pointer type
+ */
+typedef int32_t (*io_write_t)(struct io_descriptor *const io_descr, const uint8_t *const buf, const uint16_t length);
+
+/**
+ * \brief I/O read function pointer type
+ */
+typedef int32_t (*io_read_t)(struct io_descriptor *const io_descr, uint8_t *const buf, const uint16_t length);
+
+/**
+ * \brief I/O descriptor
+ */
+struct io_descriptor {
+ io_write_t write; /*! The write function pointer. */
+ io_read_t read; /*! The read function pointer. */
+};
+
+/**
+ * \brief I/O write interface
+ *
+ * This function writes up to \p length of bytes to a given I/O descriptor.
+ * It returns the number of bytes actually write.
+ *
+ * \param[in] descr An I/O descriptor to write
+ * \param[in] buf The buffer pointer to story the write data
+ * \param[in] length The number of bytes to write
+ *
+ * \return The number of bytes written
+ */
+int32_t io_write(struct io_descriptor *const io_descr, const uint8_t *const buf, const uint16_t length);
+
+/**
+ * \brief I/O read interface
+ *
+ * This function reads up to \p length bytes from a given I/O descriptor, and
+ * stores it in the buffer pointed to by \p buf. It returns the number of bytes
+ * actually read.
+ *
+ * \param[in] descr An I/O descriptor to read
+ * \param[in] buf The buffer pointer to story the read data
+ * \param[in] length The number of bytes to read
+ *
+ * \return The number of bytes actually read. This number can be less than the
+ * requested length. E.g., in a driver that uses ring buffer for
+ * reception, it may depend on the availability of data in the
+ * ring buffer.
+ */
+int32_t io_read(struct io_descriptor *const io_descr, uint8_t *const buf, const uint16_t length);
+
+#ifdef __cplusplus
+}
+#endif
+/**@}*/
+#endif /* _HAL_IO_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hal_sleep.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hal_sleep.h
new file mode 100644
index 0000000..b90ef6a
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hal_sleep.h
@@ -0,0 +1,74 @@
+/**
+ * \file
+ *
+ * \brief Sleep related functionality declaration.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _HAL_SLEEP_H_INCLUDED
+#define _HAL_SLEEP_H_INCLUDED
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \addtogroup doc_driver_hal_helper_sleep
+ *
+ *@{
+ */
+
+/**
+ * \brief Set the sleep mode of the device and put the MCU to sleep
+ *
+ * For an overview of which systems are disabled in sleep for the different
+ * sleep modes, see the data sheet.
+ *
+ * \param[in] mode Sleep mode to use
+ *
+ * \return The status of a sleep request
+ * \retval -1 The requested sleep mode was invalid or not available
+ * \retval 0 The operation completed successfully, returned after leaving the
+ * sleep
+ */
+int sleep(const uint8_t mode);
+
+/**
+ * \brief Retrieve the current driver version
+ *
+ * \return Current driver version.
+ */
+uint32_t sleep_get_version(void);
+/**@}*/
+#ifdef __cplusplus
+}
+#endif
+#endif /* _HAL_SLEEP_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hal_spi_m_sync.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hal_spi_m_sync.h
new file mode 100644
index 0000000..5d04055
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hal_spi_m_sync.h
@@ -0,0 +1,221 @@
+/**
+ * \file
+ *
+ * \brief SPI related functionality declaration.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _HAL_SPI_M_SYNC_H_INCLUDED
+#define _HAL_SPI_M_SYNC_H_INCLUDED
+
+#include
+#include
+
+/**
+ * \addtogroup doc_driver_hal_spi_master_sync
+ *
+ * @{
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** \brief SPI HAL driver struct for polling mode
+ *
+ */
+struct spi_m_sync_descriptor {
+ struct _spi_m_sync_hpl_interface *func;
+ /** SPI device instance */
+ struct _spi_sync_dev dev;
+ /** I/O read/write */
+ struct io_descriptor io;
+ /** Flags for HAL driver */
+ uint16_t flags;
+};
+
+/** \brief Set the SPI HAL instance function pointer for HPL APIs.
+ *
+ * Set SPI HAL instance function pointer for HPL APIs.
+ *
+ * \param[in] spi Pointer to the HAL SPI instance.
+ * \param[in] func Pointer to the HPL api structure.
+ *
+ */
+void spi_m_sync_set_func_ptr(struct spi_m_sync_descriptor *spi, void *const func);
+
+/** \brief Initialize SPI HAL instance and hardware for polling mode
+ *
+ * Initialize SPI HAL with polling mode.
+ *
+ * \param[in] spi Pointer to the HAL SPI instance.
+ * \param[in] hw Pointer to the hardware base.
+ *
+ * \return Operation status.
+ * \retval ERR_NONE Success.
+ * \retval ERR_INVALID_DATA Error, initialized.
+ */
+int32_t spi_m_sync_init(struct spi_m_sync_descriptor *spi, void *const hw);
+
+/** \brief Deinitialize the SPI HAL instance and hardware
+ *
+ * Abort transfer, disable and reset SPI, deinit software.
+ *
+ * \param[in] spi Pointer to the HAL SPI instance.
+ *
+ * \return Operation status.
+ * \retval ERR_NONE Success.
+ * \retval <0 Error code.
+ */
+void spi_m_sync_deinit(struct spi_m_sync_descriptor *spi);
+
+/** \brief Enable SPI
+ *
+ * \param[in] spi Pointer to the HAL SPI instance.
+ *
+ * \return Operation status.
+ * \retval ERR_NONE Success.
+ * \retval <0 Error code.
+ */
+void spi_m_sync_enable(struct spi_m_sync_descriptor *spi);
+
+/** \brief Disable SPI
+ *
+ * \param[in] spi Pointer to the HAL SPI instance.
+ *
+ * \return Operation status.
+ * \retval ERR_NONE Success.
+ * \retval <0 Error code.
+ */
+void spi_m_sync_disable(struct spi_m_sync_descriptor *spi);
+
+/** \brief Set SPI baudrate
+ *
+ * Works if SPI is initialized as master, it sets the baudrate.
+ *
+ * \param[in] spi Pointer to the HAL SPI instance.
+ * \param[in] baud_val The target baudrate value
+ * (see "baudrate calculation" for calculating the value).
+ *
+ * \return Operation status.
+ * \retval ERR_NONE Success.
+ * \retval ERR_BUSY Busy
+ * \retval ERR_INVALID_ARG The baudrate is not supported.
+ */
+int32_t spi_m_sync_set_baudrate(struct spi_m_sync_descriptor *spi, const uint32_t baud_val);
+
+/** \brief Set SPI mode
+ *
+ * Set the SPI transfer mode (\ref spi_transfer_mode),
+ * which controls the clock polarity and clock phase:
+ * - Mode 0: leading edge is rising edge, data sample on leading edge.
+ * - Mode 1: leading edge is rising edge, data sample on trailing edge.
+ * - Mode 2: leading edge is falling edge, data sample on leading edge.
+ * - Mode 3: leading edge is falling edge, data sample on trailing edge.
+ *
+ * \param[in] spi Pointer to the HAL SPI instance.
+ * \param[in] mode The mode (0~3).
+ *
+ * \return Operation status.
+ * \retval ERR_NONE Success.
+ * \retval ERR_BUSY Busy
+ * \retval ERR_INVALID_ARG The mode is not supported.
+ */
+int32_t spi_m_sync_set_mode(struct spi_m_sync_descriptor *spi, const enum spi_transfer_mode mode);
+
+/** \brief Set SPI transfer character size in number of bits
+ *
+ * The character size (\ref spi_char_size) influence the way the data is
+ * sent/received.
+ * For char size <= 8-bit, data is stored byte by byte.
+ * For char size between 9-bit ~ 16-bit, data is stored in 2-byte length.
+ * Note that the default and recommended char size is 8-bit since it's
+ * supported by all system.
+ *
+ * \param[in] spi Pointer to the HAL SPI instance.
+ * \param[in] char_size The char size (~16, recommended 8).
+ *
+ * \return Operation status.
+ * \retval ERR_NONE Success.
+ * \retval ERR_BUSY Busy
+ * \retval ERR_INVALID_ARG The char size is not supported.
+ */
+int32_t spi_m_sync_set_char_size(struct spi_m_sync_descriptor *spi, const enum spi_char_size char_size);
+
+/** \brief Set SPI transfer data order
+ *
+ * \param[in] spi Pointer to the HAL SPI instance.
+ * \param[in] dord The data order: send LSB/MSB first.
+ *
+ * \return Operation status.
+ * \retval ERR_NONE Success.
+ * \retval ERR_BUSY Busy
+ * \retval ERR_INVALID_ARG The data order is not supported.
+ */
+int32_t spi_m_sync_set_data_order(struct spi_m_sync_descriptor *spi, const enum spi_data_order dord);
+
+/** \brief Perform the SPI data transfer (TX and RX) in polling way
+ *
+ * Activate CS, do TX and RX and deactivate CS. It blocks.
+ *
+ * \param[in, out] spi Pointer to the HAL SPI instance.
+ * \param[in] xfer Pointer to the transfer information (\ref spi_xfer).
+ *
+ * \retval size Success.
+ * \retval >=0 Timeout, with number of characters transferred.
+ * \retval ERR_BUSY SPI is busy
+ */
+int32_t spi_m_sync_transfer(struct spi_m_sync_descriptor *spi, const struct spi_xfer *xfer);
+
+/**
+ * \brief Return the I/O descriptor for this SPI instance
+ *
+ * This function will return an I/O instance for this SPI driver instance.
+ *
+ * \param[in] spi An SPI master descriptor, which is used to communicate through
+ * SPI
+ * \param[in, out] io A pointer to an I/O descriptor pointer type
+ *
+ * \retval ERR_NONE
+ */
+int32_t spi_m_sync_get_io_descriptor(struct spi_m_sync_descriptor *const spi, struct io_descriptor **io);
+
+/** \brief Retrieve the current driver version
+ *
+ * \return Current driver version.
+ */
+uint32_t spi_m_sync_get_version(void);
+
+/**@}*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ifndef _HAL_SPI_M_SYNC_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hal_usart_sync.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hal_usart_sync.h
new file mode 100644
index 0000000..1ef22fc
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hal_usart_sync.h
@@ -0,0 +1,247 @@
+/**
+ * \file
+ *
+ * \brief USART related functionality declaration.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _HAL_SYNC_USART_H_INCLUDED
+#define _HAL_SYNC_USART_H_INCLUDED
+
+#include "hal_io.h"
+#include
+
+/**
+ * \addtogroup doc_driver_hal_usart_sync
+ *
+ * @{
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \brief Synchronous USART descriptor
+ */
+struct usart_sync_descriptor {
+ struct io_descriptor io;
+ struct _usart_sync_device device;
+};
+
+/**
+ * \brief Initialize USART interface
+ *
+ * This function initializes the given I/O descriptor to be used
+ * as USART interface descriptor.
+ * It checks if the given hardware is not initialized and
+ * if the given hardware is permitted to be initialized.
+ *
+ * \param[out] descr A USART descriptor which is used to communicate via USART
+ * \param[in] hw The pointer to hardware instance
+ * \param[in] func The pointer to as set of functions pointers
+ *
+ * \return Initialization status.
+ */
+int32_t usart_sync_init(struct usart_sync_descriptor *const descr, void *const hw, void *const func);
+
+/**
+ * \brief Deinitialize USART interface
+ *
+ * This function deinitializes the given I/O descriptor.
+ * It checks if the given hardware is initialized and
+ * if the given hardware is permitted to be deinitialized.
+ *
+ * \param[in] descr A USART descriptor which is used to communicate via USART
+ *
+ * \return De-initialization status.
+ */
+int32_t usart_sync_deinit(struct usart_sync_descriptor *const descr);
+
+/**
+ * \brief Enable USART interface
+ *
+ * Enables the USART interface
+ *
+ * \param[in] descr A USART descriptor which is used to communicate via USART
+ *
+ * \return Enabling status.
+ */
+int32_t usart_sync_enable(struct usart_sync_descriptor *const descr);
+
+/**
+ * \brief Disable USART interface
+ *
+ * Disables the USART interface
+ *
+ * \param[in] descr A USART descriptor which is used to communicate via USART
+ *
+ * \return Disabling status.
+ */
+int32_t usart_sync_disable(struct usart_sync_descriptor *const descr);
+
+/**
+ * \brief Retrieve I/O descriptor
+ *
+ * This function retrieves the I/O descriptor of the given USART descriptor.
+ *
+ * \param[in] descr A USART descriptor which is used to communicate via USART
+ * \param[out] io An I/O descriptor to retrieve
+ *
+ * \return The status of the I/O descriptor retrieving.
+ */
+int32_t usart_sync_get_io_descriptor(struct usart_sync_descriptor *const descr, struct io_descriptor **io);
+
+/**
+ * \brief Specify action for flow control pins
+ *
+ * This function sets the action (or state) for the flow control pins
+ * if the flow control is enabled.
+ * It sets the state of flow control pins only if the automatic support of
+ * the flow control is not supported by the hardware.
+ *
+ * \param[in] descr A USART descriptor which is used to communicate via USART
+ * \param[in] state A state to set the flow control pins
+ *
+ * \return The status of flow control action setup.
+ */
+int32_t usart_sync_set_flow_control(struct usart_sync_descriptor *const descr,
+ const union usart_flow_control_state state);
+
+/**
+ * \brief Set USART baud rate
+ *
+ * \param[in] descr A USART descriptor which is used to communicate via USART
+ * \param[in] baud_rate A baud rate to set
+ *
+ * \return The status of baud rate setting.
+ */
+int32_t usart_sync_set_baud_rate(struct usart_sync_descriptor *const descr, const uint32_t baud_rate);
+
+/**
+ * \brief Set USART data order
+ *
+ * \param[in] descr A USART descriptor which is used to communicate via USART
+ * \param[in] data_order A data order to set
+ *
+ * \return The status of data order setting.
+ */
+int32_t usart_sync_set_data_order(struct usart_sync_descriptor *const descr, const enum usart_data_order data_order);
+
+/**
+ * \brief Set USART mode
+ *
+ * \param[in] descr A USART descriptor which is used to communicate via USART
+ * \param[in] mode A mode to set
+ *
+ * \return The status of mode setting.
+ */
+int32_t usart_sync_set_mode(struct usart_sync_descriptor *const descr, const enum usart_mode mode);
+
+/**
+ * \brief Set USART parity
+ *
+ * \param[in] descr A USART descriptor which is used to communicate via USART
+ * \param[in] parity A parity to set
+ *
+ * \return The status of parity setting.
+ */
+int32_t usart_sync_set_parity(struct usart_sync_descriptor *const descr, const enum usart_parity parity);
+
+/**
+ * \brief Set USART stop bits
+ *
+ * \param[in] descr A USART descriptor which is used to communicate via USART
+ * \param[in] stop_bits Stop bits to set
+ *
+ * \return The status of stop bits setting.
+ */
+int32_t usart_sync_set_stopbits(struct usart_sync_descriptor *const descr, const enum usart_stop_bits stop_bits);
+
+/**
+ * \brief Set USART character size
+ *
+ * \param[in] descr A USART descriptor which is used to communicate via USART
+ * \param[in] size A character size to set
+ *
+ * \return The status of character size setting.
+ */
+int32_t usart_sync_set_character_size(struct usart_sync_descriptor *const descr, const enum usart_character_size size);
+
+/**
+ * \brief Retrieve the state of flow control pins
+ *
+ * This function retrieves the of flow control pins
+ * if the flow control is enabled.
+ * Function can return USART_FLOW_CONTROL_STATE_UNAVAILABLE in case
+ * if the flow control is done by the hardware
+ * and the pins state cannot be read out.
+ *
+ * \param[in] descr A USART descriptor which is used to communicate via USART
+ * \param[out] state The state of flow control pins
+ *
+ * \return The status of flow control state reading.
+ */
+int32_t usart_sync_flow_control_status(const struct usart_sync_descriptor *const descr,
+ union usart_flow_control_state *const state);
+
+/**
+ * \brief Check if the USART transmitter is empty
+ *
+ * \param[in] descr A USART descriptor which is used to communicate via USART
+ *
+ * \return The status of USART TX empty checking.
+ * \retval 0 The USART transmitter is not empty
+ * \retval 1 The USART transmitter is empty
+ */
+int32_t usart_sync_is_tx_empty(const struct usart_sync_descriptor *const descr);
+
+/**
+ * \brief Check if the USART receiver is not empty
+ *
+ * \param[in] descr A USART descriptor which is used to communicate via USART
+ *
+ * \return The status of USART RX empty checking.
+ * \retval 1 The USART receiver is not empty
+ * \retval 0 The USART receiver is empty
+ */
+int32_t usart_sync_is_rx_not_empty(const struct usart_sync_descriptor *const descr);
+
+/**
+ * \brief Retrieve the current driver version
+ *
+ * \return Current driver version.
+ */
+uint32_t usart_sync_get_version(void);
+
+#ifdef __cplusplus
+}
+#endif
+/**@}*/
+#endif /* _HAL_SYNC_USART_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_cmcc.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_cmcc.h
new file mode 100644
index 0000000..cb26091
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_cmcc.h
@@ -0,0 +1,277 @@
+/**
+ * \file
+ *
+ * \brief Generic CMCC(Cortex M Cache Controller) related functionality.
+ *
+ * Copyright (c)2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+/*
+ * Support and FAQ: visit Microchip Support
+ */
+
+#ifndef HPL_CMCC_H_
+#define HPL_CMCC_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+#include
+
+/**
+ * \Cache driver MACROS
+ */
+#define CMCC_DISABLE 0U
+#define CMCC_ENABLE 1U
+#define IS_CMCC_DISABLED 0U
+#define IS_CMCC_ENABLED 1U
+#define CMCC_WAY_NOS 4U
+#define CMCC_LINE_NOS 64U
+#define CMCC_MONITOR_DISABLE 0U
+
+/**
+ * \brief Cache size configurations
+ */
+enum conf_cache_size { CONF_CSIZE_1KB = 0u, CONF_CSIZE_2KB, CONF_CSIZE_4KB };
+
+/**
+ * \brief Way Numbers
+ */
+enum way_num_index { WAY0 = 1u, WAY1 = 2u, WAY2 = 4u, WAY3 = 8 };
+
+/**
+ * \brief Cache monitor configurations
+ */
+enum conf_cache_monitor { CYCLE_COUNT = 0u, IHIT_COUNT, DHIT_COUNT };
+
+/**
+ * \brief Cache configuration structure
+ */
+struct _cache_cfg {
+ enum conf_cache_size cache_size;
+ bool data_cache_disable;
+ bool inst_cache_disable;
+ bool gclk_gate_disable;
+};
+
+/**
+ * \brief Cache enable status
+ */
+static inline bool _is_cache_enabled(const void *hw)
+{
+ return (hri_cmcc_get_SR_CSTS_bit(hw) == IS_CMCC_ENABLED ? true : false);
+}
+
+/**
+ * \brief Cache disable status
+ */
+static inline bool _is_cache_disabled(const void *hw)
+{
+ return (hri_cmcc_get_SR_CSTS_bit(hw) == IS_CMCC_DISABLED ? true : false);
+}
+
+/**
+ * \brief Cache enable
+ */
+static inline int32_t _cmcc_enable(const void *hw)
+{
+ int32_t return_value;
+
+ if (_is_cache_disabled(hw)) {
+ hri_cmcc_write_CTRL_reg(hw, CMCC_CTRL_CEN);
+ return_value = _is_cache_enabled(hw) == true ? ERR_NONE : ERR_FAILURE;
+ } else {
+ return_value = ERR_NO_CHANGE;
+ }
+
+ return return_value;
+}
+
+/**
+ * \brief Cache disable
+ */
+static inline int32_t _cmcc_disable(const void *hw)
+{
+ hri_cmcc_write_CTRL_reg(hw, (CMCC_DISABLE << CMCC_CTRL_CEN_Pos));
+ while (!(_is_cache_disabled(hw)))
+ ;
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Initialize Cache Module
+ *
+ * This function initialize low level cmcc module configuration.
+ *
+ * \return initialize status
+ */
+int32_t _cmcc_init(void);
+
+/**
+ * \brief Configure CMCC module
+ *
+ * \param[in] pointer pointing to the starting address of CMCC module
+ * \param[in] cache configuration structure pointer
+ *
+ * \return status of operation
+ */
+int32_t _cmcc_configure(const void *hw, struct _cache_cfg *cache_ctrl);
+
+/**
+ * \brief Enable data cache in CMCC module
+ *
+ * \param[in] pointer pointing to the starting address of CMCC module
+ * \param[in] boolean 1 -> Enable the data cache, 0 -> disable the data cache
+ *
+ * \return status of operation
+ */
+int32_t _cmcc_enable_data_cache(const void *hw, bool value);
+
+/**
+ * \brief Enable instruction cache in CMCC module
+ *
+ * \param[in] pointer pointing to the starting address of CMCC module
+ * \param[in] boolean 1 -> Enable the inst cache, 0 -> disable the inst cache
+ *
+ * \return status of operation
+ */
+int32_t _cmcc_enable_inst_cache(const void *hw, bool value);
+
+/**
+ * \brief Enable clock gating in CMCC module
+ *
+ * \param[in] pointer pointing to the starting address of CMCC module
+ * \param[in] boolean 1 -> Enable the clock gate, 0 -> disable the clock gate
+ *
+ * \return status of operation
+ */
+int32_t _cmcc_enable_clock_gating(const void *hw, bool value);
+
+/**
+ * \brief Configure the cache size in CMCC module
+ *
+ * \param[in] pointer pointing to the starting address of CMCC module
+ * \param[in] element from cache size configuration enumerator
+ * 0->1K, 1->2K, 2->4K(default)
+ *
+ * \return status of operation
+ */
+int32_t _cmcc_configure_cache_size(const void *hw, enum conf_cache_size size);
+
+/**
+ * \brief Lock the mentioned WAY in CMCC module
+ *
+ * \param[in] pointer pointing to the starting address of CMCC module
+ * \param[in] element from "way_num_index" enumerator
+ *
+ * \return status of operation
+ */
+int32_t _cmcc_lock_way(const void *hw, enum way_num_index);
+
+/**
+ * \brief Unlock the mentioned WAY in CMCC module
+ *
+ * \param[in] pointer pointing to the starting address of CMCC module
+ * \param[in] element from "way_num_index" enumerator
+ *
+ * \return status of operation
+ */
+int32_t _cmcc_unlock_way(const void *hw, enum way_num_index);
+
+/**
+ * \brief Invalidate the mentioned cache line in CMCC module
+ *
+ * \param[in] pointer pointing to the starting address of CMCC module
+ * \param[in] element from "way_num" enumerator (valid arg is 0-3)
+ * \param[in] line number (valid arg is 0-63 as each way will have 64 lines)
+ *
+ * \return status of operation
+ */
+int32_t _cmcc_invalidate_by_line(const void *hw, uint8_t way_num, uint8_t line_num);
+
+/**
+ * \brief Invalidate entire cache entries in CMCC module
+ *
+ * \param[in] pointer pointing to the starting address of CMCC module
+ *
+ * \return status of operation
+ */
+int32_t _cmcc_invalidate_all(const void *hw);
+
+/**
+ * \brief Configure cache monitor in CMCC module
+ *
+ * \param[in] pointer pointing to the starting address of CMCC module
+ * \param[in] element from cache monitor configurations enumerator
+ *
+ * \return status of operation
+ */
+int32_t _cmcc_configure_monitor(const void *hw, enum conf_cache_monitor monitor_cfg);
+
+/**
+ * \brief Enable cache monitor in CMCC module
+ *
+ * \param[in] pointer pointing to the starting address of CMCC module
+ *
+ * \return status of operation
+ */
+int32_t _cmcc_enable_monitor(const void *hw);
+
+/**
+ * \brief Disable cache monitor in CMCC module
+ *
+ * \param[in] pointer pointing to the starting address of CMCC module
+ *
+ * \return status of operation
+ */
+int32_t _cmcc_disable_monitor(const void *hw);
+
+/**
+ * \brief Reset cache monitor in CMCC module
+ *
+ * \param[in] pointer pointing to the starting address of CMCC module
+ *
+ * \return status of operation
+ */
+int32_t _cmcc_reset_monitor(const void *hw);
+
+/**
+ * \brief Get cache monitor event counter value from CMCC module
+ *
+ * \param[in] pointer pointing to the starting address of CMCC module
+ *
+ * \return event counter value
+ */
+uint32_t _cmcc_get_monitor_event_count(const void *hw);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* HPL_CMCC_H_ */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_core.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_core.h
new file mode 100644
index 0000000..9324c43
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_core.h
@@ -0,0 +1,56 @@
+/**
+ * \file
+ *
+ * \brief CPU core related functionality declaration.
+ *
+ * Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _HPL_CORE_H_INCLUDED
+#define _HPL_CORE_H_INCLUDED
+
+/**
+ * \addtogroup HPL Core
+ *
+ * \section hpl_core_rev Revision History
+ * - v1.0.0 Initial Release
+ *
+ *@{
+ */
+
+#include "hpl_core_port.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+/**@}*/
+#endif /* _HPL_CORE_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_delay.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_delay.h
new file mode 100644
index 0000000..a0f1ac8
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_delay.h
@@ -0,0 +1,97 @@
+/**
+ * \file
+ *
+ * \brief Delay related functionality declaration.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _HPL_DELAY_H_INCLUDED
+#define _HPL_DELAY_H_INCLUDED
+
+/**
+ * \addtogroup HPL Delay
+ *
+ * \section hpl_delay_rev Revision History
+ * - v1.0.0 Initial Release
+ *
+ *@{
+ */
+
+#ifndef _UNIT_TEST_
+#include
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \name HPL functions
+ */
+//@{
+
+/**
+ * \brief Initialize delay functionality
+ *
+ * \param[in] hw The pointer to hardware instance
+ */
+void _delay_init(void *const hw);
+
+/**
+ * \brief Retrieve the amount of cycles to delay for the given amount of us
+ *
+ * \param[in] us The amount of us to delay for
+ *
+ * \return The amount of cycles
+ */
+uint32_t _get_cycles_for_us(const uint16_t us);
+
+/**
+ * \brief Retrieve the amount of cycles to delay for the given amount of ms
+ *
+ * \param[in] ms The amount of ms to delay for
+ *
+ * \return The amount of cycles
+ */
+uint32_t _get_cycles_for_ms(const uint16_t ms);
+
+/**
+ * \brief Delay loop to delay n number of cycles
+ *
+ * \param[in] hw The pointer to hardware instance
+ * \param[in] cycles The amount of cycles to delay for
+ */
+void _delay_cycles(void *const hw, uint32_t cycles);
+//@}
+
+#ifdef __cplusplus
+}
+#endif
+/**@}*/
+#endif /* _HPL_DELAY_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_dma.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_dma.h
new file mode 100644
index 0000000..1e08434
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_dma.h
@@ -0,0 +1,176 @@
+/**
+ * \file
+ *
+ * \brief DMA related functionality declaration.
+ *
+ * Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _HPL_DMA_H_INCLUDED
+#define _HPL_DMA_H_INCLUDED
+
+/**
+ * \addtogroup HPL DMA
+ *
+ * \section hpl_dma_rev Revision History
+ * - v1.0.0 Initial Release
+ *
+ *@{
+ */
+
+#include
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct _dma_resource;
+
+/**
+ * \brief DMA callback types
+ */
+enum _dma_callback_type { DMA_TRANSFER_COMPLETE_CB, DMA_TRANSFER_ERROR_CB };
+
+/**
+ * \brief DMA interrupt callbacks
+ */
+struct _dma_callbacks {
+ void (*transfer_done)(struct _dma_resource *resource);
+ void (*error)(struct _dma_resource *resource);
+};
+
+/**
+ * \brief DMA resource structure
+ */
+struct _dma_resource {
+ struct _dma_callbacks dma_cb;
+ void * back;
+};
+
+/**
+ * \brief Initialize DMA
+ *
+ * This function does low level DMA configuration.
+ *
+ * \return initialize status
+ */
+int32_t _dma_init(void);
+
+/**
+ * \brief Set destination address
+ *
+ * \param[in] channel DMA channel to set destination address for
+ * \param[in] dst Destination address
+ *
+ * \return setting status
+ */
+int32_t _dma_set_destination_address(const uint8_t channel, const void *const dst);
+
+/**
+ * \brief Set source address
+ *
+ * \param[in] channel DMA channel to set source address for
+ * \param[in] src Source address
+ *
+ * \return setting status
+ */
+int32_t _dma_set_source_address(const uint8_t channel, const void *const src);
+
+/**
+ * \brief Set next descriptor address
+ *
+ * \param[in] current_channel Current DMA channel to set next descriptor address
+ * \param[in] next_channel Next DMA channel used as next descriptor
+ *
+ * \return setting status
+ */
+int32_t _dma_set_next_descriptor(const uint8_t current_channel, const uint8_t next_channel);
+
+/**
+ * \brief Enable/disable source address incrementation during DMA transaction
+ *
+ * \param[in] channel DMA channel to set source address for
+ * \param[in] enable True to enable, false to disable
+ *
+ * \return status of operation
+ */
+int32_t _dma_srcinc_enable(const uint8_t channel, const bool enable);
+
+/**
+ * \brief Enable/disable Destination address incrementation during DMA transaction
+ *
+ * \param[in] channel DMA channel to set destination address for
+ * \param[in] enable True to enable, false to disable
+ *
+ * \return status of operation
+ */
+int32_t _dma_dstinc_enable(const uint8_t channel, const bool enable);
+/**
+ * \brief Set the amount of data to be transfered per transaction
+ *
+ * \param[in] channel DMA channel to set data amount for
+ * \param[in] amount Data amount
+ *
+ * \return status of operation
+ */
+int32_t _dma_set_data_amount(const uint8_t channel, const uint32_t amount);
+
+/**
+ * \brief Trigger DMA transaction on the given channel
+ *
+ * \param[in] channel DMA channel to trigger transaction on
+ *
+ * \return status of operation
+ */
+int32_t _dma_enable_transaction(const uint8_t channel, const bool software_trigger);
+
+/**
+ * \brief Retrieves DMA resource structure
+ *
+ * \param[out] resource The resource to be retrieved
+ * \param[in] channel DMA channel to retrieve structure for
+ *
+ * \return status of operation
+ */
+int32_t _dma_get_channel_resource(struct _dma_resource **resource, const uint8_t channel);
+
+/**
+ * \brief Enable/disable DMA interrupt
+ *
+ * \param[in] channel DMA channel to enable/disable interrupt for
+ * \param[in] type The type of interrupt to disable/enable if applicable
+ * \param[in] state Enable or disable
+ */
+void _dma_set_irq_state(const uint8_t channel, const enum _dma_callback_type type, const bool state);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* HPL_DMA_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_gpio.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_gpio.h
new file mode 100644
index 0000000..5cdd387
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_gpio.h
@@ -0,0 +1,185 @@
+/**
+ * \file
+ *
+ * \brief Port related functionality declaration.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _HPL_GPIO_H_INCLUDED
+#define _HPL_GPIO_H_INCLUDED
+
+/**
+ * \addtogroup HPL Port
+ *
+ * \section hpl_port_rev Revision History
+ * - v1.0.0 Initial Release
+ *
+ *@{
+ */
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+/**
+ * \brief Macros for the pin and port group, lower 5
+ * bits stands for pin number in the group, higher 3
+ * bits stands for port group
+ */
+#define GPIO_PIN(n) (((n)&0x1Fu) << 0)
+#define GPIO_PORT(n) ((n) >> 5)
+#define GPIO(port, pin) ((((port)&0x7u) << 5) + ((pin)&0x1Fu))
+#define GPIO_PIN_FUNCTION_OFF 0xffffffff
+
+/**
+ * \brief PORT pull mode settings
+ */
+enum gpio_pull_mode { GPIO_PULL_OFF, GPIO_PULL_UP, GPIO_PULL_DOWN };
+
+/**
+ * \brief PORT direction settins
+ */
+enum gpio_direction { GPIO_DIRECTION_OFF, GPIO_DIRECTION_IN, GPIO_DIRECTION_OUT };
+
+/**
+ * \brief PORT group abstraction
+ */
+
+enum gpio_port { GPIO_PORTA, GPIO_PORTB, GPIO_PORTC, GPIO_PORTD, GPIO_PORTE };
+
+/**
+ * \name HPL functions
+ */
+//@{
+/**
+ * \brief Port initialization function
+ *
+ * Port initialization function should setup the port module based
+ * on a static configuration file, this function should normally
+ * not be called directly, but is a part of hal_init()
+ */
+void _gpio_init(void);
+
+/**
+ * \brief Set direction on port with mask
+ *
+ * Set data direction for each pin, or disable the pin
+ *
+ * \param[in] port Ports are grouped into groups of maximum 32 pins,
+ * GPIO_PORTA = group 0, GPIO_PORTB = group 1, etc
+ * \param[in] mask Bit mask where 1 means apply direction setting to the
+ * corresponding pin
+ * \param[in] direction GPIO_DIRECTION_OFF = set pin direction to input
+ * and disable input buffer to disable the pin
+ * GPIO_DIRECTION_IN = set pin direction to input
+ * and enable input buffer to enable the pin
+ * GPIO_DIRECTION_OUT = set pin direction to output
+ * and disable input buffer
+ */
+static inline void _gpio_set_direction(const enum gpio_port port, const uint32_t mask,
+ const enum gpio_direction direction);
+
+/**
+ * \brief Set output level on port with mask
+ *
+ * Sets output state on pin to high or low with pin masking
+ *
+ * \param[in] port Ports are grouped into groups of maximum 32 pins,
+ * GPIO_PORTA = group 0, GPIO_PORTB = group 1, etc
+ * \param[in] mask Bit mask where 1 means apply direction setting to
+ * the corresponding pin
+ * \param[in] level true = pin level is set to 1
+ * false = pin level is set to 0
+ */
+static inline void _gpio_set_level(const enum gpio_port port, const uint32_t mask, const bool level);
+
+/**
+ * \brief Change output level to the opposite with mask
+ *
+ * Change pin output level to the opposite with pin masking
+ *
+ * \param[in] port Ports are grouped into groups of maximum 32 pins,
+ * GPIO_PORTA = group 0, GPIO_PORTB = group 1, etc
+ * \param[in] mask Bit mask where 1 means apply direction setting to
+ * the corresponding pin
+ */
+static inline void _gpio_toggle_level(const enum gpio_port port, const uint32_t mask);
+
+/**
+ * \brief Get input levels on all port pins
+ *
+ * Get input level on all port pins, will read IN register if configured to
+ * input and OUT register if configured as output
+ *
+ * \param[in] port Ports are grouped into groups of maximum 32 pins,
+ * GPIO_PORTA = group 0, GPIO_PORTB = group 1, etc
+ */
+static inline uint32_t _gpio_get_level(const enum gpio_port port);
+
+/**
+ * \brief Set pin pull mode
+ *
+ * Set pull mode on a single pin
+ *
+ * \notice This function will automatically change pin direction to input
+ *
+ * \param[in] port Ports are grouped into groups of maximum 32 pins,
+ * GPIO_PORTA = group 0, GPIO_PORTB = group 1, etc
+ * \param[in] pin The pin in the group that pull mode should be selected
+ * for
+ * \param[in] pull_mode GPIO_PULL_OFF = pull resistor on pin is disabled
+ * GPIO_PULL_DOWN = pull resistor on pin will pull pin
+ * level to ground level
+ * GPIO_PULL_UP = pull resistor on pin will pull pin
+ * level to VCC
+ */
+static inline void _gpio_set_pin_pull_mode(const enum gpio_port port, const uint8_t pin,
+ const enum gpio_pull_mode pull_mode);
+
+/**
+ * \brief Set gpio function
+ *
+ * Select which function a gpio is used for
+ *
+ * \param[in] gpio The gpio to set function for
+ * \param[in] function The gpio function is given by a 32-bit wide bitfield
+ * found in the header files for the device
+ *
+ */
+static inline void _gpio_set_pin_function(const uint32_t gpio, const uint32_t function);
+
+#include
+//@}
+
+#ifdef __cplusplus
+}
+#endif
+/**@}*/
+#endif /* _HPL_GPIO_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_i2c_m_async.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_i2c_m_async.h
new file mode 100644
index 0000000..8a9491d
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_i2c_m_async.h
@@ -0,0 +1,205 @@
+/**
+ * \file
+ *
+ * \brief I2C Master Hardware Proxy Layer(HPL) declaration.
+ *
+ * Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+#ifndef _HPL_I2C_M_ASYNC_H_INCLUDED
+#define _HPL_I2C_M_ASYNC_H_INCLUDED
+
+#include "hpl_i2c_m_sync.h"
+#include "hpl_irq.h"
+#include "utils.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \brief i2c master callback names
+ */
+enum _i2c_m_async_callback_type {
+ I2C_M_ASYNC_DEVICE_ERROR,
+ I2C_M_ASYNC_DEVICE_TX_COMPLETE,
+ I2C_M_ASYNC_DEVICE_RX_COMPLETE
+};
+
+struct _i2c_m_async_device;
+
+typedef void (*_i2c_complete_cb_t)(struct _i2c_m_async_device *i2c_dev);
+typedef void (*_i2c_error_cb_t)(struct _i2c_m_async_device *i2c_dev, int32_t errcode);
+
+/**
+ * \brief i2c callback pointers structure
+ */
+struct _i2c_m_async_callback {
+ _i2c_error_cb_t error;
+ _i2c_complete_cb_t tx_complete;
+ _i2c_complete_cb_t rx_complete;
+};
+
+/**
+ * \brief i2c device structure
+ */
+struct _i2c_m_async_device {
+ struct _i2c_m_service service;
+ void * hw;
+ struct _i2c_m_async_callback cb;
+ struct _irq_descriptor irq;
+};
+
+/**
+ * \name HPL functions
+ */
+
+/**
+ * \brief Initialize I2C in interrupt mode
+ *
+ * This function does low level I2C configuration.
+ *
+ * \param[in] i2c_dev The pointer to i2c interrupt device structure
+ * \param[in] hw The pointer to hardware instance
+ *
+ * \return Return 0 for success and negative value for error
+ */
+int32_t _i2c_m_async_init(struct _i2c_m_async_device *const i2c_dev, void *const hw);
+
+/**
+ * \brief Deinitialize I2C in interrupt mode
+ *
+ * \param[in] i2c_dev The pointer to i2c device structure
+ *
+ * \return Return 0 for success and negative value for error
+ */
+int32_t _i2c_m_async_deinit(struct _i2c_m_async_device *const i2c_dev);
+
+/**
+ * \brief Enable I2C module
+ *
+ * This function does low level I2C enable.
+ *
+ * \param[in] i2c_dev The pointer to i2c device structure
+ *
+ * \return Return 0 for success and negative value for error
+ */
+int32_t _i2c_m_async_enable(struct _i2c_m_async_device *const i2c_dev);
+
+/**
+ * \brief Disable I2C module
+ *
+ * This function does low level I2C disable.
+ *
+ * \param[in] i2c_dev The pointer to i2c device structure
+ *
+ * \return Return 0 for success and negative value for error
+ */
+int32_t _i2c_m_async_disable(struct _i2c_m_async_device *const i2c_dev);
+
+/**
+ * \brief Transfer data by I2C
+ *
+ * This function does low level I2C data transfer.
+ *
+ * \param[in] i2c_dev The pointer to i2c device structure
+ * \param[in] msg The pointer to i2c msg structure
+ *
+ * \return Return 0 for success and negative value for error
+ */
+int32_t _i2c_m_async_transfer(struct _i2c_m_async_device *const i2c_dev, struct _i2c_m_msg *msg);
+
+/**
+ * \brief Set baud rate of I2C
+ *
+ * This function does low level I2C set baud rate.
+ *
+ * \param[in] i2c_dev The pointer to i2c device structure
+ * \param[in] clkrate The clock rate(KHz) input to i2c module
+ * \param[in] baudrate The demand baud rate(KHz) of i2c module
+ *
+ * \return Return 0 for success and negative value for error
+ */
+int32_t _i2c_m_async_set_baudrate(struct _i2c_m_async_device *const i2c_dev, uint32_t clkrate, uint32_t baudrate);
+
+/**
+ * \brief Register callback to I2C
+ *
+ * This function does low level I2C callback register.
+ *
+ * \param[in] i2c_dev The pointer to i2c device structure
+ * \param[in] cb_type The callback type request
+ * \param[in] func The callback function pointer
+ *
+ * \return Return 0 for success and negative value for error
+ */
+int32_t _i2c_m_async_register_callback(struct _i2c_m_async_device *i2c_dev, enum _i2c_m_async_callback_type cb_type,
+ FUNC_PTR func);
+
+/**
+ * \brief Generate stop condition on the I2C bus
+ *
+ * This function will generate a stop condition on the I2C bus
+ *
+ * \param[in] i2c_m_async_descriptor An i2c descriptor which is used to communicate through I2C
+ *
+ * \return Operation status
+ * \retval 0 Operation executed successfully
+ * \retval <0 Operation failed
+ */
+int32_t _i2c_m_async_send_stop(struct _i2c_m_async_device *const i2c_dev);
+
+/**
+ * \brief Returns the number of bytes left or not used in the I2C message buffer
+ *
+ * This function will return the number of bytes left (not written to the bus) or still free
+ * (not received from the bus) in the message buffer, depending on direction of transmission.
+ *
+ * \param[in] i2c_m_async_descriptor An i2c descriptor which is used to communicate through I2C
+ *
+ * \return Number of bytes or error code
+ * \retval >0 Positive number indicating bytes left
+ * \retval 0 Buffer is full/empty depending on direction
+ * \retval <0 Error code
+ */
+int32_t _i2c_m_async_get_bytes_left(struct _i2c_m_async_device *const i2c_dev);
+
+/**
+ * \brief Enable/disable I2C master interrupt
+ *
+ * param[in] device The pointer to I2C master device instance
+ * param[in] type The type of interrupt to disable/enable if applicable
+ * param[in] state Enable or disable
+ */
+void _i2c_m_async_set_irq_state(struct _i2c_m_async_device *const device, const enum _i2c_m_async_callback_type type,
+ const bool state);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_i2c_m_sync.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_i2c_m_sync.h
new file mode 100644
index 0000000..ce173ae
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_i2c_m_sync.h
@@ -0,0 +1,185 @@
+/**
+ * \file
+ *
+ * \brief I2C Master Hardware Proxy Layer(HPL) declaration.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+#ifndef _HPL_I2C_M_SYNC_H_INCLUDED
+#define _HPL_I2C_M_SYNC_H_INCLUDED
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \brief i2c flags
+ */
+#define I2C_M_RD 0x0001 /* read data, from slave to master */
+#define I2C_M_BUSY 0x0100
+#define I2C_M_TEN 0x0400 /* this is a ten bit chip address */
+#define I2C_M_SEVEN 0x0800 /* this is a seven bit chip address */
+#define I2C_M_FAIL 0x1000
+#define I2C_M_STOP 0x8000 /* if I2C_FUNC_PROTOCOL_MANGLING */
+
+/**
+ * \brief i2c Return codes
+ */
+#define I2C_OK 0 /* Operation successful */
+#define I2C_ACK -1 /* Received ACK from device on I2C bus */
+#define I2C_NACK -2 /* Received NACK from device on I2C bus */
+#define I2C_ERR_ARBLOST -3 /* Arbitration lost */
+#define I2C_ERR_BAD_ADDRESS -4 /* Bad address */
+#define I2C_ERR_BUS -5 /* Bus error */
+#define I2C_ERR_BUSY -6 /* Device busy */
+#define I2c_ERR_PACKAGE_COLLISION -7 /* Package collision */
+
+/**
+ * \brief i2c I2C Modes
+ */
+#define I2C_STANDARD_MODE 0x00
+#define I2C_FASTMODE 0x01
+#define I2C_HIGHSPEED_MODE 0x02
+
+/**
+ * \brief i2c master message structure
+ */
+struct _i2c_m_msg {
+ uint16_t addr;
+ volatile uint16_t flags;
+ int32_t len;
+ uint8_t * buffer;
+};
+
+/**
+ * \brief i2c master service
+ */
+struct _i2c_m_service {
+ struct _i2c_m_msg msg;
+ uint16_t mode;
+ uint16_t trise;
+};
+
+/**
+ * \brief i2c sync master device structure
+ */
+struct _i2c_m_sync_device {
+ struct _i2c_m_service service;
+ void * hw;
+};
+
+/**
+ * \name HPL functions
+ */
+
+/**
+ * \brief Initialize I2C
+ *
+ * This function does low level I2C configuration.
+ *
+ * \param[in] i2c_dev The pointer to i2c device structure
+ * \param[in] hw The pointer to hardware instance
+ *
+ * \return Return 0 for success and negative value for error
+ */
+int32_t _i2c_m_sync_init(struct _i2c_m_sync_device *const i2c_dev, void *const hw);
+
+/**
+ * \brief Deinitialize I2C
+ *
+ * \param[in] i2c_dev The pointer to i2c device structure
+ *
+ * \return Return 0 for success and negative value for error
+ */
+int32_t _i2c_m_sync_deinit(struct _i2c_m_sync_device *const i2c_dev);
+
+/**
+ * \brief Enable I2C module
+ *
+ * This function does low level I2C enable.
+ *
+ * \param[in] i2c_dev The pointer to i2c device structure
+ *
+ * \return Return 0 for success and negative value for error
+ */
+int32_t _i2c_m_sync_enable(struct _i2c_m_sync_device *const i2c_dev);
+
+/**
+ * \brief Disable I2C module
+ *
+ * This function does low level I2C disable.
+ *
+ * \param[in] i2c_dev The pointer to i2c device structure
+ *
+ * \return Return 0 for success and negative value for error
+ */
+int32_t _i2c_m_sync_disable(struct _i2c_m_sync_device *const i2c_dev);
+
+/**
+ * \brief Transfer data by I2C
+ *
+ * This function does low level I2C data transfer.
+ *
+ * \param[in] i2c_dev The pointer to i2c device structure
+ * \param[in] msg The pointer to i2c msg structure
+ *
+ * \return Return 0 for success and negative value for error
+ */
+int32_t _i2c_m_sync_transfer(struct _i2c_m_sync_device *const i2c_dev, struct _i2c_m_msg *msg);
+
+/**
+ * \brief Set baud rate of I2C
+ *
+ * This function does low level I2C set baud rate.
+ *
+ * \param[in] i2c_dev The pointer to i2c device structure
+ * \param[in] clkrate The clock rate(KHz) input to i2c module
+ * \param[in] baudrate The demand baud rate(KHz) of i2c module
+ *
+ * \return Return 0 for success and negative value for error
+ */
+int32_t _i2c_m_sync_set_baudrate(struct _i2c_m_sync_device *const i2c_dev, uint32_t clkrate, uint32_t baudrate);
+
+/**
+ * \brief Send send condition on the I2C bus
+ *
+ * This function will generate a stop condition on the I2C bus
+ *
+ * \param[in] i2c_dev The pointer to i2c device struct
+ *
+ * \return Return 0 for success and negative value for error
+ */
+int32_t _i2c_m_sync_send_stop(struct _i2c_m_sync_device *const i2c_dev);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_i2c_s_async.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_i2c_s_async.h
new file mode 100644
index 0000000..92a5765
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_i2c_s_async.h
@@ -0,0 +1,184 @@
+/**
+ * \file
+ *
+ * \brief I2C Slave Hardware Proxy Layer(HPL) declaration.
+ *
+ * Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+#ifndef _HPL_I2C_S_ASYNC_H_INCLUDED
+#define _HPL_I2C_S_ASYNC_H_INCLUDED
+
+#include "hpl_i2c_s_sync.h"
+#include "hpl_irq.h"
+#include "utils.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \brief i2c callback types
+ */
+enum _i2c_s_async_callback_type { I2C_S_DEVICE_ERROR, I2C_S_DEVICE_TX, I2C_S_DEVICE_RX_COMPLETE };
+
+/**
+ * \brief Forward declaration of I2C Slave device
+ */
+struct _i2c_s_async_device;
+
+/**
+ * \brief i2c slave callback function type
+ */
+typedef void (*_i2c_s_async_cb_t)(struct _i2c_s_async_device *device);
+
+/**
+ * \brief i2c slave callback pointers structure
+ */
+struct _i2c_s_async_callback {
+ void (*error)(struct _i2c_s_async_device *const device);
+ void (*tx)(struct _i2c_s_async_device *const device);
+ void (*rx_done)(struct _i2c_s_async_device *const device, const uint8_t data);
+};
+
+/**
+ * \brief i2c slave device structure
+ */
+struct _i2c_s_async_device {
+ void * hw;
+ struct _i2c_s_async_callback cb;
+ struct _irq_descriptor irq;
+};
+
+/**
+ * \name HPL functions
+ */
+
+/**
+ * \brief Initialize asynchronous I2C slave
+ *
+ * This function does low level I2C configuration.
+ *
+ * \param[in] device The pointer to i2c interrupt device structure
+ *
+ * \return Return 0 for success and negative value for error
+ */
+int32_t _i2c_s_async_init(struct _i2c_s_async_device *const device, void *const hw);
+
+/**
+ * \brief Deinitialize asynchronous I2C in interrupt mode
+ *
+ * \param[in] device The pointer to i2c device structure
+ *
+ * \return Return 0 for success and negative value for error
+ */
+int32_t _i2c_s_async_deinit(struct _i2c_s_async_device *const device);
+
+/**
+ * \brief Enable I2C module
+ *
+ * This function does low level I2C enable.
+ *
+ * \param[in] device The pointer to i2c slave device structure
+ *
+ * \return Return 0 for success and negative value for error
+ */
+int32_t _i2c_s_async_enable(struct _i2c_s_async_device *const device);
+
+/**
+ * \brief Disable I2C module
+ *
+ * This function does low level I2C disable.
+ *
+ * \param[in] device The pointer to i2c slave device structure
+ *
+ * \return Return 0 for success and negative value for error
+ */
+int32_t _i2c_s_async_disable(struct _i2c_s_async_device *const device);
+
+/**
+ * \brief Check if 10-bit addressing mode is on
+ *
+ * \param[in] device The pointer to i2c slave device structure
+ *
+ * \return Cheking status
+ * \retval 1 10-bit addressing mode is on
+ * \retval 0 10-bit addressing mode is off
+ */
+int32_t _i2c_s_async_is_10bit_addressing_on(const struct _i2c_s_async_device *const device);
+
+/**
+ * \brief Set I2C slave address
+ *
+ * \param[in] device The pointer to i2c slave device structure
+ * \param[in] address Address to set
+ *
+ * \return Return 0 for success and negative value for error
+ */
+int32_t _i2c_s_async_set_address(struct _i2c_s_async_device *const device, const uint16_t address);
+
+/**
+ * \brief Write a byte to the given I2C instance
+ *
+ * \param[in] device The pointer to i2c slave device structure
+ * \param[in] data Data to write
+ */
+void _i2c_s_async_write_byte(struct _i2c_s_async_device *const device, const uint8_t data);
+
+/**
+ * \brief Retrieve I2C slave status
+ *
+ * \param[in] device The pointer to i2c slave device structure
+ *
+ *\return I2C slave status
+ */
+i2c_s_status_t _i2c_s_async_get_status(const struct _i2c_s_async_device *const device);
+
+/**
+ * \brief Abort data transmission
+ *
+ * \param[in] device The pointer to i2c device structure
+ *
+ * \return Return 0 for success and negative value for error
+ */
+int32_t _i2c_s_async_abort_transmission(const struct _i2c_s_async_device *const device);
+
+/**
+ * \brief Enable/disable I2C slave interrupt
+ *
+ * param[in] device The pointer to I2C slave device instance
+ * param[in] type The type of interrupt to disable/enable if applicable
+ * param[in] disable Enable or disable
+ */
+int32_t _i2c_s_async_set_irq_state(struct _i2c_s_async_device *const device, const enum _i2c_s_async_callback_type type,
+ const bool disable);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _HPL_I2C_S_ASYNC_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_i2c_s_sync.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_i2c_s_sync.h
new file mode 100644
index 0000000..93b5934
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_i2c_s_sync.h
@@ -0,0 +1,184 @@
+/**
+ * \file
+ *
+ * \brief I2C Slave Hardware Proxy Layer(HPL) declaration.
+ *
+ * Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+#ifndef _HPL_I2C_S_SYNC_H_INCLUDED
+#define _HPL_I2C_S_SYNC_H_INCLUDED
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \brief I2C Slave status type
+ */
+typedef uint32_t i2c_s_status_t;
+
+/**
+ * \brief i2c slave device structure
+ */
+struct _i2c_s_sync_device {
+ void *hw;
+};
+
+#include
+
+/**
+ * \name HPL functions
+ */
+
+/**
+ * \brief Initialize synchronous I2C slave
+ *
+ * This function does low level I2C configuration.
+ *
+ * \param[in] device The pointer to i2c slave device structure
+ *
+ * \return Return 0 for success and negative value for error
+ */
+int32_t _i2c_s_sync_init(struct _i2c_s_sync_device *const device, void *const hw);
+
+/**
+ * \brief Deinitialize synchronous I2C slave
+ *
+ * \param[in] device The pointer to i2c slave device structure
+ *
+ * \return Return 0 for success and negative value for error
+ */
+int32_t _i2c_s_sync_deinit(struct _i2c_s_sync_device *const device);
+
+/**
+ * \brief Enable I2C module
+ *
+ * This function does low level I2C enable.
+ *
+ * \param[in] device The pointer to i2c slave device structure
+ *
+ * \return Return 0 for success and negative value for error
+ */
+int32_t _i2c_s_sync_enable(struct _i2c_s_sync_device *const device);
+
+/**
+ * \brief Disable I2C module
+ *
+ * This function does low level I2C disable.
+ *
+ * \param[in] device The pointer to i2c slave device structure
+ *
+ * \return Return 0 for success and negative value for error
+ */
+int32_t _i2c_s_sync_disable(struct _i2c_s_sync_device *const device);
+
+/**
+ * \brief Check if 10-bit addressing mode is on
+ *
+ * \param[in] device The pointer to i2c slave device structure
+ *
+ * \return Cheking status
+ * \retval 1 10-bit addressing mode is on
+ * \retval 0 10-bit addressing mode is off
+ */
+int32_t _i2c_s_sync_is_10bit_addressing_on(const struct _i2c_s_sync_device *const device);
+
+/**
+ * \brief Set I2C slave address
+ *
+ * \param[in] device The pointer to i2c slave device structure
+ * \param[in] address Address to set
+ *
+ * \return Return 0 for success and negative value for error
+ */
+int32_t _i2c_s_sync_set_address(struct _i2c_s_sync_device *const device, const uint16_t address);
+
+/**
+ * \brief Write a byte to the given I2C instance
+ *
+ * \param[in] device The pointer to i2c slave device structure
+ * \param[in] data Data to write
+ */
+void _i2c_s_sync_write_byte(struct _i2c_s_sync_device *const device, const uint8_t data);
+
+/**
+ * \brief Retrieve I2C slave status
+ *
+ * \param[in] device The pointer to i2c slave device structure
+ *
+ *\return I2C slave status
+ */
+i2c_s_status_t _i2c_s_sync_get_status(const struct _i2c_s_sync_device *const device);
+
+/**
+ * \brief Clear the Data Ready interrupt flag
+ *
+ * \param[in] device The pointer to i2c slave device structure
+ *
+ * \return Return 0 for success and negative value for error
+ */
+int32_t _i2c_s_sync_clear_data_ready_flag(const struct _i2c_s_sync_device *const device);
+
+/**
+ * \brief Read a byte from the given I2C instance
+ *
+ * \param[in] device The pointer to i2c slave device structure
+ *
+ * \return Data received via I2C interface.
+ */
+uint8_t _i2c_s_sync_read_byte(const struct _i2c_s_sync_device *const device);
+
+/**
+ * \brief Check if I2C is ready to send next byte
+ *
+ * \param[in] device The pointer to i2c slave device structure
+ *
+ * \return Status of the ready check.
+ * \retval true if the I2C is ready to send next byte
+ * \retval false if the I2C is not ready to send next byte
+ */
+bool _i2c_s_sync_is_byte_sent(const struct _i2c_s_sync_device *const device);
+
+/**
+ * \brief Check if there is data received by I2C
+ *
+ * \param[in] device The pointer to i2c slave device structure
+ *
+ * \return Status of the data received check.
+ * \retval true if the I2C has received a byte
+ * \retval false if the I2C has not received a byte
+ */
+bool _i2c_s_sync_is_byte_received(const struct _i2c_s_sync_device *const device);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _HPL_I2C_S_SYNC_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_init.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_init.h
new file mode 100644
index 0000000..71bf49c
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_init.h
@@ -0,0 +1,124 @@
+/**
+ * \file
+ *
+ * \brief Init related functionality declaration.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _HPL_INIT_H_INCLUDED
+#define _HPL_INIT_H_INCLUDED
+
+/**
+ * \addtogroup HPL Init
+ *
+ * \section hpl_init_rev Revision History
+ * - v1.0.0 Initial Release
+ *
+ *@{
+ */
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \name HPL functions
+ */
+//@{
+/**
+ * \brief Initializes clock sources
+ */
+void _sysctrl_init_sources(void);
+
+/**
+ * \brief Initializes Power Manager
+ */
+void _pm_init(void);
+
+/**
+ * \brief Initialize generators
+ */
+void _gclk_init_generators(void);
+
+/**
+ * \brief Initialize 32 kHz clock sources
+ */
+void _osc32kctrl_init_sources(void);
+
+/**
+ * \brief Initialize clock sources
+ */
+void _oscctrl_init_sources(void);
+
+/**
+ * \brief Initialize clock sources that need input reference clocks
+ */
+void _sysctrl_init_referenced_generators(void);
+
+/**
+ * \brief Initialize clock sources that need input reference clocks
+ */
+void _oscctrl_init_referenced_generators(void);
+
+/**
+ * \brief Initialize master clock generator
+ */
+void _mclk_init(void);
+
+/**
+ * \brief Initialize clock generator
+ */
+void _lpmcu_misc_regs_init(void);
+
+/**
+ * \brief Initialize clock generator
+ */
+void _pmc_init(void);
+
+/**
+ * \brief Set performance level
+ *
+ * \param[in] level The performance level to set
+ */
+void _set_performance_level(const uint8_t level);
+
+/**
+ * \brief Initialize the chip
+ */
+void _init_chip(void);
+
+//@}
+
+#ifdef __cplusplus
+}
+#endif
+/**@}*/
+#endif /* _HPL_INIT_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_irq.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_irq.h
new file mode 100644
index 0000000..2894944
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_irq.h
@@ -0,0 +1,116 @@
+/**
+ * \file
+ *
+ * \brief IRQ related functionality declaration.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _HPL_IRQ_H_INCLUDED
+#define _HPL_IRQ_H_INCLUDED
+
+/**
+ * \addtogroup HPL IRQ
+ *
+ * \section hpl_irq_rev Revision History
+ * - v1.0.0 Initial Release
+ *
+ *@{
+ */
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \brief IRQ descriptor
+ */
+struct _irq_descriptor {
+ void (*handler)(void *parameter);
+ void *parameter;
+};
+
+/**
+ * \name HPL functions
+ */
+//@{
+/**
+ * \brief Retrieve current IRQ number
+ *
+ * \return The current IRQ number
+ */
+uint8_t _irq_get_current(void);
+
+/**
+ * \brief Disable the given IRQ
+ *
+ * \param[in] n The number of IRQ to disable
+ */
+void _irq_disable(uint8_t n);
+
+/**
+ * \brief Set the given IRQ
+ *
+ * \param[in] n The number of IRQ to set
+ */
+void _irq_set(uint8_t n);
+
+/**
+ * \brief Clear the given IRQ
+ *
+ * \param[in] n The number of IRQ to clear
+ */
+void _irq_clear(uint8_t n);
+
+/**
+ * \brief Enable the given IRQ
+ *
+ * \param[in] n The number of IRQ to enable
+ */
+void _irq_enable(uint8_t n);
+
+/**
+ * \brief Register IRQ handler
+ *
+ * \param[in] number The number registered IRQ
+ * \param[in] irq The pointer to irq handler to register
+ *
+ * \return The status of IRQ handler registering
+ * \retval -1 Passed parameters were invalid
+ * \retval 0 The registering is completed successfully
+ */
+void _irq_register(const uint8_t number, struct _irq_descriptor *const irq);
+//@}
+
+#ifdef __cplusplus
+}
+#endif
+/**@}*/
+#endif /* _HPL_IRQ_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_missing_features.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_missing_features.h
new file mode 100644
index 0000000..7071db2
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_missing_features.h
@@ -0,0 +1,37 @@
+/**
+ * \file
+ *
+ * \brief Family-dependent missing features expected by HAL
+ *
+ * Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _HPL_MISSING_FEATURES
+#define _HPL_MISSING_FEATURES
+
+#endif /* _HPL_MISSING_FEATURES */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_ramecc.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_ramecc.h
new file mode 100644
index 0000000..d79d514
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_ramecc.h
@@ -0,0 +1,100 @@
+/**
+ * \file
+ *
+ * \brief RAMECC related functionality declaration.
+ *
+ * Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _HPL_RAMECC_H_INCLUDED
+#define _HPL_RAMECC_H_INCLUDED
+
+/**
+ * \addtogroup HPL RAMECC
+ *
+ * \section hpl_ramecc_rev Revision History
+ * - v1.0.0 Initial Release
+ *
+ *@{
+ */
+
+#include
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \brief RAMECC callback type
+ */
+typedef void (*ramecc_cb_t)(const uint32_t data);
+
+/**
+ * \brief RAMECC callback types
+ */
+enum _ramecc_callback_type { RAMECC_DUAL_ERROR_CB, RAMECC_SINGLE_ERROR_CB };
+
+/**
+ * \brief RAMECC interrupt callbacks
+ */
+struct _ramecc_callbacks {
+ ramecc_cb_t dual_bit_err;
+ ramecc_cb_t single_bit_err;
+};
+
+/**
+ * \brief RAMECC device structure
+ */
+struct _ramecc_device {
+ struct _ramecc_callbacks ramecc_cb;
+ struct _irq_descriptor irq;
+};
+
+/**
+ * \brief Initialize RAMECC
+ *
+ * This function does low level RAMECC configuration.
+ *
+ * \return initialize status
+ */
+int32_t _ramecc_init(void);
+
+/**
+ * \brief Register RAMECC callback
+ *
+ * \param[in] type The type of callback
+ * \param[in] cb A callback function
+ */
+void _ramecc_register_callback(const enum _ramecc_callback_type type, ramecc_cb_t cb);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _HPL_RAMECC_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_reset.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_reset.h
new file mode 100644
index 0000000..d627ea6
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_reset.h
@@ -0,0 +1,93 @@
+/**
+ * \file
+ *
+ * \brief Reset related functionality declaration.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _HPL_RESET_H_INCLUDED
+#define _HPL_RESET_H_INCLUDED
+
+/**
+ * \addtogroup HPL Reset
+ *
+ * \section hpl_reset_rev Revision History
+ * - v1.0.0 Initial Release
+ *
+ *@{
+ */
+
+#ifndef _UNIT_TEST_
+#include
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \brief Reset reason enumeration
+ *
+ * The list of possible reset reasons.
+ */
+enum reset_reason {
+ RESET_REASON_POR = 1,
+ RESET_REASON_BOD12 = 2,
+ RESET_REASON_BOD33 = 4,
+ RESET_REASON_NVM = 8,
+ RESET_REASON_EXT = 16,
+ RESET_REASON_WDT = 32,
+ RESET_REASON_SYST = 64,
+ RESET_REASON_BACKUP = 128
+};
+
+/**
+ * \name HPL functions
+ */
+//@{
+/**
+ * \brief Retrieve the reset reason
+ *
+ * Retrieves the reset reason of the last MCU reset.
+ *
+ *\return An enum value indicating the reason of the last reset.
+ */
+enum reset_reason _get_reset_reason(void);
+
+/**
+ * \brief Reset MCU
+ */
+void _reset_mcu(void);
+//@}
+
+#ifdef __cplusplus
+}
+#endif
+/**@}*/
+#endif /* _HPL_RESET_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_sleep.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_sleep.h
new file mode 100644
index 0000000..6731ec3
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_sleep.h
@@ -0,0 +1,88 @@
+/**
+ * \file
+ *
+ * \brief Sleep related functionality declaration.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _HPL_SLEEP_H_INCLUDED
+#define _HPL_SLEEP_H_INCLUDED
+
+/**
+ * \addtogroup HPL Sleep
+ *
+ * \section hpl_sleep_rev Revision History
+ * - v1.0.0 Initial Release
+ *
+ *@{
+ */
+
+#ifndef _UNIT_TEST_
+#include
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \name HPL functions
+ */
+//@{
+/**
+ * \brief Set the sleep mode for the device
+ *
+ * This function sets the sleep mode for the device.
+ * For an overview of which systems are disabled in sleep for the different
+ * sleep modes see datasheet.
+ *
+ * \param[in] mode Sleep mode to use
+ *
+ * \return the status of a sleep request
+ * \retval -1 The requested sleep mode was invalid
+ * \retval 0 The operation completed successfully, sleep mode is set
+ */
+int32_t _set_sleep_mode(const uint8_t mode);
+
+/**
+ * \brief Reset MCU
+ */
+void _reset_mcu(void);
+
+/**
+ * \brief Put MCU to sleep
+ */
+void _go_to_sleep(void);
+//@}
+
+#ifdef __cplusplus
+}
+#endif
+/**@}*/
+#endif /* _HPL_SLEEP_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_spi.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_spi.h
new file mode 100644
index 0000000..a5652e5
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_spi.h
@@ -0,0 +1,163 @@
+/**
+ * \file
+ *
+ * \brief SPI related functionality declaration.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _HPL_SPI_H_INCLUDED
+#define _HPL_SPI_H_INCLUDED
+
+#include
+#include
+
+/**
+ * \addtogroup hpl_spi HPL SPI
+ *
+ *@{
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \brief SPI Dummy char is used when reading data from the SPI slave
+ */
+#define SPI_DUMMY_CHAR 0x1ff
+
+/**
+ * \brief SPI message to let driver to process
+ */
+//@{
+struct spi_msg {
+ /** Pointer to the output data buffer */
+ uint8_t *txbuf;
+ /** Pointer to the input data buffer */
+ uint8_t *rxbuf;
+ /** Size of the message data in SPI characters */
+ uint32_t size;
+};
+//@}
+
+/**
+ * \brief SPI transfer modes
+ * SPI transfer mode controls clock polarity and clock phase.
+ * Mode 0: leading edge is rising edge, data sample on leading edge.
+ * Mode 1: leading edge is rising edge, data sample on trailing edge.
+ * Mode 2: leading edge is falling edge, data sample on leading edge.
+ * Mode 3: leading edge is falling edge, data sample on trailing edge.
+ */
+enum spi_transfer_mode {
+ /** Leading edge is rising edge, data sample on leading edge. */
+ SPI_MODE_0,
+ /** Leading edge is rising edge, data sample on trailing edge. */
+ SPI_MODE_1,
+ /** Leading edge is falling edge, data sample on leading edge. */
+ SPI_MODE_2,
+ /** Leading edge is falling edge, data sample on trailing edge. */
+ SPI_MODE_3
+};
+
+/**
+ * \brief SPI character sizes
+ * The character size influence the way the data is sent/received.
+ * For char size <= 8 data is stored byte by byte.
+ * For char size between 9 ~ 16 data is stored in 2-byte length.
+ * Note that the default and recommended char size is 8 bit since it's
+ * supported by all system.
+ */
+enum spi_char_size {
+ /** Character size is 8 bit. */
+ SPI_CHAR_SIZE_8 = 0,
+ /** Character size is 9 bit. */
+ SPI_CHAR_SIZE_9 = 1,
+ /** Character size is 10 bit. */
+ SPI_CHAR_SIZE_10 = 2,
+ /** Character size is 11 bit. */
+ SPI_CHAR_SIZE_11 = 3,
+ /** Character size is 12 bit. */
+ SPI_CHAR_SIZE_12 = 4,
+ /** Character size is 13 bit. */
+ SPI_CHAR_SIZE_13 = 5,
+ /** Character size is 14 bit. */
+ SPI_CHAR_SIZE_14 = 6,
+ /** Character size is 15 bit. */
+ SPI_CHAR_SIZE_15 = 7,
+ /** Character size is 16 bit. */
+ SPI_CHAR_SIZE_16 = 8
+};
+
+/**
+ * \brief SPI data order
+ */
+enum spi_data_order {
+ /** MSB goes first. */
+ SPI_DATA_ORDER_MSB_1ST = 0,
+ /** LSB goes first. */
+ SPI_DATA_ORDER_LSB_1ST = 1
+};
+
+/** \brief Transfer descriptor for SPI
+ * Transfer descriptor holds TX and RX buffers
+ */
+struct spi_xfer {
+ /** Pointer to data buffer to TX */
+ uint8_t *txbuf;
+ /** Pointer to data buffer to RX */
+ uint8_t *rxbuf;
+ /** Size of data characters to TX & RX */
+ uint32_t size;
+};
+
+/** SPI generic driver. */
+struct spi_dev {
+ /** Pointer to the hardware base or private data for special device. */
+ void *prvt;
+ /** Reference start of sync/async variables */
+ uint32_t sync_async_misc[1];
+};
+
+/**
+ * \brief Calculate the baudrate value for hardware to use to set baudrate
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \param[in] clk Clock frequency (Hz) for baudrate generation.
+ * \param[in] baud Target baudrate (bps).
+ * \return Error or baudrate value.
+ * \retval >0 Baudrate value.
+ * \retval ERR_INVALID_ARG Calculation fail.
+ */
+int32_t _spi_calc_baud_val(struct spi_dev *dev, const uint32_t clk, const uint32_t baud);
+
+#ifdef __cplusplus
+}
+#endif
+
+/**@}*/
+#endif /* ifndef _HPL_SPI_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_spi_async.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_spi_async.h
new file mode 100644
index 0000000..8e5a848
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_spi_async.h
@@ -0,0 +1,131 @@
+/**
+ * \file
+ *
+ * \brief Common SPI related functionality declaration.
+ *
+ * Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _HPL_SPI_ASYNC_H_INCLUDED
+#define _HPL_SPI_ASYNC_H_INCLUDED
+
+#include
+#include
+
+/**
+ * \addtogroup hpl_spi HPL SPI
+ *
+ *@{
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \brief Callbacks the SPI driver must offer in async mode
+ */
+//@{
+/** The callback types */
+enum _spi_async_dev_cb_type {
+ /** Callback type for transmit, see \ref _spi_async_dev_cb_xfer_t. */
+ SPI_DEV_CB_TX,
+ /** Callback type for receive, see \ref _spi_async_dev_cb_xfer_t. */
+ SPI_DEV_CB_RX,
+ /** Callback type for \ref _spi_async_dev_cb_complete_t. */
+ SPI_DEV_CB_COMPLETE,
+ /** Callback type for error */
+ SPI_DEV_CB_ERROR,
+ /** Number of callbacks. */
+ SPI_DEV_CB_N
+};
+
+struct _spi_async_dev;
+
+/** \brief The prototype for callback on SPI transfer error.
+ * If status code is zero, it indicates the normal completion, that is,
+ * SS deactivation.
+ * If status code belows zero, it indicates complete.
+ */
+typedef void (*_spi_async_dev_cb_error_t)(struct _spi_async_dev *dev, int32_t status);
+
+/** \brief The prototype for callback on SPI transmit/receive event
+ * For TX, the callback is invoked when transmit is done or ready to start
+ * transmit.
+ * For RX, the callback is invoked when receive is done or ready to read data,
+ * see \ref _spi_async_dev_read_one_t on data reading.
+ * Without DMA enabled, the callback is invoked on each character event.
+ * With DMA enabled, the callback is invoked on DMA buffer done.
+ */
+typedef void (*_spi_async_dev_cb_xfer_t)(struct _spi_async_dev *dev);
+
+/**
+ * \brief The callbacks offered by SPI driver
+ */
+struct _spi_async_dev_callbacks {
+ /** TX callback, see \ref _spi_async_dev_cb_xfer_t. */
+ _spi_async_dev_cb_xfer_t tx;
+ /** RX callback, see \ref _spi_async_dev_cb_xfer_t. */
+ _spi_async_dev_cb_xfer_t rx;
+ /** Complete or complete callback, see \ref _spi_async_dev_cb_complete_t. */
+ _spi_async_dev_cb_xfer_t complete;
+ /** Error callback, see \ref */
+ _spi_async_dev_cb_error_t err;
+};
+//@}
+
+/**
+ * \brief SPI async driver
+ */
+//@{
+
+/** SPI driver to support async HAL */
+struct _spi_async_dev {
+ /** Pointer to the hardware base or private data for special device. */
+ void *prvt;
+ /** Data size, number of bytes for each character */
+ uint8_t char_size;
+ /** Dummy byte used in master mode when reading the slave */
+ uint16_t dummy_byte;
+
+ /** \brief Pointer to callback functions, ignored for polling mode
+ * Pointer to the callback functions so that initialize the driver to
+ * handle interrupts.
+ */
+ struct _spi_async_dev_callbacks callbacks;
+ /** IRQ instance for SPI device. */
+ struct _irq_descriptor irq;
+};
+//@}
+
+#ifdef __cplusplus
+}
+#endif
+
+/**@}*/
+#endif /* ifndef _HPL_SPI_ASYNC_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_spi_dma.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_spi_dma.h
new file mode 100644
index 0000000..04a3015
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_spi_dma.h
@@ -0,0 +1,88 @@
+/**
+ * \file
+ *
+ * \brief Common SPI DMA related functionality declaration.
+ *
+ * Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _HPL_SPI_DMA_H_INCLUDED
+#define _HPL_SPI_DMA_H_INCLUDED
+
+#include
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** The callback types */
+enum _spi_dma_dev_cb_type {
+ /** Callback type for DMA transmit. */
+ SPI_DEV_CB_DMA_TX,
+ /** Callback type for DMA receive. */
+ SPI_DEV_CB_DMA_RX,
+ /** Callback type for DMA error. */
+ SPI_DEV_CB_DMA_ERROR,
+ /** Number of callbacks. */
+ SPI_DEV_CB_DMA_N
+};
+
+struct _spi_dma_dev;
+
+/**
+ * \brief The prototype for callback on SPI DMA.
+ */
+typedef void (*_spi_dma_cb_t)(struct _dma_resource *resource);
+
+/**
+ * \brief The callbacks offered by SPI driver
+ */
+struct _spi_dma_dev_callbacks {
+ _spi_dma_cb_t tx;
+ _spi_dma_cb_t rx;
+ _spi_dma_cb_t error;
+};
+
+/** SPI driver to support DMA HAL */
+struct _spi_dma_dev {
+ /** Pointer to the hardware base or private data for special device. */
+ void *prvt;
+ /** Pointer to callback functions */
+ struct _spi_dma_dev_callbacks callbacks;
+ /** IRQ instance for SPI device. */
+ struct _irq_descriptor irq;
+ /** DMA resource */
+ struct _dma_resource *resource;
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ifndef _HPL_SPI_DMA_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_spi_m_async.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_spi_m_async.h
new file mode 100644
index 0000000..8d3555e
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_spi_m_async.h
@@ -0,0 +1,243 @@
+/**
+ * \file
+ *
+ * \brief SPI Slave Async related functionality declaration.
+ *
+ * Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _HPL_SPI_M_ASYNC_H_INCLUDED
+#define _HPL_SPI_M_ASYNC_H_INCLUDED
+
+#include
+#include
+
+/**
+ * \addtogroup hpl_spi HPL SPI
+ *
+ *
+ *@{
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Uses common SPI async device driver. */
+#define _spi_m_async_dev _spi_async_dev
+
+#define _spi_m_async_dev_cb_type _spi_async_dev_cb_type
+
+/** Uses common SPI async device driver complete callback type. */
+#define _spi_m_async_dev_cb_error_t _spi_async_dev_cb_error_t
+
+/** Uses common SPI async device driver transfer callback type. */
+#define _spi_m_async_dev_cb_xfer_t _spi_async_dev_cb_xfer_t
+
+/**
+ * \name HPL functions
+ */
+//@{
+/**
+ * \brief Initialize SPI for access with interrupts
+ * It will load default hardware configuration and software struct.
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \param[in] hw Pointer to the hardware base.
+ * \retval ERR_INVALID_ARG Input parameter problem.
+ * \retval ERR_BUSY SPI hardware not ready (resetting).
+ * \retval ERR_DENIED SPI has been enabled.
+ * \retval 0 Operation done successfully.
+ */
+int32_t _spi_m_async_init(struct _spi_m_async_dev *dev, void *const hw);
+
+/**
+ * \brief Initialize SPI for access with interrupts
+ * Disable, reset the hardware and the software struct.
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \return Operation status.
+ * \retval 0 Operation done successfully.
+ */
+int32_t _spi_m_async_deinit(struct _spi_m_async_dev *dev);
+
+/**
+ * \brief Enable SPI for access with interrupts
+ * Enable the SPI and enable callback generation of receive and error
+ * interrupts.
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \return Operation status.
+ * \retval ERR_INVALID_ARG Input parameter problem.
+ * \retval ERR_BUSY SPI hardware not ready (resetting).
+ * \retval 0 Operation done successfully.
+ */
+int32_t _spi_m_async_enable(struct _spi_m_async_dev *dev);
+
+/**
+ * \brief Disable SPI for access without interrupts
+ * Disable SPI and interrupts. Deactivate all CS pins if works as master.
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \return Operation status.
+ * \retval 0 Operation done successfully.
+ */
+int32_t _spi_m_async_disable(struct _spi_m_async_dev *dev);
+
+/**
+ * \brief Set SPI transfer mode
+ * Set SPI transfer mode (\ref spi_transfer_mode),
+ * which controls clock polarity and clock phase.
+ * Mode 0: leading edge is rising edge, data sample on leading edge.
+ * Mode 1: leading edge is rising edge, data sample on trailing edge.
+ * Mode 2: leading edge is falling edge, data sample on leading edge.
+ * Mode 3: leading edge is falling edge, data sample on trailing edge.
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \param[in] mode The SPI transfer mode.
+ * \return Operation status.
+ * \retval ERR_BUSY SPI is not ready to accept new setting.
+ * \retval 0 Operation done successfully.
+ */
+int32_t _spi_m_async_set_mode(struct _spi_m_async_dev *dev, const enum spi_transfer_mode mode);
+
+/**
+ * \brief Set SPI baudrate
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \param[in] baud_val The SPI baudrate value, see \ref _spi_calc_baud_val() on
+ * how it's generated.
+ * \return Operation status.
+ * \retval ERR_BUSY SPI is not ready to accept new setting.
+ * \retval 0 Operation done successfully.
+ */
+int32_t _spi_m_async_set_baudrate(struct _spi_m_async_dev *dev, const uint32_t baud_val);
+
+/**
+ * \brief Set SPI baudrate
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \param[in] char_size The character size, see \ref spi_char_size.
+ * \return Operation status.
+ * \retval ERR_INVALID_ARG The character size is not supported.
+ * \retval ERR_BUSY SPI is not ready to accept new setting.
+ * \retval 0 Operation done successfully.
+ */
+int32_t _spi_m_async_set_char_size(struct _spi_m_async_dev *dev, const enum spi_char_size char_size);
+
+/**
+ * \brief Set SPI data order
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \param[in] dord SPI data order (LSB/MSB first).
+ * \return Operation status.
+ * \retval ERR_INVALID_ARG The character size is not supported.
+ * \retval ERR_BUSY SPI is not ready to accept new setting.
+ * \retval 0 Operation done successfully.
+ */
+int32_t _spi_m_async_set_data_order(struct _spi_m_async_dev *dev, const enum spi_data_order dord);
+
+/**
+ * \brief Enable interrupt on character output
+ *
+ * Enable interrupt when a new character can be written
+ * to the SPI device.
+ *
+ * \param[in] dev Pointer to the SPI device instance
+ * \param[in] state true = enable output interrupt
+ * false = disable output interrupt
+ *
+ * \return Status code
+ * \retval 0 Ok status
+ */
+int32_t _spi_m_async_enable_tx(struct _spi_m_async_dev *dev, bool state);
+
+/**
+ * \brief Enable interrupt on character input
+ *
+ * Enable interrupt when a new character is ready to be
+ * read from the SPI device.
+ *
+ * \param[in] dev Pointer to the SPI device instance
+ * \param[in] state true = enable input interrupts
+ * false = disable input interrupt
+ *
+ * \return Status code
+ * \retvat 0 OK Status
+ */
+int32_t _spi_m_async_enable_rx(struct _spi_m_async_dev *dev, bool state);
+
+/**
+ * \brief Enable interrupt on after data transmission complate
+ *
+ * \param[in] dev Pointer to the SPI device instance
+ * \param[in] state true = enable input interrupts
+ * false = disable input interrupt
+ *
+ * \return Status code
+ * \retvat 0 OK Status
+ */
+int32_t _spi_m_async_enable_tx_complete(struct _spi_m_async_dev *dev, bool state);
+
+/**
+ * \brief Read one character to SPI device instance
+ * \param[in, out] dev Pointer to the SPI device instance.
+ *
+ * \return Character read from SPI module
+ */
+uint16_t _spi_m_async_read_one(struct _spi_m_async_dev *dev);
+
+/**
+ * \brief Write one character to assigned buffer
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \param[in] data
+ *
+ * \return Status code of write operation
+ * \retval 0 Write operation OK
+ */
+int32_t _spi_m_async_write_one(struct _spi_m_async_dev *dev, uint16_t data);
+
+/**
+ * \brief Register the SPI device callback
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \param[in] cb_type The callback type.
+ * \param[in] func The callback function to register. NULL to disable callback.
+ * \return Always 0.
+ */
+int32_t _spi_m_async_register_callback(struct _spi_m_async_dev *dev, const enum _spi_m_async_dev_cb_type cb_type,
+ const FUNC_PTR func);
+
+/**
+ * \brief Enable/disable SPI master interrupt
+ *
+ * param[in] device The pointer to SPI master device instance
+ * param[in] type The type of interrupt to disable/enable if applicable
+ * param[in] state Enable or disable
+ */
+void _spi_m_async_set_irq_state(struct _spi_m_async_dev *const device, const enum _spi_m_async_dev_cb_type type,
+ const bool state);
+//@}
+
+#ifdef __cplusplus
+}
+#endif
+
+/**@}*/
+#endif /* ifndef _HPL_SPI_M_ASYNC_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_spi_m_dma.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_spi_m_dma.h
new file mode 100644
index 0000000..2b48300
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_spi_m_dma.h
@@ -0,0 +1,182 @@
+/**
+ * \file
+ *
+ * \brief SPI Master DMA related functionality declaration.
+ *
+ * Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _HPL_SPI_M_DMA_H_INCLUDED
+#define _HPL_SPI_M_DMA_H_INCLUDED
+
+#include
+#include
+
+/**
+ * \addtogroup hpl_spi HPL SPI
+ *
+ *
+ *@{
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Uses common SPI dma device driver. */
+#define _spi_m_dma_dev _spi_dma_dev
+
+#define _spi_m_dma_dev_cb_type _spi_dma_dev_cb_type
+
+/**
+ * \name HPL functions
+ */
+//@{
+/**
+ * \brief Initialize SPI for access with interrupts
+ * It will load default hardware configuration and software struct.
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \param[in] hw Pointer to the hardware base.
+ * \return Operation status.
+ * \retval ERR_INVALID_ARG Input parameter problem.
+ * \retval ERR_BUSY SPI hardware not ready (resetting).
+ * \retval ERR_DENIED SPI has been enabled.
+ * \retval 0 ERR_NONE is operation done successfully.
+ */
+int32_t _spi_m_dma_init(struct _spi_m_dma_dev *dev, void *const hw);
+
+/**
+ * \brief Initialize SPI for access with interrupts
+ * Disable, reset the hardware and the software struct.
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \return Operation status.
+ * \retval 0 ERR_NONE is operation done successfully.
+ */
+int32_t _spi_m_dma_deinit(struct _spi_m_dma_dev *dev);
+
+/**
+ * \brief Enable SPI for access with interrupts
+ * Enable the SPI and enable callback generation of receive and error
+ * interrupts.
+ * \param[in] dev Pointer to the SPI device instance.
+ * \return Operation status.
+ * \retval ERR_INVALID_ARG Input parameter problem.
+ * \retval ERR_BUSY SPI hardware not ready (resetting).
+ * \retval 0 ERR_NONE is operation done successfully.
+ */
+int32_t _spi_m_dma_enable(struct _spi_m_dma_dev *dev);
+
+/**
+ * \brief Disable SPI for access without interrupts
+ * Disable SPI and interrupts. Deactivate all CS pins if works as master.
+ * \param[in] dev Pointer to the SPI device instance.
+ * \return Operation status.
+ * \retval 0 ERR_NONE is operation done successfully.
+ */
+int32_t _spi_m_dma_disable(struct _spi_m_dma_dev *dev);
+
+/**
+ * \brief Set SPI transfer mode
+ * Set SPI transfer mode (\ref spi_transfer_mode),
+ * which controls clock polarity and clock phase.
+ * Mode 0: leading edge is rising edge, data sample on leading edge.
+ * Mode 1: leading edge is rising edge, data sample on trailing edge.
+ * Mode 2: leading edge is falling edge, data sample on leading edge.
+ * Mode 3: leading edge is falling edge, data sample on trailing edge.
+ * \param[in] dev Pointer to the SPI device instance.
+ * \param[in] mode The SPI transfer mode.
+ * \return Operation status.
+ * \retval ERR_BUSY SPI is not ready to accept new setting.
+ * \retval 0 ERR_NONE is operation done successfully.
+ */
+int32_t _spi_m_dma_set_mode(struct _spi_m_dma_dev *dev, const enum spi_transfer_mode mode);
+
+/**
+ * \brief Set SPI baudrate
+ * \param[in] dev Pointer to the SPI device instance.
+ * \param[in] baud_val The SPI baudrate value, see \ref _spi_calc_baud_val() on
+ * how it's generated.
+ * \return Operation status.
+ * \retval ERR_BUSY SPI is not ready to accept new setting.
+ * \retval 0 Operation done successfully.
+ */
+int32_t _spi_m_dma_set_baudrate(struct _spi_m_dma_dev *dev, const uint32_t baud_val);
+
+/**
+ * \brief Set SPI baudrate
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \param[in] char_size The character size, see \ref spi_char_size.
+ * \return Operation status.
+ * \retval ERR_INVALID_ARG The character size is not supported.
+ * \retval ERR_BUSY SPI is not ready to accept new setting.
+ * \retval 0 Operation done successfully.
+ */
+int32_t _spi_m_dma_set_char_size(struct _spi_m_dma_dev *dev, const enum spi_char_size char_size);
+
+/**
+ * \brief Set SPI data order
+ * \param[in] dev Pointer to the SPI device instance.
+ * \param[in] dord SPI data order (LSB/MSB first).
+ * \return Operation status.
+ * \retval ERR_INVALID_ARG The character size is not supported.
+ * \retval ERR_BUSY SPI is not ready to accept new setting.
+ * \retval 0 Operation done successfully.
+ */
+int32_t _spi_m_dma_set_data_order(struct _spi_m_dma_dev *dev, const enum spi_data_order dord);
+
+/**
+ * \brief Register the SPI device callback
+ * \param[in] dev Pointer to the SPI device instance.
+ * \param[in] cb_type The callback type.
+ * \param[in] func The callback function to register. NULL to disable callback.
+ * \return Always 0.
+ */
+void _spi_m_dma_register_callback(struct _spi_m_dma_dev *dev, enum _spi_dma_dev_cb_type, _spi_dma_cb_t func);
+
+/** \brief Do SPI data transfer (TX & RX) with DMA
+ * Log the TX & RX buffers and transfer them in background. It never blocks.
+ *
+ * \param[in] dev Pointer to the SPI device instance.
+ * \param[in] txbuf Pointer to the transfer information (\ref spi_transfer).
+ * \param[out] rxbuf Pointer to the receiver information (\ref spi_receive).
+ * \param[in] length spi transfer data length.
+ *
+ * \return Operation status.
+ * \retval ERR_NONE Success.
+ * \retval ERR_BUSY Busy.
+ */
+int32_t _spi_m_dma_transfer(struct _spi_m_dma_dev *dev, uint8_t const *txbuf, uint8_t *const rxbuf,
+ const uint16_t length);
+//@}
+
+#ifdef __cplusplus
+}
+#endif
+
+/**@}*/
+#endif /* ifndef _HPL_SPI_M_DMA_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_spi_m_sync.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_spi_m_sync.h
new file mode 100644
index 0000000..38df15b
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_spi_m_sync.h
@@ -0,0 +1,166 @@
+/**
+ * \file
+ *
+ * \brief SPI related functionality declaration.
+ *
+ * Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _HPL_SPI_M_SYNC_H_INCLUDED
+#define _HPL_SPI_M_SYNC_H_INCLUDED
+
+#include
+#include
+
+/**
+ * \addtogroup hpl_spi HPL SPI
+ *
+ *@{
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Uses common SPI sync device driver. */
+#define _spi_m_sync_dev _spi_sync_dev
+
+/**
+ * \name HPL functions
+ */
+//@{
+/**
+ * \brief Initialize SPI for access without interrupts
+ * It will load default hardware configuration and software struct.
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \param[in] hw Pointer to the hardware base.
+ * \return Operation status.
+ * \retval ERR_INVALID_ARG Input parameter problem.
+ * \retval ERR_BUSY SPI hardware not ready (resetting).
+ * \retval ERR_DENIED SPI has been enabled.
+ * \retval 0 Operation done successfully.
+ */
+int32_t _spi_m_sync_init(struct _spi_m_sync_dev *dev, void *const hw);
+
+/**
+ * \brief Deinitialize SPI
+ * Disable, reset the hardware and the software struct.
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \return Operation status.
+ * \retval 0 Operation done successfully.
+ */
+int32_t _spi_m_sync_deinit(struct _spi_m_sync_dev *dev);
+
+/**
+ * \brief Enable SPI for access without interrupts
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \return Operation status.
+ * \retval ERR_BUSY SPI hardware not ready (resetting).
+ * \retval 0 Operation done successfully.
+ */
+int32_t _spi_m_sync_enable(struct _spi_m_sync_dev *dev);
+
+/**
+ * \brief Disable SPI for access without interrupts
+ * Disable SPI. Deactivate all CS pins if works as master.
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \return Operation status.
+ * \retval 0 Operation done successfully.
+ */
+int32_t _spi_m_sync_disable(struct _spi_m_sync_dev *dev);
+
+/**
+ * \brief Set SPI transfer mode
+ * Set SPI transfer mode (\ref spi_transfer_mode),
+ * which controls clock polarity and clock phase.
+ * Mode 0: leading edge is rising edge, data sample on leading edge.
+ * Mode 1: leading edge is rising edge, data sample on trailing edge.
+ * Mode 2: leading edge is falling edge, data sample on leading edge.
+ * Mode 3: leading edge is falling edge, data sample on trailing edge.
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \param[in] mode The SPI transfer mode.
+ * \return Operation status.
+ * \retval ERR_BUSY SPI is not ready to accept new setting.
+ * \retval 0 Operation done successfully.
+ */
+int32_t _spi_m_sync_set_mode(struct _spi_m_sync_dev *dev, const enum spi_transfer_mode mode);
+
+/**
+ * \brief Set SPI baudrate
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \param[in] baud_val The SPI baudrate value, see \ref _spi_calc_baud_val() on
+ * how it's generated.
+ * \return Operation status.
+ * \retval ERR_BUSY SPI is not ready to accept new setting.
+ * \retval 0 Operation done successfully.
+ */
+int32_t _spi_m_sync_set_baudrate(struct _spi_m_sync_dev *dev, const uint32_t baud_val);
+
+/**
+ * \brief Set SPI char size
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \param[in] char_size The character size, see \ref spi_char_size.
+ * \return Operation status.
+ * \retval ERR_INVALID_ARG The character size is not supported.
+ * \retval ERR_BUSY SPI is not ready to accept new setting.
+ * \retval 0 Operation done successfully.
+ */
+int32_t _spi_m_sync_set_char_size(struct _spi_m_sync_dev *dev, const enum spi_char_size char_size);
+
+/**
+ * \brief Set SPI data order
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \param[in] dord SPI data order (LSB/MSB first).
+ * \return Operation status.
+ * \retval ERR_INVALID_ARG The character size is not supported.
+ * \retval ERR_BUSY SPI is not ready to accept new setting.
+ * \retval 0 Operation done successfully.
+ */
+int32_t _spi_m_sync_set_data_order(struct _spi_m_sync_dev *dev, const enum spi_data_order dord);
+
+/**
+ * \brief Transfer the whole message without interrupt
+ * Transfer the message, it will keep waiting until the message finish or
+ * error.
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \param[in] msg Pointer to the message instance to process.
+ * \return Error or number of characters transferred.
+ * \retval ERR_BUSY SPI hardware is not ready to start transfer (not
+ * enabled, busy applying settings, ...).
+ * \retval SPI_ERR_OVERFLOW Overflow error.
+ * \retval >=0 Number of characters transferred.
+ */
+int32_t _spi_m_sync_trans(struct _spi_m_sync_dev *dev, const struct spi_msg *msg);
+//@}
+
+#ifdef __cplusplus
+}
+#endif
+
+/**@}*/
+#endif /* ifndef _HPL_SPI_M_SYNC_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_spi_s_async.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_spi_s_async.h
new file mode 100644
index 0000000..5647243
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_spi_s_async.h
@@ -0,0 +1,232 @@
+/**
+ * \file
+ *
+ * \brief SPI Slave Async related functionality declaration.
+ *
+ * Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _HPL_SPI_S_ASYNC_H_INCLUDED
+#define _HPL_SPI_S_ASYNC_H_INCLUDED
+
+#include
+
+/**
+ * \addtogroup hpl_spi HPL SPI
+ *
+ *
+ *@{
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Uses common SPI async device driver. */
+#define _spi_s_async_dev _spi_async_dev
+
+#define _spi_s_async_dev_cb_type _spi_async_dev_cb_type
+
+/** Uses common SPI async device driver complete callback type. */
+#define _spi_m_async_dev_cb_error_t _spi_async_dev_cb_error_t
+
+/** Uses common SPI async device driver transfer callback type. */
+#define _spi_s_async_dev_cb_xfer_t _spi_async_dev_cb_xfer_t
+
+/**
+ * \name HPL functions
+ */
+//@{
+/**
+ * \brief Initialize SPI for access with interrupts
+ * It will load default hardware configuration and software struct.
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \param[in] hw Pointer to the hardware base.
+ * \return Operation status.
+ * \retval ERR_INVALID_ARG Input parameter problem.
+ * \retval ERR_BUSY SPI hardware not ready (resetting).
+ * \retval ERR_DENIED SPI has been enabled.
+ * \retval 0 Operation done successfully.
+ */
+int32_t _spi_s_async_init(struct _spi_s_async_dev *dev, void *const hw);
+
+/**
+ * \brief Initialize SPI for access with interrupts
+ * Disable, reset the hardware and the software struct.
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \return Operation status.
+ * \retval 0 Operation done successfully.
+ */
+int32_t _spi_s_async_deinit(struct _spi_s_async_dev *dev);
+
+/**
+ * \brief Enable SPI for access with interrupts
+ * Enable the SPI and enable callback generation of receive and error
+ * interrupts.
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \return Operation status.
+ * \retval ERR_INVALID_ARG Input parameter problem.
+ * \retval ERR_BUSY SPI hardware not ready (resetting).
+ * \retval 0 Operation done successfully.
+ */
+int32_t _spi_s_async_enable(struct _spi_s_async_dev *dev);
+
+/**
+ * \brief Disable SPI for access without interrupts
+ * Disable SPI and interrupts. Deactivate all CS pins if works as master.
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \return Operation status.
+ * \retval 0 Operation done successfully.
+ */
+int32_t _spi_s_async_disable(struct _spi_s_async_dev *dev);
+
+/**
+ * \brief Set SPI transfer mode
+ * Set SPI transfer mode (\ref spi_transfer_mode),
+ * which controls clock polarity and clock phase.
+ * Mode 0: leading edge is rising edge, data sample on leading edge.
+ * Mode 1: leading edge is rising edge, data sample on trailing edge.
+ * Mode 2: leading edge is falling edge, data sample on leading edge.
+ * Mode 3: leading edge is falling edge, data sample on trailing edge.
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \param[in] mode The SPI transfer mode.
+ * \return Operation status.
+ * \retval ERR_BUSY SPI is not ready to accept new setting.
+ * \retval 0 Operation done successfully.
+ */
+int32_t _spi_s_async_set_mode(struct _spi_s_async_dev *dev, const enum spi_transfer_mode mode);
+
+/**
+ * \brief Set SPI baudrate
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \param[in] char_size The character size, see \ref spi_char_size.
+ * \return Operation status.
+ * \retval ERR_INVALID_ARG The character size is not supported.
+ * \retval ERR_BUSY SPI is not ready to accept new setting.
+ * \retval 0 Operation done successfully.
+ */
+int32_t _spi_s_async_set_char_size(struct _spi_s_async_dev *dev, const enum spi_char_size char_size);
+
+/**
+ * \brief Set SPI data order
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \param[in] dord SPI data order (LSB/MSB first).
+ * \return Operation status.
+ * \retval ERR_INVALID_ARG The character size is not supported.
+ * \retval ERR_BUSY SPI is not ready to accept new setting.
+ * \retval 0 Operation done successfully.
+ */
+int32_t _spi_s_async_set_data_order(struct _spi_s_async_dev *dev, const enum spi_data_order dord);
+
+/**
+ * \brief Enable interrupt on character output
+ *
+ * Enable interrupt when a new character can be written
+ * to the SPI device.
+ *
+ * \param[in] dev Pointer to the SPI device instance
+ * \param[in] state true = enable output interrupt
+ * false = disable output interrupt
+ *
+ * \return Status code
+ * \retval 0 Ok status
+ */
+int32_t _spi_s_async_enable_tx(struct _spi_s_async_dev *dev, bool state);
+
+/**
+ * \brief Enable interrupt on character input
+ *
+ * Enable interrupt when a new character is ready to be
+ * read from the SPI device.
+ *
+ * \param[in] dev Pointer to the SPI device instance
+ * \param[in] state true = enable input interrupts
+ * false = disable input interrupt
+ *
+ * \return Status code
+ * \retvat 0 OK Status
+ */
+int32_t _spi_s_async_enable_rx(struct _spi_s_async_dev *dev, bool state);
+
+/**
+ * \brief Enable interrupt on Slave Select (SS) rising
+ *
+ * \param[in] dev Pointer to the SPI device instance
+ * \param[in] state true = enable input interrupts
+ * false = disable input interrupt
+ *
+ * \return Status code
+ * \retvat 0 OK Status
+ */
+int32_t _spi_s_async_enable_ss_detect(struct _spi_s_async_dev *dev, bool state);
+
+/**
+ * \brief Read one character to SPI device instance
+ * \param[in, out] dev Pointer to the SPI device instance.
+ *
+ * \return Character read from SPI module
+ */
+uint16_t _spi_s_async_read_one(struct _spi_s_async_dev *dev);
+
+/**
+ * \brief Write one character to assigned buffer
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \param[in] data
+ *
+ * \return Status code of write operation
+ * \retval 0 Write operation OK
+ */
+int32_t _spi_s_async_write_one(struct _spi_s_async_dev *dev, uint16_t data);
+
+/**
+ * \brief Register the SPI device callback
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \param[in] cb_type The callback type.
+ * \param[in] func The callback function to register. NULL to disable callback.
+ * \return Always 0.
+ */
+int32_t _spi_s_async_register_callback(struct _spi_s_async_dev *dev, const enum _spi_s_async_dev_cb_type cb_type,
+ const FUNC_PTR func);
+
+/**
+ * \brief Enable/disable SPI slave interrupt
+ *
+ * param[in] device The pointer to SPI slave device instance
+ * param[in] type The type of interrupt to disable/enable if applicable
+ * param[in] state Enable or disable
+ */
+void _spi_s_async_set_irq_state(struct _spi_s_async_dev *const device, const enum _spi_async_dev_cb_type type,
+ const bool state);
+//@}
+
+#ifdef __cplusplus
+}
+#endif
+
+/**@}*/
+#endif /* ifndef _HPL_SPI_S_ASYNC_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_spi_s_sync.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_spi_s_sync.h
new file mode 100644
index 0000000..ff4c811
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_spi_s_sync.h
@@ -0,0 +1,232 @@
+/**
+ * \file
+ *
+ * \brief SPI related functionality declaration.
+ *
+ * Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _HPL_SPI_S_SYNC_H_INCLUDED
+#define _HPL_SPI_S_SYNC_H_INCLUDED
+
+#include
+
+/**
+ * \addtogroup hpl_spi HPL SPI
+ *
+ *@{
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Uses common SPI sync device driver. */
+#define _spi_s_sync_dev _spi_sync_dev
+
+/**
+ * \name HPL functions
+ */
+//@{
+/**
+ * \brief Initialize SPI for access without interrupts
+ * It will load default hardware configuration and software struct.
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \param[in] hw Pointer to the hardware base.
+ * \return Operation status.
+ * \retval ERR_INVALID_ARG Input parameter problem.
+ * \retval ERR_BUSY SPI hardware not ready (resetting).
+ * \retval ERR_DENIED SPI has been enabled.
+ * \retval 0 Operation done successfully.
+ */
+int32_t _spi_s_sync_init(struct _spi_s_sync_dev *dev, void *const hw);
+
+/**
+ * \brief Initialize SPI for access with interrupts
+ * Disable, reset the hardware and the software struct.
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \return Operation status.
+ * \retval 0 Operation done successfully.
+ */
+int32_t _spi_s_sync_deinit(struct _spi_s_sync_dev *dev);
+
+/**
+ * \brief Enable SPI for access without interrupts
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \return Operation status.
+ * \retval ERR_BUSY SPI hardware not ready (resetting).
+ * \retval 0 Operation done successfully.
+ */
+int32_t _spi_s_sync_enable(struct _spi_s_sync_dev *dev);
+
+/**
+ * \brief Disable SPI for access without interrupts
+ * Disable SPI. Deactivate all CS pins if works as master.
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \return Operation status.
+ * \retval 0 Operation done successfully.
+ */
+int32_t _spi_s_sync_disable(struct _spi_s_sync_dev *dev);
+
+/**
+ * \brief Set SPI transfer mode
+ * Set SPI transfer mode (\ref spi_transfer_mode),
+ * which controls clock polarity and clock phase.
+ * Mode 0: leading edge is rising edge, data sample on leading edge.
+ * Mode 1: leading edge is rising edge, data sample on trailing edge.
+ * Mode 2: leading edge is falling edge, data sample on leading edge.
+ * Mode 3: leading edge is falling edge, data sample on trailing edge.
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \param[in] mode The SPI transfer mode.
+ * \return Operation status.
+ * \retval ERR_BUSY SPI is not ready to accept new setting.
+ * \retval 0 Operation done successfully.
+ */
+int32_t _spi_s_sync_set_mode(struct _spi_s_sync_dev *dev, const enum spi_transfer_mode mode);
+
+/**
+ * \brief Set SPI baudrate
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \param[in] char_size The character size, see \ref spi_char_size.
+ * \return Operation status.
+ * \retval ERR_INVALID_ARG The character size is not supported.
+ * \retval ERR_BUSY SPI is not ready to accept new setting.
+ * \retval 0 Operation done successfully.
+ */
+int32_t _spi_s_sync_set_char_size(struct _spi_s_sync_dev *dev, const enum spi_char_size char_size);
+
+/**
+ * \brief Set SPI data order
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \param[in] dord SPI data order (LSB/MSB first).
+ * \return Operation status.
+ * \retval ERR_INVALID_ARG The character size is not supported.
+ * \retval ERR_BUSY SPI is not ready to accept new setting.
+ * \retval 0 Operation done successfully.
+ */
+int32_t _spi_s_sync_set_data_order(struct _spi_s_sync_dev *dev, const enum spi_data_order dord);
+
+/**
+ * \brief Enable interrupt on character output
+ *
+ * Enable interrupt when a new character can be written
+ * to the SPI device.
+ *
+ * \param[in] dev Pointer to the SPI device instance
+ * \param[in] state true = enable output interrupt
+ * false = disable output interrupt
+ *
+ * \return Status code
+ * \retval 0 Ok status
+ */
+int32_t _spi_s_sync_enable_tx(struct _spi_s_sync_dev *dev, bool state);
+
+/**
+ * \brief Enable interrupt on character input
+ *
+ * Enable interrupt when a new character is ready to be
+ * read from the SPI device.
+ *
+ * \param[in] dev Pointer to the SPI device instance
+ * \param[in] state true = enable input interrupts
+ * false = disable input interrupt
+ *
+ * \return Status code
+ * \retval 0 OK Status
+ */
+int32_t _spi_s_sync_enable_rx(struct _spi_s_sync_dev *dev, bool state);
+
+/**
+ * \brief Read one character to SPI device instance
+ * \param[in, out] dev Pointer to the SPI device instance.
+ *
+ * \return Character read from SPI module
+ */
+uint16_t _spi_s_sync_read_one(struct _spi_s_sync_dev *dev);
+
+/**
+ * \brief Write one character to assigned buffer
+ * \param[in, out] dev Pointer to the SPI device instance.
+ * \param[in] data
+ *
+ * \return Status code of write operation
+ * \retval 0 Write operation OK
+ */
+int32_t _spi_s_sync_write_one(struct _spi_s_sync_dev *dev, uint16_t data);
+
+/**
+ * \brief Check if TX ready
+ *
+ * \param[in] dev Pointer to the SPI device instance
+ *
+ * \return TX ready state
+ * \retval true TX ready
+ * \retval false TX not ready
+ */
+bool _spi_s_sync_is_tx_ready(struct _spi_s_sync_dev *dev);
+
+/**
+ * \brief Check if RX character ready
+ *
+ * \param[in] dev Pointer to the SPI device instance
+ *
+ * \return RX character ready state
+ * \retval true RX character ready
+ * \retval false RX character not ready
+ */
+bool _spi_s_sync_is_rx_ready(struct _spi_s_sync_dev *dev);
+
+/**
+ * \brief Check if SS deactiviation detected
+ *
+ * \param[in] dev Pointer to the SPI device instance
+ *
+ * \return SS deactiviation state
+ * \retval true SS deactiviation detected
+ * \retval false SS deactiviation not detected
+ */
+bool _spi_s_sync_is_ss_deactivated(struct _spi_s_sync_dev *dev);
+
+/**
+ * \brief Check if error is detected
+ *
+ * \param[in] dev Pointer to the SPI device instance
+ *
+ * \return Error detection state
+ * \retval true Error detected
+ * \retval false Error not detected
+ */
+bool _spi_s_sync_is_error(struct _spi_s_sync_dev *dev);
+//@}
+
+#ifdef __cplusplus
+}
+#endif
+
+/**@}*/
+#endif /* ifndef _HPL_SPI_S_SYNC_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_spi_sync.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_spi_sync.h
new file mode 100644
index 0000000..dc88648
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_spi_sync.h
@@ -0,0 +1,70 @@
+/**
+ * \file
+ *
+ * \brief Common SPI related functionality declaration.
+ *
+ * Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _HPL_SPI_SYNC_H_INCLUDED
+#define _HPL_SPI_SYNC_H_INCLUDED
+
+#include
+#include
+
+#include
+
+/**
+ * \addtogroup hpl_spi HPL SPI
+ *
+ * \section hpl_spi_rev Revision History
+ * - v1.0.0 Initial Release
+ *
+ *@{
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** SPI driver to support sync HAL */
+struct _spi_sync_dev {
+ /** Pointer to the hardware base or private data for special device. */
+ void *prvt;
+ /** Data size, number of bytes for each character */
+ uint8_t char_size;
+ /** Dummy byte used in master mode when reading the slave */
+ uint16_t dummy_byte;
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+/**@}*/
+#endif /* ifndef _HPL_SPI_SYNC_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_usart.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_usart.h
new file mode 100644
index 0000000..0e09501
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_usart.h
@@ -0,0 +1,113 @@
+/**
+ * \file
+ *
+ * \brief USART related functionality declaration.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _HPL_USART_H_INCLUDED
+#define _HPL_USART_H_INCLUDED
+
+/**
+ * \addtogroup HPL USART SYNC
+ *
+ * \section hpl_usart_sync_rev Revision History
+ * - v1.0.0 Initial Release
+ *
+ *@{
+ */
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \brief USART flow control state
+ */
+union usart_flow_control_state {
+ struct {
+ uint8_t cts : 1;
+ uint8_t rts : 1;
+ uint8_t unavailable : 1;
+ uint8_t reserved : 5;
+ } bit;
+ uint8_t value;
+};
+
+/**
+ * \brief USART baud rate mode
+ */
+enum usart_baud_rate_mode { USART_BAUDRATE_ASYNCH_ARITHMETIC, USART_BAUDRATE_ASYNCH_FRACTIONAL, USART_BAUDRATE_SYNCH };
+
+/**
+ * \brief USART data order
+ */
+enum usart_data_order { USART_DATA_ORDER_MSB = 0, USART_DATA_ORDER_LSB = 1 };
+
+/**
+ * \brief USART mode
+ */
+enum usart_mode { USART_MODE_ASYNCHRONOUS = 0, USART_MODE_SYNCHRONOUS = 1 };
+
+/**
+ * \brief USART parity
+ */
+enum usart_parity {
+ USART_PARITY_EVEN = 0,
+ USART_PARITY_ODD = 1,
+ USART_PARITY_NONE = 2,
+ USART_PARITY_SPACE = 3,
+ USART_PARITY_MARK = 4
+};
+
+/**
+ * \brief USART stop bits mode
+ */
+enum usart_stop_bits { USART_STOP_BITS_ONE = 0, USART_STOP_BITS_TWO = 1, USART_STOP_BITS_ONE_P_FIVE = 2 };
+
+/**
+ * \brief USART character size
+ */
+enum usart_character_size {
+ USART_CHARACTER_SIZE_8BITS = 0,
+ USART_CHARACTER_SIZE_9BITS = 1,
+ USART_CHARACTER_SIZE_5BITS = 5,
+ USART_CHARACTER_SIZE_6BITS = 6,
+ USART_CHARACTER_SIZE_7BITS = 7
+};
+
+//@}
+
+#ifdef __cplusplus
+}
+#endif
+/**@}*/
+#endif /* _HPL_USART_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_usart_async.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_usart_async.h
new file mode 100644
index 0000000..3f833d1
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_usart_async.h
@@ -0,0 +1,270 @@
+/**
+ * \file
+ *
+ * \brief USART related functionality declaration.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _HPL_USART_ASYNC_H_INCLUDED
+#define _HPL_USART_ASYNC_H_INCLUDED
+
+/**
+ * \addtogroup HPL USART
+ *
+ * \section hpl_usart_rev Revision History
+ * - v1.0.0 Initial Release
+ *
+ *@{
+ */
+
+#include "hpl_usart.h"
+#include "hpl_irq.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \brief USART callback types
+ */
+enum _usart_async_callback_type { USART_ASYNC_BYTE_SENT, USART_ASYNC_RX_DONE, USART_ASYNC_TX_DONE, USART_ASYNC_ERROR };
+
+/**
+ * \brief USART device structure
+ *
+ * The USART device structure forward declaration.
+ */
+struct _usart_async_device;
+
+/**
+ * \brief USART interrupt callbacks
+ */
+struct _usart_async_callbacks {
+ void (*tx_byte_sent)(struct _usart_async_device *device);
+ void (*rx_done_cb)(struct _usart_async_device *device, uint8_t data);
+ void (*tx_done_cb)(struct _usart_async_device *device);
+ void (*error_cb)(struct _usart_async_device *device);
+};
+
+/**
+ * \brief USART descriptor device structure
+ */
+struct _usart_async_device {
+ struct _usart_async_callbacks usart_cb;
+ struct _irq_descriptor irq;
+ void * hw;
+};
+/**
+ * \name HPL functions
+ */
+//@{
+/**
+ * \brief Initialize asynchronous USART
+ *
+ * This function does low level USART configuration.
+ *
+ * \param[in] device The pointer to USART device instance
+ * \param[in] hw The pointer to hardware instance
+ *
+ * \return Initialization status
+ */
+int32_t _usart_async_init(struct _usart_async_device *const device, void *const hw);
+
+/**
+ * \brief Deinitialize USART
+ *
+ * This function closes the given USART by disabling its clock.
+ *
+ * \param[in] device The pointer to USART device instance
+ */
+void _usart_async_deinit(struct _usart_async_device *const device);
+
+/**
+ * \brief Enable usart module
+ *
+ * This function will enable the usart module
+ *
+ * \param[in] device The pointer to USART device instance
+ */
+void _usart_async_enable(struct _usart_async_device *const device);
+
+/**
+ * \brief Disable usart module
+ *
+ * This function will disable the usart module
+ *
+ * \param[in] device The pointer to USART device instance
+ */
+void _usart_async_disable(struct _usart_async_device *const device);
+
+/**
+ * \brief Calculate baud rate register value
+ *
+ * \param[in] baud Required baud rate
+ * \param[in] clock_rate clock frequency
+ * \param[in] samples The number of samples
+ * \param[in] mode USART mode
+ * \param[in] fraction A fraction value
+ *
+ * \return Calculated baud rate register value
+ */
+uint16_t _usart_async_calculate_baud_rate(const uint32_t baud, const uint32_t clock_rate, const uint8_t samples,
+ const enum usart_baud_rate_mode mode, const uint8_t fraction);
+
+/**
+ * \brief Set baud rate
+ *
+ * \param[in] device The pointer to USART device instance
+ * \param[in] baud_rate A baud rate to set
+ */
+void _usart_async_set_baud_rate(struct _usart_async_device *const device, const uint32_t baud_rate);
+
+/**
+ * \brief Set data order
+ *
+ * \param[in] device The pointer to USART device instance
+ * \param[in] order A data order to set
+ */
+void _usart_async_set_data_order(struct _usart_async_device *const device, const enum usart_data_order order);
+
+/**
+ * \brief Set mode
+ *
+ * \param[in] device The pointer to USART device instance
+ * \param[in] mode A mode to set
+ */
+void _usart_async_set_mode(struct _usart_async_device *const device, const enum usart_mode mode);
+
+/**
+ * \brief Set parity
+ *
+ * \param[in] device The pointer to USART device instance
+ * \param[in] parity A parity to set
+ */
+void _usart_async_set_parity(struct _usart_async_device *const device, const enum usart_parity parity);
+
+/**
+ * \brief Set stop bits mode
+ *
+ * \param[in] device The pointer to USART device instance
+ * \param[in] stop_bits A stop bits mode to set
+ */
+void _usart_async_set_stop_bits(struct _usart_async_device *const device, const enum usart_stop_bits stop_bits);
+
+/**
+ * \brief Set character size
+ *
+ * \param[in] device The pointer to USART device instance
+ * \param[in] size A character size to set
+ */
+void _usart_async_set_character_size(struct _usart_async_device *const device, const enum usart_character_size size);
+
+/**
+ * \brief Retrieve usart status
+ *
+ * \param[in] device The pointer to USART device instance
+ */
+uint32_t _usart_async_get_status(const struct _usart_async_device *const device);
+
+/**
+ * \brief Write a byte to the given USART instance
+ *
+ * \param[in] device The pointer to USART device instance
+ * \param[in] data Data to write
+ */
+void _usart_async_write_byte(struct _usart_async_device *const device, uint8_t data);
+
+/**
+ * \brief Check if USART is ready to send next byte
+ *
+ * \param[in] device The pointer to USART device instance
+ *
+ * \return Status of the ready check.
+ * \retval true if the USART is ready to send next byte
+ * \retval false if the USART is not ready to send next byte
+ */
+bool _usart_async_is_byte_sent(const struct _usart_async_device *const device);
+
+/**
+ * \brief Set the state of flow control pins
+ *
+ * \param[in] device The pointer to USART device instance
+ * \param[in] state - A state of flow control pins to set
+ */
+void _usart_async_set_flow_control_state(struct _usart_async_device *const device,
+ const union usart_flow_control_state state);
+
+/**
+ * \brief Retrieve the state of flow control pins
+ *
+ * This function retrieves the of flow control pins.
+ *
+ * \return USART_FLOW_CONTROL_STATE_UNAVAILABLE.
+ */
+union usart_flow_control_state _usart_async_get_flow_control_state(const struct _usart_async_device *const device);
+
+/**
+ * \brief Enable data register empty interrupt
+ *
+ * \param[in] device The pointer to USART device instance
+ */
+void _usart_async_enable_byte_sent_irq(struct _usart_async_device *const device);
+
+/**
+ * \brief Enable transmission complete interrupt
+ *
+ * \param[in] device The pointer to USART device instance
+ */
+void _usart_async_enable_tx_done_irq(struct _usart_async_device *const device);
+
+/**
+ * \brief Retrieve ordinal number of the given USART hardware instance
+ *
+ * \param[in] device The pointer to USART device instance
+ *
+ * \return The ordinal number of the given USART hardware instance
+ */
+uint8_t _usart_async_get_hardware_index(const struct _usart_async_device *const device);
+
+/**
+ * \brief Enable/disable USART interrupt
+ *
+ * param[in] device The pointer to USART device instance
+ * param[in] type The type of interrupt to disable/enable if applicable
+ * param[in] state Enable or disable
+ */
+void _usart_async_set_irq_state(struct _usart_async_device *const device, const enum _usart_async_callback_type type,
+ const bool state);
+//@}
+
+#ifdef __cplusplus
+}
+#endif
+/**@}*/
+#endif /* _HPL_USART_ASYNC_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_usart_sync.h b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_usart_sync.h
new file mode 100644
index 0000000..abc7264
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/include/hpl_usart_sync.h
@@ -0,0 +1,254 @@
+/**
+ * \file
+ *
+ * \brief USART related functionality declaration.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _HPL_SYNC_USART_H_INCLUDED
+#define _HPL_SYNC_USART_H_INCLUDED
+
+/**
+ * \addtogroup HPL USART SYNC
+ *
+ * \section hpl_usart_sync_rev Revision History
+ * - v1.0.0 Initial Release
+ *
+ *@{
+ */
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \brief USART descriptor device structure
+ */
+struct _usart_sync_device {
+ void *hw;
+};
+
+/**
+ * \name HPL functions
+ */
+//@{
+/**
+ * \brief Initialize synchronous USART
+ *
+ * This function does low level USART configuration.
+ *
+ * \param[in] device The pointer to USART device instance
+ * \param[in] hw The pointer to hardware instance
+ *
+ * \return Initialization status
+ */
+int32_t _usart_sync_init(struct _usart_sync_device *const device, void *const hw);
+
+/**
+ * \brief Deinitialize USART
+ *
+ * This function closes the given USART by disabling its clock.
+ *
+ * \param[in] device The pointer to USART device instance
+ */
+void _usart_sync_deinit(struct _usart_sync_device *const device);
+
+/**
+ * \brief Enable usart module
+ *
+ * This function will enable the usart module
+ *
+ * \param[in] device The pointer to USART device instance
+ */
+void _usart_sync_enable(struct _usart_sync_device *const device);
+
+/**
+ * \brief Disable usart module
+ *
+ * This function will disable the usart module
+ *
+ * \param[in] device The pointer to USART device instance
+ */
+void _usart_sync_disable(struct _usart_sync_device *const device);
+
+/**
+ * \brief Calculate baud rate register value
+ *
+ * \param[in] baud Required baud rate
+ * \param[in] clock_rate clock frequency
+ * \param[in] samples The number of samples
+ * \param[in] mode USART mode
+ * \param[in] fraction A fraction value
+ *
+ * \return Calculated baud rate register value
+ */
+uint16_t _usart_sync_calculate_baud_rate(const uint32_t baud, const uint32_t clock_rate, const uint8_t samples,
+ const enum usart_baud_rate_mode mode, const uint8_t fraction);
+
+/**
+ * \brief Set baud rate
+ *
+ * \param[in] device The pointer to USART device instance
+ * \param[in] baud_rate A baud rate to set
+ */
+void _usart_sync_set_baud_rate(struct _usart_sync_device *const device, const uint32_t baud_rate);
+
+/**
+ * \brief Set data order
+ *
+ * \param[in] device The pointer to USART device instance
+ * \param[in] order A data order to set
+ */
+void _usart_sync_set_data_order(struct _usart_sync_device *const device, const enum usart_data_order order);
+
+/**
+ * \brief Set mode
+ *
+ * \param[in] device The pointer to USART device instance
+ * \param[in] mode A mode to set
+ */
+void _usart_sync_set_mode(struct _usart_sync_device *const device, const enum usart_mode mode);
+
+/**
+ * \brief Set parity
+ *
+ * \param[in] device The pointer to USART device instance
+ * \param[in] parity A parity to set
+ */
+void _usart_sync_set_parity(struct _usart_sync_device *const device, const enum usart_parity parity);
+
+/**
+ * \brief Set stop bits mode
+ *
+ * \param[in] device The pointer to USART device instance
+ * \param[in] stop_bits A stop bits mode to set
+ */
+void _usart_sync_set_stop_bits(struct _usart_sync_device *const device, const enum usart_stop_bits stop_bits);
+
+/**
+ * \brief Set character size
+ *
+ * \param[in] device The pointer to USART device instance
+ * \param[in] size A character size to set
+ */
+void _usart_sync_set_character_size(struct _usart_sync_device *const device, const enum usart_character_size size);
+
+/**
+ * \brief Retrieve usart status
+ *
+ * \param[in] device The pointer to USART device instance
+ */
+uint32_t _usart_sync_get_status(const struct _usart_sync_device *const device);
+
+/**
+ * \brief Write a byte to the given USART instance
+ *
+ * \param[in] device The pointer to USART device instance
+ * \param[in] data Data to write
+ */
+void _usart_sync_write_byte(struct _usart_sync_device *const device, uint8_t data);
+
+/**
+ * \brief Read a byte from the given USART instance
+ *
+ * \param[in] device The pointer to USART device instance
+ * \param[in] data Data to write
+ *
+ * \return Data received via USART interface.
+ */
+uint8_t _usart_sync_read_byte(const struct _usart_sync_device *const device);
+
+/**
+ * \brief Check if USART is ready to send next byte
+ *
+ * \param[in] device The pointer to USART device instance
+ *
+ * \return Status of the ready check.
+ * \retval true if the USART is ready to send next byte
+ * \retval false if the USART is not ready to send next byte
+ */
+bool _usart_sync_is_ready_to_send(const struct _usart_sync_device *const device);
+
+/**
+ * \brief Check if USART transmitter has sent the byte
+ *
+ * \param[in] device The pointer to USART device instance
+ *
+ * \return Status of the ready check.
+ * \retval true if the USART transmitter has sent the byte
+ * \retval false if the USART transmitter has not send the byte
+ */
+bool _usart_sync_is_transmit_done(const struct _usart_sync_device *const device);
+
+/**
+ * \brief Check if there is data received by USART
+ *
+ * \param[in] device The pointer to USART device instance
+ *
+ * \return Status of the data received check.
+ * \retval true if the USART has received a byte
+ * \retval false if the USART has not received a byte
+ */
+bool _usart_sync_is_byte_received(const struct _usart_sync_device *const device);
+
+/**
+ * \brief Set the state of flow control pins
+ *
+ * \param[in] device The pointer to USART device instance
+ * \param[in] state - A state of flow control pins to set
+ */
+void _usart_sync_set_flow_control_state(struct _usart_sync_device *const device,
+ const union usart_flow_control_state state);
+
+/**
+ * \brief Retrieve the state of flow control pins
+ *
+ * This function retrieves the of flow control pins.
+ *
+ * \return USART_FLOW_CONTROL_STATE_UNAVAILABLE.
+ */
+union usart_flow_control_state _usart_sync_get_flow_control_state(const struct _usart_sync_device *const device);
+
+/**
+ * \brief Retrieve ordinal number of the given USART hardware instance
+ *
+ * \param[in] device The pointer to USART device instance
+ *
+ * \return The ordinal number of the given USART hardware instance
+ */
+uint8_t _usart_sync_get_hardware_index(const struct _usart_sync_device *const device);
+//@}
+
+#ifdef __cplusplus
+}
+#endif
+/**@}*/
+#endif /* _HPL_SYNC_USART_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/src/hal_atomic.c b/Examples/AS5048A_test/AS5048A_test/hal/src/hal_atomic.c
new file mode 100644
index 0000000..f56418e
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/src/hal_atomic.c
@@ -0,0 +1,66 @@
+/**
+ * \file
+ *
+ * \brief Critical sections related functionality implementation.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#include "hal_atomic.h"
+
+/**
+ * \brief Driver version
+ */
+#define DRIVER_VERSION 0x00000001u
+
+/**
+ * \brief Disable interrupts, enter critical section
+ */
+void atomic_enter_critical(hal_atomic_t volatile *atomic)
+{
+ *atomic = __get_PRIMASK();
+ __disable_irq();
+ __DMB();
+}
+
+/**
+ * \brief Exit atomic section
+ */
+void atomic_leave_critical(hal_atomic_t volatile *atomic)
+{
+ __DMB();
+ __set_PRIMASK(*atomic);
+}
+
+/**
+ * \brief Retrieve the current driver version
+ */
+uint32_t atomic_get_version(void)
+{
+ return DRIVER_VERSION;
+}
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/src/hal_cache.c b/Examples/AS5048A_test/AS5048A_test/hal/src/hal_cache.c
new file mode 100644
index 0000000..b2e75aa
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/src/hal_cache.c
@@ -0,0 +1,78 @@
+/**
+ * \file
+ *
+ * \brief HAL cache functionality implementation.
+ *
+ * Copyright (c)2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+/*
+ * Support and FAQ: visit Microchip Support
+ */
+
+#include
+#include
+
+/**
+ * \brief Initialize cache module
+ */
+int32_t cache_init(void)
+{
+ return _cmcc_init();
+}
+
+/**
+ * \brief Enable cache module
+ */
+int32_t cache_enable(const void *hw)
+{
+ return _cmcc_enable(hw);
+}
+
+/**
+ * \brief Disable cache module
+ */
+int32_t cache_disable(const void *hw)
+{
+ return _cmcc_disable(hw);
+}
+
+/**
+ * \brief Configure cache module
+ */
+int32_t cache_configure(const void *hw, struct _cache_cfg *cache)
+{
+ return _cmcc_configure(hw, cache);
+}
+
+/**
+ * \brief Invalidate entire cache entries
+ */
+int32_t cache_invalidate_all(const void *hw)
+{
+ return _cmcc_invalidate_all(hw);
+}
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/src/hal_delay.c b/Examples/AS5048A_test/AS5048A_test/hal/src/hal_delay.c
new file mode 100644
index 0000000..6f77cc7
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/src/hal_delay.c
@@ -0,0 +1,80 @@
+/**
+ * \file
+ *
+ * \brief HAL delay related functionality implementation.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#include
+#include
+#include
+#include "hal_delay.h"
+#include
+
+/**
+ * \brief Driver version
+ */
+#define DRIVER_VERSION 0x00000001u
+
+/**
+ * \brief The pointer to a hardware instance used by the driver.
+ */
+static void *hardware;
+
+/**
+ * \brief Initialize Delay driver
+ */
+void delay_init(void *const hw)
+{
+ _delay_init(hardware = hw);
+}
+
+/**
+ * \brief Perform delay in us
+ */
+void delay_us(const uint16_t us)
+{
+ _delay_cycles(hardware, _get_cycles_for_us(us));
+}
+
+/**
+ * \brief Perform delay in ms
+ */
+void delay_ms(const uint16_t ms)
+{
+ _delay_cycles(hardware, _get_cycles_for_ms(ms));
+}
+
+/**
+ * \brief Retrieve the current driver version
+ */
+uint32_t delay_get_version(void)
+{
+ return DRIVER_VERSION;
+}
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/src/hal_gpio.c b/Examples/AS5048A_test/AS5048A_test/hal/src/hal_gpio.c
new file mode 100644
index 0000000..00dfea6
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/src/hal_gpio.c
@@ -0,0 +1,44 @@
+/**
+ * \file
+ *
+ * \brief Port
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#include "hal_gpio.h"
+
+/**
+ * \brief Driver version
+ */
+#define DRIVER_VERSION 0x00000001u
+
+uint32_t gpio_get_version(void)
+{
+ return DRIVER_VERSION;
+}
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/src/hal_init.c b/Examples/AS5048A_test/AS5048A_test/hal/src/hal_init.c
new file mode 100644
index 0000000..fb65341
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/src/hal_init.c
@@ -0,0 +1,47 @@
+/**
+ * \file
+ *
+ * \brief HAL initialization related functionality implementation.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#include "hal_init.h"
+
+/**
+ * \brief Driver version
+ */
+#define HAL_INIT_VERSION 0x00000001u
+
+/**
+ * \brief Retrieve the current driver version
+ */
+uint32_t init_get_version(void)
+{
+ return HAL_INIT_VERSION;
+}
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/src/hal_io.c b/Examples/AS5048A_test/AS5048A_test/hal/src/hal_io.c
new file mode 100644
index 0000000..7e8feb0
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/src/hal_io.c
@@ -0,0 +1,63 @@
+/**
+ * \file
+ *
+ * \brief I/O functionality implementation.
+ *
+ * Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#include
+#include
+
+/**
+ * \brief Driver version
+ */
+#define DRIVER_VERSION 0x00000001u
+
+uint32_t io_get_version(void)
+{
+ return DRIVER_VERSION;
+}
+
+/**
+ * \brief I/O write interface
+ */
+int32_t io_write(struct io_descriptor *const io_descr, const uint8_t *const buf, const uint16_t length)
+{
+ ASSERT(io_descr && buf);
+ return io_descr->write(io_descr, buf, length);
+}
+
+/**
+ * \brief I/O read interface
+ */
+int32_t io_read(struct io_descriptor *const io_descr, uint8_t *const buf, const uint16_t length)
+{
+ ASSERT(io_descr && buf);
+ return io_descr->read(io_descr, buf, length);
+}
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/src/hal_sleep.c b/Examples/AS5048A_test/AS5048A_test/hal/src/hal_sleep.c
new file mode 100644
index 0000000..89472f1
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/src/hal_sleep.c
@@ -0,0 +1,73 @@
+/**
+ * \file
+ *
+ * \brief Sleep related functionality implementation.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#include "hal_sleep.h"
+#include
+
+/**
+ * \brief Driver version
+ */
+#define DRIVER_VERSION 0x00000001u
+
+/**
+ * \brief Set the sleep mode of the device and put the MCU to sleep
+ *
+ * For an overview of which systems are disabled in sleep for the different
+ * sleep modes, see the data sheet.
+ *
+ * \param[in] mode Sleep mode to use
+ *
+ * \return The status of a sleep request
+ * \retval -1 The requested sleep mode was invalid or not available
+ * \retval 0 The operation completed successfully, returned after leaving the
+ * sleep
+ */
+int sleep(const uint8_t mode)
+{
+ if (ERR_NONE != _set_sleep_mode(mode))
+ return ERR_INVALID_ARG;
+
+ _go_to_sleep();
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Retrieve the current driver version
+ *
+ * \return Current driver version
+ */
+uint32_t sleep_get_version(void)
+{
+ return DRIVER_VERSION;
+}
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/src/hal_spi_m_sync.c b/Examples/AS5048A_test/AS5048A_test/hal/src/hal_spi_m_sync.c
new file mode 100644
index 0000000..1a64296
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/src/hal_spi_m_sync.c
@@ -0,0 +1,201 @@
+/**
+ * \file
+ *
+ * \brief I/O SPI related functionality implementation.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#include "hal_spi_m_sync.h"
+#include
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \brief Driver version
+ */
+#define SPI_M_SYNC_DRIVER_VERSION 0x00000001u
+
+#define SPI_DEACTIVATE_NEXT 0x8000
+
+static int32_t _spi_m_sync_io_write(struct io_descriptor *const io, const uint8_t *const buf, const uint16_t length);
+static int32_t _spi_m_sync_io_read(struct io_descriptor *const io, uint8_t *const buf, const uint16_t length);
+
+/**
+ * \brief Initialize the SPI HAL instance function pointer for HPL APIs.
+ */
+void spi_m_sync_set_func_ptr(struct spi_m_sync_descriptor *spi, void *const func)
+{
+ ASSERT(spi);
+ spi->func = (struct _spi_m_sync_hpl_interface *)func;
+}
+
+int32_t spi_m_sync_init(struct spi_m_sync_descriptor *spi, void *const hw)
+{
+ int32_t rc = 0;
+ ASSERT(spi && hw);
+ spi->dev.prvt = (void *)hw;
+ rc = _spi_m_sync_init(&spi->dev, hw);
+
+ if (rc < 0) {
+ return rc;
+ }
+
+ spi->flags = SPI_DEACTIVATE_NEXT;
+ spi->io.read = _spi_m_sync_io_read;
+ spi->io.write = _spi_m_sync_io_write;
+
+ return ERR_NONE;
+}
+
+void spi_m_sync_deinit(struct spi_m_sync_descriptor *spi)
+{
+ ASSERT(spi);
+ _spi_m_sync_deinit(&spi->dev);
+}
+
+void spi_m_sync_enable(struct spi_m_sync_descriptor *spi)
+{
+ ASSERT(spi);
+ _spi_m_sync_enable(&spi->dev);
+}
+
+void spi_m_sync_disable(struct spi_m_sync_descriptor *spi)
+{
+ ASSERT(spi);
+ _spi_m_sync_disable(&spi->dev);
+}
+
+int32_t spi_m_sync_set_baudrate(struct spi_m_sync_descriptor *spi, const uint32_t baud_val)
+{
+ ASSERT(spi);
+ return _spi_m_sync_set_baudrate(&spi->dev, baud_val);
+}
+
+int32_t spi_m_sync_set_mode(struct spi_m_sync_descriptor *spi, const enum spi_transfer_mode mode)
+{
+ ASSERT(spi);
+ return _spi_m_sync_set_mode(&spi->dev, mode);
+}
+
+int32_t spi_m_sync_set_char_size(struct spi_m_sync_descriptor *spi, const enum spi_char_size char_size)
+{
+ ASSERT(spi);
+ return _spi_m_sync_set_char_size(&spi->dev, char_size);
+}
+
+int32_t spi_m_sync_set_data_order(struct spi_m_sync_descriptor *spi, const enum spi_data_order dord)
+{
+ ASSERT(spi);
+ return _spi_m_sync_set_data_order(&spi->dev, dord);
+}
+
+/** \brief Do SPI read in polling way
+ * For SPI master, activate CS, do send 0xFFs and read data, deactivate CS.
+ *
+ * It blocks until all data read or error.
+ *
+ * \param[in, out] spi Pointer to the HAL SPI instance.
+ * \param[out] buf Pointer to the buffer to store read data.
+ * \param[in] size Size of the data in number of characters.
+ * \return Operation status.
+ * \retval size Success.
+ * \retval >=0 Time out, with number of characters read.
+ */
+static int32_t _spi_m_sync_io_read(struct io_descriptor *io, uint8_t *buf, const uint16_t length)
+{
+ ASSERT(io);
+
+ struct spi_m_sync_descriptor *spi = CONTAINER_OF(io, struct spi_m_sync_descriptor, io);
+ struct spi_xfer xfer;
+
+ xfer.rxbuf = buf;
+ xfer.txbuf = 0;
+ xfer.size = length;
+
+ return spi_m_sync_transfer(spi, &xfer);
+}
+
+/** \brief Do SPI data write in polling way
+ * For SPI master, activate CS, do buffer send and deactivate CS. The data back
+ * is discarded.
+ *
+ * The data read back is discarded.
+ *
+ * It blocks until all data sent or error.
+ *
+ * \param[in, out] spi Pointer to the HAL SPI instance.
+ * \param[in] p_xfer Pointer to the transfer information (\ref spi_transfer).
+ * \return Operation status.
+ * \retval size Success.
+ * \retval >=0 Timeout, with number of characters transferred.
+ */
+static int32_t _spi_m_sync_io_write(struct io_descriptor *const io, const uint8_t *const buf, const uint16_t length)
+{
+ ASSERT(io);
+
+ struct spi_m_sync_descriptor *spi = CONTAINER_OF(io, struct spi_m_sync_descriptor, io);
+ struct spi_xfer xfer;
+
+ xfer.rxbuf = 0;
+ xfer.txbuf = (uint8_t *)buf;
+ xfer.size = length;
+
+ return spi_m_sync_transfer(spi, &xfer);
+}
+
+int32_t spi_m_sync_transfer(struct spi_m_sync_descriptor *spi, const struct spi_xfer *p_xfer)
+{
+ struct spi_msg msg;
+
+ ASSERT(spi && p_xfer);
+
+ msg.txbuf = p_xfer->txbuf;
+ msg.rxbuf = p_xfer->rxbuf;
+ msg.size = p_xfer->size;
+ return _spi_m_sync_trans(&spi->dev, &msg);
+}
+
+int32_t spi_m_sync_get_io_descriptor(struct spi_m_sync_descriptor *const spi, struct io_descriptor **io)
+{
+ ASSERT(spi && io);
+ *io = &spi->io;
+ return 0;
+}
+
+uint32_t spi_m_sync_get_version(void)
+{
+ return SPI_M_SYNC_DRIVER_VERSION;
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/src/hal_usart_sync.c b/Examples/AS5048A_test/AS5048A_test/hal/src/hal_usart_sync.c
new file mode 100644
index 0000000..ab99c1d
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/src/hal_usart_sync.c
@@ -0,0 +1,276 @@
+/**
+ * \file
+ *
+ * \brief I/O USART related functionality implementation.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#include "hal_usart_sync.h"
+#include
+#include
+
+/**
+ * \brief Driver version
+ */
+#define DRIVER_VERSION 0x00000001u
+
+static int32_t usart_sync_write(struct io_descriptor *const io_descr, const uint8_t *const buf, const uint16_t length);
+static int32_t usart_sync_read(struct io_descriptor *const io_descr, uint8_t *const buf, const uint16_t length);
+
+/**
+ * \brief Initialize usart interface
+ */
+int32_t usart_sync_init(struct usart_sync_descriptor *const descr, void *const hw, void *const func)
+{
+ int32_t init_status;
+ ASSERT(descr && hw);
+ init_status = _usart_sync_init(&descr->device, hw);
+ if (init_status) {
+ return init_status;
+ }
+
+ descr->io.read = usart_sync_read;
+ descr->io.write = usart_sync_write;
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Uninitialize usart interface
+ */
+int32_t usart_sync_deinit(struct usart_sync_descriptor *const descr)
+{
+ ASSERT(descr);
+ _usart_sync_deinit(&descr->device);
+
+ descr->io.read = NULL;
+ descr->io.write = NULL;
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Enable usart interface
+ */
+int32_t usart_sync_enable(struct usart_sync_descriptor *const descr)
+{
+ ASSERT(descr);
+ _usart_sync_enable(&descr->device);
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Disable usart interface
+ */
+int32_t usart_sync_disable(struct usart_sync_descriptor *const descr)
+{
+ ASSERT(descr);
+ _usart_sync_disable(&descr->device);
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Retrieve I/O descriptor
+ */
+int32_t usart_sync_get_io_descriptor(struct usart_sync_descriptor *const descr, struct io_descriptor **io)
+{
+ ASSERT(descr && io);
+
+ *io = &descr->io;
+ return ERR_NONE;
+}
+
+/**
+ * \brief Specify action for flow control pins
+ */
+int32_t usart_sync_set_flow_control(struct usart_sync_descriptor *const descr,
+ const union usart_flow_control_state state)
+{
+ ASSERT(descr);
+ _usart_sync_set_flow_control_state(&descr->device, state);
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Set usart baud rate
+ */
+int32_t usart_sync_set_baud_rate(struct usart_sync_descriptor *const descr, const uint32_t baud_rate)
+{
+ ASSERT(descr);
+ _usart_sync_set_baud_rate(&descr->device, baud_rate);
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Set usart data order
+ */
+int32_t usart_sync_set_data_order(struct usart_sync_descriptor *const descr, const enum usart_data_order data_order)
+{
+ ASSERT(descr);
+ _usart_sync_set_data_order(&descr->device, data_order);
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Set usart mode
+ */
+int32_t usart_sync_set_mode(struct usart_sync_descriptor *const descr, const enum usart_mode mode)
+{
+ ASSERT(descr);
+ _usart_sync_set_mode(&descr->device, mode);
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Set usart parity
+ */
+int32_t usart_sync_set_parity(struct usart_sync_descriptor *const descr, const enum usart_parity parity)
+{
+ ASSERT(descr);
+ _usart_sync_set_parity(&descr->device, parity);
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Set usart stop bits
+ */
+int32_t usart_sync_set_stopbits(struct usart_sync_descriptor *const descr, const enum usart_stop_bits stop_bits)
+{
+ ASSERT(descr);
+ _usart_sync_set_stop_bits(&descr->device, stop_bits);
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Set usart character size
+ */
+int32_t usart_sync_set_character_size(struct usart_sync_descriptor *const descr, const enum usart_character_size size)
+{
+ ASSERT(descr);
+ _usart_sync_set_character_size(&descr->device, size);
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Retrieve the state of flow control pins
+ */
+int32_t usart_sync_flow_control_status(const struct usart_sync_descriptor *const descr,
+ union usart_flow_control_state *const state)
+{
+ ASSERT(descr && state);
+ *state = _usart_sync_get_flow_control_state(&descr->device);
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Check if the usart transmitter is empty
+ */
+int32_t usart_sync_is_tx_empty(const struct usart_sync_descriptor *const descr)
+{
+ ASSERT(descr);
+ return _usart_sync_is_ready_to_send(&descr->device);
+}
+
+/**
+ * \brief Check if the usart receiver is not empty
+ */
+int32_t usart_sync_is_rx_not_empty(const struct usart_sync_descriptor *const descr)
+{
+ ASSERT(descr);
+ return _usart_sync_is_byte_received(&descr->device);
+}
+
+/**
+ * \brief Retrieve the current driver version
+ */
+uint32_t usart_sync_get_version(void)
+{
+ return DRIVER_VERSION;
+}
+
+/*
+ * \internal Write the given data to usart interface
+ *
+ * \param[in] descr The pointer to an io descriptor
+ * \param[in] buf Data to write to usart
+ * \param[in] length The number of bytes to write
+ *
+ * \return The number of bytes written.
+ */
+static int32_t usart_sync_write(struct io_descriptor *const io_descr, const uint8_t *const buf, const uint16_t length)
+{
+ uint32_t offset = 0;
+ struct usart_sync_descriptor *descr = CONTAINER_OF(io_descr, struct usart_sync_descriptor, io);
+
+ ASSERT(io_descr && buf && length);
+ while (!_usart_sync_is_ready_to_send(&descr->device))
+ ;
+ do {
+ _usart_sync_write_byte(&descr->device, buf[offset]);
+ while (!_usart_sync_is_ready_to_send(&descr->device))
+ ;
+ } while (++offset < length);
+ while (!_usart_sync_is_transmit_done(&descr->device))
+ ;
+ return (int32_t)offset;
+}
+
+/*
+ * \internal Read data from usart interface
+ *
+ * \param[in] descr The pointer to an io descriptor
+ * \param[in] buf A buffer to read data to
+ * \param[in] length The size of a buffer
+ *
+ * \return The number of bytes read.
+ */
+static int32_t usart_sync_read(struct io_descriptor *const io_descr, uint8_t *const buf, const uint16_t length)
+{
+ uint32_t offset = 0;
+ struct usart_sync_descriptor *descr = CONTAINER_OF(io_descr, struct usart_sync_descriptor, io);
+
+ ASSERT(io_descr && buf && length);
+ do {
+ while (!_usart_sync_is_byte_received(&descr->device))
+ ;
+ buf[offset] = _usart_sync_read_byte(&descr->device);
+ } while (++offset < length);
+
+ return (int32_t)offset;
+}
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/utils/include/compiler.h b/Examples/AS5048A_test/AS5048A_test/hal/utils/include/compiler.h
new file mode 100644
index 0000000..f35db3d
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/utils/include/compiler.h
@@ -0,0 +1,64 @@
+/**
+ * \file
+ *
+ * \brief Header
+ *
+ * Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+/*
+ * Support and FAQ: visit Microchip Support
+ */
+
+/******************************************************************************
+ * compiler.h
+ *
+ * Created: 05.05.2014
+ * Author: N. Fomin
+ ******************************************************************************/
+
+#ifndef _COMPILER_H
+#define _COMPILER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+#include
+#include
+
+#ifndef _UNIT_TEST_
+#include "parts.h"
+#endif
+#include "err_codes.h"
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _COMPILER_H */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/utils/include/err_codes.h b/Examples/AS5048A_test/AS5048A_test/hal/utils/include/err_codes.h
new file mode 100644
index 0000000..a7aff01
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/utils/include/err_codes.h
@@ -0,0 +1,73 @@
+/**
+ * \file
+ *
+ * \brief Error code definitions.
+ *
+ * This file defines various status codes returned by functions,
+ * indicating success or failure as well as what kind of failure.
+ *
+ * Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef ERROR_CODES_H_INCLUDED
+#define ERROR_CODES_H_INCLUDED
+
+#define ERR_NONE 0
+#define ERR_INVALID_DATA -1
+#define ERR_NO_CHANGE -2
+#define ERR_ABORTED -3
+#define ERR_BUSY -4
+#define ERR_SUSPEND -5
+#define ERR_IO -6
+#define ERR_REQ_FLUSHED -7
+#define ERR_TIMEOUT -8
+#define ERR_BAD_DATA -9
+#define ERR_NOT_FOUND -10
+#define ERR_UNSUPPORTED_DEV -11
+#define ERR_NO_MEMORY -12
+#define ERR_INVALID_ARG -13
+#define ERR_BAD_ADDRESS -14
+#define ERR_BAD_FORMAT -15
+#define ERR_BAD_FRQ -16
+#define ERR_DENIED -17
+#define ERR_ALREADY_INITIALIZED -18
+#define ERR_OVERFLOW -19
+#define ERR_NOT_INITIALIZED -20
+#define ERR_SAMPLERATE_UNAVAILABLE -21
+#define ERR_RESOLUTION_UNAVAILABLE -22
+#define ERR_BAUDRATE_UNAVAILABLE -23
+#define ERR_PACKET_COLLISION -24
+#define ERR_PROTOCOL -25
+#define ERR_PIN_MUX_INVALID -26
+#define ERR_UNSUPPORTED_OP -27
+#define ERR_NO_RESOURCE -28
+#define ERR_NOT_READY -29
+#define ERR_FAILURE -30
+#define ERR_WRONG_LENGTH -31
+
+#endif
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/utils/include/events.h b/Examples/AS5048A_test/AS5048A_test/hal/utils/include/events.h
new file mode 100644
index 0000000..3ee891a
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/utils/include/events.h
@@ -0,0 +1,54 @@
+/**
+ * \file
+ *
+ * \brief Events declaration.
+ *
+ * Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _EVENTS_H_INCLUDED
+#define _EVENTS_H_INCLUDED
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+
+/**
+ * \brief List of events. Must start with 0, be unique and follow numerical order.
+ */
+#define EVENT_IS_READY_TO_SLEEP_ID 0
+#define EVENT_PREPARE_TO_SLEEP_ID 1
+#define EVENT_WOKEN_UP_ID 2
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _EVENTS_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/utils/include/parts.h b/Examples/AS5048A_test/AS5048A_test/hal/utils/include/parts.h
new file mode 100644
index 0000000..98bb969
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/utils/include/parts.h
@@ -0,0 +1,41 @@
+/**
+ * \file
+ *
+ * \brief Atmel part identification macros
+ *
+ * Copyright (c) 2015-2019 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef ATMEL_PARTS_H
+#define ATMEL_PARTS_H
+
+#include "same54.h"
+
+#include "hri_e54.h"
+
+#endif /* ATMEL_PARTS_H */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/utils/include/utils.h b/Examples/AS5048A_test/AS5048A_test/hal/utils/include/utils.h
new file mode 100644
index 0000000..1cf2699
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/utils/include/utils.h
@@ -0,0 +1,368 @@
+/**
+ * \file
+ *
+ * \brief Different macros.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef UTILS_H_INCLUDED
+#define UTILS_H_INCLUDED
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \addtogroup doc_driver_hal_utils_macro
+ *
+ * @{
+ */
+
+/**
+ * \brief Retrieve pointer to parent structure
+ */
+#define CONTAINER_OF(ptr, type, field_name) ((type *)(((uint8_t *)ptr) - offsetof(type, field_name)))
+
+/**
+ * \brief Retrieve array size
+ */
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
+
+/**
+ * \brief Emit the compiler pragma \a arg.
+ *
+ * \param[in] arg The pragma directive as it would appear after \e \#pragma
+ * (i.e. not stringified).
+ */
+#define COMPILER_PRAGMA(arg) _Pragma(#arg)
+
+/**
+ * \def COMPILER_PACK_SET(alignment)
+ * \brief Set maximum alignment for subsequent struct and union definitions to \a alignment.
+ */
+#define COMPILER_PACK_SET(alignment) COMPILER_PRAGMA(pack(alignment))
+
+/**
+ * \def COMPILER_PACK_RESET()
+ * \brief Set default alignment for subsequent struct and union definitions.
+ */
+#define COMPILER_PACK_RESET() COMPILER_PRAGMA(pack())
+
+/**
+ * \brief Set aligned boundary.
+ */
+#if defined __GNUC__
+#define COMPILER_ALIGNED(a) __attribute__((__aligned__(a)))
+#elif defined __ICCARM__
+#define COMPILER_ALIGNED(a) COMPILER_PRAGMA(data_alignment = a)
+#elif defined __CC_ARM
+#define COMPILER_ALIGNED(a) __attribute__((__aligned__(a)))
+#endif
+
+/**
+ * \brief Flash located data macros
+ */
+#if defined __GNUC__
+#define PROGMEM_DECLARE(type, name) const type name
+#define PROGMEM_T const
+#define PROGMEM_READ_BYTE(x) *((uint8_t *)(x))
+#define PROGMEM_PTR_T const *
+#define PROGMEM_STRING_T const uint8_t *
+#elif defined __ICCARM__
+#define PROGMEM_DECLARE(type, name) const type name
+#define PROGMEM_T const
+#define PROGMEM_READ_BYTE(x) *((uint8_t *)(x))
+#define PROGMEM_PTR_T const *
+#define PROGMEM_STRING_T const uint8_t *
+#elif defined __CC_ARM
+#define PROGMEM_DECLARE(type, name) const type name
+#define PROGMEM_T const
+#define PROGMEM_READ_BYTE(x) *((uint8_t *)(x))
+#define PROGMEM_PTR_T const *
+#define PROGMEM_STRING_T const uint8_t *
+#endif
+
+/**
+ * \brief Optimization
+ */
+#if defined __GNUC__
+#define OPTIMIZE_HIGH __attribute__((optimize(s)))
+#elif defined __CC_ARM
+#define OPTIMIZE_HIGH _Pragma("O3")
+#elif defined __ICCARM__
+#define OPTIMIZE_HIGH _Pragma("optimize=high")
+#endif
+
+/**
+ * \brief RAM located function attribute
+ */
+#if defined(__CC_ARM) /* Keil ?Vision 4 */
+#define RAMFUNC __attribute__((section(".ramfunc")))
+#elif defined(__ICCARM__) /* IAR Ewarm 5.41+ */
+#define RAMFUNC __ramfunc
+#elif defined(__GNUC__) /* GCC CS3 2009q3-68 */
+#define RAMFUNC __attribute__((section(".ramfunc")))
+#endif
+
+/**
+ * \brief No-init section.
+ * Place a data object or a function in a no-init section.
+ */
+#if defined(__CC_ARM)
+#define NO_INIT(a) __attribute__((zero_init))
+#elif defined(__ICCARM__)
+#define NO_INIT(a) __no_init
+#elif defined(__GNUC__)
+#define NO_INIT(a) __attribute__((section(".no_init")))
+#endif
+
+/**
+ * \brief Set user-defined section.
+ * Place a data object or a function in a user-defined section.
+ */
+#if defined(__CC_ARM)
+#define COMPILER_SECTION(a) __attribute__((__section__(a)))
+#elif defined(__ICCARM__)
+#define COMPILER_SECTION(a) COMPILER_PRAGMA(location = a)
+#elif defined(__GNUC__)
+#define COMPILER_SECTION(a) __attribute__((__section__(a)))
+#endif
+
+/**
+ * \brief Define WEAK attribute.
+ */
+#if defined(__CC_ARM) /* Keil ?Vision 4 */
+#define WEAK __attribute__((weak))
+#elif defined(__ICCARM__) /* IAR Ewarm 5.41+ */
+#define WEAK __weak
+#elif defined(__GNUC__) /* GCC CS3 2009q3-68 */
+#define WEAK __attribute__((weak))
+#endif
+
+/**
+ * \brief Pointer to function
+ */
+typedef void (*FUNC_PTR)(void);
+
+#define LE_BYTE0(a) ((uint8_t)(a))
+#define LE_BYTE1(a) ((uint8_t)((a) >> 8))
+#define LE_BYTE2(a) ((uint8_t)((a) >> 16))
+#define LE_BYTE3(a) ((uint8_t)((a) >> 24))
+
+#define LE_2_U16(p) ((p)[0] + ((p)[1] << 8))
+#define LE_2_U32(p) ((p)[0] + ((p)[1] << 8) + ((p)[2] << 16) + ((p)[3] << 24))
+
+/** \name Zero-Bit Counting
+ *
+ * Under GCC, __builtin_clz and __builtin_ctz behave like macros when
+ * applied to constant expressions (values known at compile time), so they are
+ * more optimized than the use of the corresponding assembly instructions and
+ * they can be used as constant expressions e.g. to initialize objects having
+ * static storage duration, and like the corresponding assembly instructions
+ * when applied to non-constant expressions (values unknown at compile time), so
+ * they are more optimized than an assembly periphrasis. Hence, clz and ctz
+ * ensure a possible and optimized behavior for both constant and non-constant
+ * expressions.
+ *
+ * @{ */
+
+/** \brief Counts the leading zero bits of the given value considered as a 32-bit integer.
+ *
+ * \param[in] u Value of which to count the leading zero bits.
+ *
+ * \return The count of leading zero bits in \a u.
+ */
+#if (defined __GNUC__) || (defined __CC_ARM)
+#define clz(u) __builtin_clz(u)
+#else
+#define clz(u) \
+ ( \
+ ((u) == 0) \
+ ? 32 \
+ : ((u) & (1ul << 31)) \
+ ? 0 \
+ : ((u) & (1ul << 30)) \
+ ? 1 \
+ : ((u) & (1ul << 29)) \
+ ? 2 \
+ : ((u) & (1ul << 28)) \
+ ? 3 \
+ : ((u) & (1ul << 27)) \
+ ? 4 \
+ : ((u) & (1ul << 26)) \
+ ? 5 \
+ : ((u) & (1ul << 25)) \
+ ? 6 \
+ : ((u) & (1ul << 24)) \
+ ? 7 \
+ : ((u) & (1ul << 23)) \
+ ? 8 \
+ : ((u) & (1ul << 22)) \
+ ? 9 \
+ : ((u) & (1ul << 21)) \
+ ? 10 \
+ : ((u) & (1ul << 20)) \
+ ? 11 \
+ : ((u) & (1ul << 19)) \
+ ? 12 \
+ : ((u) & (1ul << 18)) \
+ ? 13 \
+ : ((u) & (1ul << 17)) ? 14 \
+ : ((u) & (1ul << 16)) ? 15 \
+ : ((u) & (1ul << 15)) ? 16 \
+ : ((u) & (1ul << 14)) ? 17 \
+ : ((u) & (1ul << 13)) ? 18 \
+ : ((u) & (1ul << 12)) ? 19 \
+ : ((u) \
+ & (1ul \
+ << 11)) \
+ ? 20 \
+ : ((u) \
+ & (1ul \
+ << 10)) \
+ ? 21 \
+ : ((u) \
+ & (1ul \
+ << 9)) \
+ ? 22 \
+ : ((u) \
+ & (1ul \
+ << 8)) \
+ ? 23 \
+ : ((u) & (1ul << 7)) ? 24 \
+ : ((u) & (1ul << 6)) ? 25 \
+ : ((u) \
+ & (1ul \
+ << 5)) \
+ ? 26 \
+ : ((u) & (1ul << 4)) ? 27 \
+ : ((u) & (1ul << 3)) ? 28 \
+ : ((u) & (1ul << 2)) ? 29 \
+ : ( \
+ (u) & (1ul << 1)) \
+ ? 30 \
+ : 31)
+#endif
+
+/** \brief Counts the trailing zero bits of the given value considered as a 32-bit integer.
+ *
+ * \param[in] u Value of which to count the trailing zero bits.
+ *
+ * \return The count of trailing zero bits in \a u.
+ */
+#if (defined __GNUC__) || (defined __CC_ARM)
+#define ctz(u) __builtin_ctz(u)
+#else
+#define ctz(u) \
+ ( \
+ (u) & (1ul << 0) \
+ ? 0 \
+ : (u) & (1ul << 1) \
+ ? 1 \
+ : (u) & (1ul << 2) \
+ ? 2 \
+ : (u) & (1ul << 3) \
+ ? 3 \
+ : (u) & (1ul << 4) \
+ ? 4 \
+ : (u) & (1ul << 5) \
+ ? 5 \
+ : (u) & (1ul << 6) \
+ ? 6 \
+ : (u) & (1ul << 7) \
+ ? 7 \
+ : (u) & (1ul << 8) \
+ ? 8 \
+ : (u) & (1ul << 9) \
+ ? 9 \
+ : (u) & (1ul << 10) \
+ ? 10 \
+ : (u) & (1ul << 11) \
+ ? 11 \
+ : (u) & (1ul << 12) \
+ ? 12 \
+ : (u) & (1ul << 13) \
+ ? 13 \
+ : (u) & (1ul << 14) \
+ ? 14 \
+ : (u) & (1ul << 15) \
+ ? 15 \
+ : (u) & (1ul << 16) \
+ ? 16 \
+ : (u) & (1ul << 17) \
+ ? 17 \
+ : (u) & (1ul << 18) \
+ ? 18 \
+ : (u) & (1ul << 19) ? 19 \
+ : (u) & (1ul << 20) ? 20 \
+ : (u) & (1ul << 21) ? 21 \
+ : (u) & (1ul << 22) ? 22 \
+ : (u) & (1ul << 23) ? 23 \
+ : (u) & (1ul << 24) ? 24 \
+ : (u) & (1ul << 25) ? 25 \
+ : (u) & (1ul << 26) ? 26 \
+ : (u) & (1ul << 27) ? 27 \
+ : (u) & (1ul << 28) ? 28 : (u) & (1ul << 29) ? 29 : (u) & (1ul << 30) ? 30 : (u) & (1ul << 31) ? 31 : 32)
+#endif
+/** @} */
+
+/**
+ * \brief Counts the number of bits in a mask (no more than 32 bits)
+ * \param[in] mask Mask of which to count the bits.
+ */
+#define size_of_mask(mask) (32 - clz(mask) - ctz(mask))
+
+/**
+ * \brief Retrieve the start position of bits mask (no more than 32 bits)
+ * \param[in] mask Mask of which to retrieve the start position.
+ */
+#define pos_of_mask(mask) ctz(mask)
+
+/**
+ * \brief Return division result of a/b and round up the result to the closest
+ * number divisible by "b"
+ */
+#define round_up(a, b) (((a)-1) / (b) + 1)
+
+/**
+ * \brief Get the minimum of x and y
+ */
+#define min(x, y) ((x) > (y) ? (y) : (x))
+
+/**
+ * \brief Get the maximum of x and y
+ */
+#define max(x, y) ((x) > (y) ? (x) : (y))
+
+/**@}*/
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* UTILS_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/utils/include/utils_assert.h b/Examples/AS5048A_test/AS5048A_test/hal/utils/include/utils_assert.h
new file mode 100644
index 0000000..c2328d6
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/utils/include/utils_assert.h
@@ -0,0 +1,93 @@
+/**
+ * \file
+ *
+ * \brief Asserts related functionality.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _ASSERT_H_INCLUDED
+#define _ASSERT_H_INCLUDED
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+
+#ifndef USE_SIMPLE_ASSERT
+//# define USE_SIMPLE_ASSERT
+#endif
+
+/**
+ * \brief Assert macro
+ *
+ * This macro is used to throw asserts. It can be mapped to different function
+ * based on debug level.
+ *
+ * \param[in] condition A condition to be checked;
+ * assert is thrown if the given condition is false
+ */
+#define ASSERT(condition) ASSERT_IMPL((condition), __FILE__, __LINE__)
+
+#ifdef DEBUG
+
+#ifdef USE_SIMPLE_ASSERT
+#define ASSERT_IMPL(condition, file, line) \
+ if (!(condition)) \
+ __asm("BKPT #0");
+#else
+#define ASSERT_IMPL(condition, file, line) assert((condition), file, line)
+#endif
+
+#else /* DEBUG */
+
+#ifdef USE_SIMPLE_ASSERT
+#define ASSERT_IMPL(condition, file, line) ((void)0)
+#else
+#define ASSERT_IMPL(condition, file, line) ((void)0)
+#endif
+
+#endif /* DEBUG */
+
+/**
+ * \brief Assert function
+ *
+ * This function is used to throw asserts.
+ *
+ * \param[in] condition A condition to be checked; assert is thrown if the given
+ * condition is false
+ * \param[in] file File name
+ * \param[in] line Line number
+ */
+void assert(const bool condition, const char *const file, const int line);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* _ASSERT_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/utils/include/utils_event.h b/Examples/AS5048A_test/AS5048A_test/hal/utils/include/utils_event.h
new file mode 100644
index 0000000..13067c4
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/utils/include/utils_event.h
@@ -0,0 +1,115 @@
+/**
+ * \file
+ *
+ * \brief Events declaration.
+ *
+ * Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _UTILS_EVENT_H_INCLUDED
+#define _UTILS_EVENT_H_INCLUDED
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+#include
+#include
+
+/**
+ * \brief The maximum amount of events
+ */
+#define EVENT_MAX_AMOUNT 8
+
+/**
+ * \brief The size of event mask used, it is EVENT_MAX_AMOUNT rounded up to the
+ * closest number divisible by 8.
+ */
+#define EVENT_MASK_SIZE (round_up(EVENT_MAX_AMOUNT, 8))
+
+/**
+ * \brief The type of event ID. IDs should start with 0 and be in numerical order.
+ */
+typedef uint8_t event_id_t;
+
+/**
+ * \brief The type of returned parameter. This type is big enough to contain
+ * pointer to data on any platform.
+ */
+typedef uintptr_t event_data_t;
+
+/**
+ * \brief The type of returned parameter. This type is big enough to contain
+ * pointer to data on any platform.
+ */
+typedef void (*event_cb_t)(event_id_t id, event_data_t data);
+
+/**
+ * \brief Event structure
+ */
+struct event {
+ struct list_element elem; /*! The pointer to next event */
+ uint8_t mask[EVENT_MASK_SIZE]; /*! Mask of event IDs callback is called for */
+ event_cb_t cb; /*! Callback to be called when an event occurs */
+};
+
+/**
+ * \brief Subscribe to event
+ *
+ * \param[in] event The pointer to event structure
+ * \param[in] id The event ID to subscribe to
+ * \param[in] cb The callback function to call when the given event occurs
+ *
+ * \return The status of subscription
+ */
+int32_t event_subscribe(struct event *const event, const event_id_t id, event_cb_t cb);
+
+/**
+ * \brief Remove event from subscription
+ *
+ * \param[in] event The pointer to event structure
+ * \param[in] id The event ID to remove subscription from
+ *
+ * \return The status of subscription removing
+ */
+int32_t event_unsubscribe(struct event *const event, const event_id_t id);
+
+/**
+ * \brief Post event
+ *
+ * \param[in] id The event ID to post
+ * \param[in] data The event data to be passed to event subscribers
+ */
+void event_post(const event_id_t id, const event_data_t data);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _UTILS_EVENT_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/utils/include/utils_increment_macro.h b/Examples/AS5048A_test/AS5048A_test/hal/utils/include/utils_increment_macro.h
new file mode 100644
index 0000000..464c6cb
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/utils/include/utils_increment_macro.h
@@ -0,0 +1,308 @@
+/**
+ * \file
+ *
+ * \brief Increment macro.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _UTILS_INCREMENT_MACRO_H
+#define _UTILS_INCREMENT_MACRO_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \brief Compile time increment, result value is entire integer literal
+ *
+ * \param[in] val - value to be incremented (254 max)
+ */
+#define INC_VALUE(val) SP_INC_##val
+
+// Preprocessor increment implementation
+#define SP_INC_0 1
+#define SP_INC_1 2
+#define SP_INC_2 3
+#define SP_INC_3 4
+#define SP_INC_4 5
+#define SP_INC_5 6
+#define SP_INC_6 7
+#define SP_INC_7 8
+#define SP_INC_8 9
+#define SP_INC_9 10
+#define SP_INC_10 11
+#define SP_INC_11 12
+#define SP_INC_12 13
+#define SP_INC_13 14
+#define SP_INC_14 15
+#define SP_INC_15 16
+#define SP_INC_16 17
+#define SP_INC_17 18
+#define SP_INC_18 19
+#define SP_INC_19 20
+#define SP_INC_20 21
+#define SP_INC_21 22
+#define SP_INC_22 23
+#define SP_INC_23 24
+#define SP_INC_24 25
+#define SP_INC_25 26
+#define SP_INC_26 27
+#define SP_INC_27 28
+#define SP_INC_28 29
+#define SP_INC_29 30
+#define SP_INC_30 31
+#define SP_INC_31 32
+#define SP_INC_32 33
+#define SP_INC_33 34
+#define SP_INC_34 35
+#define SP_INC_35 36
+#define SP_INC_36 37
+#define SP_INC_37 38
+#define SP_INC_38 39
+#define SP_INC_39 40
+#define SP_INC_40 41
+#define SP_INC_41 42
+#define SP_INC_42 43
+#define SP_INC_43 44
+#define SP_INC_44 45
+#define SP_INC_45 46
+#define SP_INC_46 47
+#define SP_INC_47 48
+#define SP_INC_48 49
+#define SP_INC_49 50
+#define SP_INC_50 51
+#define SP_INC_51 52
+#define SP_INC_52 53
+#define SP_INC_53 54
+#define SP_INC_54 55
+#define SP_INC_55 56
+#define SP_INC_56 57
+#define SP_INC_57 58
+#define SP_INC_58 59
+#define SP_INC_59 60
+#define SP_INC_60 61
+#define SP_INC_61 62
+#define SP_INC_62 63
+#define SP_INC_63 64
+#define SP_INC_64 65
+#define SP_INC_65 66
+#define SP_INC_66 67
+#define SP_INC_67 68
+#define SP_INC_68 69
+#define SP_INC_69 70
+#define SP_INC_70 71
+#define SP_INC_71 72
+#define SP_INC_72 73
+#define SP_INC_73 74
+#define SP_INC_74 75
+#define SP_INC_75 76
+#define SP_INC_76 77
+#define SP_INC_77 78
+#define SP_INC_78 79
+#define SP_INC_79 80
+#define SP_INC_80 81
+#define SP_INC_81 82
+#define SP_INC_82 83
+#define SP_INC_83 84
+#define SP_INC_84 85
+#define SP_INC_85 86
+#define SP_INC_86 87
+#define SP_INC_87 88
+#define SP_INC_88 89
+#define SP_INC_89 90
+#define SP_INC_90 91
+#define SP_INC_91 92
+#define SP_INC_92 93
+#define SP_INC_93 94
+#define SP_INC_94 95
+#define SP_INC_95 96
+#define SP_INC_96 97
+#define SP_INC_97 98
+#define SP_INC_98 99
+#define SP_INC_99 100
+#define SP_INC_100 101
+#define SP_INC_101 102
+#define SP_INC_102 103
+#define SP_INC_103 104
+#define SP_INC_104 105
+#define SP_INC_105 106
+#define SP_INC_106 107
+#define SP_INC_107 108
+#define SP_INC_108 109
+#define SP_INC_109 110
+#define SP_INC_110 111
+#define SP_INC_111 112
+#define SP_INC_112 113
+#define SP_INC_113 114
+#define SP_INC_114 115
+#define SP_INC_115 116
+#define SP_INC_116 117
+#define SP_INC_117 118
+#define SP_INC_118 119
+#define SP_INC_119 120
+#define SP_INC_120 121
+#define SP_INC_121 122
+#define SP_INC_122 123
+#define SP_INC_123 124
+#define SP_INC_124 125
+#define SP_INC_125 126
+#define SP_INC_126 127
+#define SP_INC_127 128
+#define SP_INC_128 129
+#define SP_INC_129 130
+#define SP_INC_130 131
+#define SP_INC_131 132
+#define SP_INC_132 133
+#define SP_INC_133 134
+#define SP_INC_134 135
+#define SP_INC_135 136
+#define SP_INC_136 137
+#define SP_INC_137 138
+#define SP_INC_138 139
+#define SP_INC_139 140
+#define SP_INC_140 141
+#define SP_INC_141 142
+#define SP_INC_142 143
+#define SP_INC_143 144
+#define SP_INC_144 145
+#define SP_INC_145 146
+#define SP_INC_146 147
+#define SP_INC_147 148
+#define SP_INC_148 149
+#define SP_INC_149 150
+#define SP_INC_150 151
+#define SP_INC_151 152
+#define SP_INC_152 153
+#define SP_INC_153 154
+#define SP_INC_154 155
+#define SP_INC_155 156
+#define SP_INC_156 157
+#define SP_INC_157 158
+#define SP_INC_158 159
+#define SP_INC_159 160
+#define SP_INC_160 161
+#define SP_INC_161 162
+#define SP_INC_162 163
+#define SP_INC_163 164
+#define SP_INC_164 165
+#define SP_INC_165 166
+#define SP_INC_166 167
+#define SP_INC_167 168
+#define SP_INC_168 169
+#define SP_INC_169 170
+#define SP_INC_170 171
+#define SP_INC_171 172
+#define SP_INC_172 173
+#define SP_INC_173 174
+#define SP_INC_174 175
+#define SP_INC_175 176
+#define SP_INC_176 177
+#define SP_INC_177 178
+#define SP_INC_178 179
+#define SP_INC_179 180
+#define SP_INC_180 181
+#define SP_INC_181 182
+#define SP_INC_182 183
+#define SP_INC_183 184
+#define SP_INC_184 185
+#define SP_INC_185 186
+#define SP_INC_186 187
+#define SP_INC_187 188
+#define SP_INC_188 189
+#define SP_INC_189 190
+#define SP_INC_190 191
+#define SP_INC_191 192
+#define SP_INC_192 193
+#define SP_INC_193 194
+#define SP_INC_194 195
+#define SP_INC_195 196
+#define SP_INC_196 197
+#define SP_INC_197 198
+#define SP_INC_198 199
+#define SP_INC_199 200
+#define SP_INC_200 201
+#define SP_INC_201 202
+#define SP_INC_202 203
+#define SP_INC_203 204
+#define SP_INC_204 205
+#define SP_INC_205 206
+#define SP_INC_206 207
+#define SP_INC_207 208
+#define SP_INC_208 209
+#define SP_INC_209 210
+#define SP_INC_210 211
+#define SP_INC_211 212
+#define SP_INC_212 213
+#define SP_INC_213 214
+#define SP_INC_214 215
+#define SP_INC_215 216
+#define SP_INC_216 217
+#define SP_INC_217 218
+#define SP_INC_218 219
+#define SP_INC_219 220
+#define SP_INC_220 221
+#define SP_INC_221 222
+#define SP_INC_222 223
+#define SP_INC_223 224
+#define SP_INC_224 225
+#define SP_INC_225 226
+#define SP_INC_226 227
+#define SP_INC_227 228
+#define SP_INC_228 229
+#define SP_INC_229 230
+#define SP_INC_230 231
+#define SP_INC_231 232
+#define SP_INC_232 233
+#define SP_INC_233 234
+#define SP_INC_234 235
+#define SP_INC_235 236
+#define SP_INC_236 237
+#define SP_INC_237 238
+#define SP_INC_238 239
+#define SP_INC_239 240
+#define SP_INC_240 241
+#define SP_INC_241 242
+#define SP_INC_242 243
+#define SP_INC_243 244
+#define SP_INC_244 245
+#define SP_INC_245 246
+#define SP_INC_246 247
+#define SP_INC_247 248
+#define SP_INC_248 249
+#define SP_INC_249 250
+#define SP_INC_250 251
+#define SP_INC_251 252
+#define SP_INC_252 253
+#define SP_INC_253 254
+#define SP_INC_254 255
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* _UTILS_INCREMENT_MACRO_H */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/utils/include/utils_list.h b/Examples/AS5048A_test/AS5048A_test/hal/utils/include/utils_list.h
new file mode 100644
index 0000000..977e8cc
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/utils/include/utils_list.h
@@ -0,0 +1,164 @@
+/**
+ * \file
+ *
+ * \brief List declaration.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _UTILS_LIST_H_INCLUDED
+#define _UTILS_LIST_H_INCLUDED
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \addtogroup doc_driver_hal_utils_list
+ *
+ * @{
+ */
+
+#include
+
+/**
+ * \brief List element type
+ */
+struct list_element {
+ struct list_element *next;
+};
+
+/**
+ * \brief List head type
+ */
+struct list_descriptor {
+ struct list_element *head;
+};
+
+/**
+ * \brief Reset list
+ *
+ * \param[in] list The pointer to a list descriptor
+ */
+static inline void list_reset(struct list_descriptor *const list)
+{
+ list->head = NULL;
+}
+
+/**
+ * \brief Retrieve list head
+ *
+ * \param[in] list The pointer to a list descriptor
+ *
+ * \return A pointer to the head of the given list or NULL if the list is
+ * empty
+ */
+static inline void *list_get_head(const struct list_descriptor *const list)
+{
+ return (void *)list->head;
+}
+
+/**
+ * \brief Retrieve next list head
+ *
+ * \param[in] list The pointer to a list element
+ *
+ * \return A pointer to the next list element or NULL if there is not next
+ * element
+ */
+static inline void *list_get_next_element(const void *const element)
+{
+ return element ? ((struct list_element *)element)->next : NULL;
+}
+
+/**
+ * \brief Insert an element as list head
+ *
+ * \param[in] list The pointer to a list element
+ * \param[in] element An element to insert to the given list
+ */
+void list_insert_as_head(struct list_descriptor *const list, void *const element);
+
+/**
+ * \brief Insert an element after the given list element
+ *
+ * \param[in] after An element to insert after
+ * \param[in] element Element to insert to the given list
+ */
+void list_insert_after(void *const after, void *const element);
+
+/**
+ * \brief Insert an element at list end
+ *
+ * \param[in] after An element to insert after
+ * \param[in] element Element to insert to the given list
+ */
+void list_insert_at_end(struct list_descriptor *const list, void *const element);
+
+/**
+ * \brief Check whether an element belongs to a list
+ *
+ * \param[in] list The pointer to a list
+ * \param[in] element An element to check
+ *
+ * \return The result of checking
+ * \retval true If the given element is an element of the given list
+ * \retval false Otherwise
+ */
+bool is_list_element(const struct list_descriptor *const list, const void *const element);
+
+/**
+ * \brief Removes list head
+ *
+ * This function removes the list head and sets the next element after the list
+ * head as a new list head.
+ *
+ * \param[in] list The pointer to a list
+ *
+ * \return The pointer to the new list head of NULL if the list head is NULL
+ */
+void *list_remove_head(struct list_descriptor *const list);
+
+/**
+ * \brief Removes the list element
+ *
+ * \param[in] list The pointer to a list
+ * \param[in] element An element to remove
+ *
+ * \return The result of element removing
+ * \retval true The given element is removed from the given list
+ * \retval false The given element is not an element of the given list
+ */
+bool list_delete_element(struct list_descriptor *const list, const void *const element);
+
+/**@}*/
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* _UTILS_LIST_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/utils/include/utils_repeat_macro.h b/Examples/AS5048A_test/AS5048A_test/hal/utils/include/utils_repeat_macro.h
new file mode 100644
index 0000000..89e6f52
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/utils/include/utils_repeat_macro.h
@@ -0,0 +1,322 @@
+/**
+ * \file
+ *
+ * \brief Repeat macro.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _UTILS_REPEAT_MACRO_H
+#define _UTILS_REPEAT_MACRO_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * \brief Sequently repeates specified macro for n times (255 max).
+ *
+ * Specified macro shall have two arguments: macro(arg, i)
+ * arg - user defined argument, which have the same value for all iterations.
+ * i - iteration number; numbering begins from zero and increments on each
+ * iteration.
+ *
+ * \param[in] macro - macro to be repeated
+ * \param[in] arg - user defined argument for repeated macro
+ * \param[in] n - total number of iterations (255 max)
+ */
+#define REPEAT_MACRO(macro, arg, n) REPEAT_MACRO_I(macro, arg, n)
+
+/*
+ * \brief Second level is needed to get integer literal from "n" if it is
+ * defined as macro
+ */
+#define REPEAT_MACRO_I(macro, arg, n) REPEAT##n(macro, arg, 0)
+
+#define REPEAT1(macro, arg, n) macro(arg, n)
+#define REPEAT2(macro, arg, n) macro(arg, n) REPEAT1(macro, arg, INC_VALUE(n))
+#define REPEAT3(macro, arg, n) macro(arg, n) REPEAT2(macro, arg, INC_VALUE(n))
+#define REPEAT4(macro, arg, n) macro(arg, n) REPEAT3(macro, arg, INC_VALUE(n))
+#define REPEAT5(macro, arg, n) macro(arg, n) REPEAT4(macro, arg, INC_VALUE(n))
+#define REPEAT6(macro, arg, n) macro(arg, n) REPEAT5(macro, arg, INC_VALUE(n))
+#define REPEAT7(macro, arg, n) macro(arg, n) REPEAT6(macro, arg, INC_VALUE(n))
+#define REPEAT8(macro, arg, n) macro(arg, n) REPEAT7(macro, arg, INC_VALUE(n))
+#define REPEAT9(macro, arg, n) macro(arg, n) REPEAT8(macro, arg, INC_VALUE(n))
+#define REPEAT10(macro, arg, n) macro(arg, n) REPEAT9(macro, arg, INC_VALUE(n))
+#define REPEAT11(macro, arg, n) macro(arg, n) REPEAT10(macro, arg, INC_VALUE(n))
+#define REPEAT12(macro, arg, n) macro(arg, n) REPEAT11(macro, arg, INC_VALUE(n))
+#define REPEAT13(macro, arg, n) macro(arg, n) REPEAT12(macro, arg, INC_VALUE(n))
+#define REPEAT14(macro, arg, n) macro(arg, n) REPEAT13(macro, arg, INC_VALUE(n))
+#define REPEAT15(macro, arg, n) macro(arg, n) REPEAT14(macro, arg, INC_VALUE(n))
+#define REPEAT16(macro, arg, n) macro(arg, n) REPEAT15(macro, arg, INC_VALUE(n))
+#define REPEAT17(macro, arg, n) macro(arg, n) REPEAT16(macro, arg, INC_VALUE(n))
+#define REPEAT18(macro, arg, n) macro(arg, n) REPEAT17(macro, arg, INC_VALUE(n))
+#define REPEAT19(macro, arg, n) macro(arg, n) REPEAT18(macro, arg, INC_VALUE(n))
+#define REPEAT20(macro, arg, n) macro(arg, n) REPEAT19(macro, arg, INC_VALUE(n))
+#define REPEAT21(macro, arg, n) macro(arg, n) REPEAT20(macro, arg, INC_VALUE(n))
+#define REPEAT22(macro, arg, n) macro(arg, n) REPEAT21(macro, arg, INC_VALUE(n))
+#define REPEAT23(macro, arg, n) macro(arg, n) REPEAT22(macro, arg, INC_VALUE(n))
+#define REPEAT24(macro, arg, n) macro(arg, n) REPEAT23(macro, arg, INC_VALUE(n))
+#define REPEAT25(macro, arg, n) macro(arg, n) REPEAT24(macro, arg, INC_VALUE(n))
+#define REPEAT26(macro, arg, n) macro(arg, n) REPEAT25(macro, arg, INC_VALUE(n))
+#define REPEAT27(macro, arg, n) macro(arg, n) REPEAT26(macro, arg, INC_VALUE(n))
+#define REPEAT28(macro, arg, n) macro(arg, n) REPEAT27(macro, arg, INC_VALUE(n))
+#define REPEAT29(macro, arg, n) macro(arg, n) REPEAT28(macro, arg, INC_VALUE(n))
+#define REPEAT30(macro, arg, n) macro(arg, n) REPEAT29(macro, arg, INC_VALUE(n))
+#define REPEAT31(macro, arg, n) macro(arg, n) REPEAT30(macro, arg, INC_VALUE(n))
+#define REPEAT32(macro, arg, n) macro(arg, n) REPEAT31(macro, arg, INC_VALUE(n))
+#define REPEAT33(macro, arg, n) macro(arg, n) REPEAT32(macro, arg, INC_VALUE(n))
+#define REPEAT34(macro, arg, n) macro(arg, n) REPEAT33(macro, arg, INC_VALUE(n))
+#define REPEAT35(macro, arg, n) macro(arg, n) REPEAT34(macro, arg, INC_VALUE(n))
+#define REPEAT36(macro, arg, n) macro(arg, n) REPEAT35(macro, arg, INC_VALUE(n))
+#define REPEAT37(macro, arg, n) macro(arg, n) REPEAT36(macro, arg, INC_VALUE(n))
+#define REPEAT38(macro, arg, n) macro(arg, n) REPEAT37(macro, arg, INC_VALUE(n))
+#define REPEAT39(macro, arg, n) macro(arg, n) REPEAT38(macro, arg, INC_VALUE(n))
+#define REPEAT40(macro, arg, n) macro(arg, n) REPEAT39(macro, arg, INC_VALUE(n))
+#define REPEAT41(macro, arg, n) macro(arg, n) REPEAT40(macro, arg, INC_VALUE(n))
+#define REPEAT42(macro, arg, n) macro(arg, n) REPEAT41(macro, arg, INC_VALUE(n))
+#define REPEAT43(macro, arg, n) macro(arg, n) REPEAT42(macro, arg, INC_VALUE(n))
+#define REPEAT44(macro, arg, n) macro(arg, n) REPEAT43(macro, arg, INC_VALUE(n))
+#define REPEAT45(macro, arg, n) macro(arg, n) REPEAT44(macro, arg, INC_VALUE(n))
+#define REPEAT46(macro, arg, n) macro(arg, n) REPEAT45(macro, arg, INC_VALUE(n))
+#define REPEAT47(macro, arg, n) macro(arg, n) REPEAT46(macro, arg, INC_VALUE(n))
+#define REPEAT48(macro, arg, n) macro(arg, n) REPEAT47(macro, arg, INC_VALUE(n))
+#define REPEAT49(macro, arg, n) macro(arg, n) REPEAT48(macro, arg, INC_VALUE(n))
+#define REPEAT50(macro, arg, n) macro(arg, n) REPEAT49(macro, arg, INC_VALUE(n))
+#define REPEAT51(macro, arg, n) macro(arg, n) REPEAT50(macro, arg, INC_VALUE(n))
+#define REPEAT52(macro, arg, n) macro(arg, n) REPEAT51(macro, arg, INC_VALUE(n))
+#define REPEAT53(macro, arg, n) macro(arg, n) REPEAT52(macro, arg, INC_VALUE(n))
+#define REPEAT54(macro, arg, n) macro(arg, n) REPEAT53(macro, arg, INC_VALUE(n))
+#define REPEAT55(macro, arg, n) macro(arg, n) REPEAT54(macro, arg, INC_VALUE(n))
+#define REPEAT56(macro, arg, n) macro(arg, n) REPEAT55(macro, arg, INC_VALUE(n))
+#define REPEAT57(macro, arg, n) macro(arg, n) REPEAT56(macro, arg, INC_VALUE(n))
+#define REPEAT58(macro, arg, n) macro(arg, n) REPEAT57(macro, arg, INC_VALUE(n))
+#define REPEAT59(macro, arg, n) macro(arg, n) REPEAT58(macro, arg, INC_VALUE(n))
+#define REPEAT60(macro, arg, n) macro(arg, n) REPEAT59(macro, arg, INC_VALUE(n))
+#define REPEAT61(macro, arg, n) macro(arg, n) REPEAT60(macro, arg, INC_VALUE(n))
+#define REPEAT62(macro, arg, n) macro(arg, n) REPEAT61(macro, arg, INC_VALUE(n))
+#define REPEAT63(macro, arg, n) macro(arg, n) REPEAT62(macro, arg, INC_VALUE(n))
+#define REPEAT64(macro, arg, n) macro(arg, n) REPEAT63(macro, arg, INC_VALUE(n))
+#define REPEAT65(macro, arg, n) macro(arg, n) REPEAT64(macro, arg, INC_VALUE(n))
+#define REPEAT66(macro, arg, n) macro(arg, n) REPEAT65(macro, arg, INC_VALUE(n))
+#define REPEAT67(macro, arg, n) macro(arg, n) REPEAT66(macro, arg, INC_VALUE(n))
+#define REPEAT68(macro, arg, n) macro(arg, n) REPEAT67(macro, arg, INC_VALUE(n))
+#define REPEAT69(macro, arg, n) macro(arg, n) REPEAT68(macro, arg, INC_VALUE(n))
+#define REPEAT70(macro, arg, n) macro(arg, n) REPEAT69(macro, arg, INC_VALUE(n))
+#define REPEAT71(macro, arg, n) macro(arg, n) REPEAT70(macro, arg, INC_VALUE(n))
+#define REPEAT72(macro, arg, n) macro(arg, n) REPEAT71(macro, arg, INC_VALUE(n))
+#define REPEAT73(macro, arg, n) macro(arg, n) REPEAT72(macro, arg, INC_VALUE(n))
+#define REPEAT74(macro, arg, n) macro(arg, n) REPEAT73(macro, arg, INC_VALUE(n))
+#define REPEAT75(macro, arg, n) macro(arg, n) REPEAT74(macro, arg, INC_VALUE(n))
+#define REPEAT76(macro, arg, n) macro(arg, n) REPEAT75(macro, arg, INC_VALUE(n))
+#define REPEAT77(macro, arg, n) macro(arg, n) REPEAT76(macro, arg, INC_VALUE(n))
+#define REPEAT78(macro, arg, n) macro(arg, n) REPEAT77(macro, arg, INC_VALUE(n))
+#define REPEAT79(macro, arg, n) macro(arg, n) REPEAT78(macro, arg, INC_VALUE(n))
+#define REPEAT80(macro, arg, n) macro(arg, n) REPEAT79(macro, arg, INC_VALUE(n))
+#define REPEAT81(macro, arg, n) macro(arg, n) REPEAT80(macro, arg, INC_VALUE(n))
+#define REPEAT82(macro, arg, n) macro(arg, n) REPEAT81(macro, arg, INC_VALUE(n))
+#define REPEAT83(macro, arg, n) macro(arg, n) REPEAT82(macro, arg, INC_VALUE(n))
+#define REPEAT84(macro, arg, n) macro(arg, n) REPEAT83(macro, arg, INC_VALUE(n))
+#define REPEAT85(macro, arg, n) macro(arg, n) REPEAT84(macro, arg, INC_VALUE(n))
+#define REPEAT86(macro, arg, n) macro(arg, n) REPEAT85(macro, arg, INC_VALUE(n))
+#define REPEAT87(macro, arg, n) macro(arg, n) REPEAT86(macro, arg, INC_VALUE(n))
+#define REPEAT88(macro, arg, n) macro(arg, n) REPEAT87(macro, arg, INC_VALUE(n))
+#define REPEAT89(macro, arg, n) macro(arg, n) REPEAT88(macro, arg, INC_VALUE(n))
+#define REPEAT90(macro, arg, n) macro(arg, n) REPEAT89(macro, arg, INC_VALUE(n))
+#define REPEAT91(macro, arg, n) macro(arg, n) REPEAT90(macro, arg, INC_VALUE(n))
+#define REPEAT92(macro, arg, n) macro(arg, n) REPEAT91(macro, arg, INC_VALUE(n))
+#define REPEAT93(macro, arg, n) macro(arg, n) REPEAT92(macro, arg, INC_VALUE(n))
+#define REPEAT94(macro, arg, n) macro(arg, n) REPEAT93(macro, arg, INC_VALUE(n))
+#define REPEAT95(macro, arg, n) macro(arg, n) REPEAT94(macro, arg, INC_VALUE(n))
+#define REPEAT96(macro, arg, n) macro(arg, n) REPEAT95(macro, arg, INC_VALUE(n))
+#define REPEAT97(macro, arg, n) macro(arg, n) REPEAT96(macro, arg, INC_VALUE(n))
+#define REPEAT98(macro, arg, n) macro(arg, n) REPEAT97(macro, arg, INC_VALUE(n))
+#define REPEAT99(macro, arg, n) macro(arg, n) REPEAT98(macro, arg, INC_VALUE(n))
+#define REPEAT100(macro, arg, n) macro(arg, n) REPEAT99(macro, arg, INC_VALUE(n))
+#define REPEAT101(macro, arg, n) macro(arg, n) REPEAT100(macro, arg, INC_VALUE(n))
+#define REPEAT102(macro, arg, n) macro(arg, n) REPEAT101(macro, arg, INC_VALUE(n))
+#define REPEAT103(macro, arg, n) macro(arg, n) REPEAT102(macro, arg, INC_VALUE(n))
+#define REPEAT104(macro, arg, n) macro(arg, n) REPEAT103(macro, arg, INC_VALUE(n))
+#define REPEAT105(macro, arg, n) macro(arg, n) REPEAT104(macro, arg, INC_VALUE(n))
+#define REPEAT106(macro, arg, n) macro(arg, n) REPEAT105(macro, arg, INC_VALUE(n))
+#define REPEAT107(macro, arg, n) macro(arg, n) REPEAT106(macro, arg, INC_VALUE(n))
+#define REPEAT108(macro, arg, n) macro(arg, n) REPEAT107(macro, arg, INC_VALUE(n))
+#define REPEAT109(macro, arg, n) macro(arg, n) REPEAT108(macro, arg, INC_VALUE(n))
+#define REPEAT110(macro, arg, n) macro(arg, n) REPEAT109(macro, arg, INC_VALUE(n))
+#define REPEAT111(macro, arg, n) macro(arg, n) REPEAT110(macro, arg, INC_VALUE(n))
+#define REPEAT112(macro, arg, n) macro(arg, n) REPEAT111(macro, arg, INC_VALUE(n))
+#define REPEAT113(macro, arg, n) macro(arg, n) REPEAT112(macro, arg, INC_VALUE(n))
+#define REPEAT114(macro, arg, n) macro(arg, n) REPEAT113(macro, arg, INC_VALUE(n))
+#define REPEAT115(macro, arg, n) macro(arg, n) REPEAT114(macro, arg, INC_VALUE(n))
+#define REPEAT116(macro, arg, n) macro(arg, n) REPEAT115(macro, arg, INC_VALUE(n))
+#define REPEAT117(macro, arg, n) macro(arg, n) REPEAT116(macro, arg, INC_VALUE(n))
+#define REPEAT118(macro, arg, n) macro(arg, n) REPEAT117(macro, arg, INC_VALUE(n))
+#define REPEAT119(macro, arg, n) macro(arg, n) REPEAT118(macro, arg, INC_VALUE(n))
+#define REPEAT120(macro, arg, n) macro(arg, n) REPEAT119(macro, arg, INC_VALUE(n))
+#define REPEAT121(macro, arg, n) macro(arg, n) REPEAT120(macro, arg, INC_VALUE(n))
+#define REPEAT122(macro, arg, n) macro(arg, n) REPEAT121(macro, arg, INC_VALUE(n))
+#define REPEAT123(macro, arg, n) macro(arg, n) REPEAT122(macro, arg, INC_VALUE(n))
+#define REPEAT124(macro, arg, n) macro(arg, n) REPEAT123(macro, arg, INC_VALUE(n))
+#define REPEAT125(macro, arg, n) macro(arg, n) REPEAT124(macro, arg, INC_VALUE(n))
+#define REPEAT126(macro, arg, n) macro(arg, n) REPEAT125(macro, arg, INC_VALUE(n))
+#define REPEAT127(macro, arg, n) macro(arg, n) REPEAT126(macro, arg, INC_VALUE(n))
+#define REPEAT128(macro, arg, n) macro(arg, n) REPEAT127(macro, arg, INC_VALUE(n))
+#define REPEAT129(macro, arg, n) macro(arg, n) REPEAT128(macro, arg, INC_VALUE(n))
+#define REPEAT130(macro, arg, n) macro(arg, n) REPEAT129(macro, arg, INC_VALUE(n))
+#define REPEAT131(macro, arg, n) macro(arg, n) REPEAT130(macro, arg, INC_VALUE(n))
+#define REPEAT132(macro, arg, n) macro(arg, n) REPEAT131(macro, arg, INC_VALUE(n))
+#define REPEAT133(macro, arg, n) macro(arg, n) REPEAT132(macro, arg, INC_VALUE(n))
+#define REPEAT134(macro, arg, n) macro(arg, n) REPEAT133(macro, arg, INC_VALUE(n))
+#define REPEAT135(macro, arg, n) macro(arg, n) REPEAT134(macro, arg, INC_VALUE(n))
+#define REPEAT136(macro, arg, n) macro(arg, n) REPEAT135(macro, arg, INC_VALUE(n))
+#define REPEAT137(macro, arg, n) macro(arg, n) REPEAT136(macro, arg, INC_VALUE(n))
+#define REPEAT138(macro, arg, n) macro(arg, n) REPEAT137(macro, arg, INC_VALUE(n))
+#define REPEAT139(macro, arg, n) macro(arg, n) REPEAT138(macro, arg, INC_VALUE(n))
+#define REPEAT140(macro, arg, n) macro(arg, n) REPEAT139(macro, arg, INC_VALUE(n))
+#define REPEAT141(macro, arg, n) macro(arg, n) REPEAT140(macro, arg, INC_VALUE(n))
+#define REPEAT142(macro, arg, n) macro(arg, n) REPEAT141(macro, arg, INC_VALUE(n))
+#define REPEAT143(macro, arg, n) macro(arg, n) REPEAT142(macro, arg, INC_VALUE(n))
+#define REPEAT144(macro, arg, n) macro(arg, n) REPEAT143(macro, arg, INC_VALUE(n))
+#define REPEAT145(macro, arg, n) macro(arg, n) REPEAT144(macro, arg, INC_VALUE(n))
+#define REPEAT146(macro, arg, n) macro(arg, n) REPEAT145(macro, arg, INC_VALUE(n))
+#define REPEAT147(macro, arg, n) macro(arg, n) REPEAT146(macro, arg, INC_VALUE(n))
+#define REPEAT148(macro, arg, n) macro(arg, n) REPEAT147(macro, arg, INC_VALUE(n))
+#define REPEAT149(macro, arg, n) macro(arg, n) REPEAT148(macro, arg, INC_VALUE(n))
+#define REPEAT150(macro, arg, n) macro(arg, n) REPEAT149(macro, arg, INC_VALUE(n))
+#define REPEAT151(macro, arg, n) macro(arg, n) REPEAT150(macro, arg, INC_VALUE(n))
+#define REPEAT152(macro, arg, n) macro(arg, n) REPEAT151(macro, arg, INC_VALUE(n))
+#define REPEAT153(macro, arg, n) macro(arg, n) REPEAT152(macro, arg, INC_VALUE(n))
+#define REPEAT154(macro, arg, n) macro(arg, n) REPEAT153(macro, arg, INC_VALUE(n))
+#define REPEAT155(macro, arg, n) macro(arg, n) REPEAT154(macro, arg, INC_VALUE(n))
+#define REPEAT156(macro, arg, n) macro(arg, n) REPEAT155(macro, arg, INC_VALUE(n))
+#define REPEAT157(macro, arg, n) macro(arg, n) REPEAT156(macro, arg, INC_VALUE(n))
+#define REPEAT158(macro, arg, n) macro(arg, n) REPEAT157(macro, arg, INC_VALUE(n))
+#define REPEAT159(macro, arg, n) macro(arg, n) REPEAT158(macro, arg, INC_VALUE(n))
+#define REPEAT160(macro, arg, n) macro(arg, n) REPEAT159(macro, arg, INC_VALUE(n))
+#define REPEAT161(macro, arg, n) macro(arg, n) REPEAT160(macro, arg, INC_VALUE(n))
+#define REPEAT162(macro, arg, n) macro(arg, n) REPEAT161(macro, arg, INC_VALUE(n))
+#define REPEAT163(macro, arg, n) macro(arg, n) REPEAT162(macro, arg, INC_VALUE(n))
+#define REPEAT164(macro, arg, n) macro(arg, n) REPEAT163(macro, arg, INC_VALUE(n))
+#define REPEAT165(macro, arg, n) macro(arg, n) REPEAT164(macro, arg, INC_VALUE(n))
+#define REPEAT166(macro, arg, n) macro(arg, n) REPEAT165(macro, arg, INC_VALUE(n))
+#define REPEAT167(macro, arg, n) macro(arg, n) REPEAT166(macro, arg, INC_VALUE(n))
+#define REPEAT168(macro, arg, n) macro(arg, n) REPEAT167(macro, arg, INC_VALUE(n))
+#define REPEAT169(macro, arg, n) macro(arg, n) REPEAT168(macro, arg, INC_VALUE(n))
+#define REPEAT170(macro, arg, n) macro(arg, n) REPEAT169(macro, arg, INC_VALUE(n))
+#define REPEAT171(macro, arg, n) macro(arg, n) REPEAT170(macro, arg, INC_VALUE(n))
+#define REPEAT172(macro, arg, n) macro(arg, n) REPEAT171(macro, arg, INC_VALUE(n))
+#define REPEAT173(macro, arg, n) macro(arg, n) REPEAT172(macro, arg, INC_VALUE(n))
+#define REPEAT174(macro, arg, n) macro(arg, n) REPEAT173(macro, arg, INC_VALUE(n))
+#define REPEAT175(macro, arg, n) macro(arg, n) REPEAT174(macro, arg, INC_VALUE(n))
+#define REPEAT176(macro, arg, n) macro(arg, n) REPEAT175(macro, arg, INC_VALUE(n))
+#define REPEAT177(macro, arg, n) macro(arg, n) REPEAT176(macro, arg, INC_VALUE(n))
+#define REPEAT178(macro, arg, n) macro(arg, n) REPEAT177(macro, arg, INC_VALUE(n))
+#define REPEAT179(macro, arg, n) macro(arg, n) REPEAT178(macro, arg, INC_VALUE(n))
+#define REPEAT180(macro, arg, n) macro(arg, n) REPEAT179(macro, arg, INC_VALUE(n))
+#define REPEAT181(macro, arg, n) macro(arg, n) REPEAT180(macro, arg, INC_VALUE(n))
+#define REPEAT182(macro, arg, n) macro(arg, n) REPEAT181(macro, arg, INC_VALUE(n))
+#define REPEAT183(macro, arg, n) macro(arg, n) REPEAT182(macro, arg, INC_VALUE(n))
+#define REPEAT184(macro, arg, n) macro(arg, n) REPEAT183(macro, arg, INC_VALUE(n))
+#define REPEAT185(macro, arg, n) macro(arg, n) REPEAT184(macro, arg, INC_VALUE(n))
+#define REPEAT186(macro, arg, n) macro(arg, n) REPEAT185(macro, arg, INC_VALUE(n))
+#define REPEAT187(macro, arg, n) macro(arg, n) REPEAT186(macro, arg, INC_VALUE(n))
+#define REPEAT188(macro, arg, n) macro(arg, n) REPEAT187(macro, arg, INC_VALUE(n))
+#define REPEAT189(macro, arg, n) macro(arg, n) REPEAT188(macro, arg, INC_VALUE(n))
+#define REPEAT190(macro, arg, n) macro(arg, n) REPEAT189(macro, arg, INC_VALUE(n))
+#define REPEAT191(macro, arg, n) macro(arg, n) REPEAT190(macro, arg, INC_VALUE(n))
+#define REPEAT192(macro, arg, n) macro(arg, n) REPEAT191(macro, arg, INC_VALUE(n))
+#define REPEAT193(macro, arg, n) macro(arg, n) REPEAT192(macro, arg, INC_VALUE(n))
+#define REPEAT194(macro, arg, n) macro(arg, n) REPEAT193(macro, arg, INC_VALUE(n))
+#define REPEAT195(macro, arg, n) macro(arg, n) REPEAT194(macro, arg, INC_VALUE(n))
+#define REPEAT196(macro, arg, n) macro(arg, n) REPEAT195(macro, arg, INC_VALUE(n))
+#define REPEAT197(macro, arg, n) macro(arg, n) REPEAT196(macro, arg, INC_VALUE(n))
+#define REPEAT198(macro, arg, n) macro(arg, n) REPEAT197(macro, arg, INC_VALUE(n))
+#define REPEAT199(macro, arg, n) macro(arg, n) REPEAT198(macro, arg, INC_VALUE(n))
+#define REPEAT200(macro, arg, n) macro(arg, n) REPEAT199(macro, arg, INC_VALUE(n))
+#define REPEAT201(macro, arg, n) macro(arg, n) REPEAT200(macro, arg, INC_VALUE(n))
+#define REPEAT202(macro, arg, n) macro(arg, n) REPEAT201(macro, arg, INC_VALUE(n))
+#define REPEAT203(macro, arg, n) macro(arg, n) REPEAT202(macro, arg, INC_VALUE(n))
+#define REPEAT204(macro, arg, n) macro(arg, n) REPEAT203(macro, arg, INC_VALUE(n))
+#define REPEAT205(macro, arg, n) macro(arg, n) REPEAT204(macro, arg, INC_VALUE(n))
+#define REPEAT206(macro, arg, n) macro(arg, n) REPEAT205(macro, arg, INC_VALUE(n))
+#define REPEAT207(macro, arg, n) macro(arg, n) REPEAT206(macro, arg, INC_VALUE(n))
+#define REPEAT208(macro, arg, n) macro(arg, n) REPEAT207(macro, arg, INC_VALUE(n))
+#define REPEAT209(macro, arg, n) macro(arg, n) REPEAT208(macro, arg, INC_VALUE(n))
+#define REPEAT210(macro, arg, n) macro(arg, n) REPEAT209(macro, arg, INC_VALUE(n))
+#define REPEAT211(macro, arg, n) macro(arg, n) REPEAT210(macro, arg, INC_VALUE(n))
+#define REPEAT212(macro, arg, n) macro(arg, n) REPEAT211(macro, arg, INC_VALUE(n))
+#define REPEAT213(macro, arg, n) macro(arg, n) REPEAT212(macro, arg, INC_VALUE(n))
+#define REPEAT214(macro, arg, n) macro(arg, n) REPEAT213(macro, arg, INC_VALUE(n))
+#define REPEAT215(macro, arg, n) macro(arg, n) REPEAT214(macro, arg, INC_VALUE(n))
+#define REPEAT216(macro, arg, n) macro(arg, n) REPEAT215(macro, arg, INC_VALUE(n))
+#define REPEAT217(macro, arg, n) macro(arg, n) REPEAT216(macro, arg, INC_VALUE(n))
+#define REPEAT218(macro, arg, n) macro(arg, n) REPEAT217(macro, arg, INC_VALUE(n))
+#define REPEAT219(macro, arg, n) macro(arg, n) REPEAT218(macro, arg, INC_VALUE(n))
+#define REPEAT220(macro, arg, n) macro(arg, n) REPEAT219(macro, arg, INC_VALUE(n))
+#define REPEAT221(macro, arg, n) macro(arg, n) REPEAT220(macro, arg, INC_VALUE(n))
+#define REPEAT222(macro, arg, n) macro(arg, n) REPEAT221(macro, arg, INC_VALUE(n))
+#define REPEAT223(macro, arg, n) macro(arg, n) REPEAT222(macro, arg, INC_VALUE(n))
+#define REPEAT224(macro, arg, n) macro(arg, n) REPEAT223(macro, arg, INC_VALUE(n))
+#define REPEAT225(macro, arg, n) macro(arg, n) REPEAT224(macro, arg, INC_VALUE(n))
+#define REPEAT226(macro, arg, n) macro(arg, n) REPEAT225(macro, arg, INC_VALUE(n))
+#define REPEAT227(macro, arg, n) macro(arg, n) REPEAT226(macro, arg, INC_VALUE(n))
+#define REPEAT228(macro, arg, n) macro(arg, n) REPEAT227(macro, arg, INC_VALUE(n))
+#define REPEAT229(macro, arg, n) macro(arg, n) REPEAT228(macro, arg, INC_VALUE(n))
+#define REPEAT230(macro, arg, n) macro(arg, n) REPEAT229(macro, arg, INC_VALUE(n))
+#define REPEAT231(macro, arg, n) macro(arg, n) REPEAT230(macro, arg, INC_VALUE(n))
+#define REPEAT232(macro, arg, n) macro(arg, n) REPEAT231(macro, arg, INC_VALUE(n))
+#define REPEAT233(macro, arg, n) macro(arg, n) REPEAT232(macro, arg, INC_VALUE(n))
+#define REPEAT234(macro, arg, n) macro(arg, n) REPEAT233(macro, arg, INC_VALUE(n))
+#define REPEAT235(macro, arg, n) macro(arg, n) REPEAT234(macro, arg, INC_VALUE(n))
+#define REPEAT236(macro, arg, n) macro(arg, n) REPEAT235(macro, arg, INC_VALUE(n))
+#define REPEAT237(macro, arg, n) macro(arg, n) REPEAT236(macro, arg, INC_VALUE(n))
+#define REPEAT238(macro, arg, n) macro(arg, n) REPEAT237(macro, arg, INC_VALUE(n))
+#define REPEAT239(macro, arg, n) macro(arg, n) REPEAT238(macro, arg, INC_VALUE(n))
+#define REPEAT240(macro, arg, n) macro(arg, n) REPEAT239(macro, arg, INC_VALUE(n))
+#define REPEAT241(macro, arg, n) macro(arg, n) REPEAT240(macro, arg, INC_VALUE(n))
+#define REPEAT242(macro, arg, n) macro(arg, n) REPEAT241(macro, arg, INC_VALUE(n))
+#define REPEAT243(macro, arg, n) macro(arg, n) REPEAT242(macro, arg, INC_VALUE(n))
+#define REPEAT244(macro, arg, n) macro(arg, n) REPEAT243(macro, arg, INC_VALUE(n))
+#define REPEAT245(macro, arg, n) macro(arg, n) REPEAT244(macro, arg, INC_VALUE(n))
+#define REPEAT246(macro, arg, n) macro(arg, n) REPEAT245(macro, arg, INC_VALUE(n))
+#define REPEAT247(macro, arg, n) macro(arg, n) REPEAT246(macro, arg, INC_VALUE(n))
+#define REPEAT248(macro, arg, n) macro(arg, n) REPEAT247(macro, arg, INC_VALUE(n))
+#define REPEAT249(macro, arg, n) macro(arg, n) REPEAT248(macro, arg, INC_VALUE(n))
+#define REPEAT250(macro, arg, n) macro(arg, n) REPEAT249(macro, arg, INC_VALUE(n))
+#define REPEAT251(macro, arg, n) macro(arg, n) REPEAT250(macro, arg, INC_VALUE(n))
+#define REPEAT252(macro, arg, n) macro(arg, n) REPEAT251(macro, arg, INC_VALUE(n))
+#define REPEAT253(macro, arg, n) macro(arg, n) REPEAT252(macro, arg, INC_VALUE(n))
+#define REPEAT254(macro, arg, n) macro(arg, n) REPEAT253(macro, arg, INC_VALUE(n))
+#define REPEAT255(macro, arg, n) macro(arg, n) REPEAT254(macro, arg, INC_VALUE(n))
+
+#ifdef __cplusplus
+}
+#endif
+
+#include
+#endif /* _UTILS_REPEAT_MACRO_H */
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/utils/src/utils_assert.c b/Examples/AS5048A_test/AS5048A_test/hal/utils/src/utils_assert.c
new file mode 100644
index 0000000..b376c97
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/utils/src/utils_assert.c
@@ -0,0 +1,46 @@
+/**
+ * \file
+ *
+ * \brief Asserts related functionality.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#include
+
+/**
+ * \brief Assert function
+ */
+void assert(const bool condition, const char *const file, const int line)
+{
+ if (!(condition)) {
+ __asm("BKPT #0");
+ }
+ (void)file;
+ (void)line;
+}
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/utils/src/utils_event.c b/Examples/AS5048A_test/AS5048A_test/hal/utils/src/utils_event.c
new file mode 100644
index 0000000..d1af9d0
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/utils/src/utils_event.c
@@ -0,0 +1,125 @@
+/**
+ * \file
+ *
+ * \brief Events implementation.
+ *
+ * Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#include
+#include
+#include
+
+#define EVENT_WORD_BITS (sizeof(event_word_t) * 8)
+
+static struct list_descriptor events;
+static uint8_t subscribed[EVENT_MASK_SIZE];
+
+int32_t event_subscribe(struct event *const event, const event_id_t id, event_cb_t cb)
+{
+ /* get byte and bit number of the given event in the event mask */
+ const uint8_t position = id >> 3;
+ const uint8_t mask = 1 << (id & 0x7);
+
+ ASSERT(event && cb && (id < EVENT_MAX_AMOUNT));
+
+ if (event->mask[position] & mask) {
+ return ERR_NO_CHANGE; /* Already subscribed */
+ }
+
+ if (!is_list_element(&events, event)) {
+ memset(event->mask, 0, EVENT_MASK_SIZE);
+ list_insert_as_head(&events, event);
+ }
+ event->cb = cb;
+ event->mask[position] |= mask;
+
+ subscribed[position] |= mask;
+
+ return ERR_NONE;
+}
+
+int32_t event_unsubscribe(struct event *const event, const event_id_t id)
+{
+ /* get byte and bit number of the given event in the event mask */
+ const uint8_t position = id >> 3;
+ const uint8_t mask = 1 << (id & 0x7);
+ const struct event *current;
+ uint8_t i;
+
+ ASSERT(event && (id < EVENT_MAX_AMOUNT));
+
+ if (!(event->mask[position] & mask)) {
+ return ERR_NO_CHANGE; /* Already unsubscribed */
+ }
+
+ event->mask[position] &= ~mask;
+
+ /* Check if there are more subscribers */
+ for ((current = (const struct event *)list_get_head(&events)); current;
+ current = (const struct event *)list_get_next_element(current)) {
+ if (current->mask[position] & mask) {
+ break;
+ }
+ }
+ if (!current) {
+ subscribed[position] &= ~mask;
+ }
+
+ /* Remove event from the list. Can be unsave, document it! */
+ for (i = 0; i < ARRAY_SIZE(event->mask); i++) {
+ if (event->mask[i]) {
+ return ERR_NONE;
+ }
+ }
+ list_delete_element(&events, event);
+
+ return ERR_NONE;
+}
+
+void event_post(const event_id_t id, const event_data_t data)
+{
+ /* get byte and bit number of the given event in the event mask */
+ const uint8_t position = id >> 3;
+ const uint8_t mask = 1 << (id & 0x7);
+ const struct event *current;
+
+ ASSERT((id < EVENT_MAX_AMOUNT));
+
+ if (!(subscribed[position] & mask)) {
+ return; /* No subscribers */
+ }
+
+ /* Find all subscribers */
+ for ((current = (const struct event *)list_get_head(&events)); current;
+ current = (const struct event *)list_get_next_element(current)) {
+ if (current->mask[position] & mask) {
+ current->cb(id, data);
+ }
+ }
+}
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/utils/src/utils_list.c b/Examples/AS5048A_test/AS5048A_test/hal/utils/src/utils_list.c
new file mode 100644
index 0000000..4006a01
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/utils/src/utils_list.c
@@ -0,0 +1,136 @@
+/**
+ * \file
+ *
+ * \brief List functionality implementation.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#include
+#include
+
+/**
+ * \brief Check whether element belongs to list
+ */
+bool is_list_element(const struct list_descriptor *const list, const void *const element)
+{
+ struct list_element *it;
+ for (it = list->head; it; it = it->next) {
+ if (it == element) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+/**
+ * \brief Insert an element as list head
+ */
+void list_insert_as_head(struct list_descriptor *const list, void *const element)
+{
+ ASSERT(!is_list_element(list, element));
+
+ ((struct list_element *)element)->next = list->head;
+ list->head = (struct list_element *)element;
+}
+
+/**
+ * \brief Insert an element after the given list element
+ */
+void list_insert_after(void *const after, void *const element)
+{
+ ((struct list_element *)element)->next = ((struct list_element *)after)->next;
+ ((struct list_element *)after)->next = (struct list_element *)element;
+}
+
+/**
+ * \brief Insert an element at list end
+ */
+void list_insert_at_end(struct list_descriptor *const list, void *const element)
+{
+ struct list_element *it = list->head;
+
+ ASSERT(!is_list_element(list, element));
+
+ if (!list->head) {
+ list->head = (struct list_element *)element;
+ ((struct list_element *)element)->next = NULL;
+ return;
+ }
+
+ while (it->next) {
+ it = it->next;
+ }
+ it->next = (struct list_element *)element;
+ ((struct list_element *)element)->next = NULL;
+}
+
+/**
+ * \brief Removes list head
+ */
+void *list_remove_head(struct list_descriptor *const list)
+{
+ if (list->head) {
+ struct list_element *tmp = list->head;
+
+ list->head = list->head->next;
+ return (void *)tmp;
+ }
+
+ return NULL;
+}
+
+/**
+ * \brief Removes list element
+ */
+bool list_delete_element(struct list_descriptor *const list, const void *const element)
+{
+ if (!element) {
+ return false;
+ }
+
+ if (list->head == element) {
+ list->head = list->head->next;
+ return true;
+ } else {
+ struct list_element *it = list->head;
+
+ while (it && it->next != element) {
+ it = it->next;
+ }
+ if (it) {
+ it->next = ((struct list_element *)element)->next;
+ return true;
+ }
+ }
+
+ return false;
+}
+
+//@}
diff --git a/Examples/AS5048A_test/AS5048A_test/hal/utils/src/utils_syscalls.c b/Examples/AS5048A_test/AS5048A_test/hal/utils/src/utils_syscalls.c
new file mode 100644
index 0000000..79e2f1f
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hal/utils/src/utils_syscalls.c
@@ -0,0 +1,152 @@
+/**
+ * \file
+ *
+ * \brief Syscalls for SAM0 (GCC).
+ *
+ * Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#include
+#include
+#include
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#undef errno
+extern int errno;
+extern int _end;
+
+extern caddr_t _sbrk(int incr);
+extern int link(char *old, char *_new);
+extern int _close(int file);
+extern int _fstat(int file, struct stat *st);
+extern int _isatty(int file);
+extern int _lseek(int file, int ptr, int dir);
+extern void _exit(int status);
+extern void _kill(int pid, int sig);
+extern int _getpid(void);
+
+/**
+ * \brief Replacement of C library of _sbrk
+ */
+extern caddr_t _sbrk(int incr)
+{
+ static unsigned char *heap = NULL;
+ unsigned char * prev_heap;
+
+ if (heap == NULL) {
+ heap = (unsigned char *)&_end;
+ }
+ prev_heap = heap;
+
+ heap += incr;
+
+ return (caddr_t)prev_heap;
+}
+
+/**
+ * \brief Replacement of C library of link
+ */
+extern int link(char *old, char *_new)
+{
+ (void)old, (void)_new;
+ return -1;
+}
+
+/**
+ * \brief Replacement of C library of _close
+ */
+extern int _close(int file)
+{
+ (void)file;
+ return -1;
+}
+
+/**
+ * \brief Replacement of C library of _fstat
+ */
+extern int _fstat(int file, struct stat *st)
+{
+ (void)file;
+ st->st_mode = S_IFCHR;
+
+ return 0;
+}
+
+/**
+ * \brief Replacement of C library of _isatty
+ */
+extern int _isatty(int file)
+{
+ (void)file;
+ return 1;
+}
+
+/**
+ * \brief Replacement of C library of _lseek
+ */
+extern int _lseek(int file, int ptr, int dir)
+{
+ (void)file, (void)ptr, (void)dir;
+ return 0;
+}
+
+/**
+ * \brief Replacement of C library of _exit
+ */
+extern void _exit(int status)
+{
+ printf("Exiting with status %d.\n", status);
+
+ for (;;)
+ ;
+}
+
+/**
+ * \brief Replacement of C library of _kill
+ */
+extern void _kill(int pid, int sig)
+{
+ (void)pid, (void)sig;
+ return;
+}
+
+/**
+ * \brief Replacement of C library of _getpid
+ */
+extern int _getpid(void)
+{
+ return -1;
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/Examples/AS5048A_test/AS5048A_test/hpl/cmcc/hpl_cmcc.c b/Examples/AS5048A_test/AS5048A_test/hpl/cmcc/hpl_cmcc.c
new file mode 100644
index 0000000..bddf0e1
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hpl/cmcc/hpl_cmcc.c
@@ -0,0 +1,354 @@
+/**
+ * \file
+ *
+ * \brief Generic CMCC(Cortex M Cache Controller) related functionality.
+ *
+ * Copyright (c)2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+/*
+ * Support and FAQ: visit Microchip Support
+ */
+
+#include
+#include
+#include
+
+/**
+ * \brief Initialize Cache Module
+ *
+ * This function does low level cache configuration.
+ *
+ * \return initialize status
+ */
+int32_t _cmcc_init(void)
+{
+ int32_t return_value;
+
+ _cmcc_disable(CMCC);
+
+ if (_is_cache_disabled(CMCC)) {
+ hri_cmcc_write_CFG_reg(
+ CMCC,
+ (CMCC_CFG_CSIZESW(CONF_CMCC_CACHE_SIZE) | (CONF_CMCC_DATA_CACHE_DISABLE << CMCC_CFG_DCDIS_Pos)
+ | (CONF_CMCC_INST_CACHE_DISABLE << CMCC_CFG_ICDIS_Pos) | (CONF_CMCC_CLK_GATING_DISABLE)));
+
+ _cmcc_enable(CMCC);
+ return_value = _is_cache_enabled(CMCC) == true ? ERR_NONE : ERR_FAILURE;
+ } else {
+ return_value = ERR_NOT_INITIALIZED;
+ }
+
+ return return_value;
+}
+
+/**
+ * \brief Configure CMCC module
+ *
+ * \param[in] pointer pointing to the starting address of CMCC module
+ * \param[in] cache configuration structure pointer
+ *
+ * \return status of operation
+ */
+int32_t _cmcc_configure(const void *hw, struct _cache_cfg *cache_ctrl)
+{
+ int32_t return_value;
+
+ _cmcc_disable(hw);
+
+ if (_is_cache_disabled(hw)) {
+ hri_cmcc_write_CFG_reg(
+ hw,
+ (CMCC_CFG_CSIZESW(cache_ctrl->cache_size) | (cache_ctrl->data_cache_disable << CMCC_CFG_DCDIS_Pos)
+ | (cache_ctrl->inst_cache_disable << CMCC_CFG_ICDIS_Pos) | (cache_ctrl->gclk_gate_disable)));
+
+ return_value = ERR_NONE;
+ } else {
+ return_value = ERR_NOT_INITIALIZED;
+ }
+
+ return return_value;
+}
+
+/**
+ * \brief Enable data cache in CMCC module
+ *
+ * \param[in] pointer pointing to the starting address of CMCC module
+ * \param[in] boolean 1 -> Enable the data cache, 0 -> disable the data cache
+ *
+ * \return status of operation
+ */
+int32_t _cmcc_enable_data_cache(const void *hw, bool value)
+{
+ uint32_t tmp;
+ int32_t ret;
+
+ tmp = hri_cmcc_read_CFG_reg(hw);
+ tmp &= ~CMCC_CFG_DCDIS;
+ tmp |= ((!value) << CMCC_CFG_DCDIS_Pos);
+
+ ret = _cmcc_disable(hw);
+ hri_cmcc_write_CFG_reg(hw, tmp);
+ ret = _cmcc_enable(hw);
+
+ return ret;
+}
+
+/**
+ * \brief Enable instruction cache in CMCC module
+ *
+ * \param[in] pointer pointing to the starting address of CMCC module
+ * \param[in] boolean 1 -> Enable the inst cache, 0 -> disable the inst cache
+ *
+ * \return status of operation
+ */
+int32_t _cmcc_enable_inst_cache(const void *hw, bool value)
+{
+ uint32_t tmp;
+ int32_t ret;
+
+ tmp = hri_cmcc_read_CFG_reg(hw);
+ tmp &= ~CMCC_CFG_ICDIS;
+ tmp |= ((!value) << CMCC_CFG_ICDIS_Pos);
+
+ ret = _cmcc_disable(hw);
+ hri_cmcc_write_CFG_reg(hw, tmp);
+ ret = _cmcc_enable(hw);
+
+ return ret;
+}
+
+/**
+ * \brief Enable clock gating in CMCC module
+ *
+ * \param[in] pointer pointing to the starting address of CMCC module
+ * \param[in] boolean 1 -> Enable the clock gate, 0 -> disable the clock gate
+ *
+ * \return status of operation
+ */
+int32_t _cmcc_enable_clock_gating(const void *hw, bool value)
+{
+ uint32_t tmp;
+ int32_t ret;
+
+ tmp = hri_cmcc_read_CFG_reg(hw);
+ tmp |= value;
+
+ ret = _cmcc_disable(hw);
+ hri_cmcc_write_CFG_reg(hw, tmp);
+ ret = _cmcc_enable(hw);
+
+ return ret;
+}
+
+/**
+ * \brief Configure the cache size in CMCC module
+ *
+ * \param[in] pointer pointing to the starting address of CMCC module
+ * \param[in] element from cache size configuration enumerator
+ * 0->1K, 1->2K, 2->4K(default)
+ *
+ * \return status of operation
+ */
+int32_t _cmcc_configure_cache_size(const void *hw, enum conf_cache_size size)
+{
+ uint32_t tmp;
+ int32_t ret;
+
+ tmp = hri_cmcc_read_CFG_reg(hw);
+ tmp &= (~CMCC_CFG_CSIZESW_Msk);
+ tmp |= (size << CMCC_CFG_CSIZESW_Pos);
+
+ ret = _cmcc_disable(hw);
+ hri_cmcc_write_CFG_reg(hw, tmp);
+ ret = _cmcc_enable(hw);
+
+ return ret;
+}
+
+/**
+ * \brief Lock the mentioned WAY in CMCC module
+ *
+ * \param[in] pointer pointing to the starting address of CMCC module
+ * \param[in] element from "way_num_index" enumerator
+ *
+ * \return status of operation
+ */
+int32_t _cmcc_lock_way(const void *hw, enum way_num_index num)
+{
+ uint32_t tmp;
+ int32_t ret;
+
+ tmp = hri_cmcc_read_LCKWAY_reg(hw);
+ tmp |= CMCC_LCKWAY_LCKWAY(num);
+
+ ret = _cmcc_disable(hw);
+ hri_cmcc_write_LCKWAY_reg(hw, tmp);
+ ret = _cmcc_enable(hw);
+
+ return ret;
+}
+
+/**
+ * \brief Unlock the mentioned WAY in CMCC module
+ *
+ * \param[in] pointer pointing to the starting address of CMCC module
+ * \param[in] element from "way_num_index" enumerator
+ *
+ * \return status of operation
+ */
+int32_t _cmcc_unlock_way(const void *hw, enum way_num_index num)
+{
+ uint32_t tmp;
+ int32_t ret;
+
+ tmp = hri_cmcc_read_LCKWAY_reg(hw);
+ tmp &= (~CMCC_LCKWAY_LCKWAY(num));
+
+ ret = _cmcc_disable(hw);
+ hri_cmcc_write_LCKWAY_reg(hw, tmp);
+ ret = _cmcc_enable(hw);
+
+ return ret;
+}
+
+/**
+ * \brief Invalidate the mentioned cache line in CMCC module
+ *
+ * \param[in] pointer pointing to the starting address of CMCC module
+ * \param[in] element from "way_num" enumerator (valid arg is 0-3)
+ * \param[in] line number (valid arg is 0-63 as each way will have 64 lines)
+ *
+ * \return status of operation
+ */
+int32_t _cmcc_invalidate_by_line(const void *hw, uint8_t way_num, uint8_t line_num)
+{
+ int32_t return_value;
+
+ if ((way_num < CMCC_WAY_NOS) && (line_num < CMCC_LINE_NOS)) {
+ _cmcc_disable(hw);
+ while (!(_is_cache_disabled(hw)))
+ ;
+ hri_cmcc_write_MAINT1_reg(hw, (CMCC_MAINT1_INDEX(line_num) | CMCC_MAINT1_WAY(way_num)));
+ return_value = ERR_NONE;
+ } else {
+ return_value = ERR_INVALID_ARG;
+ }
+
+ return return_value;
+}
+
+/**
+ * \brief Invalidate entire cache entries in CMCC module
+ *
+ * \param[in] pointer pointing to the starting address of CMCC module
+ *
+ * \return status of operation
+ */
+int32_t _cmcc_invalidate_all(const void *hw)
+{
+ int32_t return_value;
+
+ _cmcc_disable(hw);
+ if (_is_cache_disabled(hw)) {
+ hri_cmcc_write_MAINT0_reg(hw, CMCC_MAINT0_INVALL);
+ return_value = ERR_NONE;
+ } else {
+ return_value = ERR_FAILURE;
+ }
+
+ return return_value;
+}
+
+/**
+ * \brief Configure cache monitor in CMCC module
+ *
+ * \param[in] pointer pointing to the starting address of CMCC module
+ * \param[in] element from cache monitor configurations enumerator
+ *
+ * \return status of operation
+ */
+int32_t _cmcc_configure_monitor(const void *hw, enum conf_cache_monitor monitor_cfg)
+{
+ hri_cmcc_write_MCFG_reg(hw, CMCC_MCFG_MODE(monitor_cfg));
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Enable cache monitor in CMCC module
+ *
+ * \param[in] pointer pointing to the starting address of CMCC module
+ *
+ * \return status of operation
+ */
+int32_t _cmcc_enable_monitor(const void *hw)
+{
+ hri_cmcc_write_MEN_reg(hw, CMCC_MEN_MENABLE);
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Disable cache monitor in CMCC module
+ *
+ * \param[in] pointer pointing to the starting address of CMCC module
+ *
+ * \return status of operation
+ */
+int32_t _cmcc_disable_monitor(const void *hw)
+{
+ hri_cmcc_write_MEN_reg(hw, (CMCC_MONITOR_DISABLE << CMCC_MEN_MENABLE_Pos));
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Reset cache monitor in CMCC module
+ *
+ * \param[in] pointer pointing to the starting address of CMCC module
+ *
+ * \return status of operation
+ */
+int32_t _cmcc_reset_monitor(const void *hw)
+{
+ hri_cmcc_write_MCTRL_reg(hw, CMCC_MCTRL_SWRST);
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Get cache monitor event counter value from CMCC module
+ *
+ * \param[in] pointer pointing to the starting address of CMCC module
+ *
+ * \return event counter value
+ */
+uint32_t _cmcc_get_monitor_event_count(const void *hw)
+{
+ return hri_cmcc_read_MSR_reg(hw);
+}
diff --git a/Examples/AS5048A_test/AS5048A_test/hpl/core/hpl_core_m4.c b/Examples/AS5048A_test/AS5048A_test/hpl/core/hpl_core_m4.c
new file mode 100644
index 0000000..4680ec3
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hpl/core/hpl_core_m4.c
@@ -0,0 +1,241 @@
+/**
+ * \file
+ *
+ * \brief Core related functionality implementation.
+ *
+ * Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#include
+#include
+#ifndef _UNIT_TEST_
+#include
+#endif
+#include
+#include
+
+#ifndef CONF_CPU_FREQUENCY
+#define CONF_CPU_FREQUENCY 1000000
+#endif
+
+#if CONF_CPU_FREQUENCY < 1000
+#define CPU_FREQ_POWER 3
+#elif CONF_CPU_FREQUENCY < 10000
+#define CPU_FREQ_POWER 4
+#elif CONF_CPU_FREQUENCY < 100000
+#define CPU_FREQ_POWER 5
+#elif CONF_CPU_FREQUENCY < 1000000
+#define CPU_FREQ_POWER 6
+#elif CONF_CPU_FREQUENCY < 10000000
+#define CPU_FREQ_POWER 7
+#elif CONF_CPU_FREQUENCY < 100000000
+#define CPU_FREQ_POWER 8
+#elif CONF_CPU_FREQUENCY < 1000000000
+#define CPU_FREQ_POWER 9
+#endif
+
+/**
+ * \brief The array of interrupt handlers
+ */
+struct _irq_descriptor *_irq_table[PERIPH_COUNT_IRQn];
+
+/**
+ * \brief Reset MCU
+ */
+void _reset_mcu(void)
+{
+ NVIC_SystemReset();
+}
+
+/**
+ * \brief Put MCU to sleep
+ */
+void _go_to_sleep(void)
+{
+ __DSB();
+ __WFI();
+}
+
+/**
+ * \brief Retrieve current IRQ number
+ */
+uint8_t _irq_get_current(void)
+{
+ return (uint8_t)__get_IPSR() - 16;
+}
+
+/**
+ * \brief Disable the given IRQ
+ */
+void _irq_disable(uint8_t n)
+{
+ NVIC_DisableIRQ((IRQn_Type)n);
+}
+
+/**
+ * \brief Set the given IRQ
+ */
+void _irq_set(uint8_t n)
+{
+ NVIC_SetPendingIRQ((IRQn_Type)n);
+}
+
+/**
+ * \brief Clear the given IRQ
+ */
+void _irq_clear(uint8_t n)
+{
+ NVIC_ClearPendingIRQ((IRQn_Type)n);
+}
+
+/**
+ * \brief Enable the given IRQ
+ */
+void _irq_enable(uint8_t n)
+{
+ NVIC_EnableIRQ((IRQn_Type)n);
+}
+
+/**
+ * \brief Register IRQ handler
+ */
+void _irq_register(const uint8_t n, struct _irq_descriptor *const irq)
+{
+ ASSERT(n < PERIPH_COUNT_IRQn);
+
+ _irq_table[n] = irq;
+}
+
+/**
+ * \brief Default interrupt handler for unused IRQs.
+ */
+void Default_Handler(void)
+{
+ while (1) {
+ }
+}
+
+/**
+ * \brief Retrieve the amount of cycles to delay for the given amount of us
+ */
+static inline uint32_t _get_cycles_for_us_internal(const uint16_t us, const uint32_t freq, const uint8_t power)
+{
+ switch (power) {
+ case 9:
+ return (us * (freq / 1000000) + 2) / 3;
+ case 8:
+ return (us * (freq / 100000) + 29) / 30;
+ case 7:
+ return (us * (freq / 10000) + 299) / 300;
+ case 6:
+ return (us * (freq / 1000) + 2999) / 3000;
+ case 5:
+ return (us * (freq / 100) + 29999) / 30000;
+ case 4:
+ return (us * (freq / 10) + 299999) / 300000;
+ default:
+ return (us * freq + 2999999) / 3000000;
+ }
+}
+
+/**
+ * \brief Retrieve the amount of cycles to delay for the given amount of us
+ */
+uint32_t _get_cycles_for_us(const uint16_t us)
+{
+ return _get_cycles_for_us_internal(us, CONF_CPU_FREQUENCY, CPU_FREQ_POWER);
+}
+
+/**
+ * \brief Retrieve the amount of cycles to delay for the given amount of ms
+ */
+static inline uint32_t _get_cycles_for_ms_internal(const uint16_t ms, const uint32_t freq, const uint8_t power)
+{
+ switch (power) {
+ case 9:
+ return (ms * (freq / 1000000) + 2) / 3 * 1000;
+ case 8:
+ return (ms * (freq / 100000) + 2) / 3 * 100;
+ case 7:
+ return (ms * (freq / 10000) + 2) / 3 * 10;
+ case 6:
+ return (ms * (freq / 1000) + 2) / 3;
+ case 5:
+ return (ms * (freq / 100) + 29) / 30;
+ case 4:
+ return (ms * (freq / 10) + 299) / 300;
+ default:
+ return (ms * (freq / 1) + 2999) / 3000;
+ }
+}
+
+/**
+ * \brief Retrieve the amount of cycles to delay for the given amount of ms
+ */
+uint32_t _get_cycles_for_ms(const uint16_t ms)
+{
+ return _get_cycles_for_ms_internal(ms, CONF_CPU_FREQUENCY, CPU_FREQ_POWER);
+}
+/**
+ * \brief Initialize delay functionality
+ */
+void _delay_init(void *const hw)
+{
+ (void)hw;
+}
+/**
+ * \brief Delay loop to delay n number of cycles
+ */
+void _delay_cycles(void *const hw, uint32_t cycles)
+{
+#ifndef _UNIT_TEST_
+ (void)hw;
+ (void)cycles;
+#if defined(__GNUC__) && (__ARMCOMPILER_VERSION > 6000000) /* Keil MDK with ARM Compiler 6 */
+ __asm(".align 3 \n"
+ "__delay:\n"
+ "subs r1, r1, #1\n"
+ "bhi __delay\n");
+#elif defined __GNUC__
+ __asm(".syntax unified\n"
+ ".align 3 \n"
+ "__delay:\n"
+ "subs r1, r1, #1\n"
+ "bhi __delay\n"
+ ".syntax divided");
+#elif defined __CC_ARM
+ __asm("__delay:\n"
+ "subs cycles, cycles, #1\n"
+ "bhi __delay\n");
+#elif defined __ICCARM__
+ __asm("__delay:\n"
+ "subs r1, r1, #1\n"
+ "bhi.n __delay\n");
+#endif
+#endif
+}
diff --git a/Examples/AS5048A_test/AS5048A_test/hpl/core/hpl_core_port.h b/Examples/AS5048A_test/AS5048A_test/hpl/core/hpl_core_port.h
new file mode 100644
index 0000000..3f3e8f2
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hpl/core/hpl_core_port.h
@@ -0,0 +1,61 @@
+/**
+ * \file
+ *
+ * \brief Core related functionality implementation.
+ *
+ * Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _HPL_CORE_PORT_H_INCLUDED
+#define _HPL_CORE_PORT_H_INCLUDED
+
+#include
+
+/* It's possible to include this file in ARM ASM files (e.g., in FreeRTOS IAR
+ * portable implement, portasm.s -> FreeRTOSConfig.h -> hpl_core_port.h),
+ * there will be assembling errors.
+ * So the following things are not included for assembling.
+ */
+#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
+
+#ifndef _UNIT_TEST_
+#include
+#endif
+
+/**
+ * \brief Check if it's in ISR handling
+ * \return \c true if it's in ISR
+ */
+static inline bool _is_in_isr(void)
+{
+ return (SCB->ICSR & SCB_ICSR_VECTACTIVE_Msk);
+}
+
+#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
+
+#endif /* _HPL_CORE_PORT_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hpl/core/hpl_init.c b/Examples/AS5048A_test/AS5048A_test/hpl/core/hpl_init.c
new file mode 100644
index 0000000..be0db93
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hpl/core/hpl_init.c
@@ -0,0 +1,78 @@
+/**
+ * \file
+ *
+ * \brief HPL initialization related functionality implementation.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+
+/* Referenced GCLKs (out of 0~11), should be initialized firstly
+ */
+#define _GCLK_INIT_1ST 0x00000000
+/* Not referenced GCLKs, initialized last */
+#define _GCLK_INIT_LAST 0x00000FFF
+
+/**
+ * \brief Initialize the hardware abstraction layer
+ */
+void _init_chip(void)
+{
+ hri_nvmctrl_set_CTRLA_RWS_bf(NVMCTRL, CONF_NVM_WAIT_STATE);
+
+ _osc32kctrl_init_sources();
+ _oscctrl_init_sources();
+ _mclk_init();
+#if _GCLK_INIT_1ST
+ _gclk_init_generators_by_fref(_GCLK_INIT_1ST);
+#endif
+ _oscctrl_init_referenced_generators();
+ _gclk_init_generators_by_fref(_GCLK_INIT_LAST);
+
+#if CONF_DMAC_ENABLE
+ hri_mclk_set_AHBMASK_DMAC_bit(MCLK);
+ _dma_init();
+#endif
+
+#if (CONF_PORT_EVCTRL_PORT_0 | CONF_PORT_EVCTRL_PORT_1 | CONF_PORT_EVCTRL_PORT_2 | CONF_PORT_EVCTRL_PORT_3)
+ _port_event_init();
+#endif
+
+#if CONF_CMCC_ENABLE
+ cache_init();
+#endif
+}
diff --git a/Examples/AS5048A_test/AS5048A_test/hpl/dmac/hpl_dmac.c b/Examples/AS5048A_test/AS5048A_test/hpl/dmac/hpl_dmac.c
new file mode 100644
index 0000000..c7b03b0
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hpl/dmac/hpl_dmac.c
@@ -0,0 +1,263 @@
+
+/**
+ * \file
+ *
+ * \brief Generic DMAC related functionality.
+ *
+ * Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+#include
+#include
+#include
+#include
+#include
+
+#if CONF_DMAC_ENABLE
+/* Section containing first descriptors for all DMAC channels */
+COMPILER_ALIGNED(16)
+DmacDescriptor _descriptor_section[DMAC_CH_NUM];
+
+/* Section containing current descriptors for all DMAC channels */
+COMPILER_ALIGNED(16)
+DmacDescriptor _write_back_section[DMAC_CH_NUM];
+
+/* Array containing callbacks for DMAC channels */
+static struct _dma_resource _resources[DMAC_CH_NUM];
+
+/* DMAC interrupt handler */
+static void _dmac_handler(void);
+
+/* This macro DMAC configuration */
+#define DMAC_CHANNEL_CFG(i, n) \
+ {(CONF_DMAC_RUNSTDBY_##n << DMAC_CHCTRLA_RUNSTDBY_Pos) | DMAC_CHCTRLA_TRIGACT(CONF_DMAC_TRIGACT_##n) \
+ | DMAC_CHCTRLA_TRIGSRC(CONF_DMAC_TRIGSRC_##n), \
+ DMAC_CHPRILVL_PRILVL(CONF_DMAC_LVL_##n), \
+ (CONF_DMAC_EVIE_##n << DMAC_CHEVCTRL_EVIE_Pos) | (CONF_DMAC_EVOE_##n << DMAC_CHEVCTRL_EVOE_Pos) \
+ | (CONF_DMAC_EVACT_##n << DMAC_CHEVCTRL_EVACT_Pos), \
+ DMAC_BTCTRL_STEPSIZE(CONF_DMAC_STEPSIZE_##n) | (CONF_DMAC_STEPSEL_##n << DMAC_BTCTRL_STEPSEL_Pos) \
+ | (CONF_DMAC_DSTINC_##n << DMAC_BTCTRL_DSTINC_Pos) | (CONF_DMAC_SRCINC_##n << DMAC_BTCTRL_SRCINC_Pos) \
+ | DMAC_BTCTRL_BEATSIZE(CONF_DMAC_BEATSIZE_##n) | DMAC_BTCTRL_BLOCKACT(CONF_DMAC_BLOCKACT_##n) \
+ | DMAC_BTCTRL_EVOSEL(CONF_DMAC_EVOSEL_##n)},
+
+/* DMAC channel configuration */
+struct dmac_channel_cfg {
+ uint32_t ctrla;
+ uint8_t prilvl;
+ uint8_t evctrl;
+ uint16_t btctrl;
+};
+
+/* DMAC channel configurations */
+const static struct dmac_channel_cfg _cfgs[] = {REPEAT_MACRO(DMAC_CHANNEL_CFG, i, DMAC_CH_NUM)};
+
+/**
+ * \brief Initialize DMAC
+ */
+int32_t _dma_init(void)
+{
+ uint8_t i;
+
+ hri_dmac_clear_CTRL_DMAENABLE_bit(DMAC);
+ hri_dmac_clear_CRCCTRL_reg(DMAC, DMAC_CRCCTRL_CRCSRC_Msk);
+ hri_dmac_set_CTRL_SWRST_bit(DMAC);
+ while (hri_dmac_get_CTRL_SWRST_bit(DMAC))
+ ;
+
+ hri_dmac_write_CTRL_reg(DMAC,
+ (CONF_DMAC_LVLEN0 << DMAC_CTRL_LVLEN0_Pos) | (CONF_DMAC_LVLEN1 << DMAC_CTRL_LVLEN1_Pos)
+ | (CONF_DMAC_LVLEN2 << DMAC_CTRL_LVLEN2_Pos)
+ | (CONF_DMAC_LVLEN3 << DMAC_CTRL_LVLEN3_Pos));
+ hri_dmac_write_DBGCTRL_DBGRUN_bit(DMAC, CONF_DMAC_DBGRUN);
+
+ hri_dmac_write_PRICTRL0_reg(
+ DMAC,
+ DMAC_PRICTRL0_LVLPRI0(CONF_DMAC_LVLPRI0) | DMAC_PRICTRL0_LVLPRI1(CONF_DMAC_LVLPRI1)
+ | DMAC_PRICTRL0_LVLPRI2(CONF_DMAC_LVLPRI2) | DMAC_PRICTRL0_LVLPRI3(CONF_DMAC_LVLPRI3)
+ | (CONF_DMAC_RRLVLEN0 << DMAC_PRICTRL0_RRLVLEN0_Pos) | (CONF_DMAC_RRLVLEN1 << DMAC_PRICTRL0_RRLVLEN1_Pos)
+ | (CONF_DMAC_RRLVLEN2 << DMAC_PRICTRL0_RRLVLEN2_Pos) | (CONF_DMAC_RRLVLEN3 << DMAC_PRICTRL0_RRLVLEN3_Pos));
+ hri_dmac_write_BASEADDR_reg(DMAC, (uint32_t)_descriptor_section);
+ hri_dmac_write_WRBADDR_reg(DMAC, (uint32_t)_write_back_section);
+
+ for (i = 0; i < DMAC_CH_NUM; i++) {
+ hri_dmac_write_CHCTRLA_reg(DMAC, i, _cfgs[i].ctrla);
+ hri_dmac_write_CHPRILVL_reg(DMAC, i, _cfgs[i].prilvl);
+ hri_dmac_write_CHEVCTRL_reg(DMAC, i, _cfgs[i].evctrl);
+ hri_dmacdescriptor_write_BTCTRL_reg(&_descriptor_section[i], _cfgs[i].btctrl);
+ hri_dmacdescriptor_write_DESCADDR_reg(&_descriptor_section[i], 0x0);
+ }
+
+ for (i = 0; i < 5; i++) {
+ NVIC_DisableIRQ(DMAC_0_IRQn + i);
+ NVIC_ClearPendingIRQ(DMAC_0_IRQn + i);
+ NVIC_EnableIRQ(DMAC_0_IRQn + i);
+ }
+
+ hri_dmac_set_CTRL_DMAENABLE_bit(DMAC);
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Enable/disable DMA interrupt
+ */
+void _dma_set_irq_state(const uint8_t channel, const enum _dma_callback_type type, const bool state)
+{
+ if (DMA_TRANSFER_COMPLETE_CB == type) {
+ hri_dmac_write_CHINTEN_TCMPL_bit(DMAC, channel, state);
+ } else if (DMA_TRANSFER_ERROR_CB == type) {
+ hri_dmac_write_CHINTEN_TERR_bit(DMAC, channel, state);
+ }
+}
+
+int32_t _dma_set_destination_address(const uint8_t channel, const void *const dst)
+{
+ hri_dmacdescriptor_write_DSTADDR_reg(&_descriptor_section[channel], (uint32_t)dst);
+
+ return ERR_NONE;
+}
+
+int32_t _dma_set_source_address(const uint8_t channel, const void *const src)
+{
+ hri_dmacdescriptor_write_SRCADDR_reg(&_descriptor_section[channel], (uint32_t)src);
+
+ return ERR_NONE;
+}
+
+int32_t _dma_set_next_descriptor(const uint8_t current_channel, const uint8_t next_channel)
+{
+ hri_dmacdescriptor_write_DESCADDR_reg(&_descriptor_section[current_channel],
+ (uint32_t)&_descriptor_section[next_channel]);
+
+ return ERR_NONE;
+}
+
+int32_t _dma_srcinc_enable(const uint8_t channel, const bool enable)
+{
+ hri_dmacdescriptor_write_BTCTRL_SRCINC_bit(&_descriptor_section[channel], enable);
+
+ return ERR_NONE;
+}
+
+int32_t _dma_set_data_amount(const uint8_t channel, const uint32_t amount)
+{
+ uint32_t address = hri_dmacdescriptor_read_DSTADDR_reg(&_descriptor_section[channel]);
+ uint8_t beat_size = hri_dmacdescriptor_read_BTCTRL_BEATSIZE_bf(&_descriptor_section[channel]);
+
+ if (hri_dmacdescriptor_get_BTCTRL_DSTINC_bit(&_descriptor_section[channel])) {
+ hri_dmacdescriptor_write_DSTADDR_reg(&_descriptor_section[channel], address + amount * (1 << beat_size));
+ }
+
+ address = hri_dmacdescriptor_read_SRCADDR_reg(&_descriptor_section[channel]);
+
+ if (hri_dmacdescriptor_get_BTCTRL_SRCINC_bit(&_descriptor_section[channel])) {
+ hri_dmacdescriptor_write_SRCADDR_reg(&_descriptor_section[channel], address + amount * (1 << beat_size));
+ }
+
+ hri_dmacdescriptor_write_BTCNT_reg(&_descriptor_section[channel], amount);
+
+ return ERR_NONE;
+}
+
+int32_t _dma_enable_transaction(const uint8_t channel, const bool software_trigger)
+{
+ hri_dmacdescriptor_set_BTCTRL_VALID_bit(&_descriptor_section[channel]);
+ hri_dmac_set_CHCTRLA_ENABLE_bit(DMAC, channel);
+
+ if (software_trigger) {
+ hri_dmac_set_SWTRIGCTRL_reg(DMAC, 1 << channel);
+ }
+
+ return ERR_NONE;
+}
+
+int32_t _dma_get_channel_resource(struct _dma_resource **resource, const uint8_t channel)
+{
+ *resource = &_resources[channel];
+
+ return ERR_NONE;
+}
+
+int32_t _dma_dstinc_enable(const uint8_t channel, const bool enable)
+{
+ hri_dmacdescriptor_write_BTCTRL_DSTINC_bit(&_descriptor_section[channel], enable);
+
+ return ERR_NONE;
+}
+/**
+ * \internal DMAC interrupt handler
+ */
+static void _dmac_handler(void)
+{
+ uint8_t channel = hri_dmac_get_INTPEND_reg(DMAC, DMAC_INTPEND_ID_Msk);
+ struct _dma_resource *tmp_resource = &_resources[channel];
+
+ if (hri_dmac_get_INTPEND_TERR_bit(DMAC)) {
+ hri_dmac_clear_CHINTFLAG_TERR_bit(DMAC, channel);
+ tmp_resource->dma_cb.error(tmp_resource);
+ } else if (hri_dmac_get_INTPEND_TCMPL_bit(DMAC)) {
+ hri_dmac_clear_CHINTFLAG_TCMPL_bit(DMAC, channel);
+ tmp_resource->dma_cb.transfer_done(tmp_resource);
+ }
+}
+/**
+ * \brief DMAC interrupt handler
+ */
+void DMAC_0_Handler(void)
+{
+ _dmac_handler();
+}
+/**
+ * \brief DMAC interrupt handler
+ */
+void DMAC_1_Handler(void)
+{
+ _dmac_handler();
+}
+/**
+ * \brief DMAC interrupt handler
+ */
+void DMAC_2_Handler(void)
+{
+ _dmac_handler();
+}
+/**
+ * \brief DMAC interrupt handler
+ */
+void DMAC_3_Handler(void)
+{
+ _dmac_handler();
+}
+/**
+ * \brief DMAC interrupt handler
+ */
+void DMAC_4_Handler(void)
+{
+ _dmac_handler();
+}
+
+#endif /* CONF_DMAC_ENABLE */
diff --git a/Examples/AS5048A_test/AS5048A_test/hpl/gclk/hpl_gclk.c b/Examples/AS5048A_test/AS5048A_test/hpl/gclk/hpl_gclk.c
new file mode 100644
index 0000000..211ccc3
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hpl/gclk/hpl_gclk.c
@@ -0,0 +1,312 @@
+
+/**
+ * \file
+ *
+ * \brief Generic Clock Controller related functionality.
+ *
+ * Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#include
+#include
+#include
+
+/**
+ * \brief Initializes generators
+ */
+void _gclk_init_generators(void)
+{
+
+#if CONF_GCLK_GENERATOR_0_CONFIG == 1
+ hri_gclk_write_GENCTRL_reg(
+ GCLK,
+ 0,
+ GCLK_GENCTRL_DIV(CONF_GCLK_GEN_0_DIV) | (CONF_GCLK_GEN_0_RUNSTDBY << GCLK_GENCTRL_RUNSTDBY_Pos)
+ | (CONF_GCLK_GEN_0_DIVSEL << GCLK_GENCTRL_DIVSEL_Pos) | (CONF_GCLK_GEN_0_OE << GCLK_GENCTRL_OE_Pos)
+ | (CONF_GCLK_GEN_0_OOV << GCLK_GENCTRL_OOV_Pos) | (CONF_GCLK_GEN_0_IDC << GCLK_GENCTRL_IDC_Pos)
+ | (CONF_GCLK_GENERATOR_0_CONFIG << GCLK_GENCTRL_GENEN_Pos) | CONF_GCLK_GEN_0_SOURCE);
+#endif
+
+#if CONF_GCLK_GENERATOR_1_CONFIG == 1
+ hri_gclk_write_GENCTRL_reg(
+ GCLK,
+ 1,
+ GCLK_GENCTRL_DIV(CONF_GCLK_GEN_1_DIV) | (CONF_GCLK_GEN_1_RUNSTDBY << GCLK_GENCTRL_RUNSTDBY_Pos)
+ | (CONF_GCLK_GEN_1_DIVSEL << GCLK_GENCTRL_DIVSEL_Pos) | (CONF_GCLK_GEN_1_OE << GCLK_GENCTRL_OE_Pos)
+ | (CONF_GCLK_GEN_1_OOV << GCLK_GENCTRL_OOV_Pos) | (CONF_GCLK_GEN_1_IDC << GCLK_GENCTRL_IDC_Pos)
+ | (CONF_GCLK_GENERATOR_1_CONFIG << GCLK_GENCTRL_GENEN_Pos) | CONF_GCLK_GEN_1_SOURCE);
+#endif
+
+#if CONF_GCLK_GENERATOR_2_CONFIG == 1
+ hri_gclk_write_GENCTRL_reg(
+ GCLK,
+ 2,
+ GCLK_GENCTRL_DIV(CONF_GCLK_GEN_2_DIV) | (CONF_GCLK_GEN_2_RUNSTDBY << GCLK_GENCTRL_RUNSTDBY_Pos)
+ | (CONF_GCLK_GEN_2_DIVSEL << GCLK_GENCTRL_DIVSEL_Pos) | (CONF_GCLK_GEN_2_OE << GCLK_GENCTRL_OE_Pos)
+ | (CONF_GCLK_GEN_2_OOV << GCLK_GENCTRL_OOV_Pos) | (CONF_GCLK_GEN_2_IDC << GCLK_GENCTRL_IDC_Pos)
+ | (CONF_GCLK_GENERATOR_2_CONFIG << GCLK_GENCTRL_GENEN_Pos) | CONF_GCLK_GEN_2_SOURCE);
+#endif
+
+#if CONF_GCLK_GENERATOR_3_CONFIG == 1
+ hri_gclk_write_GENCTRL_reg(
+ GCLK,
+ 3,
+ GCLK_GENCTRL_DIV(CONF_GCLK_GEN_3_DIV) | (CONF_GCLK_GEN_3_RUNSTDBY << GCLK_GENCTRL_RUNSTDBY_Pos)
+ | (CONF_GCLK_GEN_3_DIVSEL << GCLK_GENCTRL_DIVSEL_Pos) | (CONF_GCLK_GEN_3_OE << GCLK_GENCTRL_OE_Pos)
+ | (CONF_GCLK_GEN_3_OOV << GCLK_GENCTRL_OOV_Pos) | (CONF_GCLK_GEN_3_IDC << GCLK_GENCTRL_IDC_Pos)
+ | (CONF_GCLK_GENERATOR_3_CONFIG << GCLK_GENCTRL_GENEN_Pos) | CONF_GCLK_GEN_3_SOURCE);
+#endif
+
+#if CONF_GCLK_GENERATOR_4_CONFIG == 1
+ hri_gclk_write_GENCTRL_reg(
+ GCLK,
+ 4,
+ GCLK_GENCTRL_DIV(CONF_GCLK_GEN_4_DIV) | (CONF_GCLK_GEN_4_RUNSTDBY << GCLK_GENCTRL_RUNSTDBY_Pos)
+ | (CONF_GCLK_GEN_4_DIVSEL << GCLK_GENCTRL_DIVSEL_Pos) | (CONF_GCLK_GEN_4_OE << GCLK_GENCTRL_OE_Pos)
+ | (CONF_GCLK_GEN_4_OOV << GCLK_GENCTRL_OOV_Pos) | (CONF_GCLK_GEN_4_IDC << GCLK_GENCTRL_IDC_Pos)
+ | (CONF_GCLK_GENERATOR_4_CONFIG << GCLK_GENCTRL_GENEN_Pos) | CONF_GCLK_GEN_4_SOURCE);
+#endif
+
+#if CONF_GCLK_GENERATOR_5_CONFIG == 1
+ hri_gclk_write_GENCTRL_reg(
+ GCLK,
+ 5,
+ GCLK_GENCTRL_DIV(CONF_GCLK_GEN_5_DIV) | (CONF_GCLK_GEN_5_RUNSTDBY << GCLK_GENCTRL_RUNSTDBY_Pos)
+ | (CONF_GCLK_GEN_5_DIVSEL << GCLK_GENCTRL_DIVSEL_Pos) | (CONF_GCLK_GEN_5_OE << GCLK_GENCTRL_OE_Pos)
+ | (CONF_GCLK_GEN_5_OOV << GCLK_GENCTRL_OOV_Pos) | (CONF_GCLK_GEN_5_IDC << GCLK_GENCTRL_IDC_Pos)
+ | (CONF_GCLK_GENERATOR_5_CONFIG << GCLK_GENCTRL_GENEN_Pos) | CONF_GCLK_GEN_5_SOURCE);
+#endif
+
+#if CONF_GCLK_GENERATOR_6_CONFIG == 1
+ hri_gclk_write_GENCTRL_reg(
+ GCLK,
+ 6,
+ GCLK_GENCTRL_DIV(CONF_GCLK_GEN_6_DIV) | (CONF_GCLK_GEN_6_RUNSTDBY << GCLK_GENCTRL_RUNSTDBY_Pos)
+ | (CONF_GCLK_GEN_6_DIVSEL << GCLK_GENCTRL_DIVSEL_Pos) | (CONF_GCLK_GEN_6_OE << GCLK_GENCTRL_OE_Pos)
+ | (CONF_GCLK_GEN_6_OOV << GCLK_GENCTRL_OOV_Pos) | (CONF_GCLK_GEN_6_IDC << GCLK_GENCTRL_IDC_Pos)
+ | (CONF_GCLK_GENERATOR_6_CONFIG << GCLK_GENCTRL_GENEN_Pos) | CONF_GCLK_GEN_6_SOURCE);
+#endif
+
+#if CONF_GCLK_GENERATOR_7_CONFIG == 1
+ hri_gclk_write_GENCTRL_reg(
+ GCLK,
+ 7,
+ GCLK_GENCTRL_DIV(CONF_GCLK_GEN_7_DIV) | (CONF_GCLK_GEN_7_RUNSTDBY << GCLK_GENCTRL_RUNSTDBY_Pos)
+ | (CONF_GCLK_GEN_7_DIVSEL << GCLK_GENCTRL_DIVSEL_Pos) | (CONF_GCLK_GEN_7_OE << GCLK_GENCTRL_OE_Pos)
+ | (CONF_GCLK_GEN_7_OOV << GCLK_GENCTRL_OOV_Pos) | (CONF_GCLK_GEN_7_IDC << GCLK_GENCTRL_IDC_Pos)
+ | (CONF_GCLK_GENERATOR_7_CONFIG << GCLK_GENCTRL_GENEN_Pos) | CONF_GCLK_GEN_7_SOURCE);
+#endif
+
+#if CONF_GCLK_GENERATOR_8_CONFIG == 1
+ hri_gclk_write_GENCTRL_reg(
+ GCLK,
+ 8,
+ GCLK_GENCTRL_DIV(CONF_GCLK_GEN_8_DIV) | (CONF_GCLK_GEN_8_RUNSTDBY << GCLK_GENCTRL_RUNSTDBY_Pos)
+ | (CONF_GCLK_GEN_8_DIVSEL << GCLK_GENCTRL_DIVSEL_Pos) | (CONF_GCLK_GEN_8_OE << GCLK_GENCTRL_OE_Pos)
+ | (CONF_GCLK_GEN_8_OOV << GCLK_GENCTRL_OOV_Pos) | (CONF_GCLK_GEN_8_IDC << GCLK_GENCTRL_IDC_Pos)
+ | (CONF_GCLK_GENERATOR_8_CONFIG << GCLK_GENCTRL_GENEN_Pos) | CONF_GCLK_GEN_8_SOURCE);
+#endif
+
+#if CONF_GCLK_GENERATOR_9_CONFIG == 1
+ hri_gclk_write_GENCTRL_reg(
+ GCLK,
+ 9,
+ GCLK_GENCTRL_DIV(CONF_GCLK_GEN_9_DIV) | (CONF_GCLK_GEN_9_RUNSTDBY << GCLK_GENCTRL_RUNSTDBY_Pos)
+ | (CONF_GCLK_GEN_9_DIVSEL << GCLK_GENCTRL_DIVSEL_Pos) | (CONF_GCLK_GEN_9_OE << GCLK_GENCTRL_OE_Pos)
+ | (CONF_GCLK_GEN_9_OOV << GCLK_GENCTRL_OOV_Pos) | (CONF_GCLK_GEN_9_IDC << GCLK_GENCTRL_IDC_Pos)
+ | (CONF_GCLK_GENERATOR_9_CONFIG << GCLK_GENCTRL_GENEN_Pos) | CONF_GCLK_GEN_9_SOURCE);
+#endif
+
+#if CONF_GCLK_GENERATOR_10_CONFIG == 1
+ hri_gclk_write_GENCTRL_reg(
+ GCLK,
+ 10,
+ GCLK_GENCTRL_DIV(CONF_GCLK_GEN_10_DIV) | (CONF_GCLK_GEN_10_RUNSTDBY << GCLK_GENCTRL_RUNSTDBY_Pos)
+ | (CONF_GCLK_GEN_10_DIVSEL << GCLK_GENCTRL_DIVSEL_Pos) | (CONF_GCLK_GEN_10_OE << GCLK_GENCTRL_OE_Pos)
+ | (CONF_GCLK_GEN_10_OOV << GCLK_GENCTRL_OOV_Pos) | (CONF_GCLK_GEN_10_IDC << GCLK_GENCTRL_IDC_Pos)
+ | (CONF_GCLK_GENERATOR_10_CONFIG << GCLK_GENCTRL_GENEN_Pos) | CONF_GCLK_GEN_10_SOURCE);
+#endif
+
+#if CONF_GCLK_GENERATOR_11_CONFIG == 1
+ hri_gclk_write_GENCTRL_reg(
+ GCLK,
+ 11,
+ GCLK_GENCTRL_DIV(CONF_GCLK_GEN_11_DIV) | (CONF_GCLK_GEN_11_RUNSTDBY << GCLK_GENCTRL_RUNSTDBY_Pos)
+ | (CONF_GCLK_GEN_11_DIVSEL << GCLK_GENCTRL_DIVSEL_Pos) | (CONF_GCLK_GEN_11_OE << GCLK_GENCTRL_OE_Pos)
+ | (CONF_GCLK_GEN_11_OOV << GCLK_GENCTRL_OOV_Pos) | (CONF_GCLK_GEN_11_IDC << GCLK_GENCTRL_IDC_Pos)
+ | (CONF_GCLK_GENERATOR_11_CONFIG << GCLK_GENCTRL_GENEN_Pos) | CONF_GCLK_GEN_11_SOURCE);
+#endif
+}
+
+void _gclk_init_generators_by_fref(uint32_t bm)
+{
+
+#if CONF_GCLK_GENERATOR_0_CONFIG == 1
+ if (bm & (1ul << 0)) {
+ hri_gclk_write_GENCTRL_reg(
+ GCLK,
+ 0,
+ GCLK_GENCTRL_DIV(CONF_GCLK_GEN_0_DIV) | (CONF_GCLK_GEN_0_RUNSTDBY << GCLK_GENCTRL_RUNSTDBY_Pos)
+ | (CONF_GCLK_GEN_0_DIVSEL << GCLK_GENCTRL_DIVSEL_Pos) | (CONF_GCLK_GEN_0_OE << GCLK_GENCTRL_OE_Pos)
+ | (CONF_GCLK_GEN_0_OOV << GCLK_GENCTRL_OOV_Pos) | (CONF_GCLK_GEN_0_IDC << GCLK_GENCTRL_IDC_Pos)
+ | (CONF_GCLK_GENERATOR_0_CONFIG << GCLK_GENCTRL_GENEN_Pos) | CONF_GCLK_GEN_0_SOURCE);
+ }
+#endif
+
+#if CONF_GCLK_GENERATOR_1_CONFIG == 1
+ if (bm & (1ul << 1)) {
+ hri_gclk_write_GENCTRL_reg(
+ GCLK,
+ 1,
+ GCLK_GENCTRL_DIV(CONF_GCLK_GEN_1_DIV) | (CONF_GCLK_GEN_1_RUNSTDBY << GCLK_GENCTRL_RUNSTDBY_Pos)
+ | (CONF_GCLK_GEN_1_DIVSEL << GCLK_GENCTRL_DIVSEL_Pos) | (CONF_GCLK_GEN_1_OE << GCLK_GENCTRL_OE_Pos)
+ | (CONF_GCLK_GEN_1_OOV << GCLK_GENCTRL_OOV_Pos) | (CONF_GCLK_GEN_1_IDC << GCLK_GENCTRL_IDC_Pos)
+ | (CONF_GCLK_GENERATOR_1_CONFIG << GCLK_GENCTRL_GENEN_Pos) | CONF_GCLK_GEN_1_SOURCE);
+ }
+#endif
+
+#if CONF_GCLK_GENERATOR_2_CONFIG == 1
+ if (bm & (1ul << 2)) {
+ hri_gclk_write_GENCTRL_reg(
+ GCLK,
+ 2,
+ GCLK_GENCTRL_DIV(CONF_GCLK_GEN_2_DIV) | (CONF_GCLK_GEN_2_RUNSTDBY << GCLK_GENCTRL_RUNSTDBY_Pos)
+ | (CONF_GCLK_GEN_2_DIVSEL << GCLK_GENCTRL_DIVSEL_Pos) | (CONF_GCLK_GEN_2_OE << GCLK_GENCTRL_OE_Pos)
+ | (CONF_GCLK_GEN_2_OOV << GCLK_GENCTRL_OOV_Pos) | (CONF_GCLK_GEN_2_IDC << GCLK_GENCTRL_IDC_Pos)
+ | (CONF_GCLK_GENERATOR_2_CONFIG << GCLK_GENCTRL_GENEN_Pos) | CONF_GCLK_GEN_2_SOURCE);
+ }
+#endif
+
+#if CONF_GCLK_GENERATOR_3_CONFIG == 1
+ if (bm & (1ul << 3)) {
+ hri_gclk_write_GENCTRL_reg(
+ GCLK,
+ 3,
+ GCLK_GENCTRL_DIV(CONF_GCLK_GEN_3_DIV) | (CONF_GCLK_GEN_3_RUNSTDBY << GCLK_GENCTRL_RUNSTDBY_Pos)
+ | (CONF_GCLK_GEN_3_DIVSEL << GCLK_GENCTRL_DIVSEL_Pos) | (CONF_GCLK_GEN_3_OE << GCLK_GENCTRL_OE_Pos)
+ | (CONF_GCLK_GEN_3_OOV << GCLK_GENCTRL_OOV_Pos) | (CONF_GCLK_GEN_3_IDC << GCLK_GENCTRL_IDC_Pos)
+ | (CONF_GCLK_GENERATOR_3_CONFIG << GCLK_GENCTRL_GENEN_Pos) | CONF_GCLK_GEN_3_SOURCE);
+ }
+#endif
+
+#if CONF_GCLK_GENERATOR_4_CONFIG == 1
+ if (bm & (1ul << 4)) {
+ hri_gclk_write_GENCTRL_reg(
+ GCLK,
+ 4,
+ GCLK_GENCTRL_DIV(CONF_GCLK_GEN_4_DIV) | (CONF_GCLK_GEN_4_RUNSTDBY << GCLK_GENCTRL_RUNSTDBY_Pos)
+ | (CONF_GCLK_GEN_4_DIVSEL << GCLK_GENCTRL_DIVSEL_Pos) | (CONF_GCLK_GEN_4_OE << GCLK_GENCTRL_OE_Pos)
+ | (CONF_GCLK_GEN_4_OOV << GCLK_GENCTRL_OOV_Pos) | (CONF_GCLK_GEN_4_IDC << GCLK_GENCTRL_IDC_Pos)
+ | (CONF_GCLK_GENERATOR_4_CONFIG << GCLK_GENCTRL_GENEN_Pos) | CONF_GCLK_GEN_4_SOURCE);
+ }
+#endif
+
+#if CONF_GCLK_GENERATOR_5_CONFIG == 1
+ if (bm & (1ul << 5)) {
+ hri_gclk_write_GENCTRL_reg(
+ GCLK,
+ 5,
+ GCLK_GENCTRL_DIV(CONF_GCLK_GEN_5_DIV) | (CONF_GCLK_GEN_5_RUNSTDBY << GCLK_GENCTRL_RUNSTDBY_Pos)
+ | (CONF_GCLK_GEN_5_DIVSEL << GCLK_GENCTRL_DIVSEL_Pos) | (CONF_GCLK_GEN_5_OE << GCLK_GENCTRL_OE_Pos)
+ | (CONF_GCLK_GEN_5_OOV << GCLK_GENCTRL_OOV_Pos) | (CONF_GCLK_GEN_5_IDC << GCLK_GENCTRL_IDC_Pos)
+ | (CONF_GCLK_GENERATOR_5_CONFIG << GCLK_GENCTRL_GENEN_Pos) | CONF_GCLK_GEN_5_SOURCE);
+ }
+#endif
+
+#if CONF_GCLK_GENERATOR_6_CONFIG == 1
+ if (bm & (1ul << 6)) {
+ hri_gclk_write_GENCTRL_reg(
+ GCLK,
+ 6,
+ GCLK_GENCTRL_DIV(CONF_GCLK_GEN_6_DIV) | (CONF_GCLK_GEN_6_RUNSTDBY << GCLK_GENCTRL_RUNSTDBY_Pos)
+ | (CONF_GCLK_GEN_6_DIVSEL << GCLK_GENCTRL_DIVSEL_Pos) | (CONF_GCLK_GEN_6_OE << GCLK_GENCTRL_OE_Pos)
+ | (CONF_GCLK_GEN_6_OOV << GCLK_GENCTRL_OOV_Pos) | (CONF_GCLK_GEN_6_IDC << GCLK_GENCTRL_IDC_Pos)
+ | (CONF_GCLK_GENERATOR_6_CONFIG << GCLK_GENCTRL_GENEN_Pos) | CONF_GCLK_GEN_6_SOURCE);
+ }
+#endif
+
+#if CONF_GCLK_GENERATOR_7_CONFIG == 1
+ if (bm & (1ul << 7)) {
+ hri_gclk_write_GENCTRL_reg(
+ GCLK,
+ 7,
+ GCLK_GENCTRL_DIV(CONF_GCLK_GEN_7_DIV) | (CONF_GCLK_GEN_7_RUNSTDBY << GCLK_GENCTRL_RUNSTDBY_Pos)
+ | (CONF_GCLK_GEN_7_DIVSEL << GCLK_GENCTRL_DIVSEL_Pos) | (CONF_GCLK_GEN_7_OE << GCLK_GENCTRL_OE_Pos)
+ | (CONF_GCLK_GEN_7_OOV << GCLK_GENCTRL_OOV_Pos) | (CONF_GCLK_GEN_7_IDC << GCLK_GENCTRL_IDC_Pos)
+ | (CONF_GCLK_GENERATOR_7_CONFIG << GCLK_GENCTRL_GENEN_Pos) | CONF_GCLK_GEN_7_SOURCE);
+ }
+#endif
+
+#if CONF_GCLK_GENERATOR_8_CONFIG == 1
+ if (bm & (1ul << 8)) {
+ hri_gclk_write_GENCTRL_reg(
+ GCLK,
+ 8,
+ GCLK_GENCTRL_DIV(CONF_GCLK_GEN_8_DIV) | (CONF_GCLK_GEN_8_RUNSTDBY << GCLK_GENCTRL_RUNSTDBY_Pos)
+ | (CONF_GCLK_GEN_8_DIVSEL << GCLK_GENCTRL_DIVSEL_Pos) | (CONF_GCLK_GEN_8_OE << GCLK_GENCTRL_OE_Pos)
+ | (CONF_GCLK_GEN_8_OOV << GCLK_GENCTRL_OOV_Pos) | (CONF_GCLK_GEN_8_IDC << GCLK_GENCTRL_IDC_Pos)
+ | (CONF_GCLK_GENERATOR_8_CONFIG << GCLK_GENCTRL_GENEN_Pos) | CONF_GCLK_GEN_8_SOURCE);
+ }
+#endif
+
+#if CONF_GCLK_GENERATOR_9_CONFIG == 1
+ if (bm & (1ul << 9)) {
+ hri_gclk_write_GENCTRL_reg(
+ GCLK,
+ 9,
+ GCLK_GENCTRL_DIV(CONF_GCLK_GEN_9_DIV) | (CONF_GCLK_GEN_9_RUNSTDBY << GCLK_GENCTRL_RUNSTDBY_Pos)
+ | (CONF_GCLK_GEN_9_DIVSEL << GCLK_GENCTRL_DIVSEL_Pos) | (CONF_GCLK_GEN_9_OE << GCLK_GENCTRL_OE_Pos)
+ | (CONF_GCLK_GEN_9_OOV << GCLK_GENCTRL_OOV_Pos) | (CONF_GCLK_GEN_9_IDC << GCLK_GENCTRL_IDC_Pos)
+ | (CONF_GCLK_GENERATOR_9_CONFIG << GCLK_GENCTRL_GENEN_Pos) | CONF_GCLK_GEN_9_SOURCE);
+ }
+#endif
+
+#if CONF_GCLK_GENERATOR_10_CONFIG == 1
+ if (bm & (1ul << 10)) {
+ hri_gclk_write_GENCTRL_reg(
+ GCLK,
+ 10,
+ GCLK_GENCTRL_DIV(CONF_GCLK_GEN_10_DIV) | (CONF_GCLK_GEN_10_RUNSTDBY << GCLK_GENCTRL_RUNSTDBY_Pos)
+ | (CONF_GCLK_GEN_10_DIVSEL << GCLK_GENCTRL_DIVSEL_Pos) | (CONF_GCLK_GEN_10_OE << GCLK_GENCTRL_OE_Pos)
+ | (CONF_GCLK_GEN_10_OOV << GCLK_GENCTRL_OOV_Pos) | (CONF_GCLK_GEN_10_IDC << GCLK_GENCTRL_IDC_Pos)
+ | (CONF_GCLK_GENERATOR_10_CONFIG << GCLK_GENCTRL_GENEN_Pos) | CONF_GCLK_GEN_10_SOURCE);
+ }
+#endif
+
+#if CONF_GCLK_GENERATOR_11_CONFIG == 1
+ if (bm & (1ul << 11)) {
+ hri_gclk_write_GENCTRL_reg(
+ GCLK,
+ 11,
+ GCLK_GENCTRL_DIV(CONF_GCLK_GEN_11_DIV) | (CONF_GCLK_GEN_11_RUNSTDBY << GCLK_GENCTRL_RUNSTDBY_Pos)
+ | (CONF_GCLK_GEN_11_DIVSEL << GCLK_GENCTRL_DIVSEL_Pos) | (CONF_GCLK_GEN_11_OE << GCLK_GENCTRL_OE_Pos)
+ | (CONF_GCLK_GEN_11_OOV << GCLK_GENCTRL_OOV_Pos) | (CONF_GCLK_GEN_11_IDC << GCLK_GENCTRL_IDC_Pos)
+ | (CONF_GCLK_GENERATOR_11_CONFIG << GCLK_GENCTRL_GENEN_Pos) | CONF_GCLK_GEN_11_SOURCE);
+ }
+#endif
+}
diff --git a/Examples/AS5048A_test/AS5048A_test/hpl/gclk/hpl_gclk_base.h b/Examples/AS5048A_test/AS5048A_test/hpl/gclk/hpl_gclk_base.h
new file mode 100644
index 0000000..3e7d282
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hpl/gclk/hpl_gclk_base.h
@@ -0,0 +1,87 @@
+/**
+ * \file
+ *
+ * \brief Generic Clock Controller.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef _HPL_GCLK_H_INCLUDED
+#define _HPL_GCLK_H_INCLUDED
+
+#include
+#ifdef _UNIT_TEST_
+#include
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \addtogroup gclk_group GCLK Hardware Proxy Layer
+ *
+ * \section gclk_hpl_rev Revision History
+ * - v0.0.0.1 Initial Commit
+ *
+ *@{
+ */
+
+/**
+ * \name HPL functions
+ */
+//@{
+/**
+ * \brief Enable clock on the given channel with the given clock source
+ *
+ * This function maps the given clock source to the given clock channel
+ * and enables channel.
+ *
+ * \param[in] channel The channel to enable clock for
+ * \param[in] source The clock source for the given channel
+ */
+static inline void _gclk_enable_channel(const uint8_t channel, const uint8_t source)
+{
+
+ hri_gclk_write_PCHCTRL_reg(GCLK, channel, source | GCLK_PCHCTRL_CHEN);
+}
+
+/**
+ * \brief Initialize GCLK generators by function references
+ * \param[in] bm Bit mapping for referenced generators,
+ * a bit 1 in position triggers generator initialization.
+ */
+void _gclk_init_generators_by_fref(uint32_t bm);
+
+//@}
+/**@}*/
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _HPL_GCLK_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hpl/mclk/hpl_mclk.c b/Examples/AS5048A_test/AS5048A_test/hpl/mclk/hpl_mclk.c
new file mode 100644
index 0000000..6684320
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hpl/mclk/hpl_mclk.c
@@ -0,0 +1,44 @@
+/**
+ * \file
+ *
+ * \brief SAM Main Clock.
+ *
+ * Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#include
+#include
+
+/**
+ * \brief Initialize master clock generator
+ */
+void _mclk_init(void)
+{
+ void *hw = (void *)MCLK;
+ hri_mclk_write_CPUDIV_reg(hw, MCLK_CPUDIV_DIV(CONF_MCLK_CPUDIV));
+}
diff --git a/Examples/AS5048A_test/AS5048A_test/hpl/osc32kctrl/hpl_osc32kctrl.c b/Examples/AS5048A_test/AS5048A_test/hpl/osc32kctrl/hpl_osc32kctrl.c
new file mode 100644
index 0000000..8859b42
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hpl/osc32kctrl/hpl_osc32kctrl.c
@@ -0,0 +1,82 @@
+
+/**
+ * \file
+ *
+ * \brief SAM 32k Oscillators Controller.
+ *
+ * Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+#include
+#include
+
+/**
+ * \brief Initialize 32 kHz clock sources
+ */
+void _osc32kctrl_init_sources(void)
+{
+ void * hw = (void *)OSC32KCTRL;
+ uint16_t calib = 0;
+
+#if CONF_XOSC32K_CONFIG == 1
+ hri_osc32kctrl_write_XOSC32K_reg(
+ hw,
+ OSC32KCTRL_XOSC32K_STARTUP(CONF_XOSC32K_STARTUP) | (CONF_XOSC32K_ONDEMAND << OSC32KCTRL_XOSC32K_ONDEMAND_Pos)
+ | (CONF_XOSC32K_RUNSTDBY << OSC32KCTRL_XOSC32K_RUNSTDBY_Pos)
+ | (CONF_XOSC32K_EN1K << OSC32KCTRL_XOSC32K_EN1K_Pos) | (CONF_XOSC32K_EN32K << OSC32KCTRL_XOSC32K_EN32K_Pos)
+ | (CONF_XOSC32K_XTALEN << OSC32KCTRL_XOSC32K_XTALEN_Pos) |
+#ifdef CONF_XOSC32K_CGM
+ OSC32KCTRL_XOSC32K_CGM(CONF_XOSC32K_CGM) |
+#endif
+ (CONF_XOSC32K_ENABLE << OSC32KCTRL_XOSC32K_ENABLE_Pos));
+
+ hri_osc32kctrl_write_CFDCTRL_reg(hw, (CONF_XOSC32K_CFDEN << OSC32KCTRL_CFDCTRL_CFDEN_Pos));
+
+ hri_osc32kctrl_write_EVCTRL_reg(hw, (CONF_XOSC32K_CFDEO << OSC32KCTRL_EVCTRL_CFDEO_Pos));
+#endif
+
+#if CONF_OSCULP32K_CONFIG == 1
+ calib = hri_osc32kctrl_read_OSCULP32K_CALIB_bf(hw);
+ hri_osc32kctrl_write_OSCULP32K_reg(hw,
+#if CONF_OSCULP32K_CALIB_ENABLE == 1
+ OSC32KCTRL_OSCULP32K_CALIB(CONF_OSCULP32K_CALIB)
+#else
+ OSC32KCTRL_OSCULP32K_CALIB(calib)
+#endif
+ );
+#endif
+
+#if CONF_XOSC32K_CONFIG
+#if CONF_XOSC32K_ENABLE == 1 && CONF_XOSC32K_ONDEMAND == 0
+ while (!hri_osc32kctrl_get_STATUS_XOSC32KRDY_bit(hw))
+ ;
+#endif
+#endif
+
+ hri_osc32kctrl_write_RTCCTRL_reg(hw, OSC32KCTRL_RTCCTRL_RTCSEL(CONF_RTCCTRL));
+ (void)calib;
+}
diff --git a/Examples/AS5048A_test/AS5048A_test/hpl/oscctrl/hpl_oscctrl.c b/Examples/AS5048A_test/AS5048A_test/hpl/oscctrl/hpl_oscctrl.c
new file mode 100644
index 0000000..9f55076
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hpl/oscctrl/hpl_oscctrl.c
@@ -0,0 +1,230 @@
+
+/**
+ * \file
+ *
+ * \brief SAM Oscillators Controller.
+ *
+ * Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#include
+#include
+#include
+
+/**
+ * \brief Initialize clock sources
+ */
+void _oscctrl_init_sources(void)
+{
+ void *hw = (void *)OSCCTRL;
+
+#if CONF_XOSC0_CONFIG == 1
+ hri_oscctrl_write_XOSCCTRL_reg(
+ hw,
+ 0,
+ OSCCTRL_XOSCCTRL_CFDPRESC(CONF_XOSC0_CFDPRESC) | OSCCTRL_XOSCCTRL_STARTUP(CONF_XOSC0_STARTUP)
+ | (CONF_XOSC0_SWBEN << OSCCTRL_XOSCCTRL_SWBEN_Pos) | (CONF_XOSC0_CFDEN << OSCCTRL_XOSCCTRL_CFDEN_Pos)
+ | (0 << OSCCTRL_XOSCCTRL_ENALC_Pos) | OSCCTRL_XOSCCTRL_IMULT(CONF_XOSC0_IMULT)
+ | OSCCTRL_XOSCCTRL_IPTAT(CONF_XOSC0_IPTAT) | (CONF_XOSC0_LOWBUFGAIN << OSCCTRL_XOSCCTRL_LOWBUFGAIN_Pos)
+ | (0 << OSCCTRL_XOSCCTRL_ONDEMAND_Pos) | (CONF_XOSC0_RUNSTDBY << OSCCTRL_XOSCCTRL_RUNSTDBY_Pos)
+ | (CONF_XOSC0_XTALEN << OSCCTRL_XOSCCTRL_XTALEN_Pos) | (CONF_XOSC0_ENABLE << OSCCTRL_XOSCCTRL_ENABLE_Pos));
+#endif
+
+#if CONF_XOSC0_CONFIG == 1
+#if CONF_XOSC0_ENABLE == 1
+ while (!hri_oscctrl_get_STATUS_XOSCRDY0_bit(hw))
+ ;
+#endif
+#if CONF_XOSC0_ENALC == 1
+ hri_oscctrl_set_XOSCCTRL_ENALC_bit(hw, 0);
+#endif
+#if CONF_XOSC0_ONDEMAND == 1
+ hri_oscctrl_set_XOSCCTRL_ONDEMAND_bit(hw, 0);
+#endif
+#endif
+
+#if CONF_XOSC1_CONFIG == 1
+ hri_oscctrl_write_XOSCCTRL_reg(
+ hw,
+ 1,
+ OSCCTRL_XOSCCTRL_CFDPRESC(CONF_XOSC1_CFDPRESC) | OSCCTRL_XOSCCTRL_STARTUP(CONF_XOSC1_STARTUP)
+ | (CONF_XOSC1_SWBEN << OSCCTRL_XOSCCTRL_SWBEN_Pos) | (CONF_XOSC1_CFDEN << OSCCTRL_XOSCCTRL_CFDEN_Pos)
+ | (0 << OSCCTRL_XOSCCTRL_ENALC_Pos) | OSCCTRL_XOSCCTRL_IMULT(CONF_XOSC1_IMULT)
+ | OSCCTRL_XOSCCTRL_IPTAT(CONF_XOSC1_IPTAT) | (CONF_XOSC1_LOWBUFGAIN << OSCCTRL_XOSCCTRL_LOWBUFGAIN_Pos)
+ | (0 << OSCCTRL_XOSCCTRL_ONDEMAND_Pos) | (CONF_XOSC1_RUNSTDBY << OSCCTRL_XOSCCTRL_RUNSTDBY_Pos)
+ | (CONF_XOSC1_XTALEN << OSCCTRL_XOSCCTRL_XTALEN_Pos) | (CONF_XOSC1_ENABLE << OSCCTRL_XOSCCTRL_ENABLE_Pos));
+#endif
+
+#if CONF_XOSC1_CONFIG == 1
+#if CONF_XOSC1_ENABLE == 1
+ while (!hri_oscctrl_get_STATUS_XOSCRDY1_bit(hw))
+ ;
+#endif
+#if CONF_XOSC1_ENALC == 1
+ hri_oscctrl_set_XOSCCTRL_ENALC_bit(hw, 1);
+#endif
+#if CONF_XOSC1_ONDEMAND == 1
+ hri_oscctrl_set_XOSCCTRL_ONDEMAND_bit(hw, 1);
+#endif
+#endif
+
+ (void)hw;
+}
+
+void _oscctrl_init_referenced_generators(void)
+{
+ void *hw = (void *)OSCCTRL;
+
+#if CONF_DFLL_CONFIG == 1
+ hri_gclk_write_GENCTRL_SRC_bf(GCLK, 0, GCLK_GENCTRL_SRC_OSCULP32K);
+ while (hri_gclk_get_SYNCBUSY_GENCTRL0_bit(GCLK))
+ ;
+ uint8_t tmp;
+ hri_oscctrl_write_DFLLCTRLA_reg(hw, 0);
+#if CONF_DFLL_USBCRM != 1 && CONF_DFLL_MODE != 0
+ hri_gclk_write_PCHCTRL_reg(
+ GCLK, OSCCTRL_GCLK_ID_DFLL48, (1 << GCLK_PCHCTRL_CHEN_Pos) | GCLK_PCHCTRL_GEN(CONF_DFLL_GCLK));
+#endif
+
+ hri_oscctrl_write_DFLLMUL_reg(hw,
+ OSCCTRL_DFLLMUL_CSTEP(CONF_DFLL_CSTEP) | OSCCTRL_DFLLMUL_FSTEP(CONF_DFLL_FSTEP)
+ | OSCCTRL_DFLLMUL_MUL(CONF_DFLL_MUL));
+ while (hri_oscctrl_get_DFLLSYNC_DFLLMUL_bit(hw))
+ ;
+
+ hri_oscctrl_write_DFLLCTRLB_reg(hw, 0);
+ while (hri_oscctrl_get_DFLLSYNC_DFLLCTRLB_bit(hw))
+ ;
+
+ tmp = (CONF_DFLL_RUNSTDBY << OSCCTRL_DFLLCTRLA_RUNSTDBY_Pos) | OSCCTRL_DFLLCTRLA_ENABLE;
+ hri_oscctrl_write_DFLLCTRLA_reg(hw, tmp);
+ while (hri_oscctrl_get_DFLLSYNC_ENABLE_bit(hw))
+ ;
+
+#if CONF_DFLL_OVERWRITE_CALIBRATION == 1
+ hri_oscctrl_write_DFLLVAL_reg(hw, OSCCTRL_DFLLVAL_COARSE(CONF_DFLL_COARSE) | OSCCTRL_DFLLVAL_FINE(CONF_DFLL_FINE));
+#endif
+ hri_oscctrl_write_DFLLVAL_reg(hw, hri_oscctrl_read_DFLLVAL_reg(hw));
+ while (hri_oscctrl_get_DFLLSYNC_DFLLVAL_bit(hw))
+ ;
+
+ tmp = (CONF_DFLL_WAITLOCK << OSCCTRL_DFLLCTRLB_WAITLOCK_Pos) | (CONF_DFLL_BPLCKC << OSCCTRL_DFLLCTRLB_BPLCKC_Pos)
+ | (CONF_DFLL_QLDIS << OSCCTRL_DFLLCTRLB_QLDIS_Pos) | (CONF_DFLL_CCDIS << OSCCTRL_DFLLCTRLB_CCDIS_Pos)
+ | (CONF_DFLL_USBCRM << OSCCTRL_DFLLCTRLB_USBCRM_Pos) | (CONF_DFLL_LLAW << OSCCTRL_DFLLCTRLB_LLAW_Pos)
+ | (CONF_DFLL_STABLE << OSCCTRL_DFLLCTRLB_STABLE_Pos) | (CONF_DFLL_MODE << OSCCTRL_DFLLCTRLB_MODE_Pos) | 0;
+ hri_oscctrl_write_DFLLCTRLB_reg(hw, tmp);
+ while (hri_oscctrl_get_DFLLSYNC_DFLLCTRLB_bit(hw))
+ ;
+#endif
+
+#if CONF_FDPLL0_CONFIG == 1
+#if CONF_FDPLL0_REFCLK == 0
+ hri_gclk_write_PCHCTRL_reg(
+ GCLK, OSCCTRL_GCLK_ID_FDPLL0, (1 << GCLK_PCHCTRL_CHEN_Pos) | GCLK_PCHCTRL_GEN(CONF_FDPLL0_GCLK));
+#endif
+ hri_oscctrl_write_DPLLRATIO_reg(
+ hw, 0, OSCCTRL_DPLLRATIO_LDRFRAC(CONF_FDPLL0_LDRFRAC) | OSCCTRL_DPLLRATIO_LDR(CONF_FDPLL0_LDR));
+ hri_oscctrl_write_DPLLCTRLB_reg(
+ hw,
+ 0,
+ OSCCTRL_DPLLCTRLB_DIV(CONF_FDPLL0_DIV) | (CONF_FDPLL0_DCOEN << OSCCTRL_DPLLCTRLB_DCOEN_Pos)
+ | OSCCTRL_DPLLCTRLB_DCOFILTER(CONF_FDPLL0_DCOFILTER)
+ | (CONF_FDPLL0_LBYPASS << OSCCTRL_DPLLCTRLB_LBYPASS_Pos) | OSCCTRL_DPLLCTRLB_LTIME(CONF_FDPLL0_LTIME)
+ | OSCCTRL_DPLLCTRLB_REFCLK(CONF_FDPLL0_REFCLK) | (CONF_FDPLL0_WUF << OSCCTRL_DPLLCTRLB_WUF_Pos)
+ | OSCCTRL_DPLLCTRLB_FILTER(CONF_FDPLL0_FILTER));
+ hri_oscctrl_write_DPLLCTRLA_reg(hw,
+ 0,
+ (CONF_FDPLL0_RUNSTDBY << OSCCTRL_DPLLCTRLA_RUNSTDBY_Pos)
+ | (CONF_FDPLL0_ENABLE << OSCCTRL_DPLLCTRLA_ENABLE_Pos));
+#endif
+
+#if CONF_FDPLL1_CONFIG == 1
+#if CONF_FDPLL1_REFCLK == 0
+ hri_gclk_write_PCHCTRL_reg(
+ GCLK, OSCCTRL_GCLK_ID_FDPLL1, (1 << GCLK_PCHCTRL_CHEN_Pos) | GCLK_PCHCTRL_GEN(CONF_FDPLL1_GCLK));
+#endif
+ hri_oscctrl_write_DPLLRATIO_reg(
+ hw, 1, OSCCTRL_DPLLRATIO_LDRFRAC(CONF_FDPLL1_LDRFRAC) | OSCCTRL_DPLLRATIO_LDR(CONF_FDPLL1_LDR));
+ hri_oscctrl_write_DPLLCTRLB_reg(
+ hw,
+ 1,
+ OSCCTRL_DPLLCTRLB_DIV(CONF_FDPLL1_DIV) | (CONF_FDPLL1_DCOEN << OSCCTRL_DPLLCTRLB_DCOEN_Pos)
+ | OSCCTRL_DPLLCTRLB_DCOFILTER(CONF_FDPLL1_DCOFILTER)
+ | (CONF_FDPLL1_LBYPASS << OSCCTRL_DPLLCTRLB_LBYPASS_Pos) | OSCCTRL_DPLLCTRLB_LTIME(CONF_FDPLL1_LTIME)
+ | OSCCTRL_DPLLCTRLB_REFCLK(CONF_FDPLL1_REFCLK) | (CONF_FDPLL1_WUF << OSCCTRL_DPLLCTRLB_WUF_Pos)
+ | OSCCTRL_DPLLCTRLB_FILTER(CONF_FDPLL1_FILTER));
+ hri_oscctrl_write_DPLLCTRLA_reg(hw,
+ 1,
+ (CONF_FDPLL1_RUNSTDBY << OSCCTRL_DPLLCTRLA_RUNSTDBY_Pos)
+ | (CONF_FDPLL1_ENABLE << OSCCTRL_DPLLCTRLA_ENABLE_Pos));
+#endif
+
+#if CONF_DFLL_CONFIG == 1
+ if (hri_oscctrl_get_DFLLCTRLB_MODE_bit(hw)) {
+ hri_oscctrl_status_reg_t status_mask = OSCCTRL_STATUS_DFLLRDY | OSCCTRL_STATUS_DFLLLCKC;
+
+ while (hri_oscctrl_get_STATUS_reg(hw, status_mask) != status_mask)
+ ;
+ } else {
+ while (!hri_oscctrl_get_STATUS_DFLLRDY_bit(hw))
+ ;
+ }
+#if CONF_DFLL_ONDEMAND == 1
+ hri_oscctrl_set_DFLLCTRLA_ONDEMAND_bit(hw);
+#endif
+#endif
+
+#if CONF_FDPLL0_CONFIG == 1
+#if CONF_FDPLL0_ENABLE == 1
+ while (!(hri_oscctrl_get_DPLLSTATUS_LOCK_bit(hw, 0) || hri_oscctrl_get_DPLLSTATUS_CLKRDY_bit(hw, 0)))
+ ;
+#endif
+#if CONF_FDPLL0_ONDEMAND == 1
+ hri_oscctrl_set_DPLLCTRLA_ONDEMAND_bit(hw, 0);
+#endif
+#endif
+
+#if CONF_FDPLL1_CONFIG == 1
+#if CONF_FDPLL1_ENABLE == 1
+ while (!(hri_oscctrl_get_DPLLSTATUS_LOCK_bit(hw, 1) || hri_oscctrl_get_DPLLSTATUS_CLKRDY_bit(hw, 1)))
+ ;
+#endif
+#if CONF_FDPLL1_ONDEMAND == 1
+ hri_oscctrl_set_DPLLCTRLA_ONDEMAND_bit(hw, 1);
+#endif
+#endif
+
+#if CONF_DFLL_CONFIG == 1
+ while (hri_gclk_read_SYNCBUSY_reg(GCLK))
+ ;
+ hri_gclk_write_GENCTRL_SRC_bf(GCLK, 0, CONF_GCLK_GEN_0_SOURCE);
+ while (hri_gclk_get_SYNCBUSY_GENCTRL0_bit(GCLK))
+ ;
+#endif
+ (void)hw;
+}
diff --git a/Examples/AS5048A_test/AS5048A_test/hpl/pm/hpl_pm.c b/Examples/AS5048A_test/AS5048A_test/hpl/pm/hpl_pm.c
new file mode 100644
index 0000000..55dc4db
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hpl/pm/hpl_pm.c
@@ -0,0 +1,68 @@
+
+/**
+ * \file
+ *
+ * \brief SAM Power manager
+ *
+ * Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#include
+#include
+
+/**
+ * \brief Set the sleep mode for the device
+ */
+int32_t _set_sleep_mode(const uint8_t mode)
+{
+ uint8_t delay = 10;
+
+ switch (mode) {
+ case 2:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ hri_pm_write_SLEEPCFG_reg(PM, mode);
+ /* A small latency happens between the store instruction and actual
+ * writing of the SLEEPCFG register due to bridges. Software has to make
+ * sure the SLEEPCFG register reads the wanted value before issuing WFI
+ * instruction.
+ */
+ do {
+ if (hri_pm_read_SLEEPCFG_reg(PM) == mode) {
+ break;
+ }
+ } while (--delay);
+ break;
+ default:
+ return ERR_INVALID_ARG;
+ }
+
+ return ERR_NONE;
+}
diff --git a/Examples/AS5048A_test/AS5048A_test/hpl/pm/hpl_pm_base.h b/Examples/AS5048A_test/AS5048A_test/hpl/pm/hpl_pm_base.h
new file mode 100644
index 0000000..5a50a91
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hpl/pm/hpl_pm_base.h
@@ -0,0 +1,45 @@
+/**
+ * \file
+ *
+ * \brief SAM Power manager
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ */
+
+#ifndef _HPL_PM_BASE_H_INCLUDED
+#define _HPL_PM_BASE_H_INCLUDED
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* _HPL_PM_BASE_H_INCLUDED */
diff --git a/Examples/AS5048A_test/AS5048A_test/hpl/port/hpl_gpio_base.h b/Examples/AS5048A_test/AS5048A_test/hpl/port/hpl_gpio_base.h
new file mode 100644
index 0000000..f32c40f
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hpl/port/hpl_gpio_base.h
@@ -0,0 +1,172 @@
+
+/**
+ * \file
+ *
+ * \brief SAM PORT.
+ *
+ * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+#include
+#include
+#include
+#include
+
+/**
+ * \brief Set direction on port with mask
+ */
+static inline void _gpio_set_direction(const enum gpio_port port, const uint32_t mask,
+ const enum gpio_direction direction)
+{
+ switch (direction) {
+ case GPIO_DIRECTION_OFF:
+ hri_port_clear_DIR_reg(PORT, port, mask);
+ hri_port_write_WRCONFIG_reg(PORT, port, PORT_WRCONFIG_WRPINCFG | (mask & 0xffff));
+ hri_port_write_WRCONFIG_reg(
+ PORT, port, PORT_WRCONFIG_HWSEL | PORT_WRCONFIG_WRPINCFG | ((mask & 0xffff0000) >> 16));
+ break;
+
+ case GPIO_DIRECTION_IN:
+ hri_port_clear_DIR_reg(PORT, port, mask);
+ hri_port_write_WRCONFIG_reg(PORT, port, PORT_WRCONFIG_WRPINCFG | PORT_WRCONFIG_INEN | (mask & 0xffff));
+ hri_port_write_WRCONFIG_reg(PORT,
+ port,
+ PORT_WRCONFIG_HWSEL | PORT_WRCONFIG_WRPINCFG | PORT_WRCONFIG_INEN
+ | ((mask & 0xffff0000) >> 16));
+ break;
+
+ case GPIO_DIRECTION_OUT:
+ hri_port_set_DIR_reg(PORT, port, mask);
+ hri_port_write_WRCONFIG_reg(PORT, port, PORT_WRCONFIG_WRPINCFG | (mask & 0xffff));
+ hri_port_write_WRCONFIG_reg(
+ PORT, port, PORT_WRCONFIG_HWSEL | PORT_WRCONFIG_WRPINCFG | ((mask & 0xffff0000) >> 16));
+ break;
+
+ default:
+ ASSERT(false);
+ }
+}
+
+/**
+ * \brief Set output level on port with mask
+ */
+static inline void _gpio_set_level(const enum gpio_port port, const uint32_t mask, const bool level)
+{
+ if (level) {
+ hri_port_set_OUT_reg(PORT, port, mask);
+ } else {
+ hri_port_clear_OUT_reg(PORT, port, mask);
+ }
+}
+
+/**
+ * \brief Change output level to the opposite with mask
+ */
+static inline void _gpio_toggle_level(const enum gpio_port port, const uint32_t mask)
+{
+ hri_port_toggle_OUT_reg(PORT, port, mask);
+}
+
+/**
+ * \brief Get input levels on all port pins
+ */
+static inline uint32_t _gpio_get_level(const enum gpio_port port)
+{
+ uint32_t tmp;
+
+ CRITICAL_SECTION_ENTER();
+
+ uint32_t dir_tmp = hri_port_read_DIR_reg(PORT, port);
+
+ tmp = hri_port_read_IN_reg(PORT, port) & ~dir_tmp;
+ tmp |= hri_port_read_OUT_reg(PORT, port) & dir_tmp;
+
+ CRITICAL_SECTION_LEAVE();
+
+ return tmp;
+}
+
+/**
+ * \brief Set pin pull mode
+ */
+static inline void _gpio_set_pin_pull_mode(const enum gpio_port port, const uint8_t pin,
+ const enum gpio_pull_mode pull_mode)
+{
+ switch (pull_mode) {
+ case GPIO_PULL_OFF:
+ hri_port_clear_PINCFG_PULLEN_bit(PORT, port, pin);
+ break;
+
+ case GPIO_PULL_UP:
+ hri_port_clear_DIR_reg(PORT, port, 1U << pin);
+ hri_port_set_PINCFG_PULLEN_bit(PORT, port, pin);
+ hri_port_set_OUT_reg(PORT, port, 1U << pin);
+ break;
+
+ case GPIO_PULL_DOWN:
+ hri_port_clear_DIR_reg(PORT, port, 1U << pin);
+ hri_port_set_PINCFG_PULLEN_bit(PORT, port, pin);
+ hri_port_clear_OUT_reg(PORT, port, 1U << pin);
+ break;
+
+ default:
+ ASSERT(false);
+ break;
+ }
+}
+
+/**
+ * \brief Set gpio pin function
+ */
+static inline void _gpio_set_pin_function(const uint32_t gpio, const uint32_t function)
+{
+ uint8_t port = GPIO_PORT(gpio);
+ uint8_t pin = GPIO_PIN(gpio);
+
+ if (function == GPIO_PIN_FUNCTION_OFF) {
+ hri_port_write_PINCFG_PMUXEN_bit(PORT, port, pin, false);
+
+ } else {
+ hri_port_write_PINCFG_PMUXEN_bit(PORT, port, pin, true);
+
+ if (pin & 1) {
+ // Odd numbered pin
+ hri_port_write_PMUX_PMUXO_bf(PORT, port, pin >> 1, function & 0xffff);
+ } else {
+ // Even numbered pin
+ hri_port_write_PMUX_PMUXE_bf(PORT, port, pin >> 1, function & 0xffff);
+ }
+ }
+}
+
+static inline void _port_event_init()
+{
+ hri_port_set_EVCTRL_reg(PORT, 0, CONF_PORTA_EVCTRL);
+ hri_port_set_EVCTRL_reg(PORT, 1, CONF_PORTB_EVCTRL);
+ hri_port_set_EVCTRL_reg(PORT, 2, CONF_PORTC_EVCTRL);
+ hri_port_set_EVCTRL_reg(PORT, 3, CONF_PORTD_EVCTRL);
+}
diff --git a/Examples/AS5048A_test/AS5048A_test/hpl/ramecc/hpl_ramecc.c b/Examples/AS5048A_test/AS5048A_test/hpl/ramecc/hpl_ramecc.c
new file mode 100644
index 0000000..4c158b2
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hpl/ramecc/hpl_ramecc.c
@@ -0,0 +1,83 @@
+/**
+ * \file
+ *
+ * \brief Generic RAMECC related functionality.
+ *
+ * Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#include
+#include
+#include
+
+/* RAMECC device descriptor */
+struct _ramecc_device device;
+
+/**
+ * \brief Initialize RAMECC
+ */
+int32_t _ramecc_init(void)
+{
+ if (hri_ramecc_get_STATUS_ECCDIS_bit(RAMECC)) {
+ return ERR_ABORTED;
+ }
+
+ NVIC_DisableIRQ(RAMECC_IRQn);
+ NVIC_ClearPendingIRQ(RAMECC_IRQn);
+ NVIC_EnableIRQ(RAMECC_IRQn);
+
+ return ERR_NONE;
+}
+
+void _ramecc_register_callback(const enum _ramecc_callback_type type, ramecc_cb_t cb)
+{
+ if (RAMECC_DUAL_ERROR_CB == type) {
+ device.ramecc_cb.dual_bit_err = cb;
+ hri_ramecc_write_INTEN_DUALE_bit(RAMECC, NULL != cb);
+ } else if (RAMECC_SINGLE_ERROR_CB == type) {
+ device.ramecc_cb.single_bit_err = cb;
+ hri_ramecc_write_INTEN_SINGLEE_bit(RAMECC, NULL != cb);
+ }
+}
+
+/**
+ * \internal RAMECC interrupt handler
+ */
+void RAMECC_Handler(void)
+{
+ struct _ramecc_device *dev = (struct _ramecc_device *)&device;
+ volatile uint32_t int_mask = hri_ramecc_read_INTFLAG_reg(RAMECC);
+
+ if (int_mask & RAMECC_INTFLAG_DUALE && dev->ramecc_cb.dual_bit_err) {
+ dev->ramecc_cb.dual_bit_err((uint32_t)hri_ramecc_read_ERRADDR_reg(RAMECC));
+ } else if (int_mask & RAMECC_INTFLAG_SINGLEE && dev->ramecc_cb.single_bit_err) {
+ dev->ramecc_cb.single_bit_err((uint32_t)hri_ramecc_read_ERRADDR_reg(RAMECC));
+ } else {
+ return;
+ }
+}
diff --git a/Examples/AS5048A_test/AS5048A_test/hpl/sercom/hpl_sercom.c b/Examples/AS5048A_test/AS5048A_test/hpl/sercom/hpl_sercom.c
new file mode 100644
index 0000000..1cd475b
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hpl/sercom/hpl_sercom.c
@@ -0,0 +1,2959 @@
+
+/**
+ * \file
+ *
+ * \brief SAM Serial Communication Interface
+ *
+ * Copyright (c) 2014-2019 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#ifndef CONF_SERCOM_0_USART_ENABLE
+#define CONF_SERCOM_0_USART_ENABLE 0
+#endif
+#ifndef CONF_SERCOM_1_USART_ENABLE
+#define CONF_SERCOM_1_USART_ENABLE 0
+#endif
+#ifndef CONF_SERCOM_2_USART_ENABLE
+#define CONF_SERCOM_2_USART_ENABLE 0
+#endif
+#ifndef CONF_SERCOM_3_USART_ENABLE
+#define CONF_SERCOM_3_USART_ENABLE 0
+#endif
+#ifndef CONF_SERCOM_4_USART_ENABLE
+#define CONF_SERCOM_4_USART_ENABLE 0
+#endif
+#ifndef CONF_SERCOM_5_USART_ENABLE
+#define CONF_SERCOM_5_USART_ENABLE 0
+#endif
+#ifndef CONF_SERCOM_6_USART_ENABLE
+#define CONF_SERCOM_6_USART_ENABLE 0
+#endif
+#ifndef CONF_SERCOM_7_USART_ENABLE
+#define CONF_SERCOM_7_USART_ENABLE 0
+#endif
+
+/** Amount of SERCOM that is used as USART. */
+#define SERCOM_USART_AMOUNT \
+ (CONF_SERCOM_0_USART_ENABLE + CONF_SERCOM_1_USART_ENABLE + CONF_SERCOM_2_USART_ENABLE + CONF_SERCOM_3_USART_ENABLE \
+ + CONF_SERCOM_4_USART_ENABLE + CONF_SERCOM_5_USART_ENABLE + CONF_SERCOM_6_USART_ENABLE \
+ + CONF_SERCOM_7_USART_ENABLE)
+
+/**
+ * \brief Macro is used to fill usart configuration structure based on
+ * its number
+ *
+ * \param[in] n The number of structures
+ */
+#define SERCOM_CONFIGURATION(n) \
+ { \
+ n, \
+ SERCOM_USART_CTRLA_MODE(CONF_SERCOM_##n##_USART_MODE) \
+ | (CONF_SERCOM_##n##_USART_RUNSTDBY << SERCOM_USART_CTRLA_RUNSTDBY_Pos) \
+ | (CONF_SERCOM_##n##_USART_IBON << SERCOM_USART_CTRLA_IBON_Pos) \
+ | (CONF_SERCOM_##n##_USART_TXINV << SERCOM_USART_CTRLA_TXINV_Pos) \
+ | (CONF_SERCOM_##n##_USART_RXINV << SERCOM_USART_CTRLA_RXINV_Pos) \
+ | SERCOM_USART_CTRLA_SAMPR(CONF_SERCOM_##n##_USART_SAMPR) \
+ | SERCOM_USART_CTRLA_TXPO(CONF_SERCOM_##n##_USART_TXPO) \
+ | SERCOM_USART_CTRLA_RXPO(CONF_SERCOM_##n##_USART_RXPO) \
+ | SERCOM_USART_CTRLA_SAMPA(CONF_SERCOM_##n##_USART_SAMPA) \
+ | SERCOM_USART_CTRLA_FORM(CONF_SERCOM_##n##_USART_FORM) \
+ | (CONF_SERCOM_##n##_USART_CMODE << SERCOM_USART_CTRLA_CMODE_Pos) \
+ | (CONF_SERCOM_##n##_USART_CPOL << SERCOM_USART_CTRLA_CPOL_Pos) \
+ | (CONF_SERCOM_##n##_USART_DORD << SERCOM_USART_CTRLA_DORD_Pos), \
+ SERCOM_USART_CTRLB_CHSIZE(CONF_SERCOM_##n##_USART_CHSIZE) \
+ | (CONF_SERCOM_##n##_USART_SBMODE << SERCOM_USART_CTRLB_SBMODE_Pos) \
+ | (CONF_SERCOM_##n##_USART_CLODEN << SERCOM_USART_CTRLB_COLDEN_Pos) \
+ | (CONF_SERCOM_##n##_USART_SFDE << SERCOM_USART_CTRLB_SFDE_Pos) \
+ | (CONF_SERCOM_##n##_USART_ENC << SERCOM_USART_CTRLB_ENC_Pos) \
+ | (CONF_SERCOM_##n##_USART_PMODE << SERCOM_USART_CTRLB_PMODE_Pos) \
+ | (CONF_SERCOM_##n##_USART_TXEN << SERCOM_USART_CTRLB_TXEN_Pos) \
+ | (CONF_SERCOM_##n##_USART_RXEN << SERCOM_USART_CTRLB_RXEN_Pos), \
+ SERCOM_USART_CTRLC_GTIME(CONF_SERCOM_##n##_USART_GTIME) \
+ | (CONF_SERCOM_##n##_USART_DSNACK << SERCOM_USART_CTRLC_DSNACK_Pos) \
+ | (CONF_SERCOM_##n##_USART_INACK << SERCOM_USART_CTRLC_INACK_Pos) \
+ | SERCOM_USART_CTRLC_MAXITER(CONF_SERCOM_##n##_USART_MAXITER), \
+ (uint16_t)(CONF_SERCOM_##n##_USART_BAUD_RATE), CONF_SERCOM_##n##_USART_FRACTIONAL, \
+ CONF_SERCOM_##n##_USART_RECEIVE_PULSE_LENGTH, CONF_SERCOM_##n##_USART_DEBUG_STOP_MODE, \
+ }
+
+/**
+ * \brief SERCOM USART configuration type
+ */
+struct usart_configuration {
+ uint8_t number;
+ hri_sercomusart_ctrla_reg_t ctrl_a;
+ hri_sercomusart_ctrlb_reg_t ctrl_b;
+ hri_sercomusart_ctrlc_reg_t ctrl_c;
+ hri_sercomusart_baud_reg_t baud;
+ uint8_t fractional;
+ hri_sercomusart_rxpl_reg_t rxpl;
+ hri_sercomusart_dbgctrl_reg_t debug_ctrl;
+};
+
+#if SERCOM_USART_AMOUNT < 1
+/** Dummy array to pass compiling. */
+static struct usart_configuration _usarts[1] = {{0}};
+#else
+/**
+ * \brief Array of SERCOM USART configurations
+ */
+static struct usart_configuration _usarts[] = {
+#if CONF_SERCOM_0_USART_ENABLE == 1
+ SERCOM_CONFIGURATION(0),
+#endif
+#if CONF_SERCOM_1_USART_ENABLE == 1
+ SERCOM_CONFIGURATION(1),
+#endif
+#if CONF_SERCOM_2_USART_ENABLE == 1
+ SERCOM_CONFIGURATION(2),
+#endif
+#if CONF_SERCOM_3_USART_ENABLE == 1
+ SERCOM_CONFIGURATION(3),
+#endif
+#if CONF_SERCOM_4_USART_ENABLE == 1
+ SERCOM_CONFIGURATION(4),
+#endif
+#if CONF_SERCOM_5_USART_ENABLE == 1
+ SERCOM_CONFIGURATION(5),
+#endif
+#if CONF_SERCOM_6_USART_ENABLE == 1
+ SERCOM_CONFIGURATION(6),
+#endif
+#if CONF_SERCOM_7_USART_ENABLE == 1
+ SERCOM_CONFIGURATION(7),
+#endif
+};
+#endif
+
+static uint8_t _get_sercom_index(const void *const hw);
+static uint8_t _sercom_get_irq_num(const void *const hw);
+static void _sercom_init_irq_param(const void *const hw, void *dev);
+static uint8_t _sercom_get_hardware_index(const void *const hw);
+
+static int32_t _usart_init(void *const hw);
+static inline void _usart_deinit(void *const hw);
+static uint16_t _usart_calculate_baud_rate(const uint32_t baud, const uint32_t clock_rate, const uint8_t samples,
+ const enum usart_baud_rate_mode mode, const uint8_t fraction);
+static void _usart_set_baud_rate(void *const hw, const uint32_t baud_rate);
+static void _usart_set_data_order(void *const hw, const enum usart_data_order order);
+static void _usart_set_mode(void *const hw, const enum usart_mode mode);
+static void _usart_set_parity(void *const hw, const enum usart_parity parity);
+static void _usart_set_stop_bits(void *const hw, const enum usart_stop_bits stop_bits);
+static void _usart_set_character_size(void *const hw, const enum usart_character_size size);
+
+/**
+ * \brief Initialize synchronous SERCOM USART
+ */
+int32_t _usart_sync_init(struct _usart_sync_device *const device, void *const hw)
+{
+ ASSERT(device);
+
+ device->hw = hw;
+
+ return _usart_init(hw);
+}
+
+/**
+ * \brief Initialize asynchronous SERCOM USART
+ */
+int32_t _usart_async_init(struct _usart_async_device *const device, void *const hw)
+{
+ int32_t init_status;
+
+ ASSERT(device);
+
+ init_status = _usart_init(hw);
+ if (init_status) {
+ return init_status;
+ }
+ device->hw = hw;
+ _sercom_init_irq_param(hw, (void *)device);
+ uint8_t irq = _sercom_get_irq_num(hw);
+ for (uint32_t i = 0; i < 4; i++) {
+ NVIC_DisableIRQ((IRQn_Type)irq);
+ NVIC_ClearPendingIRQ((IRQn_Type)irq);
+ NVIC_EnableIRQ((IRQn_Type)irq);
+ irq++;
+ }
+ return ERR_NONE;
+}
+
+/**
+ * \brief De-initialize SERCOM USART
+ */
+void _usart_sync_deinit(struct _usart_sync_device *const device)
+{
+ _usart_deinit(device->hw);
+}
+
+/**
+ * \brief De-initialize SERCOM USART
+ */
+void _usart_async_deinit(struct _usart_async_device *const device)
+{
+ NVIC_DisableIRQ((IRQn_Type)_sercom_get_irq_num(device->hw));
+ _usart_deinit(device->hw);
+}
+
+/**
+ * \brief Calculate baud rate register value
+ */
+uint16_t _usart_sync_calculate_baud_rate(const uint32_t baud, const uint32_t clock_rate, const uint8_t samples,
+ const enum usart_baud_rate_mode mode, const uint8_t fraction)
+{
+ return _usart_calculate_baud_rate(baud, clock_rate, samples, mode, fraction);
+}
+
+/**
+ * \brief Calculate baud rate register value
+ */
+uint16_t _usart_async_calculate_baud_rate(const uint32_t baud, const uint32_t clock_rate, const uint8_t samples,
+ const enum usart_baud_rate_mode mode, const uint8_t fraction)
+{
+ return _usart_calculate_baud_rate(baud, clock_rate, samples, mode, fraction);
+}
+
+/**
+ * \brief Enable SERCOM module
+ */
+void _usart_sync_enable(struct _usart_sync_device *const device)
+{
+ hri_sercomusart_set_CTRLA_ENABLE_bit(device->hw);
+}
+
+/**
+ * \brief Enable SERCOM module
+ */
+void _usart_async_enable(struct _usart_async_device *const device)
+{
+ hri_sercomusart_set_CTRLA_ENABLE_bit(device->hw);
+}
+
+/**
+ * \brief Disable SERCOM module
+ */
+void _usart_sync_disable(struct _usart_sync_device *const device)
+{
+ hri_sercomusart_clear_CTRLA_ENABLE_bit(device->hw);
+}
+
+/**
+ * \brief Disable SERCOM module
+ */
+void _usart_async_disable(struct _usart_async_device *const device)
+{
+ hri_sercomusart_clear_CTRLA_ENABLE_bit(device->hw);
+}
+
+/**
+ * \brief Set baud rate
+ */
+void _usart_sync_set_baud_rate(struct _usart_sync_device *const device, const uint32_t baud_rate)
+{
+ _usart_set_baud_rate(device->hw, baud_rate);
+}
+
+/**
+ * \brief Set baud rate
+ */
+void _usart_async_set_baud_rate(struct _usart_async_device *const device, const uint32_t baud_rate)
+{
+ _usart_set_baud_rate(device->hw, baud_rate);
+}
+
+/**
+ * \brief Set data order
+ */
+void _usart_sync_set_data_order(struct _usart_sync_device *const device, const enum usart_data_order order)
+{
+ _usart_set_data_order(device->hw, order);
+}
+
+/**
+ * \brief Set data order
+ */
+void _usart_async_set_data_order(struct _usart_async_device *const device, const enum usart_data_order order)
+{
+ _usart_set_data_order(device->hw, order);
+}
+
+/**
+ * \brief Set mode
+ */
+void _usart_sync_set_mode(struct _usart_sync_device *const device, const enum usart_mode mode)
+{
+ _usart_set_mode(device->hw, mode);
+}
+
+/**
+ * \brief Set mode
+ */
+void _usart_async_set_mode(struct _usart_async_device *const device, const enum usart_mode mode)
+{
+ _usart_set_mode(device->hw, mode);
+}
+
+/**
+ * \brief Set parity
+ */
+void _usart_sync_set_parity(struct _usart_sync_device *const device, const enum usart_parity parity)
+{
+ _usart_set_parity(device->hw, parity);
+}
+
+/**
+ * \brief Set parity
+ */
+void _usart_async_set_parity(struct _usart_async_device *const device, const enum usart_parity parity)
+{
+ _usart_set_parity(device->hw, parity);
+}
+
+/**
+ * \brief Set stop bits mode
+ */
+void _usart_sync_set_stop_bits(struct _usart_sync_device *const device, const enum usart_stop_bits stop_bits)
+{
+ _usart_set_stop_bits(device->hw, stop_bits);
+}
+
+/**
+ * \brief Set stop bits mode
+ */
+void _usart_async_set_stop_bits(struct _usart_async_device *const device, const enum usart_stop_bits stop_bits)
+{
+ _usart_set_stop_bits(device->hw, stop_bits);
+}
+
+/**
+ * \brief Set character size
+ */
+void _usart_sync_set_character_size(struct _usart_sync_device *const device, const enum usart_character_size size)
+{
+ _usart_set_character_size(device->hw, size);
+}
+
+/**
+ * \brief Set character size
+ */
+void _usart_async_set_character_size(struct _usart_async_device *const device, const enum usart_character_size size)
+{
+ _usart_set_character_size(device->hw, size);
+}
+
+/**
+ * \brief Retrieve SERCOM usart status
+ */
+uint32_t _usart_sync_get_status(const struct _usart_sync_device *const device)
+{
+ return hri_sercomusart_read_STATUS_reg(device->hw);
+}
+
+/**
+ * \brief Retrieve SERCOM usart status
+ */
+uint32_t _usart_async_get_status(const struct _usart_async_device *const device)
+{
+ return hri_sercomusart_read_STATUS_reg(device->hw);
+}
+
+/**
+ * \brief Write a byte to the given SERCOM USART instance
+ */
+void _usart_sync_write_byte(struct _usart_sync_device *const device, uint8_t data)
+{
+ hri_sercomusart_write_DATA_reg(device->hw, data);
+}
+
+/**
+ * \brief Write a byte to the given SERCOM USART instance
+ */
+void _usart_async_write_byte(struct _usart_async_device *const device, uint8_t data)
+{
+ hri_sercomusart_write_DATA_reg(device->hw, data);
+}
+
+/**
+ * \brief Read a byte from the given SERCOM USART instance
+ */
+uint8_t _usart_sync_read_byte(const struct _usart_sync_device *const device)
+{
+ return hri_sercomusart_read_DATA_reg(device->hw);
+}
+
+/**
+ * \brief Check if USART is ready to send next byte
+ */
+bool _usart_sync_is_ready_to_send(const struct _usart_sync_device *const device)
+{
+ return hri_sercomusart_get_interrupt_DRE_bit(device->hw);
+}
+
+/**
+ * \brief Check if USART transmission complete
+ */
+bool _usart_sync_is_transmit_done(const struct _usart_sync_device *const device)
+{
+ return hri_sercomusart_get_interrupt_TXC_bit(device->hw);
+}
+
+/**
+ * \brief Check if USART is ready to send next byte
+ */
+bool _usart_async_is_byte_sent(const struct _usart_async_device *const device)
+{
+ return hri_sercomusart_get_interrupt_DRE_bit(device->hw);
+}
+
+/**
+ * \brief Check if there is data received by USART
+ */
+bool _usart_sync_is_byte_received(const struct _usart_sync_device *const device)
+{
+ return hri_sercomusart_get_interrupt_RXC_bit(device->hw);
+}
+
+/**
+ * \brief Set the state of flow control pins
+ */
+void _usart_sync_set_flow_control_state(struct _usart_sync_device *const device,
+ const union usart_flow_control_state state)
+{
+ (void)device;
+ (void)state;
+}
+
+/**
+ * \brief Set the state of flow control pins
+ */
+void _usart_async_set_flow_control_state(struct _usart_async_device *const device,
+ const union usart_flow_control_state state)
+{
+ (void)device;
+ (void)state;
+}
+
+/**
+ * \brief Retrieve the state of flow control pins
+ */
+union usart_flow_control_state _usart_sync_get_flow_control_state(const struct _usart_sync_device *const device)
+{
+ (void)device;
+ union usart_flow_control_state state;
+
+ state.value = 0;
+ state.bit.unavailable = 1;
+ return state;
+}
+
+/**
+ * \brief Retrieve the state of flow control pins
+ */
+union usart_flow_control_state _usart_async_get_flow_control_state(const struct _usart_async_device *const device)
+{
+ (void)device;
+ union usart_flow_control_state state;
+
+ state.value = 0;
+ state.bit.unavailable = 1;
+ return state;
+}
+
+/**
+ * \brief Enable data register empty interrupt
+ */
+void _usart_async_enable_byte_sent_irq(struct _usart_async_device *const device)
+{
+ hri_sercomusart_set_INTEN_DRE_bit(device->hw);
+}
+
+/**
+ * \brief Enable transmission complete interrupt
+ */
+void _usart_async_enable_tx_done_irq(struct _usart_async_device *const device)
+{
+ hri_sercomusart_set_INTEN_TXC_bit(device->hw);
+}
+
+/**
+ * \brief Retrieve ordinal number of the given sercom hardware instance
+ */
+static uint8_t _sercom_get_hardware_index(const void *const hw)
+{
+ Sercom *const sercom_modules[] = SERCOM_INSTS;
+ /* Find index for SERCOM instance. */
+ for (uint32_t i = 0; i < SERCOM_INST_NUM; i++) {
+ if ((uint32_t)hw == (uint32_t)sercom_modules[i]) {
+ return i;
+ }
+ }
+ return 0;
+}
+
+/**
+ * \brief Retrieve ordinal number of the given SERCOM USART hardware instance
+ */
+uint8_t _usart_sync_get_hardware_index(const struct _usart_sync_device *const device)
+{
+ return _sercom_get_hardware_index(device->hw);
+}
+
+/**
+ * \brief Retrieve ordinal number of the given SERCOM USART hardware instance
+ */
+uint8_t _usart_async_get_hardware_index(const struct _usart_async_device *const device)
+{
+ return _sercom_get_hardware_index(device->hw);
+}
+
+/**
+ * \brief Enable/disable USART interrupt
+ */
+void _usart_async_set_irq_state(struct _usart_async_device *const device, const enum _usart_async_callback_type type,
+ const bool state)
+{
+ ASSERT(device);
+
+ if (USART_ASYNC_BYTE_SENT == type || USART_ASYNC_TX_DONE == type) {
+ hri_sercomusart_write_INTEN_DRE_bit(device->hw, state);
+ hri_sercomusart_write_INTEN_TXC_bit(device->hw, state);
+ } else if (USART_ASYNC_RX_DONE == type) {
+ hri_sercomusart_write_INTEN_RXC_bit(device->hw, state);
+ } else if (USART_ASYNC_ERROR == type) {
+ hri_sercomusart_write_INTEN_ERROR_bit(device->hw, state);
+ }
+}
+
+/**
+ * \internal Retrieve ordinal number of the given sercom hardware instance
+ *
+ * \param[in] hw The pointer to hardware instance
+
+ * \return The ordinal number of the given sercom hardware instance
+ */
+static uint8_t _get_sercom_index(const void *const hw)
+{
+ uint8_t sercom_offset = _sercom_get_hardware_index(hw);
+ uint8_t i;
+
+ for (i = 0; i < ARRAY_SIZE(_usarts); i++) {
+ if (_usarts[i].number == sercom_offset) {
+ return i;
+ }
+ }
+
+ ASSERT(false);
+ return 0;
+}
+
+/**
+ * \brief Init irq param with the given sercom hardware instance
+ */
+static void _sercom_init_irq_param(const void *const hw, void *dev)
+{
+}
+
+/**
+ * \internal Initialize SERCOM USART
+ *
+ * \param[in] hw The pointer to hardware instance
+ *
+ * \return The status of initialization
+ */
+static int32_t _usart_init(void *const hw)
+{
+ uint8_t i = _get_sercom_index(hw);
+
+ if (!hri_sercomusart_is_syncing(hw, SERCOM_USART_SYNCBUSY_SWRST)) {
+ uint32_t mode = _usarts[i].ctrl_a & SERCOM_USART_CTRLA_MODE_Msk;
+ if (hri_sercomusart_get_CTRLA_reg(hw, SERCOM_USART_CTRLA_ENABLE)) {
+ hri_sercomusart_clear_CTRLA_ENABLE_bit(hw);
+ hri_sercomusart_wait_for_sync(hw, SERCOM_USART_SYNCBUSY_ENABLE);
+ }
+ hri_sercomusart_write_CTRLA_reg(hw, SERCOM_USART_CTRLA_SWRST | mode);
+ }
+ hri_sercomusart_wait_for_sync(hw, SERCOM_USART_SYNCBUSY_SWRST);
+
+ hri_sercomusart_write_CTRLA_reg(hw, _usarts[i].ctrl_a);
+ hri_sercomusart_write_CTRLB_reg(hw, _usarts[i].ctrl_b);
+ hri_sercomusart_write_CTRLC_reg(hw, _usarts[i].ctrl_c);
+ if ((_usarts[i].ctrl_a & SERCOM_USART_CTRLA_SAMPR(0x1)) || (_usarts[i].ctrl_a & SERCOM_USART_CTRLA_SAMPR(0x3))) {
+ ((Sercom *)hw)->USART.BAUD.FRAC.BAUD = _usarts[i].baud;
+ ((Sercom *)hw)->USART.BAUD.FRAC.FP = _usarts[i].fractional;
+ } else {
+ hri_sercomusart_write_BAUD_reg(hw, _usarts[i].baud);
+ }
+
+ hri_sercomusart_write_RXPL_reg(hw, _usarts[i].rxpl);
+ hri_sercomusart_write_DBGCTRL_reg(hw, _usarts[i].debug_ctrl);
+
+ return ERR_NONE;
+}
+
+/**
+ * \internal De-initialize SERCOM USART
+ *
+ * \param[in] hw The pointer to hardware instance
+ */
+static inline void _usart_deinit(void *const hw)
+{
+ hri_sercomusart_clear_CTRLA_ENABLE_bit(hw);
+ hri_sercomusart_set_CTRLA_SWRST_bit(hw);
+}
+
+/**
+ * \internal Calculate baud rate register value
+ *
+ * \param[in] baud Required baud rate
+ * \param[in] clock_rate SERCOM clock frequency
+ * \param[in] samples The number of samples
+ * \param[in] mode USART mode
+ * \param[in] fraction A fraction value
+ *
+ * \return Calculated baud rate register value
+ */
+static uint16_t _usart_calculate_baud_rate(const uint32_t baud, const uint32_t clock_rate, const uint8_t samples,
+ const enum usart_baud_rate_mode mode, const uint8_t fraction)
+{
+ if (USART_BAUDRATE_ASYNCH_ARITHMETIC == mode) {
+ return 65536 - ((uint64_t)65536 * samples * baud) / clock_rate;
+ }
+
+ if (USART_BAUDRATE_ASYNCH_FRACTIONAL == mode) {
+ return clock_rate / baud / samples + SERCOM_USART_BAUD_FRACFP_FP(fraction);
+ }
+
+ if (USART_BAUDRATE_SYNCH == mode) {
+ return clock_rate / baud / 2 - 1;
+ }
+
+ return 0;
+}
+
+/**
+ * \internal Set baud rate
+ *
+ * \param[in] device The pointer to USART device instance
+ * \param[in] baud_rate A baud rate to set
+ */
+static void _usart_set_baud_rate(void *const hw, const uint32_t baud_rate)
+{
+ bool enabled = hri_sercomusart_get_CTRLA_ENABLE_bit(hw);
+
+ hri_sercomusart_clear_CTRLA_ENABLE_bit(hw);
+
+ CRITICAL_SECTION_ENTER()
+ hri_sercomusart_wait_for_sync(hw, SERCOM_USART_SYNCBUSY_ENABLE);
+ hri_sercomusart_write_BAUD_reg(hw, baud_rate);
+ CRITICAL_SECTION_LEAVE()
+
+ hri_sercomusart_write_CTRLA_ENABLE_bit(hw, enabled);
+}
+
+/**
+ * \internal Set data order
+ *
+ * \param[in] device The pointer to USART device instance
+ * \param[in] order A data order to set
+ */
+static void _usart_set_data_order(void *const hw, const enum usart_data_order order)
+{
+ bool enabled = hri_sercomusart_get_CTRLA_ENABLE_bit(hw);
+
+ hri_sercomusart_clear_CTRLA_ENABLE_bit(hw);
+
+ CRITICAL_SECTION_ENTER()
+ hri_sercomusart_wait_for_sync(hw, SERCOM_USART_SYNCBUSY_ENABLE);
+ hri_sercomusart_write_CTRLA_DORD_bit(hw, order);
+ CRITICAL_SECTION_LEAVE()
+
+ hri_sercomusart_write_CTRLA_ENABLE_bit(hw, enabled);
+}
+
+/**
+ * \internal Set mode
+ *
+ * \param[in] device The pointer to USART device instance
+ * \param[in] mode A mode to set
+ */
+static void _usart_set_mode(void *const hw, const enum usart_mode mode)
+{
+ bool enabled = hri_sercomusart_get_CTRLA_ENABLE_bit(hw);
+
+ hri_sercomusart_clear_CTRLA_ENABLE_bit(hw);
+
+ CRITICAL_SECTION_ENTER()
+ hri_sercomusart_wait_for_sync(hw, SERCOM_USART_SYNCBUSY_ENABLE);
+ hri_sercomusart_write_CTRLA_CMODE_bit(hw, mode);
+ CRITICAL_SECTION_LEAVE()
+
+ hri_sercomusart_write_CTRLA_ENABLE_bit(hw, enabled);
+}
+
+/**
+ * \internal Set parity
+ *
+ * \param[in] device The pointer to USART device instance
+ * \param[in] parity A parity to set
+ */
+static void _usart_set_parity(void *const hw, const enum usart_parity parity)
+{
+ bool enabled = hri_sercomusart_get_CTRLA_ENABLE_bit(hw);
+
+ hri_sercomusart_clear_CTRLA_ENABLE_bit(hw);
+
+ CRITICAL_SECTION_ENTER()
+ hri_sercomusart_wait_for_sync(hw, SERCOM_USART_SYNCBUSY_ENABLE);
+
+ if (USART_PARITY_NONE != parity) {
+ hri_sercomusart_set_CTRLA_FORM_bf(hw, 1);
+ } else {
+ hri_sercomusart_clear_CTRLA_FORM_bf(hw, 1);
+ }
+
+ hri_sercomusart_write_CTRLB_PMODE_bit(hw, parity);
+ CRITICAL_SECTION_LEAVE()
+
+ hri_sercomusart_write_CTRLA_ENABLE_bit(hw, enabled);
+}
+
+/**
+ * \internal Set stop bits mode
+ *
+ * \param[in] device The pointer to USART device instance
+ * \param[in] stop_bits A stop bits mode to set
+ */
+static void _usart_set_stop_bits(void *const hw, const enum usart_stop_bits stop_bits)
+{
+ bool enabled = hri_sercomusart_get_CTRLA_ENABLE_bit(hw);
+
+ hri_sercomusart_clear_CTRLA_ENABLE_bit(hw);
+
+ CRITICAL_SECTION_ENTER()
+ hri_sercomusart_wait_for_sync(hw, SERCOM_USART_SYNCBUSY_ENABLE);
+ hri_sercomusart_write_CTRLB_SBMODE_bit(hw, stop_bits);
+ CRITICAL_SECTION_LEAVE()
+
+ hri_sercomusart_write_CTRLA_ENABLE_bit(hw, enabled);
+}
+
+/**
+ * \internal Set character size
+ *
+ * \param[in] device The pointer to USART device instance
+ * \param[in] size A character size to set
+ */
+static void _usart_set_character_size(void *const hw, const enum usart_character_size size)
+{
+ bool enabled = hri_sercomusart_get_CTRLA_ENABLE_bit(hw);
+
+ hri_sercomusart_clear_CTRLA_ENABLE_bit(hw);
+
+ CRITICAL_SECTION_ENTER()
+ hri_sercomusart_wait_for_sync(hw, SERCOM_USART_SYNCBUSY_ENABLE);
+ hri_sercomusart_write_CTRLB_CHSIZE_bf(hw, size);
+ CRITICAL_SECTION_LEAVE()
+
+ if (enabled) {
+ hri_sercomusart_set_CTRLA_ENABLE_bit(hw);
+ }
+}
+
+ /* Sercom I2C implementation */
+
+#ifndef CONF_SERCOM_0_I2CM_ENABLE
+#define CONF_SERCOM_0_I2CM_ENABLE 0
+#endif
+#ifndef CONF_SERCOM_1_I2CM_ENABLE
+#define CONF_SERCOM_1_I2CM_ENABLE 0
+#endif
+#ifndef CONF_SERCOM_2_I2CM_ENABLE
+#define CONF_SERCOM_2_I2CM_ENABLE 0
+#endif
+#ifndef CONF_SERCOM_3_I2CM_ENABLE
+#define CONF_SERCOM_3_I2CM_ENABLE 0
+#endif
+#ifndef CONF_SERCOM_4_I2CM_ENABLE
+#define CONF_SERCOM_4_I2CM_ENABLE 0
+#endif
+#ifndef CONF_SERCOM_5_I2CM_ENABLE
+#define CONF_SERCOM_5_I2CM_ENABLE 0
+#endif
+#ifndef CONF_SERCOM_6_I2CM_ENABLE
+#define CONF_SERCOM_6_I2CM_ENABLE 0
+#endif
+#ifndef CONF_SERCOM_7_I2CM_ENABLE
+#define CONF_SERCOM_7_I2CM_ENABLE 0
+#endif
+
+/** Amount of SERCOM that is used as I2C Master. */
+#define SERCOM_I2CM_AMOUNT \
+ (CONF_SERCOM_0_I2CM_ENABLE + CONF_SERCOM_1_I2CM_ENABLE + CONF_SERCOM_2_I2CM_ENABLE + CONF_SERCOM_3_I2CM_ENABLE \
+ + CONF_SERCOM_4_I2CM_ENABLE + CONF_SERCOM_5_I2CM_ENABLE + CONF_SERCOM_6_I2CM_ENABLE + CONF_SERCOM_7_I2CM_ENABLE)
+
+/**
+ * \brief Macro is used to fill i2cm configuration structure based on
+ * its number
+ *
+ * \param[in] n The number of structures
+ */
+#define I2CM_CONFIGURATION(n) \
+ { \
+ (n), \
+ (SERCOM_I2CM_CTRLA_MODE_I2C_MASTER) | (CONF_SERCOM_##n##_I2CM_RUNSTDBY << SERCOM_I2CM_CTRLA_RUNSTDBY_Pos) \
+ | (CONF_SERCOM_##n##_I2CM_SPEED << SERCOM_I2CM_CTRLA_SPEED_Pos) \
+ | (CONF_SERCOM_##n##_I2CM_MEXTTOEN << SERCOM_I2CM_CTRLA_MEXTTOEN_Pos) \
+ | (CONF_SERCOM_##n##_I2CM_SEXTTOEN << SERCOM_I2CM_CTRLA_SEXTTOEN_Pos) \
+ | (CONF_SERCOM_##n##_I2CM_INACTOUT << SERCOM_I2CM_CTRLA_INACTOUT_Pos) \
+ | (CONF_SERCOM_##n##_I2CM_LOWTOUT << SERCOM_I2CM_CTRLA_LOWTOUTEN_Pos) \
+ | (CONF_SERCOM_##n##_I2CM_SDAHOLD << SERCOM_I2CM_CTRLA_SDAHOLD_Pos), \
+ SERCOM_I2CM_CTRLB_SMEN, (uint32_t)(CONF_SERCOM_##n##_I2CM_BAUD_RATE), \
+ CONF_SERCOM_##n##_I2CM_DEBUG_STOP_MODE, CONF_SERCOM_##n##_I2CM_TRISE, CONF_GCLK_SERCOM##n##_CORE_FREQUENCY \
+ }
+
+#define ERROR_FLAG (1 << 7)
+#define SB_FLAG (1 << 1)
+#define MB_FLAG (1 << 0)
+
+#define CMD_STOP 0x3
+#define I2C_IDLE 0x1
+#define I2C_SM 0x0
+#define I2C_FM 0x1
+#define I2C_HS 0x2
+#define TEN_ADDR_FRAME 0x78
+#define TEN_ADDR_MASK 0x3ff
+#define SEVEN_ADDR_MASK 0x7f
+
+/**
+ * \brief SERCOM I2CM configuration type
+ */
+struct i2cm_configuration {
+ uint8_t number;
+ hri_sercomi2cm_ctrla_reg_t ctrl_a;
+ hri_sercomi2cm_ctrlb_reg_t ctrl_b;
+ hri_sercomi2cm_baud_reg_t baud;
+ hri_sercomi2cm_dbgctrl_reg_t dbgctrl;
+ uint16_t trise;
+ uint32_t clk; /* SERCOM peripheral clock frequency */
+};
+
+static inline int32_t _i2c_m_enable_implementation(void *hw);
+static int32_t _i2c_m_sync_init_impl(struct _i2c_m_service *const service, void *const hw);
+
+#if SERCOM_I2CM_AMOUNT < 1
+/** Dummy array to pass compiling. */
+static struct i2cm_configuration _i2cms[1] = {{0}};
+#else
+/**
+ * \brief Array of SERCOM I2CM configurations
+ */
+static struct i2cm_configuration _i2cms[] = {
+#if CONF_SERCOM_0_I2CM_ENABLE == 1
+ I2CM_CONFIGURATION(0),
+#endif
+#if CONF_SERCOM_1_I2CM_ENABLE == 1
+ I2CM_CONFIGURATION(1),
+#endif
+#if CONF_SERCOM_2_I2CM_ENABLE == 1
+ I2CM_CONFIGURATION(2),
+#endif
+#if CONF_SERCOM_3_I2CM_ENABLE == 1
+ I2CM_CONFIGURATION(3),
+#endif
+#if CONF_SERCOM_4_I2CM_ENABLE == 1
+ I2CM_CONFIGURATION(4),
+#endif
+#if CONF_SERCOM_5_I2CM_ENABLE == 1
+ I2CM_CONFIGURATION(5),
+#endif
+#if CONF_SERCOM_6_I2CM_ENABLE == 1
+ I2CM_CONFIGURATION(6),
+#endif
+#if CONF_SERCOM_7_I2CM_ENABLE == 1
+ I2CM_CONFIGURATION(7),
+#endif
+};
+#endif
+
+/**
+ * \internal Retrieve ordinal number of the given sercom hardware instance
+ *
+ * \param[in] hw The pointer to hardware instance
+
+ * \return The ordinal number of the given sercom hardware instance
+ */
+static int8_t _get_i2cm_index(const void *const hw)
+{
+ uint8_t sercom_offset = _sercom_get_hardware_index(hw);
+ uint8_t i;
+
+ for (i = 0; i < ARRAY_SIZE(_i2cms); i++) {
+ if (_i2cms[i].number == sercom_offset) {
+ return i;
+ }
+ }
+
+ ASSERT(false);
+ return -1;
+}
+
+static inline void _sercom_i2c_send_stop(void *const hw)
+{
+ hri_sercomi2cm_set_CTRLB_CMD_bf(hw, CMD_STOP);
+}
+
+/**
+ * \brief SERCOM I2CM analyze hardware status and transfer next byte
+ */
+static inline int32_t _sercom_i2c_sync_analyse_flags(void *const hw, uint32_t flags, struct _i2c_m_msg *const msg)
+{
+ int sclsm = hri_sercomi2cm_get_CTRLA_SCLSM_bit(hw);
+ uint16_t status = hri_sercomi2cm_read_STATUS_reg(hw);
+
+ if (flags & MB_FLAG) {
+ /* tx error */
+ if (status & SERCOM_I2CM_STATUS_ARBLOST) {
+ hri_sercomi2cm_clear_interrupt_MB_bit(hw);
+ msg->flags |= I2C_M_FAIL;
+ msg->flags &= ~I2C_M_BUSY;
+
+ if (status & SERCOM_I2CM_STATUS_BUSERR) {
+ return I2C_ERR_BUS;
+ }
+
+ return I2C_ERR_BAD_ADDRESS;
+ } else {
+ if (status & SERCOM_I2CM_STATUS_RXNACK) {
+
+ /* Slave rejects to receive more data */
+ if (msg->len > 0) {
+ msg->flags |= I2C_M_FAIL;
+ }
+
+ if (msg->flags & I2C_M_STOP) {
+ _sercom_i2c_send_stop(hw);
+ }
+
+ msg->flags &= ~I2C_M_BUSY;
+
+ return I2C_NACK;
+ }
+
+ if (msg->flags & I2C_M_TEN) {
+ hri_sercomi2cm_write_ADDR_reg(hw,
+ ((((msg->addr & TEN_ADDR_MASK) >> 8) | TEN_ADDR_FRAME) << 1) | I2C_M_RD
+ | (hri_sercomi2cm_read_ADDR_reg(hw) & SERCOM_I2CM_ADDR_HS));
+ msg->flags &= ~I2C_M_TEN;
+
+ return I2C_OK;
+ }
+
+ if (msg->len == 0) {
+ if (msg->flags & I2C_M_STOP) {
+ _sercom_i2c_send_stop(hw);
+ }
+
+ msg->flags &= ~I2C_M_BUSY;
+ } else {
+ hri_sercomi2cm_write_DATA_reg(hw, *msg->buffer);
+ msg->buffer++;
+ msg->len--;
+ }
+
+ return I2C_OK;
+ }
+ } else if (flags & SB_FLAG) {
+ if ((msg->len) && !(status & SERCOM_I2CM_STATUS_RXNACK)) {
+ msg->len--;
+
+ /* last byte, send nack */
+ if ((msg->len == 0 && !sclsm) || (msg->len == 1 && sclsm)) {
+ hri_sercomi2cm_set_CTRLB_ACKACT_bit(hw);
+ }
+
+ if (msg->len == 0) {
+ if (msg->flags & I2C_M_STOP) {
+ hri_sercomi2cm_clear_CTRLB_SMEN_bit(hw);
+ _sercom_i2c_send_stop(hw);
+ }
+
+ msg->flags &= ~I2C_M_BUSY;
+ }
+
+ /* Accessing DATA.DATA auto-triggers I2C bus operations.
+ * The operation performed depends on the state of
+ * CTRLB.ACKACT, CTRLB.SMEN
+ **/
+ *msg->buffer++ = hri_sercomi2cm_read_DATA_reg(hw);
+ } else {
+ hri_sercomi2cm_clear_interrupt_SB_bit(hw);
+ return I2C_NACK;
+ }
+
+ hri_sercomi2cm_clear_interrupt_SB_bit(hw);
+ }
+
+ return I2C_OK;
+}
+
+/**
+ * \brief Enable the i2c master module
+ *
+ * \param[in] i2c_dev The pointer to i2c device
+ */
+int32_t _i2c_m_async_enable(struct _i2c_m_async_device *const i2c_dev)
+{
+ ASSERT(i2c_dev);
+
+ return _i2c_m_enable_implementation(i2c_dev->hw);
+}
+
+/**
+ * \brief Disable the i2c master module
+ *
+ * \param[in] i2c_dev The pointer to i2c device
+ */
+int32_t _i2c_m_async_disable(struct _i2c_m_async_device *const i2c_dev)
+{
+ void *hw = i2c_dev->hw;
+
+ ASSERT(i2c_dev);
+ ASSERT(i2c_dev->hw);
+
+ NVIC_DisableIRQ((IRQn_Type)_sercom_get_irq_num(hw));
+ hri_sercomi2cm_clear_CTRLA_ENABLE_bit(hw);
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Set baudrate of master
+ *
+ * \param[in] i2c_dev The pointer to i2c device
+ * \param[in] clkrate The clock rate of i2c master, in KHz
+ * \param[in] baudrate The baud rate desired for i2c master, in KHz
+ */
+int32_t _i2c_m_async_set_baudrate(struct _i2c_m_async_device *const i2c_dev, uint32_t clkrate, uint32_t baudrate)
+{
+ uint32_t tmp;
+ void * hw = i2c_dev->hw;
+
+ if (hri_sercomi2cm_get_CTRLA_ENABLE_bit(hw)) {
+ return ERR_DENIED;
+ }
+
+ tmp = _get_i2cm_index(hw);
+ clkrate = _i2cms[tmp].clk / 1000;
+
+ if (i2c_dev->service.mode == I2C_STANDARD_MODE) {
+ tmp = (uint32_t)((clkrate - 10 * baudrate - baudrate * clkrate * (i2c_dev->service.trise * 0.000000001))
+ / (2 * baudrate));
+ hri_sercomi2cm_write_BAUD_BAUD_bf(hw, tmp);
+ } else if (i2c_dev->service.mode == I2C_FASTMODE) {
+ tmp = (uint32_t)((clkrate - 10 * baudrate - baudrate * clkrate * (i2c_dev->service.trise * 0.000000001))
+ / (2 * baudrate));
+ hri_sercomi2cm_write_BAUD_BAUD_bf(hw, tmp);
+ } else if (i2c_dev->service.mode == I2C_HIGHSPEED_MODE) {
+ tmp = (clkrate - 2 * baudrate) / (2 * baudrate);
+ hri_sercomi2cm_write_BAUD_HSBAUD_bf(hw, tmp);
+ } else {
+ /* error baudrate */
+ return ERR_INVALID_ARG;
+ }
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Retrieve IRQ number for the given hardware instance
+ */
+static uint8_t _sercom_get_irq_num(const void *const hw)
+{
+ return SERCOM0_0_IRQn + (_sercom_get_hardware_index(hw) << 2);
+}
+
+/**
+ * \brief Initialize sercom i2c module to use in async mode
+ *
+ * \param[in] i2c_dev The pointer to i2c device
+ */
+int32_t _i2c_m_async_init(struct _i2c_m_async_device *const i2c_dev, void *const hw)
+{
+ int32_t init_status;
+
+ ASSERT(i2c_dev);
+
+ i2c_dev->hw = hw;
+
+ init_status = _i2c_m_sync_init_impl(&i2c_dev->service, hw);
+ if (init_status) {
+ return init_status;
+ }
+
+ _sercom_init_irq_param(hw, (void *)i2c_dev);
+ uint8_t irq = _sercom_get_irq_num(hw);
+ for (uint32_t i = 0; i < 4; i++) {
+ NVIC_DisableIRQ((IRQn_Type)irq);
+ NVIC_ClearPendingIRQ((IRQn_Type)irq);
+ NVIC_EnableIRQ((IRQn_Type)irq);
+ irq++;
+ }
+ return ERR_NONE;
+}
+
+/**
+ * \brief Deinitialize sercom i2c module
+ *
+ * \param[in] i2c_dev The pointer to i2c device
+ */
+int32_t _i2c_m_async_deinit(struct _i2c_m_async_device *const i2c_dev)
+{
+ ASSERT(i2c_dev);
+
+ hri_sercomi2cm_clear_CTRLA_ENABLE_bit(i2c_dev->hw);
+ hri_sercomi2cm_set_CTRLA_SWRST_bit(i2c_dev->hw);
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Transfer the slave address to bus, which will start the transfer
+ *
+ * \param[in] i2c_dev The pointer to i2c device
+ */
+static int32_t _sercom_i2c_send_address(struct _i2c_m_async_device *const i2c_dev)
+{
+ void * hw = i2c_dev->hw;
+ struct _i2c_m_msg *msg = &i2c_dev->service.msg;
+ int sclsm = hri_sercomi2cm_get_CTRLA_SCLSM_bit(hw);
+
+ ASSERT(i2c_dev);
+
+ if (msg->len == 1 && sclsm) {
+ hri_sercomi2cm_set_CTRLB_ACKACT_bit(hw);
+ } else {
+ hri_sercomi2cm_clear_CTRLB_ACKACT_bit(hw);
+ }
+
+ /* ten bit address */
+ if (msg->addr & I2C_M_TEN) {
+ if (msg->flags & I2C_M_RD) {
+ msg->flags |= I2C_M_TEN;
+ }
+
+ hri_sercomi2cm_write_ADDR_reg(hw,
+ ((msg->addr & TEN_ADDR_MASK) << 1) | SERCOM_I2CM_ADDR_TENBITEN
+ | (hri_sercomi2cm_read_ADDR_reg(hw) & SERCOM_I2CM_ADDR_HS));
+ } else {
+ hri_sercomi2cm_write_ADDR_reg(hw,
+ ((msg->addr & SEVEN_ADDR_MASK) << 1) | (msg->flags & I2C_M_RD ? I2C_M_RD : 0x0)
+ | (hri_sercomi2cm_read_ADDR_reg(hw) & SERCOM_I2CM_ADDR_HS));
+ }
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Transfer data specified by msg
+ *
+ * \param[in] i2c_dev The pointer to i2c device
+ * \param[in] msg The pointer to i2c message
+ *
+ * \return Transfer status.
+ * \retval 0 Transfer success
+ * \retval <0 Transfer fail, return the error code
+ */
+int32_t _i2c_m_async_transfer(struct _i2c_m_async_device *i2c_dev, struct _i2c_m_msg *msg)
+{
+ int ret;
+
+ ASSERT(i2c_dev);
+ ASSERT(i2c_dev->hw);
+ ASSERT(msg);
+
+ if (msg->len == 0) {
+ return ERR_NONE;
+ }
+
+ if (i2c_dev->service.msg.flags & I2C_M_BUSY) {
+ return ERR_BUSY;
+ }
+
+ msg->flags |= I2C_M_BUSY;
+ i2c_dev->service.msg = *msg;
+ hri_sercomi2cm_set_CTRLB_SMEN_bit(i2c_dev->hw);
+
+ ret = _sercom_i2c_send_address(i2c_dev);
+
+ if (ret) {
+ i2c_dev->service.msg.flags &= ~I2C_M_BUSY;
+
+ return ret;
+ }
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Set callback to be called in interrupt handler
+ *
+ * \param[in] i2c_dev The pointer to master i2c device
+ * \param[in] type The callback type
+ * \param[in] func The callback function pointer
+ */
+int32_t _i2c_m_async_register_callback(struct _i2c_m_async_device *const i2c_dev, enum _i2c_m_async_callback_type type,
+ FUNC_PTR func)
+{
+ switch (type) {
+ case I2C_M_ASYNC_DEVICE_ERROR:
+ i2c_dev->cb.error = (_i2c_error_cb_t)func;
+ break;
+ case I2C_M_ASYNC_DEVICE_TX_COMPLETE:
+ i2c_dev->cb.tx_complete = (_i2c_complete_cb_t)func;
+ break;
+ case I2C_M_ASYNC_DEVICE_RX_COMPLETE:
+ i2c_dev->cb.rx_complete = (_i2c_complete_cb_t)func;
+ break;
+ default:
+ /* error */
+ break;
+ }
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Set stop condition on I2C
+ *
+ * \param i2c_dev Pointer to master i2c device
+ *
+ * \return Operation status
+ * \retval I2C_OK Operation was successfull
+ */
+int32_t _i2c_m_async_send_stop(struct _i2c_m_async_device *const i2c_dev)
+{
+ void *hw = i2c_dev->hw;
+
+ _sercom_i2c_send_stop(hw);
+
+ return I2C_OK;
+}
+
+/**
+ * \brief Get number of bytes left in transfer buffer
+ *
+ * \param i2c_dev Pointer to i2c master device
+ *
+ * \return Bytes left in buffer
+ * \retval =>0 Bytes left in buffer
+ */
+int32_t _i2c_m_async_get_bytes_left(struct _i2c_m_async_device *const i2c_dev)
+{
+ if (i2c_dev->service.msg.flags & I2C_M_BUSY) {
+ return i2c_dev->service.msg.len;
+ }
+
+ return 0;
+}
+
+/**
+ * \brief Initialize sercom i2c module to use in sync mode
+ *
+ * \param[in] i2c_dev The pointer to i2c device
+ */
+int32_t _i2c_m_sync_init(struct _i2c_m_sync_device *const i2c_dev, void *const hw)
+{
+ ASSERT(i2c_dev);
+
+ i2c_dev->hw = hw;
+
+ return _i2c_m_sync_init_impl(&i2c_dev->service, hw);
+}
+
+/**
+ * \brief Deinitialize sercom i2c module
+ *
+ * \param[in] i2c_dev The pointer to i2c device
+ */
+int32_t _i2c_m_sync_deinit(struct _i2c_m_sync_device *const i2c_dev)
+{
+ ASSERT(i2c_dev);
+
+ hri_sercomi2cm_clear_CTRLA_ENABLE_bit(i2c_dev->hw);
+ hri_sercomi2cm_set_CTRLA_SWRST_bit(i2c_dev->hw);
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Enable the i2c master module
+ *
+ * \param[in] i2c_dev The pointer to i2c device
+ */
+int32_t _i2c_m_sync_enable(struct _i2c_m_sync_device *const i2c_dev)
+{
+ ASSERT(i2c_dev);
+
+ return _i2c_m_enable_implementation(i2c_dev->hw);
+}
+
+/**
+ * \brief Disable the i2c master module
+ *
+ * \param[in] i2c_dev The pointer to i2c device
+ */
+int32_t _i2c_m_sync_disable(struct _i2c_m_sync_device *const i2c_dev)
+{
+ void *hw = i2c_dev->hw;
+
+ ASSERT(i2c_dev);
+ ASSERT(i2c_dev->hw);
+
+ hri_sercomi2cm_clear_CTRLA_ENABLE_bit(hw);
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Set baudrate of master
+ *
+ * \param[in] i2c_dev The pointer to i2c device
+ * \param[in] clkrate The clock rate of i2c master, in KHz
+ * \param[in] baudrate The baud rate desired for i2c master, in KHz
+ */
+int32_t _i2c_m_sync_set_baudrate(struct _i2c_m_sync_device *const i2c_dev, uint32_t clkrate, uint32_t baudrate)
+{
+ uint32_t tmp;
+ void * hw = i2c_dev->hw;
+
+ if (hri_sercomi2cm_get_CTRLA_ENABLE_bit(hw)) {
+ return ERR_DENIED;
+ }
+
+ tmp = _get_i2cm_index(hw);
+ clkrate = _i2cms[tmp].clk / 1000;
+
+ if (i2c_dev->service.mode == I2C_STANDARD_MODE) {
+ tmp = (uint32_t)((clkrate - 10 * baudrate - baudrate * clkrate * (i2c_dev->service.trise * 0.000000001))
+ / (2 * baudrate));
+ hri_sercomi2cm_write_BAUD_BAUD_bf(hw, tmp);
+ } else if (i2c_dev->service.mode == I2C_FASTMODE) {
+ tmp = (uint32_t)((clkrate - 10 * baudrate - baudrate * clkrate * (i2c_dev->service.trise * 0.000000001))
+ / (2 * baudrate));
+ hri_sercomi2cm_write_BAUD_BAUD_bf(hw, tmp);
+ } else if (i2c_dev->service.mode == I2C_HIGHSPEED_MODE) {
+ tmp = (clkrate - 2 * baudrate) / (2 * baudrate);
+ hri_sercomi2cm_write_BAUD_HSBAUD_bf(hw, tmp);
+ } else {
+ /* error baudrate */
+ return ERR_INVALID_ARG;
+ }
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Enable/disable I2C master interrupt
+ */
+void _i2c_m_async_set_irq_state(struct _i2c_m_async_device *const device, const enum _i2c_m_async_callback_type type,
+ const bool state)
+{
+ if (I2C_M_ASYNC_DEVICE_TX_COMPLETE == type || I2C_M_ASYNC_DEVICE_RX_COMPLETE == type) {
+ hri_sercomi2cm_write_INTEN_SB_bit(device->hw, state);
+ hri_sercomi2cm_write_INTEN_MB_bit(device->hw, state);
+ } else if (I2C_M_ASYNC_DEVICE_ERROR == type) {
+ hri_sercomi2cm_write_INTEN_ERROR_bit(device->hw, state);
+ }
+}
+
+/**
+ * \brief Wait for bus response
+ *
+ * \param[in] i2c_dev The pointer to i2c device
+ * \param[in] flags Store the hardware response
+ *
+ * \return Bus response status.
+ * \retval 0 Bus response status OK
+ * \retval <0 Bus response fail
+ */
+inline static int32_t _sercom_i2c_sync_wait_bus(struct _i2c_m_sync_device *const i2c_dev, uint32_t *flags)
+{
+ uint32_t timeout = 65535;
+ void * hw = i2c_dev->hw;
+
+ do {
+ *flags = hri_sercomi2cm_read_INTFLAG_reg(hw);
+
+ if (timeout-- == 0) {
+ return I2C_ERR_BUS;
+ }
+ } while (!(*flags & MB_FLAG) && !(*flags & SB_FLAG));
+
+ return I2C_OK;
+}
+
+/**
+ * \brief Send the slave address to bus, which will start the transfer
+ *
+ * \param[in] i2c_dev The pointer to i2c device
+ */
+static int32_t _sercom_i2c_sync_send_address(struct _i2c_m_sync_device *const i2c_dev)
+{
+ void * hw = i2c_dev->hw;
+ struct _i2c_m_msg *msg = &i2c_dev->service.msg;
+ int sclsm = hri_sercomi2cm_get_CTRLA_SCLSM_bit(hw);
+ uint32_t flags;
+
+ ASSERT(i2c_dev);
+
+ if (msg->len == 1 && sclsm) {
+ hri_sercomi2cm_set_CTRLB_ACKACT_bit(hw);
+ } else {
+ hri_sercomi2cm_clear_CTRLB_ACKACT_bit(hw);
+ }
+
+ /* ten bit address */
+ if (msg->addr & I2C_M_TEN) {
+ if (msg->flags & I2C_M_RD) {
+ msg->flags |= I2C_M_TEN;
+ }
+
+ hri_sercomi2cm_write_ADDR_reg(hw,
+ ((msg->addr & TEN_ADDR_MASK) << 1) | SERCOM_I2CM_ADDR_TENBITEN
+ | (hri_sercomi2cm_read_ADDR_reg(hw) & SERCOM_I2CM_ADDR_HS));
+ } else {
+ hri_sercomi2cm_write_ADDR_reg(hw,
+ ((msg->addr & SEVEN_ADDR_MASK) << 1) | (msg->flags & I2C_M_RD ? I2C_M_RD : 0x0)
+ | (hri_sercomi2cm_read_ADDR_reg(hw) & SERCOM_I2CM_ADDR_HS));
+ }
+
+ _sercom_i2c_sync_wait_bus(i2c_dev, &flags);
+ return _sercom_i2c_sync_analyse_flags(hw, flags, msg);
+}
+
+/**
+ * \brief Transfer data specified by msg
+ *
+ * \param[in] i2c_dev The pointer to i2c device
+ * \param[in] msg The pointer to i2c message
+ *
+ * \return Transfer status.
+ * \retval 0 Transfer success
+ * \retval <0 Transfer fail or partial fail, return the error code
+ */
+int32_t _i2c_m_sync_transfer(struct _i2c_m_sync_device *const i2c_dev, struct _i2c_m_msg *msg)
+{
+ uint32_t flags;
+ int ret;
+ void * hw = i2c_dev->hw;
+
+ ASSERT(i2c_dev);
+ ASSERT(i2c_dev->hw);
+ ASSERT(msg);
+
+ if (i2c_dev->service.msg.flags & I2C_M_BUSY) {
+ return I2C_ERR_BUSY;
+ }
+
+ msg->flags |= I2C_M_BUSY;
+ i2c_dev->service.msg = *msg;
+ hri_sercomi2cm_set_CTRLB_SMEN_bit(hw);
+
+ ret = _sercom_i2c_sync_send_address(i2c_dev);
+
+ if (ret) {
+ i2c_dev->service.msg.flags &= ~I2C_M_BUSY;
+
+ return ret;
+ }
+
+ while (i2c_dev->service.msg.flags & I2C_M_BUSY) {
+ ret = _sercom_i2c_sync_wait_bus(i2c_dev, &flags);
+
+ if (ret) {
+ if (msg->flags & I2C_M_STOP) {
+ _sercom_i2c_send_stop(hw);
+ }
+
+ i2c_dev->service.msg.flags &= ~I2C_M_BUSY;
+
+ return ret;
+ }
+
+ ret = _sercom_i2c_sync_analyse_flags(hw, flags, &i2c_dev->service.msg);
+ }
+
+ return ret;
+}
+
+int32_t _i2c_m_sync_send_stop(struct _i2c_m_sync_device *const i2c_dev)
+{
+ void *hw = i2c_dev->hw;
+
+ _sercom_i2c_send_stop(hw);
+
+ return I2C_OK;
+}
+
+static inline int32_t _i2c_m_enable_implementation(void *const hw)
+{
+ int timeout = 65535;
+ int timeout_attempt = 4;
+
+ ASSERT(hw);
+
+ /* Enable interrupts */
+ hri_sercomi2cm_set_CTRLA_ENABLE_bit(hw);
+
+ while (hri_sercomi2cm_read_STATUS_BUSSTATE_bf(hw) != I2C_IDLE) {
+ timeout--;
+
+ if (timeout <= 0) {
+ if (--timeout_attempt)
+ timeout = 65535;
+ else
+ return I2C_ERR_BUSY;
+ hri_sercomi2cm_clear_STATUS_reg(hw, SERCOM_I2CM_STATUS_BUSSTATE(I2C_IDLE));
+ }
+ }
+ return ERR_NONE;
+}
+
+static int32_t _i2c_m_sync_init_impl(struct _i2c_m_service *const service, void *const hw)
+{
+ uint8_t i = _get_i2cm_index(hw);
+
+ if (!hri_sercomi2cm_is_syncing(hw, SERCOM_I2CM_SYNCBUSY_SWRST)) {
+ uint32_t mode = _i2cms[i].ctrl_a & SERCOM_I2CM_CTRLA_MODE_Msk;
+ if (hri_sercomi2cm_get_CTRLA_reg(hw, SERCOM_I2CM_CTRLA_ENABLE)) {
+ hri_sercomi2cm_clear_CTRLA_ENABLE_bit(hw);
+ hri_sercomi2cm_wait_for_sync(hw, SERCOM_I2CM_SYNCBUSY_ENABLE);
+ }
+ hri_sercomi2cm_write_CTRLA_reg(hw, SERCOM_I2CM_CTRLA_SWRST | mode);
+ }
+ hri_sercomi2cm_wait_for_sync(hw, SERCOM_I2CM_SYNCBUSY_SWRST);
+
+ hri_sercomi2cm_write_CTRLA_reg(hw, _i2cms[i].ctrl_a);
+ hri_sercomi2cm_write_CTRLB_reg(hw, _i2cms[i].ctrl_b);
+ hri_sercomi2cm_write_BAUD_reg(hw, _i2cms[i].baud);
+
+ service->mode = (_i2cms[i].ctrl_a & SERCOM_I2CM_CTRLA_SPEED_Msk) >> SERCOM_I2CM_CTRLA_SPEED_Pos;
+ hri_sercomi2cm_write_ADDR_HS_bit(hw, service->mode < I2C_HS ? 0 : 1);
+
+ service->trise = _i2cms[i].trise;
+
+ return ERR_NONE;
+}
+
+ /* SERCOM I2C slave */
+
+#ifndef CONF_SERCOM_0_I2CS_ENABLE
+#define CONF_SERCOM_0_I2CS_ENABLE 0
+#endif
+#ifndef CONF_SERCOM_1_I2CS_ENABLE
+#define CONF_SERCOM_1_I2CS_ENABLE 0
+#endif
+#ifndef CONF_SERCOM_2_I2CS_ENABLE
+#define CONF_SERCOM_2_I2CS_ENABLE 0
+#endif
+#ifndef CONF_SERCOM_3_I2CS_ENABLE
+#define CONF_SERCOM_3_I2CS_ENABLE 0
+#endif
+#ifndef CONF_SERCOM_4_I2CS_ENABLE
+#define CONF_SERCOM_4_I2CS_ENABLE 0
+#endif
+#ifndef CONF_SERCOM_5_I2CS_ENABLE
+#define CONF_SERCOM_5_I2CS_ENABLE 0
+#endif
+#ifndef CONF_SERCOM_6_I2CS_ENABLE
+#define CONF_SERCOM_6_I2CS_ENABLE 0
+#endif
+#ifndef CONF_SERCOM_7_I2CS_ENABLE
+#define CONF_SERCOM_7_I2CS_ENABLE 0
+#endif
+
+/** Amount of SERCOM that is used as I2C Slave. */
+#define SERCOM_I2CS_AMOUNT \
+ (CONF_SERCOM_0_I2CS_ENABLE + CONF_SERCOM_1_I2CS_ENABLE + CONF_SERCOM_2_I2CS_ENABLE + CONF_SERCOM_3_I2CS_ENABLE \
+ + CONF_SERCOM_4_I2CS_ENABLE + CONF_SERCOM_5_I2CS_ENABLE + CONF_SERCOM_6_I2CS_ENABLE + CONF_SERCOM_7_I2CS_ENABLE)
+
+/**
+ * \brief Macro is used to fill I2C slave configuration structure based on
+ * its number
+ *
+ * \param[in] n The number of structures
+ */
+#define I2CS_CONFIGURATION(n) \
+ { \
+ n, \
+ SERCOM_I2CM_CTRLA_MODE_I2C_SLAVE | (CONF_SERCOM_##n##_I2CS_RUNSTDBY << SERCOM_I2CS_CTRLA_RUNSTDBY_Pos) \
+ | SERCOM_I2CS_CTRLA_SDAHOLD(CONF_SERCOM_##n##_I2CS_SDAHOLD) \
+ | (CONF_SERCOM_##n##_I2CS_SEXTTOEN << SERCOM_I2CS_CTRLA_SEXTTOEN_Pos) \
+ | (CONF_SERCOM_##n##_I2CS_SPEED << SERCOM_I2CS_CTRLA_SPEED_Pos) \
+ | (CONF_SERCOM_##n##_I2CS_SCLSM << SERCOM_I2CS_CTRLA_SCLSM_Pos) \
+ | (CONF_SERCOM_##n##_I2CS_LOWTOUT << SERCOM_I2CS_CTRLA_LOWTOUTEN_Pos), \
+ SERCOM_I2CS_CTRLB_SMEN | SERCOM_I2CS_CTRLB_AACKEN | SERCOM_I2CS_CTRLB_AMODE(CONF_SERCOM_##n##_I2CS_AMODE), \
+ (CONF_SERCOM_##n##_I2CS_GENCEN << SERCOM_I2CS_ADDR_GENCEN_Pos) \
+ | SERCOM_I2CS_ADDR_ADDR(CONF_SERCOM_##n##_I2CS_ADDRESS) \
+ | (CONF_SERCOM_##n##_I2CS_TENBITEN << SERCOM_I2CS_ADDR_TENBITEN_Pos) \
+ | SERCOM_I2CS_ADDR_ADDRMASK(CONF_SERCOM_##n##_I2CS_ADDRESS_MASK) \
+ }
+
+/**
+ * \brief Macro to check 10-bit addressing
+ */
+#define I2CS_7BIT_ADDRESSING_MASK 0x7F
+
+static int32_t _i2c_s_init(void *const hw);
+static int8_t _get_i2c_s_index(const void *const hw);
+static inline void _i2c_s_deinit(void *const hw);
+static int32_t _i2c_s_set_address(void *const hw, const uint16_t address);
+
+/**
+ * \brief SERCOM I2C slave configuration type
+ */
+struct i2cs_configuration {
+ uint8_t number;
+ hri_sercomi2cs_ctrla_reg_t ctrl_a;
+ hri_sercomi2cs_ctrlb_reg_t ctrl_b;
+ hri_sercomi2cs_addr_reg_t address;
+};
+
+#if SERCOM_I2CS_AMOUNT < 1
+/** Dummy array for compiling. */
+static struct i2cs_configuration _i2css[1] = {{0}};
+#else
+/**
+ * \brief Array of SERCOM I2C slave configurations
+ */
+static struct i2cs_configuration _i2css[] = {
+#if CONF_SERCOM_0_I2CS_ENABLE == 1
+ I2CS_CONFIGURATION(0),
+#endif
+#if CONF_SERCOM_1_I2CS_ENABLE == 1
+ I2CS_CONFIGURATION(1),
+#endif
+#if CONF_SERCOM_2_I2CS_ENABLE == 1
+ I2CS_CONFIGURATION(2),
+#endif
+#if CONF_SERCOM_3_I2CS_ENABLE == 1
+ I2CS_CONFIGURATION(3),
+#endif
+#if CONF_SERCOM_4_I2CS_ENABLE == 1
+ I2CS_CONFIGURATION(4),
+#endif
+#if CONF_SERCOM_5_I2CS_ENABLE == 1
+ I2CS_CONFIGURATION(5),
+#endif
+#if CONF_SERCOM_6_I2CS_ENABLE == 1
+ I2CS_CONFIGURATION(6),
+#endif
+#if CONF_SERCOM_7_I2CS_ENABLE == 1
+ I2CS_CONFIGURATION(7),
+#endif
+};
+#endif
+
+/**
+ * \brief Initialize synchronous I2C slave
+ */
+int32_t _i2c_s_sync_init(struct _i2c_s_sync_device *const device, void *const hw)
+{
+ int32_t status;
+
+ ASSERT(device);
+
+ status = _i2c_s_init(hw);
+ if (status) {
+ return status;
+ }
+ device->hw = hw;
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Initialize asynchronous I2C slave
+ */
+int32_t _i2c_s_async_init(struct _i2c_s_async_device *const device, void *const hw)
+{
+ int32_t init_status;
+
+ ASSERT(device);
+
+ init_status = _i2c_s_init(hw);
+ if (init_status) {
+ return init_status;
+ }
+
+ device->hw = hw;
+ _sercom_init_irq_param(hw, (void *)device);
+ uint8_t irq = _sercom_get_irq_num(hw);
+ for (uint32_t i = 0; i < 4; i++) {
+ NVIC_DisableIRQ((IRQn_Type)irq);
+ NVIC_ClearPendingIRQ((IRQn_Type)irq);
+ NVIC_EnableIRQ((IRQn_Type)irq);
+ irq++;
+ }
+ // Enable Address Match and PREC interrupt by default.
+ hri_sercomi2cs_set_INTEN_AMATCH_bit(hw);
+ hri_sercomi2cs_set_INTEN_PREC_bit(hw);
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Deinitialize synchronous I2C
+ */
+int32_t _i2c_s_sync_deinit(struct _i2c_s_sync_device *const device)
+{
+ _i2c_s_deinit(device->hw);
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Deinitialize asynchronous I2C
+ */
+int32_t _i2c_s_async_deinit(struct _i2c_s_async_device *const device)
+{
+ NVIC_DisableIRQ((IRQn_Type)_sercom_get_irq_num(device->hw));
+ _i2c_s_deinit(device->hw);
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Enable I2C module
+ */
+int32_t _i2c_s_sync_enable(struct _i2c_s_sync_device *const device)
+{
+ hri_sercomi2cs_set_CTRLA_ENABLE_bit(device->hw);
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Enable I2C module
+ */
+int32_t _i2c_s_async_enable(struct _i2c_s_async_device *const device)
+{
+ hri_sercomi2cs_set_CTRLA_ENABLE_bit(device->hw);
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Disable I2C module
+ */
+int32_t _i2c_s_sync_disable(struct _i2c_s_sync_device *const device)
+{
+ hri_sercomi2cs_clear_CTRLA_ENABLE_bit(device->hw);
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Disable I2C module
+ */
+int32_t _i2c_s_async_disable(struct _i2c_s_async_device *const device)
+{
+ hri_sercomi2cs_clear_CTRLA_ENABLE_bit(device->hw);
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Check if 10-bit addressing mode is on
+ */
+int32_t _i2c_s_sync_is_10bit_addressing_on(const struct _i2c_s_sync_device *const device)
+{
+ return hri_sercomi2cs_get_ADDR_TENBITEN_bit(device->hw);
+}
+
+/**
+ * \brief Check if 10-bit addressing mode is on
+ */
+int32_t _i2c_s_async_is_10bit_addressing_on(const struct _i2c_s_async_device *const device)
+{
+ return hri_sercomi2cs_get_ADDR_TENBITEN_bit(device->hw);
+}
+
+/**
+ * \brief Set I2C slave address
+ */
+int32_t _i2c_s_sync_set_address(struct _i2c_s_sync_device *const device, const uint16_t address)
+{
+ return _i2c_s_set_address(device->hw, address);
+}
+
+/**
+ * \brief Set I2C slave address
+ */
+int32_t _i2c_s_async_set_address(struct _i2c_s_async_device *const device, const uint16_t address)
+{
+ return _i2c_s_set_address(device->hw, address);
+}
+
+/**
+ * \brief Write a byte to the given I2C instance
+ */
+void _i2c_s_sync_write_byte(struct _i2c_s_sync_device *const device, const uint8_t data)
+{
+ hri_sercomi2cs_write_DATA_reg(device->hw, data);
+}
+
+/**
+ * \brief Write a byte to the given I2C instance
+ */
+void _i2c_s_async_write_byte(struct _i2c_s_async_device *const device, const uint8_t data)
+{
+ hri_sercomi2cs_write_DATA_reg(device->hw, data);
+}
+
+/**
+ * \brief Read a byte from the given I2C instance
+ */
+uint8_t _i2c_s_sync_read_byte(const struct _i2c_s_sync_device *const device)
+{
+ return hri_sercomi2cs_read_DATA_reg(device->hw);
+}
+
+/**
+ * \brief Check if I2C is ready to send next byt
+ */
+bool _i2c_s_sync_is_byte_sent(const struct _i2c_s_sync_device *const device)
+{
+ return hri_sercomi2cs_get_interrupt_DRDY_bit(device->hw);
+}
+
+/**
+ * \brief Check if there is data received by I2C
+ */
+bool _i2c_s_sync_is_byte_received(const struct _i2c_s_sync_device *const device)
+{
+ return hri_sercomi2cs_get_interrupt_DRDY_bit(device->hw);
+}
+
+/**
+ * \brief Retrieve I2C slave status
+ */
+i2c_s_status_t _i2c_s_sync_get_status(const struct _i2c_s_sync_device *const device)
+{
+ return hri_sercomi2cs_read_STATUS_reg(device->hw);
+}
+
+/**
+ * \brief Clear the Data Ready interrupt flag
+ */
+int32_t _i2c_s_sync_clear_data_ready_flag(const struct _i2c_s_sync_device *const device)
+{
+ hri_sercomi2cs_clear_INTFLAG_DRDY_bit(device->hw);
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Retrieve I2C slave status
+ */
+i2c_s_status_t _i2c_s_async_get_status(const struct _i2c_s_async_device *const device)
+{
+ return hri_sercomi2cs_read_STATUS_reg(device->hw);
+}
+
+/**
+ * \brief Abort data transmission
+ */
+int32_t _i2c_s_async_abort_transmission(const struct _i2c_s_async_device *const device)
+{
+ hri_sercomi2cs_clear_INTEN_DRDY_bit(device->hw);
+
+ return ERR_NONE;
+}
+
+/**
+ * \brief Enable/disable I2C slave interrupt
+ */
+int32_t _i2c_s_async_set_irq_state(struct _i2c_s_async_device *const device, const enum _i2c_s_async_callback_type type,
+ const bool state)
+{
+ ASSERT(device);
+
+ if (I2C_S_DEVICE_TX == type || I2C_S_DEVICE_RX_COMPLETE == type) {
+ hri_sercomi2cs_write_INTEN_DRDY_bit(device->hw, state);
+ } else if (I2C_S_DEVICE_ERROR == type) {
+ hri_sercomi2cs_write_INTEN_ERROR_bit(device->hw, state);
+ }
+
+ return ERR_NONE;
+}
+
+/**
+ * \internal Initalize i2c slave hardware
+ *
+ * \param[in] p The pointer to hardware instance
+ *
+ *\ return status of initialization
+ */
+static int32_t _i2c_s_init(void *const hw)
+{
+ int8_t i = _get_i2c_s_index(hw);
+ if (i == -1) {
+ return ERR_INVALID_ARG;
+ }
+
+ if (!hri_sercomi2cs_is_syncing(hw, SERCOM_I2CS_CTRLA_SWRST)) {
+ uint32_t mode = _i2css[i].ctrl_a & SERCOM_I2CS_CTRLA_MODE_Msk;
+ if (hri_sercomi2cs_get_CTRLA_reg(hw, SERCOM_I2CS_CTRLA_ENABLE)) {
+ hri_sercomi2cs_clear_CTRLA_ENABLE_bit(hw);
+ hri_sercomi2cs_wait_for_sync(hw, SERCOM_I2CS_SYNCBUSY_ENABLE);
+ }
+ hri_sercomi2cs_write_CTRLA_reg(hw, SERCOM_I2CS_CTRLA_SWRST | mode);
+ }
+ hri_sercomi2cs_wait_for_sync(hw, SERCOM_I2CS_SYNCBUSY_SWRST);
+
+ hri_sercomi2cs_write_CTRLA_reg(hw, _i2css[i].ctrl_a);
+ hri_sercomi2cs_write_CTRLB_reg(hw, _i2css[i].ctrl_b);
+ hri_sercomi2cs_write_ADDR_reg(hw, _i2css[i].address);
+
+ return ERR_NONE;
+}
+
+/**
+ * \internal Retrieve ordinal number of the given sercom hardware instance
+ *
+ * \param[in] hw The pointer to hardware instance
+ *
+ * \return The ordinal number of the given sercom hardware instance
+ */
+static int8_t _get_i2c_s_index(const void *const hw)
+{
+ uint8_t sercom_offset = _sercom_get_hardware_index(hw);
+ uint8_t i;
+
+ for (i = 0; i < ARRAY_SIZE(_i2css); i++) {
+ if (_i2css[i].number == sercom_offset) {
+ return i;
+ }
+ }
+
+ ASSERT(false);
+ return -1;
+}
+
+/**
+ * \internal De-initialize i2c slave
+ *
+ * \param[in] hw The pointer to hardware instance
+ */
+static inline void _i2c_s_deinit(void *const hw)
+{
+ hri_sercomi2cs_clear_CTRLA_ENABLE_bit(hw);
+ hri_sercomi2cs_set_CTRLA_SWRST_bit(hw);
+}
+
+/**
+ * \internal De-initialize i2c slave
+ *
+ * \param[in] hw The pointer to hardware instance
+ * \param[in] address Address to set
+ */
+static int32_t _i2c_s_set_address(void *const hw, const uint16_t address)
+{
+ bool enabled;
+
+ enabled = hri_sercomi2cs_get_CTRLA_ENABLE_bit(hw);
+
+ CRITICAL_SECTION_ENTER()
+ hri_sercomi2cs_clear_CTRLA_ENABLE_bit(hw);
+ hri_sercomi2cs_write_ADDR_ADDR_bf(hw, address);
+ CRITICAL_SECTION_LEAVE()
+
+ if (enabled) {
+ hri_sercomi2cs_set_CTRLA_ENABLE_bit(hw);
+ }
+
+ return ERR_NONE;
+}
+
+ /* Sercom SPI implementation */
+
+#ifndef SERCOM_USART_CTRLA_MODE_SPI_SLAVE
+#define SERCOM_USART_CTRLA_MODE_SPI_SLAVE (2 << 2)
+#endif
+
+#define SPI_DEV_IRQ_MODE 0x8000
+
+#define _SPI_CS_PORT_EXTRACT(cs) (((cs) >> 0) & 0xFF)
+#define _SPI_CS_PIN_EXTRACT(cs) (((cs) >> 8) & 0xFF)
+
+COMPILER_PACK_SET(1)
+/** Initialization configuration of registers. */
+struct sercomspi_regs_cfg {
+ uint32_t ctrla;
+ uint32_t ctrlb;
+ uint32_t addr;
+ uint8_t baud;
+ uint8_t dbgctrl;
+ uint16_t dummy_byte;
+ uint8_t n;
+};
+COMPILER_PACK_RESET()
+
+/** Build configuration from header macros. */
+#define SERCOMSPI_REGS(n) \
+ { \
+ (((CONF_SERCOM_##n##_SPI_DORD) << SERCOM_SPI_CTRLA_DORD_Pos) \
+ | (CONF_SERCOM_##n##_SPI_CPOL << SERCOM_SPI_CTRLA_CPOL_Pos) \
+ | (CONF_SERCOM_##n##_SPI_CPHA << SERCOM_SPI_CTRLA_CPHA_Pos) \
+ | (CONF_SERCOM_##n##_SPI_AMODE_EN ? SERCOM_SPI_CTRLA_FORM(2) : SERCOM_SPI_CTRLA_FORM(0)) \
+ | SERCOM_SPI_CTRLA_DOPO(CONF_SERCOM_##n##_SPI_TXPO) | SERCOM_SPI_CTRLA_DIPO(CONF_SERCOM_##n##_SPI_RXPO) \
+ | (CONF_SERCOM_##n##_SPI_IBON << SERCOM_SPI_CTRLA_IBON_Pos) \
+ | (CONF_SERCOM_##n##_SPI_RUNSTDBY << SERCOM_SPI_CTRLA_RUNSTDBY_Pos) \
+ | SERCOM_SPI_CTRLA_MODE(CONF_SERCOM_##n##_SPI_MODE)), /* ctrla */ \
+ ((CONF_SERCOM_##n##_SPI_RXEN << SERCOM_SPI_CTRLB_RXEN_Pos) \
+ | (CONF_SERCOM_##n##_SPI_MSSEN << SERCOM_SPI_CTRLB_MSSEN_Pos) \
+ | (CONF_SERCOM_##n##_SPI_SSDE << SERCOM_SPI_CTRLB_SSDE_Pos) \
+ | (CONF_SERCOM_##n##_SPI_PLOADEN << SERCOM_SPI_CTRLB_PLOADEN_Pos) \
+ | SERCOM_SPI_CTRLB_AMODE(CONF_SERCOM_##n##_SPI_AMODE) \
+ | SERCOM_SPI_CTRLB_CHSIZE(CONF_SERCOM_##n##_SPI_CHSIZE)), /* ctrlb */ \
+ (SERCOM_SPI_ADDR_ADDR(CONF_SERCOM_##n##_SPI_ADDR) \
+ | SERCOM_SPI_ADDR_ADDRMASK(CONF_SERCOM_##n##_SPI_ADDRMASK)), /* addr */ \
+ ((uint8_t)CONF_SERCOM_##n##_SPI_BAUD_RATE), /* baud */ \
+ (CONF_SERCOM_##n##_SPI_DBGSTOP << SERCOM_SPI_DBGCTRL_DBGSTOP_Pos), /* dbgctrl */ \
+ CONF_SERCOM_##n##_SPI_DUMMYBYTE, /* Dummy byte for SPI master mode */ \
+ n /* sercom number */ \
+ }
+
+#ifndef CONF_SERCOM_0_SPI_ENABLE
+#define CONF_SERCOM_0_SPI_ENABLE 0
+#endif
+#ifndef CONF_SERCOM_1_SPI_ENABLE
+#define CONF_SERCOM_1_SPI_ENABLE 0
+#endif
+#ifndef CONF_SERCOM_2_SPI_ENABLE
+#define CONF_SERCOM_2_SPI_ENABLE 0
+#endif
+#ifndef CONF_SERCOM_3_SPI_ENABLE
+#define CONF_SERCOM_3_SPI_ENABLE 0
+#endif
+#ifndef CONF_SERCOM_4_SPI_ENABLE
+#define CONF_SERCOM_4_SPI_ENABLE 0
+#endif
+#ifndef CONF_SERCOM_5_SPI_ENABLE
+#define CONF_SERCOM_5_SPI_ENABLE 0
+#endif
+#ifndef CONF_SERCOM_6_SPI_ENABLE
+#define CONF_SERCOM_6_SPI_ENABLE 0
+#endif
+#ifndef CONF_SERCOM_7_SPI_ENABLE
+#define CONF_SERCOM_7_SPI_ENABLE 0
+#endif
+
+/** Amount of SERCOM that is used as SPI */
+#define SERCOM_SPI_AMOUNT \
+ (CONF_SERCOM_0_SPI_ENABLE + CONF_SERCOM_1_SPI_ENABLE + CONF_SERCOM_2_SPI_ENABLE + CONF_SERCOM_3_SPI_ENABLE \
+ + CONF_SERCOM_4_SPI_ENABLE + CONF_SERCOM_5_SPI_ENABLE + CONF_SERCOM_6_SPI_ENABLE + CONF_SERCOM_7_SPI_ENABLE)
+
+#if SERCOM_SPI_AMOUNT < 1
+/** Dummy array for compiling. */
+static const struct sercomspi_regs_cfg sercomspi_regs[1] = {{0}};
+#else
+/** The SERCOM SPI configurations of SERCOM that is used as SPI. */
+static const struct sercomspi_regs_cfg sercomspi_regs[] = {
+#if CONF_SERCOM_0_SPI_ENABLE
+ SERCOMSPI_REGS(0),
+#endif
+#if CONF_SERCOM_1_SPI_ENABLE
+ SERCOMSPI_REGS(1),
+#endif
+#if CONF_SERCOM_2_SPI_ENABLE
+ SERCOMSPI_REGS(2),
+#endif
+#if CONF_SERCOM_3_SPI_ENABLE
+ SERCOMSPI_REGS(3),
+#endif
+#if CONF_SERCOM_4_SPI_ENABLE
+ SERCOMSPI_REGS(4),
+#endif
+#if CONF_SERCOM_5_SPI_ENABLE
+ SERCOMSPI_REGS(5),
+#endif
+#if CONF_SERCOM_6_SPI_ENABLE
+ SERCOMSPI_REGS(6),
+#endif
+#if CONF_SERCOM_7_SPI_ENABLE
+ SERCOMSPI_REGS(7),
+#endif
+};
+#endif
+
+/** \internal De-initialize SERCOM SPI
+ *
+ * \param[in] hw Pointer to the hardware register base.
+ *
+ * \return De-initialization status
+ */
+static int32_t _spi_deinit(void *const hw)
+{
+ hri_sercomspi_clear_CTRLA_ENABLE_bit(hw);
+ hri_sercomspi_set_CTRLA_SWRST_bit(hw);
+
+ return ERR_NONE;
+}
+
+/** \internal Enable SERCOM SPI
+ *
+ * \param[in] hw Pointer to the hardware register base.
+ *
+ * \return Enabling status
+ */
+static int32_t _spi_sync_enable(void *const hw)
+{
+ if (hri_sercomspi_is_syncing(hw, SERCOM_SPI_SYNCBUSY_SWRST)) {
+ return ERR_BUSY;
+ }
+
+ hri_sercomspi_set_CTRLA_ENABLE_bit(hw);
+
+ return ERR_NONE;
+}
+
+/** \internal Enable SERCOM SPI
+ *
+ * \param[in] hw Pointer to the hardware register base.
+ *
+ * \return Enabling status
+ */
+static int32_t _spi_async_enable(void *const hw)
+{
+ _spi_sync_enable(hw);
+ uint8_t irq = _sercom_get_irq_num(hw);
+ for (uint32_t i = 0; i < 4; i++) {
+ NVIC_EnableIRQ((IRQn_Type)irq++);
+ }
+
+ return ERR_NONE;
+}
+
+/** \internal Disable SERCOM SPI
+ *
+ * \param[in] hw Pointer to the hardware register base.
+ *
+ * \return Disabling status
+ */
+static int32_t _spi_sync_disable(void *const hw)
+{
+ if (hri_sercomspi_is_syncing(hw, SERCOM_SPI_SYNCBUSY_SWRST)) {
+ return ERR_BUSY;
+ }
+ hri_sercomspi_clear_CTRLA_ENABLE_bit(hw);
+
+ return ERR_NONE;
+}
+
+/** \internal Disable SERCOM SPI
+ *
+ * \param[in] hw Pointer to the hardware register base.
+ *
+ * \return Disabling status
+ */
+static int32_t _spi_async_disable(void *const hw)
+{
+ _spi_sync_disable(hw);
+ hri_sercomspi_clear_INTEN_reg(
+ hw, SERCOM_SPI_INTFLAG_ERROR | SERCOM_SPI_INTFLAG_RXC | SERCOM_SPI_INTFLAG_TXC | SERCOM_SPI_INTFLAG_DRE);
+ uint8_t irq = _sercom_get_irq_num(hw);
+ for (uint32_t i = 0; i < 4; i++) {
+ NVIC_DisableIRQ((IRQn_Type)irq++);
+ }
+
+ return ERR_NONE;
+}
+
+/** \internal Set SERCOM SPI mode
+ *
+ * \param[in] hw Pointer to the hardware register base.
+ * \param[in] mode The mode to set
+ *
+ * \return Setting mode status
+ */
+static int32_t _spi_set_mode(void *const hw, const enum spi_transfer_mode mode)
+{
+ uint32_t ctrla;
+
+ if (hri_sercomspi_is_syncing(hw, SERCOM_SPI_SYNCBUSY_SWRST | SERCOM_SPI_SYNCBUSY_ENABLE)) {
+ return ERR_BUSY;
+ }
+
+ ctrla = hri_sercomspi_read_CTRLA_reg(hw);
+ ctrla &= ~(SERCOM_SPI_CTRLA_CPOL | SERCOM_SPI_CTRLA_CPHA);
+ ctrla |= (mode & 0x3u) << SERCOM_SPI_CTRLA_CPHA_Pos;
+ hri_sercomspi_write_CTRLA_reg(hw, ctrla);
+
+ return ERR_NONE;
+}
+
+/** \internal Set SERCOM SPI baudrate
+ *
+ * \param[in] hw Pointer to the hardware register base.
+ * \param[in] baud_val The baudrate to set
+ *
+ * \return Setting baudrate status
+ */
+static int32_t _spi_set_baudrate(void *const hw, const uint32_t baud_val)
+{
+ if (hri_sercomspi_is_syncing(hw, SERCOM_SPI_SYNCBUSY_SWRST)) {
+ return ERR_BUSY;
+ }
+
+ hri_sercomspi_write_BAUD_reg(hw, baud_val);
+
+ return ERR_NONE;
+}
+
+/** \internal Set SERCOM SPI char size
+ *
+ * \param[in] hw Pointer to the hardware register base.
+ * \param[in] baud_val The baudrate to set
+ * \param[out] size Stored char size
+ *
+ * \return Setting char size status
+ */
+static int32_t _spi_set_char_size(void *const hw, const enum spi_char_size char_size, uint8_t *const size)
+{
+ /* Only 8-bit or 9-bit accepted */
+ if (!(char_size == SPI_CHAR_SIZE_8 || char_size == SPI_CHAR_SIZE_9)) {
+ return ERR_INVALID_ARG;
+ }
+
+ if (hri_sercomspi_is_syncing(hw, SERCOM_SPI_SYNCBUSY_SWRST | SERCOM_SPI_SYNCBUSY_CTRLB)) {
+ return ERR_BUSY;
+ }
+
+ hri_sercomspi_write_CTRLB_CHSIZE_bf(hw, char_size);
+ *size = (char_size == SPI_CHAR_SIZE_8) ? 1 : 2;
+
+ return ERR_NONE;
+}
+
+/** \internal Set SERCOM SPI data order
+ *
+ * \param[in] hw Pointer to the hardware register base.
+ * \param[in] baud_val The baudrate to set
+ *
+ * \return Setting data order status
+ */
+static int32_t _spi_set_data_order(void *const hw, const enum spi_data_order dord)
+{
+ uint32_t ctrla;
+
+ if (hri_sercomspi_is_syncing(hw, SERCOM_SPI_SYNCBUSY_SWRST)) {
+ return ERR_BUSY;
+ }
+
+ ctrla = hri_sercomspi_read_CTRLA_reg(hw);
+
+ if (dord == SPI_DATA_ORDER_LSB_1ST) {
+ ctrla |= SERCOM_SPI_CTRLA_DORD;
+ } else {
+ ctrla &= ~SERCOM_SPI_CTRLA_DORD;
+ }
+ hri_sercomspi_write_CTRLA_reg(hw, ctrla);
+
+ return ERR_NONE;
+}
+
+/** \brief Load SERCOM registers to init for SPI master mode
+ * The settings will be applied with default master mode, unsupported things
+ * are ignored.
+ * \param[in, out] hw Pointer to the hardware register base.
+ * \param[in] regs Pointer to register configuration values.
+ */
+static inline void _spi_load_regs_master(void *const hw, const struct sercomspi_regs_cfg *regs)
+{
+ ASSERT(hw && regs);
+ hri_sercomspi_write_CTRLA_reg(
+ hw, regs->ctrla & ~(SERCOM_SPI_CTRLA_IBON | SERCOM_SPI_CTRLA_ENABLE | SERCOM_SPI_CTRLA_SWRST));
+ hri_sercomspi_write_CTRLB_reg(
+ hw,
+ (regs->ctrlb
+ & ~(SERCOM_SPI_CTRLB_MSSEN | SERCOM_SPI_CTRLB_AMODE_Msk | SERCOM_SPI_CTRLB_SSDE | SERCOM_SPI_CTRLB_PLOADEN))
+ | (SERCOM_SPI_CTRLB_RXEN));
+ hri_sercomspi_write_BAUD_reg(hw, regs->baud);
+ hri_sercomspi_write_DBGCTRL_reg(hw, regs->dbgctrl);
+}
+
+/** \brief Load SERCOM registers to init for SPI slave mode
+ * The settings will be applied with default slave mode, unsupported things
+ * are ignored.
+ * \param[in, out] hw Pointer to the hardware register base.
+ * \param[in] regs Pointer to register configuration values.
+ */
+static inline void _spi_load_regs_slave(void *const hw, const struct sercomspi_regs_cfg *regs)
+{
+ ASSERT(hw && regs);
+ hri_sercomspi_write_CTRLA_reg(
+ hw, regs->ctrla & ~(SERCOM_SPI_CTRLA_IBON | SERCOM_SPI_CTRLA_ENABLE | SERCOM_SPI_CTRLA_SWRST));
+ hri_sercomspi_write_CTRLB_reg(hw,
+ (regs->ctrlb & ~(SERCOM_SPI_CTRLB_MSSEN))
+ | (SERCOM_SPI_CTRLB_RXEN | SERCOM_SPI_CTRLB_SSDE | SERCOM_SPI_CTRLB_PLOADEN));
+ hri_sercomspi_write_ADDR_reg(hw, regs->addr);
+ hri_sercomspi_write_DBGCTRL_reg(hw, regs->dbgctrl);
+ while (hri_sercomspi_is_syncing(hw, 0xFFFFFFFF))
+ ;
+}
+
+/** \brief Return the pointer to register settings of specific SERCOM
+ * \param[in] hw_addr The hardware register base address.
+ * \return Pointer to register settings of specific SERCOM.
+ */
+static inline const struct sercomspi_regs_cfg *_spi_get_regs(const uint32_t hw_addr)
+{
+ uint8_t n = _sercom_get_hardware_index((const void *)hw_addr);
+ uint8_t i;
+
+ for (i = 0; i < sizeof(sercomspi_regs) / sizeof(struct sercomspi_regs_cfg); i++) {
+ if (sercomspi_regs[i].n == n) {
+ return &sercomspi_regs[i];
+ }
+ }
+
+ return NULL;
+}
+
+int32_t _spi_m_sync_init(struct _spi_m_sync_dev *dev, void *const hw)
+{
+ const struct sercomspi_regs_cfg *regs = _spi_get_regs((uint32_t)hw);
+
+ ASSERT(dev && hw);
+
+ if (regs == NULL) {
+ return ERR_INVALID_ARG;
+ }
+
+ if (!hri_sercomspi_is_syncing(hw, SERCOM_SPI_SYNCBUSY_SWRST)) {
+ uint32_t mode = regs->ctrla & SERCOM_SPI_CTRLA_MODE_Msk;
+ if (hri_sercomspi_get_CTRLA_reg(hw, SERCOM_SPI_CTRLA_ENABLE)) {
+ hri_sercomspi_clear_CTRLA_ENABLE_bit(hw);
+ hri_sercomspi_wait_for_sync(hw, SERCOM_SPI_SYNCBUSY_ENABLE);
+ }
+ hri_sercomspi_write_CTRLA_reg(hw, SERCOM_SPI_CTRLA_SWRST | mode);
+ }
+ hri_sercomspi_wait_for_sync(hw, SERCOM_SPI_SYNCBUSY_SWRST);
+
+ dev->prvt = hw;
+
+ if ((regs->ctrla & SERCOM_SPI_CTRLA_MODE_Msk) == SERCOM_USART_CTRLA_MODE_SPI_SLAVE) {
+ _spi_load_regs_slave(hw, regs);
+ } else {
+ _spi_load_regs_master(hw, regs);
+ }
+
+ /* Load character size from default hardware configuration */
+ dev->char_size = ((regs->ctrlb & SERCOM_SPI_CTRLB_CHSIZE_Msk) == 0) ? 1 : 2;
+
+ dev->dummy_byte = regs->dummy_byte;
+
+ return ERR_NONE;
+}
+
+int32_t _spi_s_sync_init(struct _spi_s_sync_dev *dev, void *const hw)
+{
+ return _spi_m_sync_init(dev, hw);
+}
+
+int32_t _spi_m_async_init(struct _spi_async_dev *dev, void *const hw)
+{
+ struct _spi_async_dev *spid = dev;
+ /* Do hardware initialize. */
+ int32_t rc = _spi_m_sync_init((struct _spi_m_sync_dev *)dev, hw);
+
+ if (rc < 0) {
+ return rc;
+ }
+
+ _sercom_init_irq_param(hw, (void *)dev);
+ /* Initialize callbacks: must use them */
+ spid->callbacks.complete = NULL;
+ spid->callbacks.rx = NULL;
+ spid->callbacks.tx = NULL;
+ uint8_t irq = _sercom_get_irq_num(hw);
+ for (uint32_t i = 0; i < 4; i++) {
+ NVIC_DisableIRQ((IRQn_Type)irq);
+ NVIC_ClearPendingIRQ((IRQn_Type)irq);
+ irq++;
+ }
+
+ return ERR_NONE;
+}
+
+int32_t _spi_s_async_init(struct _spi_s_async_dev *dev, void *const hw)
+{
+ return _spi_m_async_init(dev, hw);
+}
+
+int32_t _spi_m_async_deinit(struct _spi_async_dev *dev)
+{
+ NVIC_DisableIRQ((IRQn_Type)_sercom_get_irq_num(dev->prvt));
+ NVIC_ClearPendingIRQ((IRQn_Type)_sercom_get_irq_num(dev->prvt));
+
+ return _spi_deinit(dev->prvt);
+}
+
+int32_t _spi_s_async_deinit(struct _spi_s_async_dev *dev)
+{
+ NVIC_DisableIRQ((IRQn_Type)_sercom_get_irq_num(dev->prvt));
+ NVIC_ClearPendingIRQ((IRQn_Type)_sercom_get_irq_num(dev->prvt));
+
+ return _spi_deinit(dev->prvt);
+}
+
+int32_t _spi_m_sync_deinit(struct _spi_m_sync_dev *dev)
+{
+ return _spi_deinit(dev->prvt);
+}
+
+int32_t _spi_s_sync_deinit(struct _spi_s_sync_dev *dev)
+{
+ return _spi_deinit(dev->prvt);
+}
+
+int32_t _spi_m_sync_enable(struct _spi_m_sync_dev *dev)
+{
+ ASSERT(dev && dev->prvt);
+
+ return _spi_sync_enable(dev->prvt);
+}
+
+int32_t _spi_s_sync_enable(struct _spi_s_sync_dev *dev)
+{
+ ASSERT(dev && dev->prvt);
+
+ return _spi_sync_enable(dev->prvt);
+}
+
+int32_t _spi_m_async_enable(struct _spi_async_dev *dev)
+{
+ ASSERT(dev && dev->prvt);
+
+ return _spi_async_enable(dev->prvt);
+}
+
+int32_t _spi_s_async_enable(struct _spi_s_async_dev *dev)
+{
+ ASSERT(dev && dev->prvt);
+
+ return _spi_async_enable(dev->prvt);
+}
+
+int32_t _spi_m_sync_disable(struct _spi_m_sync_dev *dev)
+{
+ ASSERT(dev && dev->prvt);
+
+ return _spi_sync_disable(dev->prvt);
+}
+
+int32_t _spi_s_sync_disable(struct _spi_s_sync_dev *dev)
+{
+ ASSERT(dev && dev->prvt);
+
+ return _spi_sync_disable(dev->prvt);
+}
+
+int32_t _spi_m_async_disable(struct _spi_async_dev *dev)
+{
+ ASSERT(dev && dev->prvt);
+
+ return _spi_async_disable(dev->prvt);
+}
+
+int32_t _spi_s_async_disable(struct _spi_s_async_dev *dev)
+{
+ ASSERT(dev && dev->prvt);
+
+ return _spi_async_disable(dev->prvt);
+}
+
+int32_t _spi_m_sync_set_mode(struct _spi_m_sync_dev *dev, const enum spi_transfer_mode mode)
+{
+ ASSERT(dev && dev->prvt);
+
+ return _spi_set_mode(dev->prvt, mode);
+}
+
+int32_t _spi_m_async_set_mode(struct _spi_async_dev *dev, const enum spi_transfer_mode mode)
+{
+ ASSERT(dev && dev->prvt);
+
+ return _spi_set_mode(dev->prvt, mode);
+}
+
+int32_t _spi_s_async_set_mode(struct _spi_s_async_dev *dev, const enum spi_transfer_mode mode)
+{
+ ASSERT(dev && dev->prvt);
+
+ return _spi_set_mode(dev->prvt, mode);
+}
+
+int32_t _spi_s_sync_set_mode(struct _spi_s_sync_dev *dev, const enum spi_transfer_mode mode)
+{
+ ASSERT(dev && dev->prvt);
+
+ return _spi_set_mode(dev->prvt, mode);
+}
+
+int32_t _spi_calc_baud_val(struct spi_dev *dev, const uint32_t clk, const uint32_t baud)
+{
+ int32_t rc;
+ ASSERT(dev);
+
+ /* Not accept 0es */
+ if (clk == 0 || baud == 0) {
+ return ERR_INVALID_ARG;
+ }
+
+ /* Check baudrate range of current assigned clock */
+ if (!(baud <= (clk >> 1) && baud >= (clk >> 8))) {
+ return ERR_INVALID_ARG;
+ }
+
+ rc = ((clk >> 1) / baud) - 1;
+ return rc;
+}
+
+int32_t _spi_m_sync_set_baudrate(struct _spi_m_sync_dev *dev, const uint32_t baud_val)
+{
+ ASSERT(dev && dev->prvt);
+
+ return _spi_set_baudrate(dev->prvt, baud_val);
+}
+
+int32_t _spi_m_async_set_baudrate(struct _spi_async_dev *dev, const uint32_t baud_val)
+{
+ ASSERT(dev && dev->prvt);
+
+ return _spi_set_baudrate(dev->prvt, baud_val);
+}
+
+int32_t _spi_m_sync_set_char_size(struct _spi_m_sync_dev *dev, const enum spi_char_size char_size)
+{
+ ASSERT(dev && dev->prvt);
+
+ return _spi_set_char_size(dev->prvt, char_size, &dev->char_size);
+}
+
+int32_t _spi_m_async_set_char_size(struct _spi_async_dev *dev, const enum spi_char_size char_size)
+{
+ ASSERT(dev && dev->prvt);
+
+ return _spi_set_char_size(dev->prvt, char_size, &dev->char_size);
+}
+
+int32_t _spi_s_async_set_char_size(struct _spi_s_async_dev *dev, const enum spi_char_size char_size)
+{
+ ASSERT(dev && dev->prvt);
+
+ return _spi_set_char_size(dev->prvt, char_size, &dev->char_size);
+}
+
+int32_t _spi_s_sync_set_char_size(struct _spi_s_sync_dev *dev, const enum spi_char_size char_size)
+{
+ ASSERT(dev && dev->prvt);
+
+ return _spi_set_char_size(dev->prvt, char_size, &dev->char_size);
+}
+
+int32_t _spi_m_sync_set_data_order(struct _spi_m_sync_dev *dev, const enum spi_data_order dord)
+{
+ ASSERT(dev && dev->prvt);
+
+ return _spi_set_data_order(dev->prvt, dord);
+}
+
+int32_t _spi_m_async_set_data_order(struct _spi_async_dev *dev, const enum spi_data_order dord)
+{
+ ASSERT(dev && dev->prvt);
+
+ return _spi_set_data_order(dev->prvt, dord);
+}
+
+int32_t _spi_s_async_set_data_order(struct _spi_s_async_dev *dev, const enum spi_data_order dord)
+{
+ ASSERT(dev && dev->prvt);
+
+ return _spi_set_data_order(dev->prvt, dord);
+}
+
+int32_t _spi_s_sync_set_data_order(struct _spi_s_sync_dev *dev, const enum spi_data_order dord)
+{
+ ASSERT(dev && dev->prvt);
+
+ return _spi_set_data_order(dev->prvt, dord);
+}
+
+/** Wait until SPI bus idle. */
+static inline void _spi_wait_bus_idle(void *const hw)
+{
+ while (!(hri_sercomspi_get_INTFLAG_reg(hw, SERCOM_SPI_INTFLAG_TXC | SERCOM_SPI_INTFLAG_DRE))) {
+ ;
+ }
+ hri_sercomspi_clear_INTFLAG_reg(hw, SERCOM_SPI_INTFLAG_TXC | SERCOM_SPI_INTFLAG_DRE);
+}
+
+/** Holds run time information for message sync transaction. */
+struct _spi_trans_ctrl {
+ /** Pointer to transmitting data buffer. */
+ uint8_t *txbuf;
+ /** Pointer to receiving data buffer. */
+ uint8_t *rxbuf;
+ /** Count number of data transmitted. */
+ uint32_t txcnt;
+ /** Count number of data received. */
+ uint32_t rxcnt;
+ /** Data character size. */
+ uint8_t char_size;
+};
+
+/** Check interrupt flag of RXC and update transaction runtime information. */
+static inline bool _spi_rx_check_and_receive(void *const hw, const uint32_t iflag, struct _spi_trans_ctrl *ctrl)
+{
+ uint32_t data;
+
+ if (!(iflag & SERCOM_SPI_INTFLAG_RXC)) {
+ return false;
+ }
+
+ data = hri_sercomspi_read_DATA_reg(hw);
+
+ if (ctrl->rxbuf) {
+ *ctrl->rxbuf++ = (uint8_t)data;
+
+ if (ctrl->char_size > 1) {
+ *ctrl->rxbuf++ = (uint8_t)(data >> 8);
+ }
+ }
+
+ ctrl->rxcnt++;
+
+ return true;
+}
+
+/** Check interrupt flag of DRE and update transaction runtime information. */
+static inline void _spi_tx_check_and_send(void *const hw, const uint32_t iflag, struct _spi_trans_ctrl *ctrl,
+ uint16_t dummy)
+{
+ uint32_t data;
+
+ if (!(SERCOM_SPI_INTFLAG_DRE & iflag)) {
+ return;
+ }
+
+ if (ctrl->txbuf) {
+ data = *ctrl->txbuf++;
+
+ if (ctrl->char_size > 1) {
+ data |= (*ctrl->txbuf) << 8;
+ ctrl->txbuf++;
+ }
+ } else {
+ data = dummy;
+ }
+
+ ctrl->txcnt++;
+ hri_sercomspi_write_DATA_reg(hw, data);
+}
+
+/** Check interrupt flag of ERROR and update transaction runtime information. */
+static inline int32_t _spi_err_check(const uint32_t iflag, void *const hw)
+{
+ if (SERCOM_SPI_INTFLAG_ERROR & iflag) {
+ hri_sercomspi_clear_STATUS_reg(hw, ~0);
+ hri_sercomspi_clear_INTFLAG_reg(hw, SERCOM_SPI_INTFLAG_ERROR);
+ return ERR_OVERFLOW;
+ }
+
+ return ERR_NONE;
+}
+
+int32_t _spi_m_sync_trans(struct _spi_m_sync_dev *dev, const struct spi_msg *msg)
+{
+ void * hw = dev->prvt;
+ int32_t rc = 0;
+ struct _spi_trans_ctrl ctrl = {msg->txbuf, msg->rxbuf, 0, 0, dev->char_size};
+
+ ASSERT(dev && hw);
+
+ /* If settings are not applied (pending), we can not go on */
+ if (hri_sercomspi_is_syncing(
+ hw, (SERCOM_SPI_SYNCBUSY_SWRST | SERCOM_SPI_SYNCBUSY_ENABLE | SERCOM_SPI_SYNCBUSY_CTRLB))) {
+ return ERR_BUSY;
+ }
+
+ /* SPI must be enabled to start synchronous transfer */
+ if (!hri_sercomspi_get_CTRLA_ENABLE_bit(hw)) {
+ return ERR_NOT_INITIALIZED;
+ }
+
+ for (;;) {
+ uint32_t iflag = hri_sercomspi_read_INTFLAG_reg(hw);
+
+ if (!_spi_rx_check_and_receive(hw, iflag, &ctrl)) {
+ /* In master mode, do not start next byte before previous byte received
+ * to make better output waveform */
+ if (ctrl.rxcnt >= ctrl.txcnt) {
+ _spi_tx_check_and_send(hw, iflag, &ctrl, dev->dummy_byte);
+ }
+ }
+
+ rc = _spi_err_check(iflag, hw);
+
+ if (rc < 0) {
+ break;
+ }
+ if (ctrl.txcnt >= msg->size && ctrl.rxcnt >= msg->size) {
+ rc = ctrl.txcnt;
+ break;
+ }
+ }
+ /* Wait until SPI bus idle */
+ _spi_wait_bus_idle(hw);
+
+ return rc;
+}
+
+int32_t _spi_m_async_enable_tx(struct _spi_async_dev *dev, bool state)
+{
+ void *hw = dev->prvt;
+
+ ASSERT(dev && hw);
+
+ if (state) {
+ hri_sercomspi_set_INTEN_DRE_bit(hw);
+ } else {
+ hri_sercomspi_clear_INTEN_DRE_bit(hw);
+ }
+
+ return ERR_NONE;
+}
+
+int32_t _spi_s_async_enable_tx(struct _spi_s_async_dev *dev, bool state)
+{
+ return _spi_m_async_enable_tx(dev, state);
+}
+
+int32_t _spi_m_async_enable_rx(struct _spi_async_dev *dev, bool state)
+{
+ void *hw = dev->prvt;
+
+ ASSERT(dev);
+ ASSERT(hw);
+
+ if (state) {
+ hri_sercomspi_set_INTEN_RXC_bit(hw);
+ } else {
+ hri_sercomspi_clear_INTEN_RXC_bit(hw);
+ }
+
+ return ERR_NONE;
+}
+
+int32_t _spi_s_async_enable_rx(struct _spi_s_async_dev *dev, bool state)
+{
+ return _spi_m_async_enable_rx(dev, state);
+}
+
+int32_t _spi_m_async_enable_tx_complete(struct _spi_async_dev *dev, bool state)
+{
+ ASSERT(dev && dev->prvt);
+
+ if (state) {
+ hri_sercomspi_set_INTEN_TXC_bit(dev->prvt);
+ } else {
+ hri_sercomspi_clear_INTEN_TXC_bit(dev->prvt);
+ }
+
+ return ERR_NONE;
+}
+
+int32_t _spi_s_async_enable_ss_detect(struct _spi_s_async_dev *dev, bool state)
+{
+ return _spi_m_async_enable_tx_complete(dev, state);
+}
+
+int32_t _spi_m_async_write_one(struct _spi_async_dev *dev, uint16_t data)
+{
+ ASSERT(dev && dev->prvt);
+
+ hri_sercomspi_write_DATA_reg(dev->prvt, data);
+
+ return ERR_NONE;
+}
+
+int32_t _spi_s_async_write_one(struct _spi_s_async_dev *dev, uint16_t data)
+{
+ ASSERT(dev && dev->prvt);
+
+ hri_sercomspi_write_DATA_reg(dev->prvt, data);
+
+ return ERR_NONE;
+}
+
+int32_t _spi_s_sync_write_one(struct _spi_s_sync_dev *dev, uint16_t data)
+{
+ ASSERT(dev && dev->prvt);
+
+ hri_sercomspi_write_DATA_reg(dev->prvt, data);
+
+ return ERR_NONE;
+}
+
+uint16_t _spi_m_async_read_one(struct _spi_async_dev *dev)
+{
+ ASSERT(dev && dev->prvt);
+
+ return hri_sercomspi_read_DATA_reg(dev->prvt);
+}
+
+uint16_t _spi_s_async_read_one(struct _spi_s_async_dev *dev)
+{
+ ASSERT(dev && dev->prvt);
+
+ return hri_sercomspi_read_DATA_reg(dev->prvt);
+}
+
+uint16_t _spi_s_sync_read_one(struct _spi_s_sync_dev *dev)
+{
+ ASSERT(dev && dev->prvt);
+
+ return hri_sercomspi_read_DATA_reg(dev->prvt);
+}
+
+int32_t _spi_m_async_register_callback(struct _spi_async_dev *dev, const enum _spi_async_dev_cb_type cb_type,
+ const FUNC_PTR func)
+{
+ typedef void (*func_t)(void);
+ struct _spi_async_dev *spid = dev;
+
+ ASSERT(dev && (cb_type < SPI_DEV_CB_N));
+
+ func_t *p_ls = (func_t *)&spid->callbacks;
+ p_ls[cb_type] = (func_t)func;
+
+ return ERR_NONE;
+}
+
+int32_t _spi_s_async_register_callback(struct _spi_s_async_dev *dev, const enum _spi_s_async_dev_cb_type cb_type,
+ const FUNC_PTR func)
+{
+ return _spi_m_async_register_callback(dev, cb_type, func);
+}
+
+bool _spi_s_sync_is_tx_ready(struct _spi_s_sync_dev *dev)
+{
+ ASSERT(dev && dev->prvt);
+
+ return hri_sercomi2cm_get_INTFLAG_reg(dev->prvt, SERCOM_SPI_INTFLAG_DRE);
+}
+
+bool _spi_s_sync_is_rx_ready(struct _spi_s_sync_dev *dev)
+{
+ ASSERT(dev && dev->prvt);
+
+ return hri_sercomi2cm_get_INTFLAG_reg(dev->prvt, SERCOM_SPI_INTFLAG_RXC);
+}
+
+bool _spi_s_sync_is_ss_deactivated(struct _spi_s_sync_dev *dev)
+{
+ void *hw = dev->prvt;
+
+ ASSERT(dev && hw);
+
+ if (hri_sercomi2cm_get_INTFLAG_reg(hw, SERCOM_SPI_INTFLAG_TXC)) {
+ hri_sercomspi_clear_INTFLAG_reg(hw, SERCOM_SPI_INTFLAG_TXC);
+ return true;
+ }
+ return false;
+}
+
+bool _spi_s_sync_is_error(struct _spi_s_sync_dev *dev)
+{
+ void *hw = dev->prvt;
+
+ ASSERT(dev && hw);
+
+ if (hri_sercomi2cm_get_INTFLAG_reg(hw, SERCOM_SPI_INTFLAG_ERROR)) {
+ hri_sercomspi_clear_STATUS_reg(hw, SERCOM_SPI_STATUS_BUFOVF);
+ hri_sercomspi_clear_INTFLAG_reg(hw, SERCOM_SPI_INTFLAG_ERROR);
+ return true;
+ }
+ return false;
+}
+
+/**
+ * \brief Enable/disable SPI master interrupt
+ *
+ * param[in] device The pointer to SPI master device instance
+ * param[in] type The type of interrupt to disable/enable if applicable
+ * param[in] state Enable or disable
+ */
+void _spi_m_async_set_irq_state(struct _spi_async_dev *const device, const enum _spi_async_dev_cb_type type,
+ const bool state)
+{
+ ASSERT(device);
+
+ if (SPI_DEV_CB_ERROR == type) {
+ hri_sercomspi_write_INTEN_ERROR_bit(device->prvt, state);
+ }
+}
+
+/**
+ * \brief Enable/disable SPI slave interrupt
+ *
+ * param[in] device The pointer to SPI slave device instance
+ * param[in] type The type of interrupt to disable/enable if applicable
+ * param[in] state Enable or disable
+ */
+void _spi_s_async_set_irq_state(struct _spi_async_dev *const device, const enum _spi_async_dev_cb_type type,
+ const bool state)
+{
+ _spi_m_async_set_irq_state(device, type, state);
+}
diff --git a/Examples/AS5048A_test/AS5048A_test/hri/hri_ac_e54.h b/Examples/AS5048A_test/AS5048A_test/hri/hri_ac_e54.h
new file mode 100644
index 0000000..588499e
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hri/hri_ac_e54.h
@@ -0,0 +1,1836 @@
+/**
+ * \file
+ *
+ * \brief SAM AC
+ *
+ * Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifdef _SAME54_AC_COMPONENT_
+#ifndef _HRI_AC_E54_H_INCLUDED_
+#define _HRI_AC_E54_H_INCLUDED_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+#include
+
+#if defined(ENABLE_AC_CRITICAL_SECTIONS)
+#define AC_CRITICAL_SECTION_ENTER() CRITICAL_SECTION_ENTER()
+#define AC_CRITICAL_SECTION_LEAVE() CRITICAL_SECTION_LEAVE()
+#else
+#define AC_CRITICAL_SECTION_ENTER()
+#define AC_CRITICAL_SECTION_LEAVE()
+#endif
+
+typedef uint16_t hri_ac_calib_reg_t;
+typedef uint16_t hri_ac_evctrl_reg_t;
+typedef uint32_t hri_ac_compctrl_reg_t;
+typedef uint32_t hri_ac_syncbusy_reg_t;
+typedef uint8_t hri_ac_ctrla_reg_t;
+typedef uint8_t hri_ac_ctrlb_reg_t;
+typedef uint8_t hri_ac_dbgctrl_reg_t;
+typedef uint8_t hri_ac_intenset_reg_t;
+typedef uint8_t hri_ac_intflag_reg_t;
+typedef uint8_t hri_ac_scaler_reg_t;
+typedef uint8_t hri_ac_statusa_reg_t;
+typedef uint8_t hri_ac_statusb_reg_t;
+typedef uint8_t hri_ac_winctrl_reg_t;
+
+static inline void hri_ac_wait_for_sync(const void *const hw, hri_ac_syncbusy_reg_t reg)
+{
+ while (((Ac *)hw)->SYNCBUSY.reg & reg) {
+ };
+}
+
+static inline bool hri_ac_is_syncing(const void *const hw, hri_ac_syncbusy_reg_t reg)
+{
+ return ((Ac *)hw)->SYNCBUSY.reg & reg;
+}
+
+static inline bool hri_ac_get_INTFLAG_COMP0_bit(const void *const hw)
+{
+ return (((Ac *)hw)->INTFLAG.reg & AC_INTFLAG_COMP0) >> AC_INTFLAG_COMP0_Pos;
+}
+
+static inline void hri_ac_clear_INTFLAG_COMP0_bit(const void *const hw)
+{
+ ((Ac *)hw)->INTFLAG.reg = AC_INTFLAG_COMP0;
+}
+
+static inline bool hri_ac_get_INTFLAG_COMP1_bit(const void *const hw)
+{
+ return (((Ac *)hw)->INTFLAG.reg & AC_INTFLAG_COMP1) >> AC_INTFLAG_COMP1_Pos;
+}
+
+static inline void hri_ac_clear_INTFLAG_COMP1_bit(const void *const hw)
+{
+ ((Ac *)hw)->INTFLAG.reg = AC_INTFLAG_COMP1;
+}
+
+static inline bool hri_ac_get_INTFLAG_WIN0_bit(const void *const hw)
+{
+ return (((Ac *)hw)->INTFLAG.reg & AC_INTFLAG_WIN0) >> AC_INTFLAG_WIN0_Pos;
+}
+
+static inline void hri_ac_clear_INTFLAG_WIN0_bit(const void *const hw)
+{
+ ((Ac *)hw)->INTFLAG.reg = AC_INTFLAG_WIN0;
+}
+
+static inline bool hri_ac_get_interrupt_COMP0_bit(const void *const hw)
+{
+ return (((Ac *)hw)->INTFLAG.reg & AC_INTFLAG_COMP0) >> AC_INTFLAG_COMP0_Pos;
+}
+
+static inline void hri_ac_clear_interrupt_COMP0_bit(const void *const hw)
+{
+ ((Ac *)hw)->INTFLAG.reg = AC_INTFLAG_COMP0;
+}
+
+static inline bool hri_ac_get_interrupt_COMP1_bit(const void *const hw)
+{
+ return (((Ac *)hw)->INTFLAG.reg & AC_INTFLAG_COMP1) >> AC_INTFLAG_COMP1_Pos;
+}
+
+static inline void hri_ac_clear_interrupt_COMP1_bit(const void *const hw)
+{
+ ((Ac *)hw)->INTFLAG.reg = AC_INTFLAG_COMP1;
+}
+
+static inline bool hri_ac_get_interrupt_WIN0_bit(const void *const hw)
+{
+ return (((Ac *)hw)->INTFLAG.reg & AC_INTFLAG_WIN0) >> AC_INTFLAG_WIN0_Pos;
+}
+
+static inline void hri_ac_clear_interrupt_WIN0_bit(const void *const hw)
+{
+ ((Ac *)hw)->INTFLAG.reg = AC_INTFLAG_WIN0;
+}
+
+static inline hri_ac_intflag_reg_t hri_ac_get_INTFLAG_reg(const void *const hw, hri_ac_intflag_reg_t mask)
+{
+ uint8_t tmp;
+ tmp = ((Ac *)hw)->INTFLAG.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline hri_ac_intflag_reg_t hri_ac_read_INTFLAG_reg(const void *const hw)
+{
+ return ((Ac *)hw)->INTFLAG.reg;
+}
+
+static inline void hri_ac_clear_INTFLAG_reg(const void *const hw, hri_ac_intflag_reg_t mask)
+{
+ ((Ac *)hw)->INTFLAG.reg = mask;
+}
+
+static inline void hri_ac_set_INTEN_COMP0_bit(const void *const hw)
+{
+ ((Ac *)hw)->INTENSET.reg = AC_INTENSET_COMP0;
+}
+
+static inline bool hri_ac_get_INTEN_COMP0_bit(const void *const hw)
+{
+ return (((Ac *)hw)->INTENSET.reg & AC_INTENSET_COMP0) >> AC_INTENSET_COMP0_Pos;
+}
+
+static inline void hri_ac_write_INTEN_COMP0_bit(const void *const hw, bool value)
+{
+ if (value == 0x0) {
+ ((Ac *)hw)->INTENCLR.reg = AC_INTENSET_COMP0;
+ } else {
+ ((Ac *)hw)->INTENSET.reg = AC_INTENSET_COMP0;
+ }
+}
+
+static inline void hri_ac_clear_INTEN_COMP0_bit(const void *const hw)
+{
+ ((Ac *)hw)->INTENCLR.reg = AC_INTENSET_COMP0;
+}
+
+static inline void hri_ac_set_INTEN_COMP1_bit(const void *const hw)
+{
+ ((Ac *)hw)->INTENSET.reg = AC_INTENSET_COMP1;
+}
+
+static inline bool hri_ac_get_INTEN_COMP1_bit(const void *const hw)
+{
+ return (((Ac *)hw)->INTENSET.reg & AC_INTENSET_COMP1) >> AC_INTENSET_COMP1_Pos;
+}
+
+static inline void hri_ac_write_INTEN_COMP1_bit(const void *const hw, bool value)
+{
+ if (value == 0x0) {
+ ((Ac *)hw)->INTENCLR.reg = AC_INTENSET_COMP1;
+ } else {
+ ((Ac *)hw)->INTENSET.reg = AC_INTENSET_COMP1;
+ }
+}
+
+static inline void hri_ac_clear_INTEN_COMP1_bit(const void *const hw)
+{
+ ((Ac *)hw)->INTENCLR.reg = AC_INTENSET_COMP1;
+}
+
+static inline void hri_ac_set_INTEN_WIN0_bit(const void *const hw)
+{
+ ((Ac *)hw)->INTENSET.reg = AC_INTENSET_WIN0;
+}
+
+static inline bool hri_ac_get_INTEN_WIN0_bit(const void *const hw)
+{
+ return (((Ac *)hw)->INTENSET.reg & AC_INTENSET_WIN0) >> AC_INTENSET_WIN0_Pos;
+}
+
+static inline void hri_ac_write_INTEN_WIN0_bit(const void *const hw, bool value)
+{
+ if (value == 0x0) {
+ ((Ac *)hw)->INTENCLR.reg = AC_INTENSET_WIN0;
+ } else {
+ ((Ac *)hw)->INTENSET.reg = AC_INTENSET_WIN0;
+ }
+}
+
+static inline void hri_ac_clear_INTEN_WIN0_bit(const void *const hw)
+{
+ ((Ac *)hw)->INTENCLR.reg = AC_INTENSET_WIN0;
+}
+
+static inline void hri_ac_set_INTEN_reg(const void *const hw, hri_ac_intenset_reg_t mask)
+{
+ ((Ac *)hw)->INTENSET.reg = mask;
+}
+
+static inline hri_ac_intenset_reg_t hri_ac_get_INTEN_reg(const void *const hw, hri_ac_intenset_reg_t mask)
+{
+ uint8_t tmp;
+ tmp = ((Ac *)hw)->INTENSET.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline hri_ac_intenset_reg_t hri_ac_read_INTEN_reg(const void *const hw)
+{
+ return ((Ac *)hw)->INTENSET.reg;
+}
+
+static inline void hri_ac_write_INTEN_reg(const void *const hw, hri_ac_intenset_reg_t data)
+{
+ ((Ac *)hw)->INTENSET.reg = data;
+ ((Ac *)hw)->INTENCLR.reg = ~data;
+}
+
+static inline void hri_ac_clear_INTEN_reg(const void *const hw, hri_ac_intenset_reg_t mask)
+{
+ ((Ac *)hw)->INTENCLR.reg = mask;
+}
+
+static inline bool hri_ac_get_STATUSA_STATE0_bit(const void *const hw)
+{
+ return (((Ac *)hw)->STATUSA.reg & AC_STATUSA_STATE0) >> AC_STATUSA_STATE0_Pos;
+}
+
+static inline bool hri_ac_get_STATUSA_STATE1_bit(const void *const hw)
+{
+ return (((Ac *)hw)->STATUSA.reg & AC_STATUSA_STATE1) >> AC_STATUSA_STATE1_Pos;
+}
+
+static inline hri_ac_statusa_reg_t hri_ac_get_STATUSA_WSTATE0_bf(const void *const hw, hri_ac_statusa_reg_t mask)
+{
+ return (((Ac *)hw)->STATUSA.reg & AC_STATUSA_WSTATE0(mask)) >> AC_STATUSA_WSTATE0_Pos;
+}
+
+static inline hri_ac_statusa_reg_t hri_ac_read_STATUSA_WSTATE0_bf(const void *const hw)
+{
+ return (((Ac *)hw)->STATUSA.reg & AC_STATUSA_WSTATE0_Msk) >> AC_STATUSA_WSTATE0_Pos;
+}
+
+static inline hri_ac_statusa_reg_t hri_ac_get_STATUSA_reg(const void *const hw, hri_ac_statusa_reg_t mask)
+{
+ uint8_t tmp;
+ tmp = ((Ac *)hw)->STATUSA.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline hri_ac_statusa_reg_t hri_ac_read_STATUSA_reg(const void *const hw)
+{
+ return ((Ac *)hw)->STATUSA.reg;
+}
+
+static inline bool hri_ac_get_STATUSB_READY0_bit(const void *const hw)
+{
+ return (((Ac *)hw)->STATUSB.reg & AC_STATUSB_READY0) >> AC_STATUSB_READY0_Pos;
+}
+
+static inline bool hri_ac_get_STATUSB_READY1_bit(const void *const hw)
+{
+ return (((Ac *)hw)->STATUSB.reg & AC_STATUSB_READY1) >> AC_STATUSB_READY1_Pos;
+}
+
+static inline hri_ac_statusb_reg_t hri_ac_get_STATUSB_reg(const void *const hw, hri_ac_statusb_reg_t mask)
+{
+ uint8_t tmp;
+ tmp = ((Ac *)hw)->STATUSB.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline hri_ac_statusb_reg_t hri_ac_read_STATUSB_reg(const void *const hw)
+{
+ return ((Ac *)hw)->STATUSB.reg;
+}
+
+static inline bool hri_ac_get_SYNCBUSY_SWRST_bit(const void *const hw)
+{
+ return (((Ac *)hw)->SYNCBUSY.reg & AC_SYNCBUSY_SWRST) >> AC_SYNCBUSY_SWRST_Pos;
+}
+
+static inline bool hri_ac_get_SYNCBUSY_ENABLE_bit(const void *const hw)
+{
+ return (((Ac *)hw)->SYNCBUSY.reg & AC_SYNCBUSY_ENABLE) >> AC_SYNCBUSY_ENABLE_Pos;
+}
+
+static inline bool hri_ac_get_SYNCBUSY_WINCTRL_bit(const void *const hw)
+{
+ return (((Ac *)hw)->SYNCBUSY.reg & AC_SYNCBUSY_WINCTRL) >> AC_SYNCBUSY_WINCTRL_Pos;
+}
+
+static inline bool hri_ac_get_SYNCBUSY_COMPCTRL0_bit(const void *const hw)
+{
+ return (((Ac *)hw)->SYNCBUSY.reg & AC_SYNCBUSY_COMPCTRL0) >> AC_SYNCBUSY_COMPCTRL0_Pos;
+}
+
+static inline bool hri_ac_get_SYNCBUSY_COMPCTRL1_bit(const void *const hw)
+{
+ return (((Ac *)hw)->SYNCBUSY.reg & AC_SYNCBUSY_COMPCTRL1) >> AC_SYNCBUSY_COMPCTRL1_Pos;
+}
+
+static inline hri_ac_syncbusy_reg_t hri_ac_get_SYNCBUSY_reg(const void *const hw, hri_ac_syncbusy_reg_t mask)
+{
+ uint32_t tmp;
+ tmp = ((Ac *)hw)->SYNCBUSY.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline hri_ac_syncbusy_reg_t hri_ac_read_SYNCBUSY_reg(const void *const hw)
+{
+ return ((Ac *)hw)->SYNCBUSY.reg;
+}
+
+static inline void hri_ac_set_CTRLA_SWRST_bit(const void *const hw)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->CTRLA.reg |= AC_CTRLA_SWRST;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_SWRST);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_ac_get_CTRLA_SWRST_bit(const void *const hw)
+{
+ uint8_t tmp;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_SWRST);
+ tmp = ((Ac *)hw)->CTRLA.reg;
+ tmp = (tmp & AC_CTRLA_SWRST) >> AC_CTRLA_SWRST_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_ac_set_CTRLA_ENABLE_bit(const void *const hw)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->CTRLA.reg |= AC_CTRLA_ENABLE;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_SWRST | AC_SYNCBUSY_ENABLE);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_ac_get_CTRLA_ENABLE_bit(const void *const hw)
+{
+ uint8_t tmp;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_SWRST | AC_SYNCBUSY_ENABLE);
+ tmp = ((Ac *)hw)->CTRLA.reg;
+ tmp = (tmp & AC_CTRLA_ENABLE) >> AC_CTRLA_ENABLE_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_ac_write_CTRLA_ENABLE_bit(const void *const hw, bool value)
+{
+ uint8_t tmp;
+ AC_CRITICAL_SECTION_ENTER();
+ tmp = ((Ac *)hw)->CTRLA.reg;
+ tmp &= ~AC_CTRLA_ENABLE;
+ tmp |= value << AC_CTRLA_ENABLE_Pos;
+ ((Ac *)hw)->CTRLA.reg = tmp;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_SWRST | AC_SYNCBUSY_ENABLE);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_clear_CTRLA_ENABLE_bit(const void *const hw)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->CTRLA.reg &= ~AC_CTRLA_ENABLE;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_SWRST | AC_SYNCBUSY_ENABLE);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_toggle_CTRLA_ENABLE_bit(const void *const hw)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->CTRLA.reg ^= AC_CTRLA_ENABLE;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_SWRST | AC_SYNCBUSY_ENABLE);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_set_CTRLA_reg(const void *const hw, hri_ac_ctrla_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->CTRLA.reg |= mask;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_SWRST | AC_SYNCBUSY_ENABLE);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_ac_ctrla_reg_t hri_ac_get_CTRLA_reg(const void *const hw, hri_ac_ctrla_reg_t mask)
+{
+ uint8_t tmp;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_SWRST | AC_SYNCBUSY_ENABLE);
+ tmp = ((Ac *)hw)->CTRLA.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline void hri_ac_write_CTRLA_reg(const void *const hw, hri_ac_ctrla_reg_t data)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->CTRLA.reg = data;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_SWRST | AC_SYNCBUSY_ENABLE);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_clear_CTRLA_reg(const void *const hw, hri_ac_ctrla_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->CTRLA.reg &= ~mask;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_SWRST | AC_SYNCBUSY_ENABLE);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_toggle_CTRLA_reg(const void *const hw, hri_ac_ctrla_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->CTRLA.reg ^= mask;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_SWRST | AC_SYNCBUSY_ENABLE);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_ac_ctrla_reg_t hri_ac_read_CTRLA_reg(const void *const hw)
+{
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_SWRST | AC_SYNCBUSY_ENABLE);
+ return ((Ac *)hw)->CTRLA.reg;
+}
+
+static inline void hri_ac_set_EVCTRL_COMPEO0_bit(const void *const hw)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->EVCTRL.reg |= AC_EVCTRL_COMPEO0;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_ac_get_EVCTRL_COMPEO0_bit(const void *const hw)
+{
+ uint16_t tmp;
+ tmp = ((Ac *)hw)->EVCTRL.reg;
+ tmp = (tmp & AC_EVCTRL_COMPEO0) >> AC_EVCTRL_COMPEO0_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_ac_write_EVCTRL_COMPEO0_bit(const void *const hw, bool value)
+{
+ uint16_t tmp;
+ AC_CRITICAL_SECTION_ENTER();
+ tmp = ((Ac *)hw)->EVCTRL.reg;
+ tmp &= ~AC_EVCTRL_COMPEO0;
+ tmp |= value << AC_EVCTRL_COMPEO0_Pos;
+ ((Ac *)hw)->EVCTRL.reg = tmp;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_clear_EVCTRL_COMPEO0_bit(const void *const hw)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->EVCTRL.reg &= ~AC_EVCTRL_COMPEO0;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_toggle_EVCTRL_COMPEO0_bit(const void *const hw)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->EVCTRL.reg ^= AC_EVCTRL_COMPEO0;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_set_EVCTRL_COMPEO1_bit(const void *const hw)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->EVCTRL.reg |= AC_EVCTRL_COMPEO1;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_ac_get_EVCTRL_COMPEO1_bit(const void *const hw)
+{
+ uint16_t tmp;
+ tmp = ((Ac *)hw)->EVCTRL.reg;
+ tmp = (tmp & AC_EVCTRL_COMPEO1) >> AC_EVCTRL_COMPEO1_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_ac_write_EVCTRL_COMPEO1_bit(const void *const hw, bool value)
+{
+ uint16_t tmp;
+ AC_CRITICAL_SECTION_ENTER();
+ tmp = ((Ac *)hw)->EVCTRL.reg;
+ tmp &= ~AC_EVCTRL_COMPEO1;
+ tmp |= value << AC_EVCTRL_COMPEO1_Pos;
+ ((Ac *)hw)->EVCTRL.reg = tmp;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_clear_EVCTRL_COMPEO1_bit(const void *const hw)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->EVCTRL.reg &= ~AC_EVCTRL_COMPEO1;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_toggle_EVCTRL_COMPEO1_bit(const void *const hw)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->EVCTRL.reg ^= AC_EVCTRL_COMPEO1;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_set_EVCTRL_WINEO0_bit(const void *const hw)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->EVCTRL.reg |= AC_EVCTRL_WINEO0;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_ac_get_EVCTRL_WINEO0_bit(const void *const hw)
+{
+ uint16_t tmp;
+ tmp = ((Ac *)hw)->EVCTRL.reg;
+ tmp = (tmp & AC_EVCTRL_WINEO0) >> AC_EVCTRL_WINEO0_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_ac_write_EVCTRL_WINEO0_bit(const void *const hw, bool value)
+{
+ uint16_t tmp;
+ AC_CRITICAL_SECTION_ENTER();
+ tmp = ((Ac *)hw)->EVCTRL.reg;
+ tmp &= ~AC_EVCTRL_WINEO0;
+ tmp |= value << AC_EVCTRL_WINEO0_Pos;
+ ((Ac *)hw)->EVCTRL.reg = tmp;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_clear_EVCTRL_WINEO0_bit(const void *const hw)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->EVCTRL.reg &= ~AC_EVCTRL_WINEO0;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_toggle_EVCTRL_WINEO0_bit(const void *const hw)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->EVCTRL.reg ^= AC_EVCTRL_WINEO0;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_set_EVCTRL_COMPEI0_bit(const void *const hw)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->EVCTRL.reg |= AC_EVCTRL_COMPEI0;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_ac_get_EVCTRL_COMPEI0_bit(const void *const hw)
+{
+ uint16_t tmp;
+ tmp = ((Ac *)hw)->EVCTRL.reg;
+ tmp = (tmp & AC_EVCTRL_COMPEI0) >> AC_EVCTRL_COMPEI0_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_ac_write_EVCTRL_COMPEI0_bit(const void *const hw, bool value)
+{
+ uint16_t tmp;
+ AC_CRITICAL_SECTION_ENTER();
+ tmp = ((Ac *)hw)->EVCTRL.reg;
+ tmp &= ~AC_EVCTRL_COMPEI0;
+ tmp |= value << AC_EVCTRL_COMPEI0_Pos;
+ ((Ac *)hw)->EVCTRL.reg = tmp;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_clear_EVCTRL_COMPEI0_bit(const void *const hw)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->EVCTRL.reg &= ~AC_EVCTRL_COMPEI0;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_toggle_EVCTRL_COMPEI0_bit(const void *const hw)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->EVCTRL.reg ^= AC_EVCTRL_COMPEI0;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_set_EVCTRL_COMPEI1_bit(const void *const hw)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->EVCTRL.reg |= AC_EVCTRL_COMPEI1;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_ac_get_EVCTRL_COMPEI1_bit(const void *const hw)
+{
+ uint16_t tmp;
+ tmp = ((Ac *)hw)->EVCTRL.reg;
+ tmp = (tmp & AC_EVCTRL_COMPEI1) >> AC_EVCTRL_COMPEI1_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_ac_write_EVCTRL_COMPEI1_bit(const void *const hw, bool value)
+{
+ uint16_t tmp;
+ AC_CRITICAL_SECTION_ENTER();
+ tmp = ((Ac *)hw)->EVCTRL.reg;
+ tmp &= ~AC_EVCTRL_COMPEI1;
+ tmp |= value << AC_EVCTRL_COMPEI1_Pos;
+ ((Ac *)hw)->EVCTRL.reg = tmp;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_clear_EVCTRL_COMPEI1_bit(const void *const hw)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->EVCTRL.reg &= ~AC_EVCTRL_COMPEI1;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_toggle_EVCTRL_COMPEI1_bit(const void *const hw)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->EVCTRL.reg ^= AC_EVCTRL_COMPEI1;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_set_EVCTRL_INVEI0_bit(const void *const hw)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->EVCTRL.reg |= AC_EVCTRL_INVEI0;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_ac_get_EVCTRL_INVEI0_bit(const void *const hw)
+{
+ uint16_t tmp;
+ tmp = ((Ac *)hw)->EVCTRL.reg;
+ tmp = (tmp & AC_EVCTRL_INVEI0) >> AC_EVCTRL_INVEI0_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_ac_write_EVCTRL_INVEI0_bit(const void *const hw, bool value)
+{
+ uint16_t tmp;
+ AC_CRITICAL_SECTION_ENTER();
+ tmp = ((Ac *)hw)->EVCTRL.reg;
+ tmp &= ~AC_EVCTRL_INVEI0;
+ tmp |= value << AC_EVCTRL_INVEI0_Pos;
+ ((Ac *)hw)->EVCTRL.reg = tmp;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_clear_EVCTRL_INVEI0_bit(const void *const hw)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->EVCTRL.reg &= ~AC_EVCTRL_INVEI0;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_toggle_EVCTRL_INVEI0_bit(const void *const hw)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->EVCTRL.reg ^= AC_EVCTRL_INVEI0;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_set_EVCTRL_INVEI1_bit(const void *const hw)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->EVCTRL.reg |= AC_EVCTRL_INVEI1;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_ac_get_EVCTRL_INVEI1_bit(const void *const hw)
+{
+ uint16_t tmp;
+ tmp = ((Ac *)hw)->EVCTRL.reg;
+ tmp = (tmp & AC_EVCTRL_INVEI1) >> AC_EVCTRL_INVEI1_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_ac_write_EVCTRL_INVEI1_bit(const void *const hw, bool value)
+{
+ uint16_t tmp;
+ AC_CRITICAL_SECTION_ENTER();
+ tmp = ((Ac *)hw)->EVCTRL.reg;
+ tmp &= ~AC_EVCTRL_INVEI1;
+ tmp |= value << AC_EVCTRL_INVEI1_Pos;
+ ((Ac *)hw)->EVCTRL.reg = tmp;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_clear_EVCTRL_INVEI1_bit(const void *const hw)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->EVCTRL.reg &= ~AC_EVCTRL_INVEI1;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_toggle_EVCTRL_INVEI1_bit(const void *const hw)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->EVCTRL.reg ^= AC_EVCTRL_INVEI1;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_set_EVCTRL_reg(const void *const hw, hri_ac_evctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->EVCTRL.reg |= mask;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_ac_evctrl_reg_t hri_ac_get_EVCTRL_reg(const void *const hw, hri_ac_evctrl_reg_t mask)
+{
+ uint16_t tmp;
+ tmp = ((Ac *)hw)->EVCTRL.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline void hri_ac_write_EVCTRL_reg(const void *const hw, hri_ac_evctrl_reg_t data)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->EVCTRL.reg = data;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_clear_EVCTRL_reg(const void *const hw, hri_ac_evctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->EVCTRL.reg &= ~mask;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_toggle_EVCTRL_reg(const void *const hw, hri_ac_evctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->EVCTRL.reg ^= mask;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_ac_evctrl_reg_t hri_ac_read_EVCTRL_reg(const void *const hw)
+{
+ return ((Ac *)hw)->EVCTRL.reg;
+}
+
+static inline void hri_ac_set_DBGCTRL_DBGRUN_bit(const void *const hw)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->DBGCTRL.reg |= AC_DBGCTRL_DBGRUN;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_ac_get_DBGCTRL_DBGRUN_bit(const void *const hw)
+{
+ uint8_t tmp;
+ tmp = ((Ac *)hw)->DBGCTRL.reg;
+ tmp = (tmp & AC_DBGCTRL_DBGRUN) >> AC_DBGCTRL_DBGRUN_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_ac_write_DBGCTRL_DBGRUN_bit(const void *const hw, bool value)
+{
+ uint8_t tmp;
+ AC_CRITICAL_SECTION_ENTER();
+ tmp = ((Ac *)hw)->DBGCTRL.reg;
+ tmp &= ~AC_DBGCTRL_DBGRUN;
+ tmp |= value << AC_DBGCTRL_DBGRUN_Pos;
+ ((Ac *)hw)->DBGCTRL.reg = tmp;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_clear_DBGCTRL_DBGRUN_bit(const void *const hw)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->DBGCTRL.reg &= ~AC_DBGCTRL_DBGRUN;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_toggle_DBGCTRL_DBGRUN_bit(const void *const hw)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->DBGCTRL.reg ^= AC_DBGCTRL_DBGRUN;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_set_DBGCTRL_reg(const void *const hw, hri_ac_dbgctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->DBGCTRL.reg |= mask;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_ac_dbgctrl_reg_t hri_ac_get_DBGCTRL_reg(const void *const hw, hri_ac_dbgctrl_reg_t mask)
+{
+ uint8_t tmp;
+ tmp = ((Ac *)hw)->DBGCTRL.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline void hri_ac_write_DBGCTRL_reg(const void *const hw, hri_ac_dbgctrl_reg_t data)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->DBGCTRL.reg = data;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_clear_DBGCTRL_reg(const void *const hw, hri_ac_dbgctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->DBGCTRL.reg &= ~mask;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_toggle_DBGCTRL_reg(const void *const hw, hri_ac_dbgctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->DBGCTRL.reg ^= mask;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_ac_dbgctrl_reg_t hri_ac_read_DBGCTRL_reg(const void *const hw)
+{
+ return ((Ac *)hw)->DBGCTRL.reg;
+}
+
+static inline void hri_ac_set_WINCTRL_WEN0_bit(const void *const hw)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->WINCTRL.reg |= AC_WINCTRL_WEN0;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_ac_get_WINCTRL_WEN0_bit(const void *const hw)
+{
+ uint8_t tmp;
+ tmp = ((Ac *)hw)->WINCTRL.reg;
+ tmp = (tmp & AC_WINCTRL_WEN0) >> AC_WINCTRL_WEN0_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_ac_write_WINCTRL_WEN0_bit(const void *const hw, bool value)
+{
+ uint8_t tmp;
+ AC_CRITICAL_SECTION_ENTER();
+ tmp = ((Ac *)hw)->WINCTRL.reg;
+ tmp &= ~AC_WINCTRL_WEN0;
+ tmp |= value << AC_WINCTRL_WEN0_Pos;
+ ((Ac *)hw)->WINCTRL.reg = tmp;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_clear_WINCTRL_WEN0_bit(const void *const hw)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->WINCTRL.reg &= ~AC_WINCTRL_WEN0;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_toggle_WINCTRL_WEN0_bit(const void *const hw)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->WINCTRL.reg ^= AC_WINCTRL_WEN0;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_set_WINCTRL_WINTSEL0_bf(const void *const hw, hri_ac_winctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->WINCTRL.reg |= AC_WINCTRL_WINTSEL0(mask);
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_ac_winctrl_reg_t hri_ac_get_WINCTRL_WINTSEL0_bf(const void *const hw, hri_ac_winctrl_reg_t mask)
+{
+ uint8_t tmp;
+ tmp = ((Ac *)hw)->WINCTRL.reg;
+ tmp = (tmp & AC_WINCTRL_WINTSEL0(mask)) >> AC_WINCTRL_WINTSEL0_Pos;
+ return tmp;
+}
+
+static inline void hri_ac_write_WINCTRL_WINTSEL0_bf(const void *const hw, hri_ac_winctrl_reg_t data)
+{
+ uint8_t tmp;
+ AC_CRITICAL_SECTION_ENTER();
+ tmp = ((Ac *)hw)->WINCTRL.reg;
+ tmp &= ~AC_WINCTRL_WINTSEL0_Msk;
+ tmp |= AC_WINCTRL_WINTSEL0(data);
+ ((Ac *)hw)->WINCTRL.reg = tmp;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_clear_WINCTRL_WINTSEL0_bf(const void *const hw, hri_ac_winctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->WINCTRL.reg &= ~AC_WINCTRL_WINTSEL0(mask);
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_toggle_WINCTRL_WINTSEL0_bf(const void *const hw, hri_ac_winctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->WINCTRL.reg ^= AC_WINCTRL_WINTSEL0(mask);
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_ac_winctrl_reg_t hri_ac_read_WINCTRL_WINTSEL0_bf(const void *const hw)
+{
+ uint8_t tmp;
+ tmp = ((Ac *)hw)->WINCTRL.reg;
+ tmp = (tmp & AC_WINCTRL_WINTSEL0_Msk) >> AC_WINCTRL_WINTSEL0_Pos;
+ return tmp;
+}
+
+static inline void hri_ac_set_WINCTRL_reg(const void *const hw, hri_ac_winctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->WINCTRL.reg |= mask;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_ac_winctrl_reg_t hri_ac_get_WINCTRL_reg(const void *const hw, hri_ac_winctrl_reg_t mask)
+{
+ uint8_t tmp;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ tmp = ((Ac *)hw)->WINCTRL.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline void hri_ac_write_WINCTRL_reg(const void *const hw, hri_ac_winctrl_reg_t data)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->WINCTRL.reg = data;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_clear_WINCTRL_reg(const void *const hw, hri_ac_winctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->WINCTRL.reg &= ~mask;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_toggle_WINCTRL_reg(const void *const hw, hri_ac_winctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->WINCTRL.reg ^= mask;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_ac_winctrl_reg_t hri_ac_read_WINCTRL_reg(const void *const hw)
+{
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ return ((Ac *)hw)->WINCTRL.reg;
+}
+
+static inline void hri_ac_set_SCALER_VALUE_bf(const void *const hw, uint8_t index, hri_ac_scaler_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->SCALER[index].reg |= AC_SCALER_VALUE(mask);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_ac_scaler_reg_t hri_ac_get_SCALER_VALUE_bf(const void *const hw, uint8_t index,
+ hri_ac_scaler_reg_t mask)
+{
+ uint8_t tmp;
+ tmp = ((Ac *)hw)->SCALER[index].reg;
+ tmp = (tmp & AC_SCALER_VALUE(mask)) >> AC_SCALER_VALUE_Pos;
+ return tmp;
+}
+
+static inline void hri_ac_write_SCALER_VALUE_bf(const void *const hw, uint8_t index, hri_ac_scaler_reg_t data)
+{
+ uint8_t tmp;
+ AC_CRITICAL_SECTION_ENTER();
+ tmp = ((Ac *)hw)->SCALER[index].reg;
+ tmp &= ~AC_SCALER_VALUE_Msk;
+ tmp |= AC_SCALER_VALUE(data);
+ ((Ac *)hw)->SCALER[index].reg = tmp;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_clear_SCALER_VALUE_bf(const void *const hw, uint8_t index, hri_ac_scaler_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->SCALER[index].reg &= ~AC_SCALER_VALUE(mask);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_toggle_SCALER_VALUE_bf(const void *const hw, uint8_t index, hri_ac_scaler_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->SCALER[index].reg ^= AC_SCALER_VALUE(mask);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_ac_scaler_reg_t hri_ac_read_SCALER_VALUE_bf(const void *const hw, uint8_t index)
+{
+ uint8_t tmp;
+ tmp = ((Ac *)hw)->SCALER[index].reg;
+ tmp = (tmp & AC_SCALER_VALUE_Msk) >> AC_SCALER_VALUE_Pos;
+ return tmp;
+}
+
+static inline void hri_ac_set_SCALER_reg(const void *const hw, uint8_t index, hri_ac_scaler_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->SCALER[index].reg |= mask;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_ac_scaler_reg_t hri_ac_get_SCALER_reg(const void *const hw, uint8_t index, hri_ac_scaler_reg_t mask)
+{
+ uint8_t tmp;
+ tmp = ((Ac *)hw)->SCALER[index].reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline void hri_ac_write_SCALER_reg(const void *const hw, uint8_t index, hri_ac_scaler_reg_t data)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->SCALER[index].reg = data;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_clear_SCALER_reg(const void *const hw, uint8_t index, hri_ac_scaler_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->SCALER[index].reg &= ~mask;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_toggle_SCALER_reg(const void *const hw, uint8_t index, hri_ac_scaler_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->SCALER[index].reg ^= mask;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_ac_scaler_reg_t hri_ac_read_SCALER_reg(const void *const hw, uint8_t index)
+{
+ return ((Ac *)hw)->SCALER[index].reg;
+}
+
+static inline void hri_ac_set_COMPCTRL_ENABLE_bit(const void *const hw, uint8_t index)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg |= AC_COMPCTRL_ENABLE;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_ENABLE);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_ac_get_COMPCTRL_ENABLE_bit(const void *const hw, uint8_t index)
+{
+ uint32_t tmp;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_ENABLE);
+ tmp = ((Ac *)hw)->COMPCTRL[index].reg;
+ tmp = (tmp & AC_COMPCTRL_ENABLE) >> AC_COMPCTRL_ENABLE_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_ac_write_COMPCTRL_ENABLE_bit(const void *const hw, uint8_t index, bool value)
+{
+ uint32_t tmp;
+ AC_CRITICAL_SECTION_ENTER();
+ tmp = ((Ac *)hw)->COMPCTRL[index].reg;
+ tmp &= ~AC_COMPCTRL_ENABLE;
+ tmp |= value << AC_COMPCTRL_ENABLE_Pos;
+ ((Ac *)hw)->COMPCTRL[index].reg = tmp;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_ENABLE);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_clear_COMPCTRL_ENABLE_bit(const void *const hw, uint8_t index)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg &= ~AC_COMPCTRL_ENABLE;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_ENABLE);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_toggle_COMPCTRL_ENABLE_bit(const void *const hw, uint8_t index)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg ^= AC_COMPCTRL_ENABLE;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_ENABLE);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_set_COMPCTRL_SINGLE_bit(const void *const hw, uint8_t index)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg |= AC_COMPCTRL_SINGLE;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_ac_get_COMPCTRL_SINGLE_bit(const void *const hw, uint8_t index)
+{
+ uint32_t tmp;
+ tmp = ((Ac *)hw)->COMPCTRL[index].reg;
+ tmp = (tmp & AC_COMPCTRL_SINGLE) >> AC_COMPCTRL_SINGLE_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_ac_write_COMPCTRL_SINGLE_bit(const void *const hw, uint8_t index, bool value)
+{
+ uint32_t tmp;
+ AC_CRITICAL_SECTION_ENTER();
+ tmp = ((Ac *)hw)->COMPCTRL[index].reg;
+ tmp &= ~AC_COMPCTRL_SINGLE;
+ tmp |= value << AC_COMPCTRL_SINGLE_Pos;
+ ((Ac *)hw)->COMPCTRL[index].reg = tmp;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_clear_COMPCTRL_SINGLE_bit(const void *const hw, uint8_t index)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg &= ~AC_COMPCTRL_SINGLE;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_toggle_COMPCTRL_SINGLE_bit(const void *const hw, uint8_t index)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg ^= AC_COMPCTRL_SINGLE;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_set_COMPCTRL_RUNSTDBY_bit(const void *const hw, uint8_t index)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg |= AC_COMPCTRL_RUNSTDBY;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_ac_get_COMPCTRL_RUNSTDBY_bit(const void *const hw, uint8_t index)
+{
+ uint32_t tmp;
+ tmp = ((Ac *)hw)->COMPCTRL[index].reg;
+ tmp = (tmp & AC_COMPCTRL_RUNSTDBY) >> AC_COMPCTRL_RUNSTDBY_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_ac_write_COMPCTRL_RUNSTDBY_bit(const void *const hw, uint8_t index, bool value)
+{
+ uint32_t tmp;
+ AC_CRITICAL_SECTION_ENTER();
+ tmp = ((Ac *)hw)->COMPCTRL[index].reg;
+ tmp &= ~AC_COMPCTRL_RUNSTDBY;
+ tmp |= value << AC_COMPCTRL_RUNSTDBY_Pos;
+ ((Ac *)hw)->COMPCTRL[index].reg = tmp;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_clear_COMPCTRL_RUNSTDBY_bit(const void *const hw, uint8_t index)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg &= ~AC_COMPCTRL_RUNSTDBY;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_toggle_COMPCTRL_RUNSTDBY_bit(const void *const hw, uint8_t index)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg ^= AC_COMPCTRL_RUNSTDBY;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_set_COMPCTRL_SWAP_bit(const void *const hw, uint8_t index)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg |= AC_COMPCTRL_SWAP;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_ac_get_COMPCTRL_SWAP_bit(const void *const hw, uint8_t index)
+{
+ uint32_t tmp;
+ tmp = ((Ac *)hw)->COMPCTRL[index].reg;
+ tmp = (tmp & AC_COMPCTRL_SWAP) >> AC_COMPCTRL_SWAP_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_ac_write_COMPCTRL_SWAP_bit(const void *const hw, uint8_t index, bool value)
+{
+ uint32_t tmp;
+ AC_CRITICAL_SECTION_ENTER();
+ tmp = ((Ac *)hw)->COMPCTRL[index].reg;
+ tmp &= ~AC_COMPCTRL_SWAP;
+ tmp |= value << AC_COMPCTRL_SWAP_Pos;
+ ((Ac *)hw)->COMPCTRL[index].reg = tmp;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_clear_COMPCTRL_SWAP_bit(const void *const hw, uint8_t index)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg &= ~AC_COMPCTRL_SWAP;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_toggle_COMPCTRL_SWAP_bit(const void *const hw, uint8_t index)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg ^= AC_COMPCTRL_SWAP;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_set_COMPCTRL_HYSTEN_bit(const void *const hw, uint8_t index)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg |= AC_COMPCTRL_HYSTEN;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_ac_get_COMPCTRL_HYSTEN_bit(const void *const hw, uint8_t index)
+{
+ uint32_t tmp;
+ tmp = ((Ac *)hw)->COMPCTRL[index].reg;
+ tmp = (tmp & AC_COMPCTRL_HYSTEN) >> AC_COMPCTRL_HYSTEN_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_ac_write_COMPCTRL_HYSTEN_bit(const void *const hw, uint8_t index, bool value)
+{
+ uint32_t tmp;
+ AC_CRITICAL_SECTION_ENTER();
+ tmp = ((Ac *)hw)->COMPCTRL[index].reg;
+ tmp &= ~AC_COMPCTRL_HYSTEN;
+ tmp |= value << AC_COMPCTRL_HYSTEN_Pos;
+ ((Ac *)hw)->COMPCTRL[index].reg = tmp;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_clear_COMPCTRL_HYSTEN_bit(const void *const hw, uint8_t index)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg &= ~AC_COMPCTRL_HYSTEN;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_toggle_COMPCTRL_HYSTEN_bit(const void *const hw, uint8_t index)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg ^= AC_COMPCTRL_HYSTEN;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_set_COMPCTRL_INTSEL_bf(const void *const hw, uint8_t index, hri_ac_compctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg |= AC_COMPCTRL_INTSEL(mask);
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_ac_compctrl_reg_t hri_ac_get_COMPCTRL_INTSEL_bf(const void *const hw, uint8_t index,
+ hri_ac_compctrl_reg_t mask)
+{
+ uint32_t tmp;
+ tmp = ((Ac *)hw)->COMPCTRL[index].reg;
+ tmp = (tmp & AC_COMPCTRL_INTSEL(mask)) >> AC_COMPCTRL_INTSEL_Pos;
+ return tmp;
+}
+
+static inline void hri_ac_write_COMPCTRL_INTSEL_bf(const void *const hw, uint8_t index, hri_ac_compctrl_reg_t data)
+{
+ uint32_t tmp;
+ AC_CRITICAL_SECTION_ENTER();
+ tmp = ((Ac *)hw)->COMPCTRL[index].reg;
+ tmp &= ~AC_COMPCTRL_INTSEL_Msk;
+ tmp |= AC_COMPCTRL_INTSEL(data);
+ ((Ac *)hw)->COMPCTRL[index].reg = tmp;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_clear_COMPCTRL_INTSEL_bf(const void *const hw, uint8_t index, hri_ac_compctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg &= ~AC_COMPCTRL_INTSEL(mask);
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_toggle_COMPCTRL_INTSEL_bf(const void *const hw, uint8_t index, hri_ac_compctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg ^= AC_COMPCTRL_INTSEL(mask);
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_ac_compctrl_reg_t hri_ac_read_COMPCTRL_INTSEL_bf(const void *const hw, uint8_t index)
+{
+ uint32_t tmp;
+ tmp = ((Ac *)hw)->COMPCTRL[index].reg;
+ tmp = (tmp & AC_COMPCTRL_INTSEL_Msk) >> AC_COMPCTRL_INTSEL_Pos;
+ return tmp;
+}
+
+static inline void hri_ac_set_COMPCTRL_MUXNEG_bf(const void *const hw, uint8_t index, hri_ac_compctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg |= AC_COMPCTRL_MUXNEG(mask);
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_ac_compctrl_reg_t hri_ac_get_COMPCTRL_MUXNEG_bf(const void *const hw, uint8_t index,
+ hri_ac_compctrl_reg_t mask)
+{
+ uint32_t tmp;
+ tmp = ((Ac *)hw)->COMPCTRL[index].reg;
+ tmp = (tmp & AC_COMPCTRL_MUXNEG(mask)) >> AC_COMPCTRL_MUXNEG_Pos;
+ return tmp;
+}
+
+static inline void hri_ac_write_COMPCTRL_MUXNEG_bf(const void *const hw, uint8_t index, hri_ac_compctrl_reg_t data)
+{
+ uint32_t tmp;
+ AC_CRITICAL_SECTION_ENTER();
+ tmp = ((Ac *)hw)->COMPCTRL[index].reg;
+ tmp &= ~AC_COMPCTRL_MUXNEG_Msk;
+ tmp |= AC_COMPCTRL_MUXNEG(data);
+ ((Ac *)hw)->COMPCTRL[index].reg = tmp;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_clear_COMPCTRL_MUXNEG_bf(const void *const hw, uint8_t index, hri_ac_compctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg &= ~AC_COMPCTRL_MUXNEG(mask);
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_toggle_COMPCTRL_MUXNEG_bf(const void *const hw, uint8_t index, hri_ac_compctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg ^= AC_COMPCTRL_MUXNEG(mask);
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_ac_compctrl_reg_t hri_ac_read_COMPCTRL_MUXNEG_bf(const void *const hw, uint8_t index)
+{
+ uint32_t tmp;
+ tmp = ((Ac *)hw)->COMPCTRL[index].reg;
+ tmp = (tmp & AC_COMPCTRL_MUXNEG_Msk) >> AC_COMPCTRL_MUXNEG_Pos;
+ return tmp;
+}
+
+static inline void hri_ac_set_COMPCTRL_MUXPOS_bf(const void *const hw, uint8_t index, hri_ac_compctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg |= AC_COMPCTRL_MUXPOS(mask);
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_ac_compctrl_reg_t hri_ac_get_COMPCTRL_MUXPOS_bf(const void *const hw, uint8_t index,
+ hri_ac_compctrl_reg_t mask)
+{
+ uint32_t tmp;
+ tmp = ((Ac *)hw)->COMPCTRL[index].reg;
+ tmp = (tmp & AC_COMPCTRL_MUXPOS(mask)) >> AC_COMPCTRL_MUXPOS_Pos;
+ return tmp;
+}
+
+static inline void hri_ac_write_COMPCTRL_MUXPOS_bf(const void *const hw, uint8_t index, hri_ac_compctrl_reg_t data)
+{
+ uint32_t tmp;
+ AC_CRITICAL_SECTION_ENTER();
+ tmp = ((Ac *)hw)->COMPCTRL[index].reg;
+ tmp &= ~AC_COMPCTRL_MUXPOS_Msk;
+ tmp |= AC_COMPCTRL_MUXPOS(data);
+ ((Ac *)hw)->COMPCTRL[index].reg = tmp;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_clear_COMPCTRL_MUXPOS_bf(const void *const hw, uint8_t index, hri_ac_compctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg &= ~AC_COMPCTRL_MUXPOS(mask);
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_toggle_COMPCTRL_MUXPOS_bf(const void *const hw, uint8_t index, hri_ac_compctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg ^= AC_COMPCTRL_MUXPOS(mask);
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_ac_compctrl_reg_t hri_ac_read_COMPCTRL_MUXPOS_bf(const void *const hw, uint8_t index)
+{
+ uint32_t tmp;
+ tmp = ((Ac *)hw)->COMPCTRL[index].reg;
+ tmp = (tmp & AC_COMPCTRL_MUXPOS_Msk) >> AC_COMPCTRL_MUXPOS_Pos;
+ return tmp;
+}
+
+static inline void hri_ac_set_COMPCTRL_SPEED_bf(const void *const hw, uint8_t index, hri_ac_compctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg |= AC_COMPCTRL_SPEED(mask);
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_ac_compctrl_reg_t hri_ac_get_COMPCTRL_SPEED_bf(const void *const hw, uint8_t index,
+ hri_ac_compctrl_reg_t mask)
+{
+ uint32_t tmp;
+ tmp = ((Ac *)hw)->COMPCTRL[index].reg;
+ tmp = (tmp & AC_COMPCTRL_SPEED(mask)) >> AC_COMPCTRL_SPEED_Pos;
+ return tmp;
+}
+
+static inline void hri_ac_write_COMPCTRL_SPEED_bf(const void *const hw, uint8_t index, hri_ac_compctrl_reg_t data)
+{
+ uint32_t tmp;
+ AC_CRITICAL_SECTION_ENTER();
+ tmp = ((Ac *)hw)->COMPCTRL[index].reg;
+ tmp &= ~AC_COMPCTRL_SPEED_Msk;
+ tmp |= AC_COMPCTRL_SPEED(data);
+ ((Ac *)hw)->COMPCTRL[index].reg = tmp;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_clear_COMPCTRL_SPEED_bf(const void *const hw, uint8_t index, hri_ac_compctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg &= ~AC_COMPCTRL_SPEED(mask);
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_toggle_COMPCTRL_SPEED_bf(const void *const hw, uint8_t index, hri_ac_compctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg ^= AC_COMPCTRL_SPEED(mask);
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_ac_compctrl_reg_t hri_ac_read_COMPCTRL_SPEED_bf(const void *const hw, uint8_t index)
+{
+ uint32_t tmp;
+ tmp = ((Ac *)hw)->COMPCTRL[index].reg;
+ tmp = (tmp & AC_COMPCTRL_SPEED_Msk) >> AC_COMPCTRL_SPEED_Pos;
+ return tmp;
+}
+
+static inline void hri_ac_set_COMPCTRL_HYST_bf(const void *const hw, uint8_t index, hri_ac_compctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg |= AC_COMPCTRL_HYST(mask);
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_ac_compctrl_reg_t hri_ac_get_COMPCTRL_HYST_bf(const void *const hw, uint8_t index,
+ hri_ac_compctrl_reg_t mask)
+{
+ uint32_t tmp;
+ tmp = ((Ac *)hw)->COMPCTRL[index].reg;
+ tmp = (tmp & AC_COMPCTRL_HYST(mask)) >> AC_COMPCTRL_HYST_Pos;
+ return tmp;
+}
+
+static inline void hri_ac_write_COMPCTRL_HYST_bf(const void *const hw, uint8_t index, hri_ac_compctrl_reg_t data)
+{
+ uint32_t tmp;
+ AC_CRITICAL_SECTION_ENTER();
+ tmp = ((Ac *)hw)->COMPCTRL[index].reg;
+ tmp &= ~AC_COMPCTRL_HYST_Msk;
+ tmp |= AC_COMPCTRL_HYST(data);
+ ((Ac *)hw)->COMPCTRL[index].reg = tmp;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_clear_COMPCTRL_HYST_bf(const void *const hw, uint8_t index, hri_ac_compctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg &= ~AC_COMPCTRL_HYST(mask);
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_toggle_COMPCTRL_HYST_bf(const void *const hw, uint8_t index, hri_ac_compctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg ^= AC_COMPCTRL_HYST(mask);
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_ac_compctrl_reg_t hri_ac_read_COMPCTRL_HYST_bf(const void *const hw, uint8_t index)
+{
+ uint32_t tmp;
+ tmp = ((Ac *)hw)->COMPCTRL[index].reg;
+ tmp = (tmp & AC_COMPCTRL_HYST_Msk) >> AC_COMPCTRL_HYST_Pos;
+ return tmp;
+}
+
+static inline void hri_ac_set_COMPCTRL_FLEN_bf(const void *const hw, uint8_t index, hri_ac_compctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg |= AC_COMPCTRL_FLEN(mask);
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_ac_compctrl_reg_t hri_ac_get_COMPCTRL_FLEN_bf(const void *const hw, uint8_t index,
+ hri_ac_compctrl_reg_t mask)
+{
+ uint32_t tmp;
+ tmp = ((Ac *)hw)->COMPCTRL[index].reg;
+ tmp = (tmp & AC_COMPCTRL_FLEN(mask)) >> AC_COMPCTRL_FLEN_Pos;
+ return tmp;
+}
+
+static inline void hri_ac_write_COMPCTRL_FLEN_bf(const void *const hw, uint8_t index, hri_ac_compctrl_reg_t data)
+{
+ uint32_t tmp;
+ AC_CRITICAL_SECTION_ENTER();
+ tmp = ((Ac *)hw)->COMPCTRL[index].reg;
+ tmp &= ~AC_COMPCTRL_FLEN_Msk;
+ tmp |= AC_COMPCTRL_FLEN(data);
+ ((Ac *)hw)->COMPCTRL[index].reg = tmp;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_clear_COMPCTRL_FLEN_bf(const void *const hw, uint8_t index, hri_ac_compctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg &= ~AC_COMPCTRL_FLEN(mask);
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_toggle_COMPCTRL_FLEN_bf(const void *const hw, uint8_t index, hri_ac_compctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg ^= AC_COMPCTRL_FLEN(mask);
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_ac_compctrl_reg_t hri_ac_read_COMPCTRL_FLEN_bf(const void *const hw, uint8_t index)
+{
+ uint32_t tmp;
+ tmp = ((Ac *)hw)->COMPCTRL[index].reg;
+ tmp = (tmp & AC_COMPCTRL_FLEN_Msk) >> AC_COMPCTRL_FLEN_Pos;
+ return tmp;
+}
+
+static inline void hri_ac_set_COMPCTRL_OUT_bf(const void *const hw, uint8_t index, hri_ac_compctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg |= AC_COMPCTRL_OUT(mask);
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_ac_compctrl_reg_t hri_ac_get_COMPCTRL_OUT_bf(const void *const hw, uint8_t index,
+ hri_ac_compctrl_reg_t mask)
+{
+ uint32_t tmp;
+ tmp = ((Ac *)hw)->COMPCTRL[index].reg;
+ tmp = (tmp & AC_COMPCTRL_OUT(mask)) >> AC_COMPCTRL_OUT_Pos;
+ return tmp;
+}
+
+static inline void hri_ac_write_COMPCTRL_OUT_bf(const void *const hw, uint8_t index, hri_ac_compctrl_reg_t data)
+{
+ uint32_t tmp;
+ AC_CRITICAL_SECTION_ENTER();
+ tmp = ((Ac *)hw)->COMPCTRL[index].reg;
+ tmp &= ~AC_COMPCTRL_OUT_Msk;
+ tmp |= AC_COMPCTRL_OUT(data);
+ ((Ac *)hw)->COMPCTRL[index].reg = tmp;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_clear_COMPCTRL_OUT_bf(const void *const hw, uint8_t index, hri_ac_compctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg &= ~AC_COMPCTRL_OUT(mask);
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_toggle_COMPCTRL_OUT_bf(const void *const hw, uint8_t index, hri_ac_compctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg ^= AC_COMPCTRL_OUT(mask);
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_MASK);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_ac_compctrl_reg_t hri_ac_read_COMPCTRL_OUT_bf(const void *const hw, uint8_t index)
+{
+ uint32_t tmp;
+ tmp = ((Ac *)hw)->COMPCTRL[index].reg;
+ tmp = (tmp & AC_COMPCTRL_OUT_Msk) >> AC_COMPCTRL_OUT_Pos;
+ return tmp;
+}
+
+static inline void hri_ac_set_COMPCTRL_reg(const void *const hw, uint8_t index, hri_ac_compctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg |= mask;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_ENABLE);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_ac_compctrl_reg_t hri_ac_get_COMPCTRL_reg(const void *const hw, uint8_t index,
+ hri_ac_compctrl_reg_t mask)
+{
+ uint32_t tmp;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_ENABLE);
+ tmp = ((Ac *)hw)->COMPCTRL[index].reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline void hri_ac_write_COMPCTRL_reg(const void *const hw, uint8_t index, hri_ac_compctrl_reg_t data)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg = data;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_ENABLE);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_clear_COMPCTRL_reg(const void *const hw, uint8_t index, hri_ac_compctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg &= ~mask;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_ENABLE);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_toggle_COMPCTRL_reg(const void *const hw, uint8_t index, hri_ac_compctrl_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->COMPCTRL[index].reg ^= mask;
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_ENABLE);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_ac_compctrl_reg_t hri_ac_read_COMPCTRL_reg(const void *const hw, uint8_t index)
+{
+ hri_ac_wait_for_sync(hw, AC_SYNCBUSY_ENABLE);
+ return ((Ac *)hw)->COMPCTRL[index].reg;
+}
+
+static inline void hri_ac_set_CALIB_BIAS0_bf(const void *const hw, hri_ac_calib_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->CALIB.reg |= AC_CALIB_BIAS0(mask);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_ac_calib_reg_t hri_ac_get_CALIB_BIAS0_bf(const void *const hw, hri_ac_calib_reg_t mask)
+{
+ uint16_t tmp;
+ tmp = ((Ac *)hw)->CALIB.reg;
+ tmp = (tmp & AC_CALIB_BIAS0(mask)) >> AC_CALIB_BIAS0_Pos;
+ return tmp;
+}
+
+static inline void hri_ac_write_CALIB_BIAS0_bf(const void *const hw, hri_ac_calib_reg_t data)
+{
+ uint16_t tmp;
+ AC_CRITICAL_SECTION_ENTER();
+ tmp = ((Ac *)hw)->CALIB.reg;
+ tmp &= ~AC_CALIB_BIAS0_Msk;
+ tmp |= AC_CALIB_BIAS0(data);
+ ((Ac *)hw)->CALIB.reg = tmp;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_clear_CALIB_BIAS0_bf(const void *const hw, hri_ac_calib_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->CALIB.reg &= ~AC_CALIB_BIAS0(mask);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_toggle_CALIB_BIAS0_bf(const void *const hw, hri_ac_calib_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->CALIB.reg ^= AC_CALIB_BIAS0(mask);
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_ac_calib_reg_t hri_ac_read_CALIB_BIAS0_bf(const void *const hw)
+{
+ uint16_t tmp;
+ tmp = ((Ac *)hw)->CALIB.reg;
+ tmp = (tmp & AC_CALIB_BIAS0_Msk) >> AC_CALIB_BIAS0_Pos;
+ return tmp;
+}
+
+static inline void hri_ac_set_CALIB_reg(const void *const hw, hri_ac_calib_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->CALIB.reg |= mask;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_ac_calib_reg_t hri_ac_get_CALIB_reg(const void *const hw, hri_ac_calib_reg_t mask)
+{
+ uint16_t tmp;
+ tmp = ((Ac *)hw)->CALIB.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline void hri_ac_write_CALIB_reg(const void *const hw, hri_ac_calib_reg_t data)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->CALIB.reg = data;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_clear_CALIB_reg(const void *const hw, hri_ac_calib_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->CALIB.reg &= ~mask;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_ac_toggle_CALIB_reg(const void *const hw, hri_ac_calib_reg_t mask)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->CALIB.reg ^= mask;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_ac_calib_reg_t hri_ac_read_CALIB_reg(const void *const hw)
+{
+ return ((Ac *)hw)->CALIB.reg;
+}
+
+static inline void hri_ac_write_CTRLB_reg(const void *const hw, hri_ac_ctrlb_reg_t data)
+{
+ AC_CRITICAL_SECTION_ENTER();
+ ((Ac *)hw)->CTRLB.reg = data;
+ AC_CRITICAL_SECTION_LEAVE();
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _HRI_AC_E54_H_INCLUDED */
+#endif /* _SAME54_AC_COMPONENT_ */
diff --git a/Examples/AS5048A_test/AS5048A_test/hri/hri_adc_e54.h b/Examples/AS5048A_test/AS5048A_test/hri/hri_adc_e54.h
new file mode 100644
index 0000000..7bb7e6f
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hri/hri_adc_e54.h
@@ -0,0 +1,3663 @@
+/**
+ * \file
+ *
+ * \brief SAM ADC
+ *
+ * Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifdef _SAME54_ADC_COMPONENT_
+#ifndef _HRI_ADC_E54_H_INCLUDED_
+#define _HRI_ADC_E54_H_INCLUDED_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+#include
+
+#if defined(ENABLE_ADC_CRITICAL_SECTIONS)
+#define ADC_CRITICAL_SECTION_ENTER() CRITICAL_SECTION_ENTER()
+#define ADC_CRITICAL_SECTION_LEAVE() CRITICAL_SECTION_LEAVE()
+#else
+#define ADC_CRITICAL_SECTION_ENTER()
+#define ADC_CRITICAL_SECTION_LEAVE()
+#endif
+
+typedef uint16_t hri_adc_calib_reg_t;
+typedef uint16_t hri_adc_ctrla_reg_t;
+typedef uint16_t hri_adc_ctrlb_reg_t;
+typedef uint16_t hri_adc_gaincorr_reg_t;
+typedef uint16_t hri_adc_inputctrl_reg_t;
+typedef uint16_t hri_adc_offsetcorr_reg_t;
+typedef uint16_t hri_adc_ress_reg_t;
+typedef uint16_t hri_adc_result_reg_t;
+typedef uint16_t hri_adc_winlt_reg_t;
+typedef uint16_t hri_adc_winut_reg_t;
+typedef uint32_t hri_adc_dseqctrl_reg_t;
+typedef uint32_t hri_adc_dseqdata_reg_t;
+typedef uint32_t hri_adc_dseqstat_reg_t;
+typedef uint32_t hri_adc_syncbusy_reg_t;
+typedef uint8_t hri_adc_avgctrl_reg_t;
+typedef uint8_t hri_adc_dbgctrl_reg_t;
+typedef uint8_t hri_adc_evctrl_reg_t;
+typedef uint8_t hri_adc_intenset_reg_t;
+typedef uint8_t hri_adc_intflag_reg_t;
+typedef uint8_t hri_adc_refctrl_reg_t;
+typedef uint8_t hri_adc_sampctrl_reg_t;
+typedef uint8_t hri_adc_status_reg_t;
+typedef uint8_t hri_adc_swtrig_reg_t;
+
+static inline void hri_adc_wait_for_sync(const void *const hw, hri_adc_syncbusy_reg_t reg)
+{
+ while (((Adc *)hw)->SYNCBUSY.reg & reg) {
+ };
+}
+
+static inline bool hri_adc_is_syncing(const void *const hw, hri_adc_syncbusy_reg_t reg)
+{
+ return ((Adc *)hw)->SYNCBUSY.reg & reg;
+}
+
+static inline bool hri_adc_get_INTFLAG_RESRDY_bit(const void *const hw)
+{
+ return (((Adc *)hw)->INTFLAG.reg & ADC_INTFLAG_RESRDY) >> ADC_INTFLAG_RESRDY_Pos;
+}
+
+static inline void hri_adc_clear_INTFLAG_RESRDY_bit(const void *const hw)
+{
+ ((Adc *)hw)->INTFLAG.reg = ADC_INTFLAG_RESRDY;
+}
+
+static inline bool hri_adc_get_INTFLAG_OVERRUN_bit(const void *const hw)
+{
+ return (((Adc *)hw)->INTFLAG.reg & ADC_INTFLAG_OVERRUN) >> ADC_INTFLAG_OVERRUN_Pos;
+}
+
+static inline void hri_adc_clear_INTFLAG_OVERRUN_bit(const void *const hw)
+{
+ ((Adc *)hw)->INTFLAG.reg = ADC_INTFLAG_OVERRUN;
+}
+
+static inline bool hri_adc_get_INTFLAG_WINMON_bit(const void *const hw)
+{
+ return (((Adc *)hw)->INTFLAG.reg & ADC_INTFLAG_WINMON) >> ADC_INTFLAG_WINMON_Pos;
+}
+
+static inline void hri_adc_clear_INTFLAG_WINMON_bit(const void *const hw)
+{
+ ((Adc *)hw)->INTFLAG.reg = ADC_INTFLAG_WINMON;
+}
+
+static inline bool hri_adc_get_interrupt_RESRDY_bit(const void *const hw)
+{
+ return (((Adc *)hw)->INTFLAG.reg & ADC_INTFLAG_RESRDY) >> ADC_INTFLAG_RESRDY_Pos;
+}
+
+static inline void hri_adc_clear_interrupt_RESRDY_bit(const void *const hw)
+{
+ ((Adc *)hw)->INTFLAG.reg = ADC_INTFLAG_RESRDY;
+}
+
+static inline bool hri_adc_get_interrupt_OVERRUN_bit(const void *const hw)
+{
+ return (((Adc *)hw)->INTFLAG.reg & ADC_INTFLAG_OVERRUN) >> ADC_INTFLAG_OVERRUN_Pos;
+}
+
+static inline void hri_adc_clear_interrupt_OVERRUN_bit(const void *const hw)
+{
+ ((Adc *)hw)->INTFLAG.reg = ADC_INTFLAG_OVERRUN;
+}
+
+static inline bool hri_adc_get_interrupt_WINMON_bit(const void *const hw)
+{
+ return (((Adc *)hw)->INTFLAG.reg & ADC_INTFLAG_WINMON) >> ADC_INTFLAG_WINMON_Pos;
+}
+
+static inline void hri_adc_clear_interrupt_WINMON_bit(const void *const hw)
+{
+ ((Adc *)hw)->INTFLAG.reg = ADC_INTFLAG_WINMON;
+}
+
+static inline hri_adc_intflag_reg_t hri_adc_get_INTFLAG_reg(const void *const hw, hri_adc_intflag_reg_t mask)
+{
+ uint8_t tmp;
+ tmp = ((Adc *)hw)->INTFLAG.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline hri_adc_intflag_reg_t hri_adc_read_INTFLAG_reg(const void *const hw)
+{
+ return ((Adc *)hw)->INTFLAG.reg;
+}
+
+static inline void hri_adc_clear_INTFLAG_reg(const void *const hw, hri_adc_intflag_reg_t mask)
+{
+ ((Adc *)hw)->INTFLAG.reg = mask;
+}
+
+static inline void hri_adc_set_INTEN_RESRDY_bit(const void *const hw)
+{
+ ((Adc *)hw)->INTENSET.reg = ADC_INTENSET_RESRDY;
+}
+
+static inline bool hri_adc_get_INTEN_RESRDY_bit(const void *const hw)
+{
+ return (((Adc *)hw)->INTENSET.reg & ADC_INTENSET_RESRDY) >> ADC_INTENSET_RESRDY_Pos;
+}
+
+static inline void hri_adc_write_INTEN_RESRDY_bit(const void *const hw, bool value)
+{
+ if (value == 0x0) {
+ ((Adc *)hw)->INTENCLR.reg = ADC_INTENSET_RESRDY;
+ } else {
+ ((Adc *)hw)->INTENSET.reg = ADC_INTENSET_RESRDY;
+ }
+}
+
+static inline void hri_adc_clear_INTEN_RESRDY_bit(const void *const hw)
+{
+ ((Adc *)hw)->INTENCLR.reg = ADC_INTENSET_RESRDY;
+}
+
+static inline void hri_adc_set_INTEN_OVERRUN_bit(const void *const hw)
+{
+ ((Adc *)hw)->INTENSET.reg = ADC_INTENSET_OVERRUN;
+}
+
+static inline bool hri_adc_get_INTEN_OVERRUN_bit(const void *const hw)
+{
+ return (((Adc *)hw)->INTENSET.reg & ADC_INTENSET_OVERRUN) >> ADC_INTENSET_OVERRUN_Pos;
+}
+
+static inline void hri_adc_write_INTEN_OVERRUN_bit(const void *const hw, bool value)
+{
+ if (value == 0x0) {
+ ((Adc *)hw)->INTENCLR.reg = ADC_INTENSET_OVERRUN;
+ } else {
+ ((Adc *)hw)->INTENSET.reg = ADC_INTENSET_OVERRUN;
+ }
+}
+
+static inline void hri_adc_clear_INTEN_OVERRUN_bit(const void *const hw)
+{
+ ((Adc *)hw)->INTENCLR.reg = ADC_INTENSET_OVERRUN;
+}
+
+static inline void hri_adc_set_INTEN_WINMON_bit(const void *const hw)
+{
+ ((Adc *)hw)->INTENSET.reg = ADC_INTENSET_WINMON;
+}
+
+static inline bool hri_adc_get_INTEN_WINMON_bit(const void *const hw)
+{
+ return (((Adc *)hw)->INTENSET.reg & ADC_INTENSET_WINMON) >> ADC_INTENSET_WINMON_Pos;
+}
+
+static inline void hri_adc_write_INTEN_WINMON_bit(const void *const hw, bool value)
+{
+ if (value == 0x0) {
+ ((Adc *)hw)->INTENCLR.reg = ADC_INTENSET_WINMON;
+ } else {
+ ((Adc *)hw)->INTENSET.reg = ADC_INTENSET_WINMON;
+ }
+}
+
+static inline void hri_adc_clear_INTEN_WINMON_bit(const void *const hw)
+{
+ ((Adc *)hw)->INTENCLR.reg = ADC_INTENSET_WINMON;
+}
+
+static inline void hri_adc_set_INTEN_reg(const void *const hw, hri_adc_intenset_reg_t mask)
+{
+ ((Adc *)hw)->INTENSET.reg = mask;
+}
+
+static inline hri_adc_intenset_reg_t hri_adc_get_INTEN_reg(const void *const hw, hri_adc_intenset_reg_t mask)
+{
+ uint8_t tmp;
+ tmp = ((Adc *)hw)->INTENSET.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline hri_adc_intenset_reg_t hri_adc_read_INTEN_reg(const void *const hw)
+{
+ return ((Adc *)hw)->INTENSET.reg;
+}
+
+static inline void hri_adc_write_INTEN_reg(const void *const hw, hri_adc_intenset_reg_t data)
+{
+ ((Adc *)hw)->INTENSET.reg = data;
+ ((Adc *)hw)->INTENCLR.reg = ~data;
+}
+
+static inline void hri_adc_clear_INTEN_reg(const void *const hw, hri_adc_intenset_reg_t mask)
+{
+ ((Adc *)hw)->INTENCLR.reg = mask;
+}
+
+static inline bool hri_adc_get_STATUS_ADCBUSY_bit(const void *const hw)
+{
+ return (((Adc *)hw)->STATUS.reg & ADC_STATUS_ADCBUSY) >> ADC_STATUS_ADCBUSY_Pos;
+}
+
+static inline hri_adc_status_reg_t hri_adc_get_STATUS_WCC_bf(const void *const hw, hri_adc_status_reg_t mask)
+{
+ return (((Adc *)hw)->STATUS.reg & ADC_STATUS_WCC(mask)) >> ADC_STATUS_WCC_Pos;
+}
+
+static inline hri_adc_status_reg_t hri_adc_read_STATUS_WCC_bf(const void *const hw)
+{
+ return (((Adc *)hw)->STATUS.reg & ADC_STATUS_WCC_Msk) >> ADC_STATUS_WCC_Pos;
+}
+
+static inline hri_adc_status_reg_t hri_adc_get_STATUS_reg(const void *const hw, hri_adc_status_reg_t mask)
+{
+ uint8_t tmp;
+ tmp = ((Adc *)hw)->STATUS.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline hri_adc_status_reg_t hri_adc_read_STATUS_reg(const void *const hw)
+{
+ return ((Adc *)hw)->STATUS.reg;
+}
+
+static inline bool hri_adc_get_SYNCBUSY_SWRST_bit(const void *const hw)
+{
+ return (((Adc *)hw)->SYNCBUSY.reg & ADC_SYNCBUSY_SWRST) >> ADC_SYNCBUSY_SWRST_Pos;
+}
+
+static inline bool hri_adc_get_SYNCBUSY_ENABLE_bit(const void *const hw)
+{
+ return (((Adc *)hw)->SYNCBUSY.reg & ADC_SYNCBUSY_ENABLE) >> ADC_SYNCBUSY_ENABLE_Pos;
+}
+
+static inline bool hri_adc_get_SYNCBUSY_INPUTCTRL_bit(const void *const hw)
+{
+ return (((Adc *)hw)->SYNCBUSY.reg & ADC_SYNCBUSY_INPUTCTRL) >> ADC_SYNCBUSY_INPUTCTRL_Pos;
+}
+
+static inline bool hri_adc_get_SYNCBUSY_CTRLB_bit(const void *const hw)
+{
+ return (((Adc *)hw)->SYNCBUSY.reg & ADC_SYNCBUSY_CTRLB) >> ADC_SYNCBUSY_CTRLB_Pos;
+}
+
+static inline bool hri_adc_get_SYNCBUSY_REFCTRL_bit(const void *const hw)
+{
+ return (((Adc *)hw)->SYNCBUSY.reg & ADC_SYNCBUSY_REFCTRL) >> ADC_SYNCBUSY_REFCTRL_Pos;
+}
+
+static inline bool hri_adc_get_SYNCBUSY_AVGCTRL_bit(const void *const hw)
+{
+ return (((Adc *)hw)->SYNCBUSY.reg & ADC_SYNCBUSY_AVGCTRL) >> ADC_SYNCBUSY_AVGCTRL_Pos;
+}
+
+static inline bool hri_adc_get_SYNCBUSY_SAMPCTRL_bit(const void *const hw)
+{
+ return (((Adc *)hw)->SYNCBUSY.reg & ADC_SYNCBUSY_SAMPCTRL) >> ADC_SYNCBUSY_SAMPCTRL_Pos;
+}
+
+static inline bool hri_adc_get_SYNCBUSY_WINLT_bit(const void *const hw)
+{
+ return (((Adc *)hw)->SYNCBUSY.reg & ADC_SYNCBUSY_WINLT) >> ADC_SYNCBUSY_WINLT_Pos;
+}
+
+static inline bool hri_adc_get_SYNCBUSY_WINUT_bit(const void *const hw)
+{
+ return (((Adc *)hw)->SYNCBUSY.reg & ADC_SYNCBUSY_WINUT) >> ADC_SYNCBUSY_WINUT_Pos;
+}
+
+static inline bool hri_adc_get_SYNCBUSY_GAINCORR_bit(const void *const hw)
+{
+ return (((Adc *)hw)->SYNCBUSY.reg & ADC_SYNCBUSY_GAINCORR) >> ADC_SYNCBUSY_GAINCORR_Pos;
+}
+
+static inline bool hri_adc_get_SYNCBUSY_OFFSETCORR_bit(const void *const hw)
+{
+ return (((Adc *)hw)->SYNCBUSY.reg & ADC_SYNCBUSY_OFFSETCORR) >> ADC_SYNCBUSY_OFFSETCORR_Pos;
+}
+
+static inline bool hri_adc_get_SYNCBUSY_SWTRIG_bit(const void *const hw)
+{
+ return (((Adc *)hw)->SYNCBUSY.reg & ADC_SYNCBUSY_SWTRIG) >> ADC_SYNCBUSY_SWTRIG_Pos;
+}
+
+static inline hri_adc_syncbusy_reg_t hri_adc_get_SYNCBUSY_reg(const void *const hw, hri_adc_syncbusy_reg_t mask)
+{
+ uint32_t tmp;
+ tmp = ((Adc *)hw)->SYNCBUSY.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline hri_adc_syncbusy_reg_t hri_adc_read_SYNCBUSY_reg(const void *const hw)
+{
+ return ((Adc *)hw)->SYNCBUSY.reg;
+}
+
+static inline bool hri_adc_get_DSEQSTAT_INPUTCTRL_bit(const void *const hw)
+{
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ return (((Adc *)hw)->DSEQSTAT.reg & ADC_DSEQSTAT_INPUTCTRL) >> ADC_DSEQSTAT_INPUTCTRL_Pos;
+}
+
+static inline bool hri_adc_get_DSEQSTAT_CTRLB_bit(const void *const hw)
+{
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ return (((Adc *)hw)->DSEQSTAT.reg & ADC_DSEQSTAT_CTRLB) >> ADC_DSEQSTAT_CTRLB_Pos;
+}
+
+static inline bool hri_adc_get_DSEQSTAT_REFCTRL_bit(const void *const hw)
+{
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ return (((Adc *)hw)->DSEQSTAT.reg & ADC_DSEQSTAT_REFCTRL) >> ADC_DSEQSTAT_REFCTRL_Pos;
+}
+
+static inline bool hri_adc_get_DSEQSTAT_AVGCTRL_bit(const void *const hw)
+{
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ return (((Adc *)hw)->DSEQSTAT.reg & ADC_DSEQSTAT_AVGCTRL) >> ADC_DSEQSTAT_AVGCTRL_Pos;
+}
+
+static inline bool hri_adc_get_DSEQSTAT_SAMPCTRL_bit(const void *const hw)
+{
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ return (((Adc *)hw)->DSEQSTAT.reg & ADC_DSEQSTAT_SAMPCTRL) >> ADC_DSEQSTAT_SAMPCTRL_Pos;
+}
+
+static inline bool hri_adc_get_DSEQSTAT_WINLT_bit(const void *const hw)
+{
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ return (((Adc *)hw)->DSEQSTAT.reg & ADC_DSEQSTAT_WINLT) >> ADC_DSEQSTAT_WINLT_Pos;
+}
+
+static inline bool hri_adc_get_DSEQSTAT_WINUT_bit(const void *const hw)
+{
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ return (((Adc *)hw)->DSEQSTAT.reg & ADC_DSEQSTAT_WINUT) >> ADC_DSEQSTAT_WINUT_Pos;
+}
+
+static inline bool hri_adc_get_DSEQSTAT_GAINCORR_bit(const void *const hw)
+{
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ return (((Adc *)hw)->DSEQSTAT.reg & ADC_DSEQSTAT_GAINCORR) >> ADC_DSEQSTAT_GAINCORR_Pos;
+}
+
+static inline bool hri_adc_get_DSEQSTAT_OFFSETCORR_bit(const void *const hw)
+{
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ return (((Adc *)hw)->DSEQSTAT.reg & ADC_DSEQSTAT_OFFSETCORR) >> ADC_DSEQSTAT_OFFSETCORR_Pos;
+}
+
+static inline bool hri_adc_get_DSEQSTAT_BUSY_bit(const void *const hw)
+{
+ return (((Adc *)hw)->DSEQSTAT.reg & ADC_DSEQSTAT_BUSY) >> ADC_DSEQSTAT_BUSY_Pos;
+}
+
+static inline hri_adc_dseqstat_reg_t hri_adc_get_DSEQSTAT_reg(const void *const hw, hri_adc_dseqstat_reg_t mask)
+{
+ uint32_t tmp;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ tmp = ((Adc *)hw)->DSEQSTAT.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline hri_adc_dseqstat_reg_t hri_adc_read_DSEQSTAT_reg(const void *const hw)
+{
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ return ((Adc *)hw)->DSEQSTAT.reg;
+}
+
+static inline hri_adc_result_reg_t hri_adc_get_RESULT_RESULT_bf(const void *const hw, hri_adc_result_reg_t mask)
+{
+ return (((Adc *)hw)->RESULT.reg & ADC_RESULT_RESULT(mask)) >> ADC_RESULT_RESULT_Pos;
+}
+
+static inline hri_adc_result_reg_t hri_adc_read_RESULT_RESULT_bf(const void *const hw)
+{
+ return (((Adc *)hw)->RESULT.reg & ADC_RESULT_RESULT_Msk) >> ADC_RESULT_RESULT_Pos;
+}
+
+static inline hri_adc_result_reg_t hri_adc_get_RESULT_reg(const void *const hw, hri_adc_result_reg_t mask)
+{
+ uint16_t tmp;
+ tmp = ((Adc *)hw)->RESULT.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline hri_adc_result_reg_t hri_adc_read_RESULT_reg(const void *const hw)
+{
+ return ((Adc *)hw)->RESULT.reg;
+}
+
+static inline hri_adc_ress_reg_t hri_adc_get_RESS_RESS_bf(const void *const hw, hri_adc_ress_reg_t mask)
+{
+ return (((Adc *)hw)->RESS.reg & ADC_RESS_RESS(mask)) >> ADC_RESS_RESS_Pos;
+}
+
+static inline hri_adc_ress_reg_t hri_adc_read_RESS_RESS_bf(const void *const hw)
+{
+ return (((Adc *)hw)->RESS.reg & ADC_RESS_RESS_Msk) >> ADC_RESS_RESS_Pos;
+}
+
+static inline hri_adc_ress_reg_t hri_adc_get_RESS_reg(const void *const hw, hri_adc_ress_reg_t mask)
+{
+ uint16_t tmp;
+ tmp = ((Adc *)hw)->RESS.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline hri_adc_ress_reg_t hri_adc_read_RESS_reg(const void *const hw)
+{
+ return ((Adc *)hw)->RESS.reg;
+}
+
+static inline void hri_adc_set_CTRLA_SWRST_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLA.reg |= ADC_CTRLA_SWRST;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_SWRST);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_adc_get_CTRLA_SWRST_bit(const void *const hw)
+{
+ uint16_t tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_SWRST);
+ tmp = ((Adc *)hw)->CTRLA.reg;
+ tmp = (tmp & ADC_CTRLA_SWRST) >> ADC_CTRLA_SWRST_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_adc_set_CTRLA_ENABLE_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLA.reg |= ADC_CTRLA_ENABLE;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_SWRST | ADC_SYNCBUSY_ENABLE);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_adc_get_CTRLA_ENABLE_bit(const void *const hw)
+{
+ uint16_t tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_SWRST | ADC_SYNCBUSY_ENABLE);
+ tmp = ((Adc *)hw)->CTRLA.reg;
+ tmp = (tmp & ADC_CTRLA_ENABLE) >> ADC_CTRLA_ENABLE_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_adc_write_CTRLA_ENABLE_bit(const void *const hw, bool value)
+{
+ uint16_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->CTRLA.reg;
+ tmp &= ~ADC_CTRLA_ENABLE;
+ tmp |= value << ADC_CTRLA_ENABLE_Pos;
+ ((Adc *)hw)->CTRLA.reg = tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_SWRST | ADC_SYNCBUSY_ENABLE);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_CTRLA_ENABLE_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLA.reg &= ~ADC_CTRLA_ENABLE;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_SWRST | ADC_SYNCBUSY_ENABLE);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_CTRLA_ENABLE_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLA.reg ^= ADC_CTRLA_ENABLE;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_SWRST | ADC_SYNCBUSY_ENABLE);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_set_CTRLA_SLAVEEN_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLA.reg |= ADC_CTRLA_SLAVEEN;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_adc_get_CTRLA_SLAVEEN_bit(const void *const hw)
+{
+ uint16_t tmp;
+ tmp = ((Adc *)hw)->CTRLA.reg;
+ tmp = (tmp & ADC_CTRLA_SLAVEEN) >> ADC_CTRLA_SLAVEEN_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_adc_write_CTRLA_SLAVEEN_bit(const void *const hw, bool value)
+{
+ uint16_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->CTRLA.reg;
+ tmp &= ~ADC_CTRLA_SLAVEEN;
+ tmp |= value << ADC_CTRLA_SLAVEEN_Pos;
+ ((Adc *)hw)->CTRLA.reg = tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_CTRLA_SLAVEEN_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLA.reg &= ~ADC_CTRLA_SLAVEEN;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_CTRLA_SLAVEEN_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLA.reg ^= ADC_CTRLA_SLAVEEN;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_set_CTRLA_RUNSTDBY_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLA.reg |= ADC_CTRLA_RUNSTDBY;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_adc_get_CTRLA_RUNSTDBY_bit(const void *const hw)
+{
+ uint16_t tmp;
+ tmp = ((Adc *)hw)->CTRLA.reg;
+ tmp = (tmp & ADC_CTRLA_RUNSTDBY) >> ADC_CTRLA_RUNSTDBY_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_adc_write_CTRLA_RUNSTDBY_bit(const void *const hw, bool value)
+{
+ uint16_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->CTRLA.reg;
+ tmp &= ~ADC_CTRLA_RUNSTDBY;
+ tmp |= value << ADC_CTRLA_RUNSTDBY_Pos;
+ ((Adc *)hw)->CTRLA.reg = tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_CTRLA_RUNSTDBY_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLA.reg &= ~ADC_CTRLA_RUNSTDBY;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_CTRLA_RUNSTDBY_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLA.reg ^= ADC_CTRLA_RUNSTDBY;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_set_CTRLA_ONDEMAND_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLA.reg |= ADC_CTRLA_ONDEMAND;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_adc_get_CTRLA_ONDEMAND_bit(const void *const hw)
+{
+ uint16_t tmp;
+ tmp = ((Adc *)hw)->CTRLA.reg;
+ tmp = (tmp & ADC_CTRLA_ONDEMAND) >> ADC_CTRLA_ONDEMAND_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_adc_write_CTRLA_ONDEMAND_bit(const void *const hw, bool value)
+{
+ uint16_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->CTRLA.reg;
+ tmp &= ~ADC_CTRLA_ONDEMAND;
+ tmp |= value << ADC_CTRLA_ONDEMAND_Pos;
+ ((Adc *)hw)->CTRLA.reg = tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_CTRLA_ONDEMAND_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLA.reg &= ~ADC_CTRLA_ONDEMAND;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_CTRLA_ONDEMAND_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLA.reg ^= ADC_CTRLA_ONDEMAND;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_set_CTRLA_R2R_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLA.reg |= ADC_CTRLA_R2R;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_adc_get_CTRLA_R2R_bit(const void *const hw)
+{
+ uint16_t tmp;
+ tmp = ((Adc *)hw)->CTRLA.reg;
+ tmp = (tmp & ADC_CTRLA_R2R) >> ADC_CTRLA_R2R_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_adc_write_CTRLA_R2R_bit(const void *const hw, bool value)
+{
+ uint16_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->CTRLA.reg;
+ tmp &= ~ADC_CTRLA_R2R;
+ tmp |= value << ADC_CTRLA_R2R_Pos;
+ ((Adc *)hw)->CTRLA.reg = tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_CTRLA_R2R_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLA.reg &= ~ADC_CTRLA_R2R;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_CTRLA_R2R_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLA.reg ^= ADC_CTRLA_R2R;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_set_CTRLA_DUALSEL_bf(const void *const hw, hri_adc_ctrla_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLA.reg |= ADC_CTRLA_DUALSEL(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_ctrla_reg_t hri_adc_get_CTRLA_DUALSEL_bf(const void *const hw, hri_adc_ctrla_reg_t mask)
+{
+ uint16_t tmp;
+ tmp = ((Adc *)hw)->CTRLA.reg;
+ tmp = (tmp & ADC_CTRLA_DUALSEL(mask)) >> ADC_CTRLA_DUALSEL_Pos;
+ return tmp;
+}
+
+static inline void hri_adc_write_CTRLA_DUALSEL_bf(const void *const hw, hri_adc_ctrla_reg_t data)
+{
+ uint16_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->CTRLA.reg;
+ tmp &= ~ADC_CTRLA_DUALSEL_Msk;
+ tmp |= ADC_CTRLA_DUALSEL(data);
+ ((Adc *)hw)->CTRLA.reg = tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_CTRLA_DUALSEL_bf(const void *const hw, hri_adc_ctrla_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLA.reg &= ~ADC_CTRLA_DUALSEL(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_CTRLA_DUALSEL_bf(const void *const hw, hri_adc_ctrla_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLA.reg ^= ADC_CTRLA_DUALSEL(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_ctrla_reg_t hri_adc_read_CTRLA_DUALSEL_bf(const void *const hw)
+{
+ uint16_t tmp;
+ tmp = ((Adc *)hw)->CTRLA.reg;
+ tmp = (tmp & ADC_CTRLA_DUALSEL_Msk) >> ADC_CTRLA_DUALSEL_Pos;
+ return tmp;
+}
+
+static inline void hri_adc_set_CTRLA_PRESCALER_bf(const void *const hw, hri_adc_ctrla_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLA.reg |= ADC_CTRLA_PRESCALER(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_ctrla_reg_t hri_adc_get_CTRLA_PRESCALER_bf(const void *const hw, hri_adc_ctrla_reg_t mask)
+{
+ uint16_t tmp;
+ tmp = ((Adc *)hw)->CTRLA.reg;
+ tmp = (tmp & ADC_CTRLA_PRESCALER(mask)) >> ADC_CTRLA_PRESCALER_Pos;
+ return tmp;
+}
+
+static inline void hri_adc_write_CTRLA_PRESCALER_bf(const void *const hw, hri_adc_ctrla_reg_t data)
+{
+ uint16_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->CTRLA.reg;
+ tmp &= ~ADC_CTRLA_PRESCALER_Msk;
+ tmp |= ADC_CTRLA_PRESCALER(data);
+ ((Adc *)hw)->CTRLA.reg = tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_CTRLA_PRESCALER_bf(const void *const hw, hri_adc_ctrla_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLA.reg &= ~ADC_CTRLA_PRESCALER(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_CTRLA_PRESCALER_bf(const void *const hw, hri_adc_ctrla_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLA.reg ^= ADC_CTRLA_PRESCALER(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_ctrla_reg_t hri_adc_read_CTRLA_PRESCALER_bf(const void *const hw)
+{
+ uint16_t tmp;
+ tmp = ((Adc *)hw)->CTRLA.reg;
+ tmp = (tmp & ADC_CTRLA_PRESCALER_Msk) >> ADC_CTRLA_PRESCALER_Pos;
+ return tmp;
+}
+
+static inline void hri_adc_set_CTRLA_reg(const void *const hw, hri_adc_ctrla_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLA.reg |= mask;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_SWRST | ADC_SYNCBUSY_ENABLE);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_ctrla_reg_t hri_adc_get_CTRLA_reg(const void *const hw, hri_adc_ctrla_reg_t mask)
+{
+ uint16_t tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_SWRST | ADC_SYNCBUSY_ENABLE);
+ tmp = ((Adc *)hw)->CTRLA.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline void hri_adc_write_CTRLA_reg(const void *const hw, hri_adc_ctrla_reg_t data)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLA.reg = data;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_SWRST | ADC_SYNCBUSY_ENABLE);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_CTRLA_reg(const void *const hw, hri_adc_ctrla_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLA.reg &= ~mask;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_SWRST | ADC_SYNCBUSY_ENABLE);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_CTRLA_reg(const void *const hw, hri_adc_ctrla_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLA.reg ^= mask;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_SWRST | ADC_SYNCBUSY_ENABLE);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_ctrla_reg_t hri_adc_read_CTRLA_reg(const void *const hw)
+{
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_SWRST | ADC_SYNCBUSY_ENABLE);
+ return ((Adc *)hw)->CTRLA.reg;
+}
+
+static inline void hri_adc_set_EVCTRL_FLUSHEI_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->EVCTRL.reg |= ADC_EVCTRL_FLUSHEI;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_adc_get_EVCTRL_FLUSHEI_bit(const void *const hw)
+{
+ uint8_t tmp;
+ tmp = ((Adc *)hw)->EVCTRL.reg;
+ tmp = (tmp & ADC_EVCTRL_FLUSHEI) >> ADC_EVCTRL_FLUSHEI_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_adc_write_EVCTRL_FLUSHEI_bit(const void *const hw, bool value)
+{
+ uint8_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->EVCTRL.reg;
+ tmp &= ~ADC_EVCTRL_FLUSHEI;
+ tmp |= value << ADC_EVCTRL_FLUSHEI_Pos;
+ ((Adc *)hw)->EVCTRL.reg = tmp;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_EVCTRL_FLUSHEI_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->EVCTRL.reg &= ~ADC_EVCTRL_FLUSHEI;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_EVCTRL_FLUSHEI_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->EVCTRL.reg ^= ADC_EVCTRL_FLUSHEI;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_set_EVCTRL_STARTEI_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->EVCTRL.reg |= ADC_EVCTRL_STARTEI;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_adc_get_EVCTRL_STARTEI_bit(const void *const hw)
+{
+ uint8_t tmp;
+ tmp = ((Adc *)hw)->EVCTRL.reg;
+ tmp = (tmp & ADC_EVCTRL_STARTEI) >> ADC_EVCTRL_STARTEI_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_adc_write_EVCTRL_STARTEI_bit(const void *const hw, bool value)
+{
+ uint8_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->EVCTRL.reg;
+ tmp &= ~ADC_EVCTRL_STARTEI;
+ tmp |= value << ADC_EVCTRL_STARTEI_Pos;
+ ((Adc *)hw)->EVCTRL.reg = tmp;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_EVCTRL_STARTEI_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->EVCTRL.reg &= ~ADC_EVCTRL_STARTEI;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_EVCTRL_STARTEI_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->EVCTRL.reg ^= ADC_EVCTRL_STARTEI;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_set_EVCTRL_FLUSHINV_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->EVCTRL.reg |= ADC_EVCTRL_FLUSHINV;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_adc_get_EVCTRL_FLUSHINV_bit(const void *const hw)
+{
+ uint8_t tmp;
+ tmp = ((Adc *)hw)->EVCTRL.reg;
+ tmp = (tmp & ADC_EVCTRL_FLUSHINV) >> ADC_EVCTRL_FLUSHINV_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_adc_write_EVCTRL_FLUSHINV_bit(const void *const hw, bool value)
+{
+ uint8_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->EVCTRL.reg;
+ tmp &= ~ADC_EVCTRL_FLUSHINV;
+ tmp |= value << ADC_EVCTRL_FLUSHINV_Pos;
+ ((Adc *)hw)->EVCTRL.reg = tmp;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_EVCTRL_FLUSHINV_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->EVCTRL.reg &= ~ADC_EVCTRL_FLUSHINV;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_EVCTRL_FLUSHINV_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->EVCTRL.reg ^= ADC_EVCTRL_FLUSHINV;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_set_EVCTRL_STARTINV_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->EVCTRL.reg |= ADC_EVCTRL_STARTINV;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_adc_get_EVCTRL_STARTINV_bit(const void *const hw)
+{
+ uint8_t tmp;
+ tmp = ((Adc *)hw)->EVCTRL.reg;
+ tmp = (tmp & ADC_EVCTRL_STARTINV) >> ADC_EVCTRL_STARTINV_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_adc_write_EVCTRL_STARTINV_bit(const void *const hw, bool value)
+{
+ uint8_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->EVCTRL.reg;
+ tmp &= ~ADC_EVCTRL_STARTINV;
+ tmp |= value << ADC_EVCTRL_STARTINV_Pos;
+ ((Adc *)hw)->EVCTRL.reg = tmp;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_EVCTRL_STARTINV_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->EVCTRL.reg &= ~ADC_EVCTRL_STARTINV;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_EVCTRL_STARTINV_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->EVCTRL.reg ^= ADC_EVCTRL_STARTINV;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_set_EVCTRL_RESRDYEO_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->EVCTRL.reg |= ADC_EVCTRL_RESRDYEO;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_adc_get_EVCTRL_RESRDYEO_bit(const void *const hw)
+{
+ uint8_t tmp;
+ tmp = ((Adc *)hw)->EVCTRL.reg;
+ tmp = (tmp & ADC_EVCTRL_RESRDYEO) >> ADC_EVCTRL_RESRDYEO_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_adc_write_EVCTRL_RESRDYEO_bit(const void *const hw, bool value)
+{
+ uint8_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->EVCTRL.reg;
+ tmp &= ~ADC_EVCTRL_RESRDYEO;
+ tmp |= value << ADC_EVCTRL_RESRDYEO_Pos;
+ ((Adc *)hw)->EVCTRL.reg = tmp;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_EVCTRL_RESRDYEO_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->EVCTRL.reg &= ~ADC_EVCTRL_RESRDYEO;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_EVCTRL_RESRDYEO_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->EVCTRL.reg ^= ADC_EVCTRL_RESRDYEO;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_set_EVCTRL_WINMONEO_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->EVCTRL.reg |= ADC_EVCTRL_WINMONEO;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_adc_get_EVCTRL_WINMONEO_bit(const void *const hw)
+{
+ uint8_t tmp;
+ tmp = ((Adc *)hw)->EVCTRL.reg;
+ tmp = (tmp & ADC_EVCTRL_WINMONEO) >> ADC_EVCTRL_WINMONEO_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_adc_write_EVCTRL_WINMONEO_bit(const void *const hw, bool value)
+{
+ uint8_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->EVCTRL.reg;
+ tmp &= ~ADC_EVCTRL_WINMONEO;
+ tmp |= value << ADC_EVCTRL_WINMONEO_Pos;
+ ((Adc *)hw)->EVCTRL.reg = tmp;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_EVCTRL_WINMONEO_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->EVCTRL.reg &= ~ADC_EVCTRL_WINMONEO;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_EVCTRL_WINMONEO_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->EVCTRL.reg ^= ADC_EVCTRL_WINMONEO;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_set_EVCTRL_reg(const void *const hw, hri_adc_evctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->EVCTRL.reg |= mask;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_evctrl_reg_t hri_adc_get_EVCTRL_reg(const void *const hw, hri_adc_evctrl_reg_t mask)
+{
+ uint8_t tmp;
+ tmp = ((Adc *)hw)->EVCTRL.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline void hri_adc_write_EVCTRL_reg(const void *const hw, hri_adc_evctrl_reg_t data)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->EVCTRL.reg = data;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_EVCTRL_reg(const void *const hw, hri_adc_evctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->EVCTRL.reg &= ~mask;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_EVCTRL_reg(const void *const hw, hri_adc_evctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->EVCTRL.reg ^= mask;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_evctrl_reg_t hri_adc_read_EVCTRL_reg(const void *const hw)
+{
+ return ((Adc *)hw)->EVCTRL.reg;
+}
+
+static inline void hri_adc_set_DBGCTRL_DBGRUN_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DBGCTRL.reg |= ADC_DBGCTRL_DBGRUN;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_adc_get_DBGCTRL_DBGRUN_bit(const void *const hw)
+{
+ uint8_t tmp;
+ tmp = ((Adc *)hw)->DBGCTRL.reg;
+ tmp = (tmp & ADC_DBGCTRL_DBGRUN) >> ADC_DBGCTRL_DBGRUN_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_adc_write_DBGCTRL_DBGRUN_bit(const void *const hw, bool value)
+{
+ uint8_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->DBGCTRL.reg;
+ tmp &= ~ADC_DBGCTRL_DBGRUN;
+ tmp |= value << ADC_DBGCTRL_DBGRUN_Pos;
+ ((Adc *)hw)->DBGCTRL.reg = tmp;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_DBGCTRL_DBGRUN_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DBGCTRL.reg &= ~ADC_DBGCTRL_DBGRUN;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_DBGCTRL_DBGRUN_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DBGCTRL.reg ^= ADC_DBGCTRL_DBGRUN;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_set_DBGCTRL_reg(const void *const hw, hri_adc_dbgctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DBGCTRL.reg |= mask;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_dbgctrl_reg_t hri_adc_get_DBGCTRL_reg(const void *const hw, hri_adc_dbgctrl_reg_t mask)
+{
+ uint8_t tmp;
+ tmp = ((Adc *)hw)->DBGCTRL.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline void hri_adc_write_DBGCTRL_reg(const void *const hw, hri_adc_dbgctrl_reg_t data)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DBGCTRL.reg = data;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_DBGCTRL_reg(const void *const hw, hri_adc_dbgctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DBGCTRL.reg &= ~mask;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_DBGCTRL_reg(const void *const hw, hri_adc_dbgctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DBGCTRL.reg ^= mask;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_dbgctrl_reg_t hri_adc_read_DBGCTRL_reg(const void *const hw)
+{
+ return ((Adc *)hw)->DBGCTRL.reg;
+}
+
+static inline void hri_adc_set_INPUTCTRL_DIFFMODE_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->INPUTCTRL.reg |= ADC_INPUTCTRL_DIFFMODE;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_adc_get_INPUTCTRL_DIFFMODE_bit(const void *const hw)
+{
+ uint16_t tmp;
+ tmp = ((Adc *)hw)->INPUTCTRL.reg;
+ tmp = (tmp & ADC_INPUTCTRL_DIFFMODE) >> ADC_INPUTCTRL_DIFFMODE_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_adc_write_INPUTCTRL_DIFFMODE_bit(const void *const hw, bool value)
+{
+ uint16_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->INPUTCTRL.reg;
+ tmp &= ~ADC_INPUTCTRL_DIFFMODE;
+ tmp |= value << ADC_INPUTCTRL_DIFFMODE_Pos;
+ ((Adc *)hw)->INPUTCTRL.reg = tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_INPUTCTRL_DIFFMODE_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->INPUTCTRL.reg &= ~ADC_INPUTCTRL_DIFFMODE;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_INPUTCTRL_DIFFMODE_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->INPUTCTRL.reg ^= ADC_INPUTCTRL_DIFFMODE;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_set_INPUTCTRL_DSEQSTOP_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->INPUTCTRL.reg |= ADC_INPUTCTRL_DSEQSTOP;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_adc_get_INPUTCTRL_DSEQSTOP_bit(const void *const hw)
+{
+ uint16_t tmp;
+ tmp = ((Adc *)hw)->INPUTCTRL.reg;
+ tmp = (tmp & ADC_INPUTCTRL_DSEQSTOP) >> ADC_INPUTCTRL_DSEQSTOP_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_adc_write_INPUTCTRL_DSEQSTOP_bit(const void *const hw, bool value)
+{
+ uint16_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->INPUTCTRL.reg;
+ tmp &= ~ADC_INPUTCTRL_DSEQSTOP;
+ tmp |= value << ADC_INPUTCTRL_DSEQSTOP_Pos;
+ ((Adc *)hw)->INPUTCTRL.reg = tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_INPUTCTRL_DSEQSTOP_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->INPUTCTRL.reg &= ~ADC_INPUTCTRL_DSEQSTOP;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_INPUTCTRL_DSEQSTOP_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->INPUTCTRL.reg ^= ADC_INPUTCTRL_DSEQSTOP;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_set_INPUTCTRL_MUXPOS_bf(const void *const hw, hri_adc_inputctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->INPUTCTRL.reg |= ADC_INPUTCTRL_MUXPOS(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_inputctrl_reg_t hri_adc_get_INPUTCTRL_MUXPOS_bf(const void *const hw,
+ hri_adc_inputctrl_reg_t mask)
+{
+ uint16_t tmp;
+ tmp = ((Adc *)hw)->INPUTCTRL.reg;
+ tmp = (tmp & ADC_INPUTCTRL_MUXPOS(mask)) >> ADC_INPUTCTRL_MUXPOS_Pos;
+ return tmp;
+}
+
+static inline void hri_adc_write_INPUTCTRL_MUXPOS_bf(const void *const hw, hri_adc_inputctrl_reg_t data)
+{
+ uint16_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->INPUTCTRL.reg;
+ tmp &= ~ADC_INPUTCTRL_MUXPOS_Msk;
+ tmp |= ADC_INPUTCTRL_MUXPOS(data);
+ ((Adc *)hw)->INPUTCTRL.reg = tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_INPUTCTRL_MUXPOS_bf(const void *const hw, hri_adc_inputctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->INPUTCTRL.reg &= ~ADC_INPUTCTRL_MUXPOS(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_INPUTCTRL_MUXPOS_bf(const void *const hw, hri_adc_inputctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->INPUTCTRL.reg ^= ADC_INPUTCTRL_MUXPOS(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_inputctrl_reg_t hri_adc_read_INPUTCTRL_MUXPOS_bf(const void *const hw)
+{
+ uint16_t tmp;
+ tmp = ((Adc *)hw)->INPUTCTRL.reg;
+ tmp = (tmp & ADC_INPUTCTRL_MUXPOS_Msk) >> ADC_INPUTCTRL_MUXPOS_Pos;
+ return tmp;
+}
+
+static inline void hri_adc_set_INPUTCTRL_MUXNEG_bf(const void *const hw, hri_adc_inputctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->INPUTCTRL.reg |= ADC_INPUTCTRL_MUXNEG(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_inputctrl_reg_t hri_adc_get_INPUTCTRL_MUXNEG_bf(const void *const hw,
+ hri_adc_inputctrl_reg_t mask)
+{
+ uint16_t tmp;
+ tmp = ((Adc *)hw)->INPUTCTRL.reg;
+ tmp = (tmp & ADC_INPUTCTRL_MUXNEG(mask)) >> ADC_INPUTCTRL_MUXNEG_Pos;
+ return tmp;
+}
+
+static inline void hri_adc_write_INPUTCTRL_MUXNEG_bf(const void *const hw, hri_adc_inputctrl_reg_t data)
+{
+ uint16_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->INPUTCTRL.reg;
+ tmp &= ~ADC_INPUTCTRL_MUXNEG_Msk;
+ tmp |= ADC_INPUTCTRL_MUXNEG(data);
+ ((Adc *)hw)->INPUTCTRL.reg = tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_INPUTCTRL_MUXNEG_bf(const void *const hw, hri_adc_inputctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->INPUTCTRL.reg &= ~ADC_INPUTCTRL_MUXNEG(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_INPUTCTRL_MUXNEG_bf(const void *const hw, hri_adc_inputctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->INPUTCTRL.reg ^= ADC_INPUTCTRL_MUXNEG(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_inputctrl_reg_t hri_adc_read_INPUTCTRL_MUXNEG_bf(const void *const hw)
+{
+ uint16_t tmp;
+ tmp = ((Adc *)hw)->INPUTCTRL.reg;
+ tmp = (tmp & ADC_INPUTCTRL_MUXNEG_Msk) >> ADC_INPUTCTRL_MUXNEG_Pos;
+ return tmp;
+}
+
+static inline void hri_adc_set_INPUTCTRL_reg(const void *const hw, hri_adc_inputctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->INPUTCTRL.reg |= mask;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_inputctrl_reg_t hri_adc_get_INPUTCTRL_reg(const void *const hw, hri_adc_inputctrl_reg_t mask)
+{
+ uint16_t tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ tmp = ((Adc *)hw)->INPUTCTRL.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline void hri_adc_write_INPUTCTRL_reg(const void *const hw, hri_adc_inputctrl_reg_t data)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->INPUTCTRL.reg = data;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_INPUTCTRL_reg(const void *const hw, hri_adc_inputctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->INPUTCTRL.reg &= ~mask;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_INPUTCTRL_reg(const void *const hw, hri_adc_inputctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->INPUTCTRL.reg ^= mask;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_inputctrl_reg_t hri_adc_read_INPUTCTRL_reg(const void *const hw)
+{
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ return ((Adc *)hw)->INPUTCTRL.reg;
+}
+
+static inline void hri_adc_set_CTRLB_LEFTADJ_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLB.reg |= ADC_CTRLB_LEFTADJ;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_adc_get_CTRLB_LEFTADJ_bit(const void *const hw)
+{
+ uint16_t tmp;
+ tmp = ((Adc *)hw)->CTRLB.reg;
+ tmp = (tmp & ADC_CTRLB_LEFTADJ) >> ADC_CTRLB_LEFTADJ_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_adc_write_CTRLB_LEFTADJ_bit(const void *const hw, bool value)
+{
+ uint16_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->CTRLB.reg;
+ tmp &= ~ADC_CTRLB_LEFTADJ;
+ tmp |= value << ADC_CTRLB_LEFTADJ_Pos;
+ ((Adc *)hw)->CTRLB.reg = tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_CTRLB_LEFTADJ_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLB.reg &= ~ADC_CTRLB_LEFTADJ;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_CTRLB_LEFTADJ_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLB.reg ^= ADC_CTRLB_LEFTADJ;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_set_CTRLB_FREERUN_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLB.reg |= ADC_CTRLB_FREERUN;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_adc_get_CTRLB_FREERUN_bit(const void *const hw)
+{
+ uint16_t tmp;
+ tmp = ((Adc *)hw)->CTRLB.reg;
+ tmp = (tmp & ADC_CTRLB_FREERUN) >> ADC_CTRLB_FREERUN_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_adc_write_CTRLB_FREERUN_bit(const void *const hw, bool value)
+{
+ uint16_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->CTRLB.reg;
+ tmp &= ~ADC_CTRLB_FREERUN;
+ tmp |= value << ADC_CTRLB_FREERUN_Pos;
+ ((Adc *)hw)->CTRLB.reg = tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_CTRLB_FREERUN_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLB.reg &= ~ADC_CTRLB_FREERUN;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_CTRLB_FREERUN_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLB.reg ^= ADC_CTRLB_FREERUN;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_set_CTRLB_CORREN_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLB.reg |= ADC_CTRLB_CORREN;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_adc_get_CTRLB_CORREN_bit(const void *const hw)
+{
+ uint16_t tmp;
+ tmp = ((Adc *)hw)->CTRLB.reg;
+ tmp = (tmp & ADC_CTRLB_CORREN) >> ADC_CTRLB_CORREN_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_adc_write_CTRLB_CORREN_bit(const void *const hw, bool value)
+{
+ uint16_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->CTRLB.reg;
+ tmp &= ~ADC_CTRLB_CORREN;
+ tmp |= value << ADC_CTRLB_CORREN_Pos;
+ ((Adc *)hw)->CTRLB.reg = tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_CTRLB_CORREN_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLB.reg &= ~ADC_CTRLB_CORREN;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_CTRLB_CORREN_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLB.reg ^= ADC_CTRLB_CORREN;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_set_CTRLB_WINSS_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLB.reg |= ADC_CTRLB_WINSS;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_adc_get_CTRLB_WINSS_bit(const void *const hw)
+{
+ uint16_t tmp;
+ tmp = ((Adc *)hw)->CTRLB.reg;
+ tmp = (tmp & ADC_CTRLB_WINSS) >> ADC_CTRLB_WINSS_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_adc_write_CTRLB_WINSS_bit(const void *const hw, bool value)
+{
+ uint16_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->CTRLB.reg;
+ tmp &= ~ADC_CTRLB_WINSS;
+ tmp |= value << ADC_CTRLB_WINSS_Pos;
+ ((Adc *)hw)->CTRLB.reg = tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_CTRLB_WINSS_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLB.reg &= ~ADC_CTRLB_WINSS;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_CTRLB_WINSS_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLB.reg ^= ADC_CTRLB_WINSS;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_set_CTRLB_RESSEL_bf(const void *const hw, hri_adc_ctrlb_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLB.reg |= ADC_CTRLB_RESSEL(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_ctrlb_reg_t hri_adc_get_CTRLB_RESSEL_bf(const void *const hw, hri_adc_ctrlb_reg_t mask)
+{
+ uint16_t tmp;
+ tmp = ((Adc *)hw)->CTRLB.reg;
+ tmp = (tmp & ADC_CTRLB_RESSEL(mask)) >> ADC_CTRLB_RESSEL_Pos;
+ return tmp;
+}
+
+static inline void hri_adc_write_CTRLB_RESSEL_bf(const void *const hw, hri_adc_ctrlb_reg_t data)
+{
+ uint16_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->CTRLB.reg;
+ tmp &= ~ADC_CTRLB_RESSEL_Msk;
+ tmp |= ADC_CTRLB_RESSEL(data);
+ ((Adc *)hw)->CTRLB.reg = tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_CTRLB_RESSEL_bf(const void *const hw, hri_adc_ctrlb_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLB.reg &= ~ADC_CTRLB_RESSEL(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_CTRLB_RESSEL_bf(const void *const hw, hri_adc_ctrlb_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLB.reg ^= ADC_CTRLB_RESSEL(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_ctrlb_reg_t hri_adc_read_CTRLB_RESSEL_bf(const void *const hw)
+{
+ uint16_t tmp;
+ tmp = ((Adc *)hw)->CTRLB.reg;
+ tmp = (tmp & ADC_CTRLB_RESSEL_Msk) >> ADC_CTRLB_RESSEL_Pos;
+ return tmp;
+}
+
+static inline void hri_adc_set_CTRLB_WINMODE_bf(const void *const hw, hri_adc_ctrlb_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLB.reg |= ADC_CTRLB_WINMODE(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_ctrlb_reg_t hri_adc_get_CTRLB_WINMODE_bf(const void *const hw, hri_adc_ctrlb_reg_t mask)
+{
+ uint16_t tmp;
+ tmp = ((Adc *)hw)->CTRLB.reg;
+ tmp = (tmp & ADC_CTRLB_WINMODE(mask)) >> ADC_CTRLB_WINMODE_Pos;
+ return tmp;
+}
+
+static inline void hri_adc_write_CTRLB_WINMODE_bf(const void *const hw, hri_adc_ctrlb_reg_t data)
+{
+ uint16_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->CTRLB.reg;
+ tmp &= ~ADC_CTRLB_WINMODE_Msk;
+ tmp |= ADC_CTRLB_WINMODE(data);
+ ((Adc *)hw)->CTRLB.reg = tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_CTRLB_WINMODE_bf(const void *const hw, hri_adc_ctrlb_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLB.reg &= ~ADC_CTRLB_WINMODE(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_CTRLB_WINMODE_bf(const void *const hw, hri_adc_ctrlb_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLB.reg ^= ADC_CTRLB_WINMODE(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_ctrlb_reg_t hri_adc_read_CTRLB_WINMODE_bf(const void *const hw)
+{
+ uint16_t tmp;
+ tmp = ((Adc *)hw)->CTRLB.reg;
+ tmp = (tmp & ADC_CTRLB_WINMODE_Msk) >> ADC_CTRLB_WINMODE_Pos;
+ return tmp;
+}
+
+static inline void hri_adc_set_CTRLB_reg(const void *const hw, hri_adc_ctrlb_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLB.reg |= mask;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_ctrlb_reg_t hri_adc_get_CTRLB_reg(const void *const hw, hri_adc_ctrlb_reg_t mask)
+{
+ uint16_t tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ tmp = ((Adc *)hw)->CTRLB.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline void hri_adc_write_CTRLB_reg(const void *const hw, hri_adc_ctrlb_reg_t data)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLB.reg = data;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_CTRLB_reg(const void *const hw, hri_adc_ctrlb_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLB.reg &= ~mask;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_CTRLB_reg(const void *const hw, hri_adc_ctrlb_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CTRLB.reg ^= mask;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_ctrlb_reg_t hri_adc_read_CTRLB_reg(const void *const hw)
+{
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ return ((Adc *)hw)->CTRLB.reg;
+}
+
+static inline void hri_adc_set_REFCTRL_REFCOMP_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->REFCTRL.reg |= ADC_REFCTRL_REFCOMP;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_adc_get_REFCTRL_REFCOMP_bit(const void *const hw)
+{
+ uint8_t tmp;
+ tmp = ((Adc *)hw)->REFCTRL.reg;
+ tmp = (tmp & ADC_REFCTRL_REFCOMP) >> ADC_REFCTRL_REFCOMP_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_adc_write_REFCTRL_REFCOMP_bit(const void *const hw, bool value)
+{
+ uint8_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->REFCTRL.reg;
+ tmp &= ~ADC_REFCTRL_REFCOMP;
+ tmp |= value << ADC_REFCTRL_REFCOMP_Pos;
+ ((Adc *)hw)->REFCTRL.reg = tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_REFCTRL_REFCOMP_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->REFCTRL.reg &= ~ADC_REFCTRL_REFCOMP;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_REFCTRL_REFCOMP_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->REFCTRL.reg ^= ADC_REFCTRL_REFCOMP;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_set_REFCTRL_REFSEL_bf(const void *const hw, hri_adc_refctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->REFCTRL.reg |= ADC_REFCTRL_REFSEL(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_refctrl_reg_t hri_adc_get_REFCTRL_REFSEL_bf(const void *const hw, hri_adc_refctrl_reg_t mask)
+{
+ uint8_t tmp;
+ tmp = ((Adc *)hw)->REFCTRL.reg;
+ tmp = (tmp & ADC_REFCTRL_REFSEL(mask)) >> ADC_REFCTRL_REFSEL_Pos;
+ return tmp;
+}
+
+static inline void hri_adc_write_REFCTRL_REFSEL_bf(const void *const hw, hri_adc_refctrl_reg_t data)
+{
+ uint8_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->REFCTRL.reg;
+ tmp &= ~ADC_REFCTRL_REFSEL_Msk;
+ tmp |= ADC_REFCTRL_REFSEL(data);
+ ((Adc *)hw)->REFCTRL.reg = tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_REFCTRL_REFSEL_bf(const void *const hw, hri_adc_refctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->REFCTRL.reg &= ~ADC_REFCTRL_REFSEL(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_REFCTRL_REFSEL_bf(const void *const hw, hri_adc_refctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->REFCTRL.reg ^= ADC_REFCTRL_REFSEL(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_refctrl_reg_t hri_adc_read_REFCTRL_REFSEL_bf(const void *const hw)
+{
+ uint8_t tmp;
+ tmp = ((Adc *)hw)->REFCTRL.reg;
+ tmp = (tmp & ADC_REFCTRL_REFSEL_Msk) >> ADC_REFCTRL_REFSEL_Pos;
+ return tmp;
+}
+
+static inline void hri_adc_set_REFCTRL_reg(const void *const hw, hri_adc_refctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->REFCTRL.reg |= mask;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_refctrl_reg_t hri_adc_get_REFCTRL_reg(const void *const hw, hri_adc_refctrl_reg_t mask)
+{
+ uint8_t tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ tmp = ((Adc *)hw)->REFCTRL.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline void hri_adc_write_REFCTRL_reg(const void *const hw, hri_adc_refctrl_reg_t data)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->REFCTRL.reg = data;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_REFCTRL_reg(const void *const hw, hri_adc_refctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->REFCTRL.reg &= ~mask;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_REFCTRL_reg(const void *const hw, hri_adc_refctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->REFCTRL.reg ^= mask;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_refctrl_reg_t hri_adc_read_REFCTRL_reg(const void *const hw)
+{
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ return ((Adc *)hw)->REFCTRL.reg;
+}
+
+static inline void hri_adc_set_AVGCTRL_SAMPLENUM_bf(const void *const hw, hri_adc_avgctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->AVGCTRL.reg |= ADC_AVGCTRL_SAMPLENUM(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_avgctrl_reg_t hri_adc_get_AVGCTRL_SAMPLENUM_bf(const void *const hw, hri_adc_avgctrl_reg_t mask)
+{
+ uint8_t tmp;
+ tmp = ((Adc *)hw)->AVGCTRL.reg;
+ tmp = (tmp & ADC_AVGCTRL_SAMPLENUM(mask)) >> ADC_AVGCTRL_SAMPLENUM_Pos;
+ return tmp;
+}
+
+static inline void hri_adc_write_AVGCTRL_SAMPLENUM_bf(const void *const hw, hri_adc_avgctrl_reg_t data)
+{
+ uint8_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->AVGCTRL.reg;
+ tmp &= ~ADC_AVGCTRL_SAMPLENUM_Msk;
+ tmp |= ADC_AVGCTRL_SAMPLENUM(data);
+ ((Adc *)hw)->AVGCTRL.reg = tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_AVGCTRL_SAMPLENUM_bf(const void *const hw, hri_adc_avgctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->AVGCTRL.reg &= ~ADC_AVGCTRL_SAMPLENUM(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_AVGCTRL_SAMPLENUM_bf(const void *const hw, hri_adc_avgctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->AVGCTRL.reg ^= ADC_AVGCTRL_SAMPLENUM(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_avgctrl_reg_t hri_adc_read_AVGCTRL_SAMPLENUM_bf(const void *const hw)
+{
+ uint8_t tmp;
+ tmp = ((Adc *)hw)->AVGCTRL.reg;
+ tmp = (tmp & ADC_AVGCTRL_SAMPLENUM_Msk) >> ADC_AVGCTRL_SAMPLENUM_Pos;
+ return tmp;
+}
+
+static inline void hri_adc_set_AVGCTRL_ADJRES_bf(const void *const hw, hri_adc_avgctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->AVGCTRL.reg |= ADC_AVGCTRL_ADJRES(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_avgctrl_reg_t hri_adc_get_AVGCTRL_ADJRES_bf(const void *const hw, hri_adc_avgctrl_reg_t mask)
+{
+ uint8_t tmp;
+ tmp = ((Adc *)hw)->AVGCTRL.reg;
+ tmp = (tmp & ADC_AVGCTRL_ADJRES(mask)) >> ADC_AVGCTRL_ADJRES_Pos;
+ return tmp;
+}
+
+static inline void hri_adc_write_AVGCTRL_ADJRES_bf(const void *const hw, hri_adc_avgctrl_reg_t data)
+{
+ uint8_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->AVGCTRL.reg;
+ tmp &= ~ADC_AVGCTRL_ADJRES_Msk;
+ tmp |= ADC_AVGCTRL_ADJRES(data);
+ ((Adc *)hw)->AVGCTRL.reg = tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_AVGCTRL_ADJRES_bf(const void *const hw, hri_adc_avgctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->AVGCTRL.reg &= ~ADC_AVGCTRL_ADJRES(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_AVGCTRL_ADJRES_bf(const void *const hw, hri_adc_avgctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->AVGCTRL.reg ^= ADC_AVGCTRL_ADJRES(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_avgctrl_reg_t hri_adc_read_AVGCTRL_ADJRES_bf(const void *const hw)
+{
+ uint8_t tmp;
+ tmp = ((Adc *)hw)->AVGCTRL.reg;
+ tmp = (tmp & ADC_AVGCTRL_ADJRES_Msk) >> ADC_AVGCTRL_ADJRES_Pos;
+ return tmp;
+}
+
+static inline void hri_adc_set_AVGCTRL_reg(const void *const hw, hri_adc_avgctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->AVGCTRL.reg |= mask;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_avgctrl_reg_t hri_adc_get_AVGCTRL_reg(const void *const hw, hri_adc_avgctrl_reg_t mask)
+{
+ uint8_t tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ tmp = ((Adc *)hw)->AVGCTRL.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline void hri_adc_write_AVGCTRL_reg(const void *const hw, hri_adc_avgctrl_reg_t data)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->AVGCTRL.reg = data;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_AVGCTRL_reg(const void *const hw, hri_adc_avgctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->AVGCTRL.reg &= ~mask;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_AVGCTRL_reg(const void *const hw, hri_adc_avgctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->AVGCTRL.reg ^= mask;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_avgctrl_reg_t hri_adc_read_AVGCTRL_reg(const void *const hw)
+{
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ return ((Adc *)hw)->AVGCTRL.reg;
+}
+
+static inline void hri_adc_set_SAMPCTRL_OFFCOMP_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->SAMPCTRL.reg |= ADC_SAMPCTRL_OFFCOMP;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_adc_get_SAMPCTRL_OFFCOMP_bit(const void *const hw)
+{
+ uint8_t tmp;
+ tmp = ((Adc *)hw)->SAMPCTRL.reg;
+ tmp = (tmp & ADC_SAMPCTRL_OFFCOMP) >> ADC_SAMPCTRL_OFFCOMP_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_adc_write_SAMPCTRL_OFFCOMP_bit(const void *const hw, bool value)
+{
+ uint8_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->SAMPCTRL.reg;
+ tmp &= ~ADC_SAMPCTRL_OFFCOMP;
+ tmp |= value << ADC_SAMPCTRL_OFFCOMP_Pos;
+ ((Adc *)hw)->SAMPCTRL.reg = tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_SAMPCTRL_OFFCOMP_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->SAMPCTRL.reg &= ~ADC_SAMPCTRL_OFFCOMP;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_SAMPCTRL_OFFCOMP_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->SAMPCTRL.reg ^= ADC_SAMPCTRL_OFFCOMP;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_set_SAMPCTRL_SAMPLEN_bf(const void *const hw, hri_adc_sampctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->SAMPCTRL.reg |= ADC_SAMPCTRL_SAMPLEN(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_sampctrl_reg_t hri_adc_get_SAMPCTRL_SAMPLEN_bf(const void *const hw, hri_adc_sampctrl_reg_t mask)
+{
+ uint8_t tmp;
+ tmp = ((Adc *)hw)->SAMPCTRL.reg;
+ tmp = (tmp & ADC_SAMPCTRL_SAMPLEN(mask)) >> ADC_SAMPCTRL_SAMPLEN_Pos;
+ return tmp;
+}
+
+static inline void hri_adc_write_SAMPCTRL_SAMPLEN_bf(const void *const hw, hri_adc_sampctrl_reg_t data)
+{
+ uint8_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->SAMPCTRL.reg;
+ tmp &= ~ADC_SAMPCTRL_SAMPLEN_Msk;
+ tmp |= ADC_SAMPCTRL_SAMPLEN(data);
+ ((Adc *)hw)->SAMPCTRL.reg = tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_SAMPCTRL_SAMPLEN_bf(const void *const hw, hri_adc_sampctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->SAMPCTRL.reg &= ~ADC_SAMPCTRL_SAMPLEN(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_SAMPCTRL_SAMPLEN_bf(const void *const hw, hri_adc_sampctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->SAMPCTRL.reg ^= ADC_SAMPCTRL_SAMPLEN(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_sampctrl_reg_t hri_adc_read_SAMPCTRL_SAMPLEN_bf(const void *const hw)
+{
+ uint8_t tmp;
+ tmp = ((Adc *)hw)->SAMPCTRL.reg;
+ tmp = (tmp & ADC_SAMPCTRL_SAMPLEN_Msk) >> ADC_SAMPCTRL_SAMPLEN_Pos;
+ return tmp;
+}
+
+static inline void hri_adc_set_SAMPCTRL_reg(const void *const hw, hri_adc_sampctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->SAMPCTRL.reg |= mask;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_sampctrl_reg_t hri_adc_get_SAMPCTRL_reg(const void *const hw, hri_adc_sampctrl_reg_t mask)
+{
+ uint8_t tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ tmp = ((Adc *)hw)->SAMPCTRL.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline void hri_adc_write_SAMPCTRL_reg(const void *const hw, hri_adc_sampctrl_reg_t data)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->SAMPCTRL.reg = data;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_SAMPCTRL_reg(const void *const hw, hri_adc_sampctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->SAMPCTRL.reg &= ~mask;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_SAMPCTRL_reg(const void *const hw, hri_adc_sampctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->SAMPCTRL.reg ^= mask;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_sampctrl_reg_t hri_adc_read_SAMPCTRL_reg(const void *const hw)
+{
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ return ((Adc *)hw)->SAMPCTRL.reg;
+}
+
+static inline void hri_adc_set_WINLT_WINLT_bf(const void *const hw, hri_adc_winlt_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->WINLT.reg |= ADC_WINLT_WINLT(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_WINLT);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_winlt_reg_t hri_adc_get_WINLT_WINLT_bf(const void *const hw, hri_adc_winlt_reg_t mask)
+{
+ uint16_t tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_WINLT);
+ tmp = ((Adc *)hw)->WINLT.reg;
+ tmp = (tmp & ADC_WINLT_WINLT(mask)) >> ADC_WINLT_WINLT_Pos;
+ return tmp;
+}
+
+static inline void hri_adc_write_WINLT_WINLT_bf(const void *const hw, hri_adc_winlt_reg_t data)
+{
+ uint16_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->WINLT.reg;
+ tmp &= ~ADC_WINLT_WINLT_Msk;
+ tmp |= ADC_WINLT_WINLT(data);
+ ((Adc *)hw)->WINLT.reg = tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_WINLT);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_WINLT_WINLT_bf(const void *const hw, hri_adc_winlt_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->WINLT.reg &= ~ADC_WINLT_WINLT(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_WINLT);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_WINLT_WINLT_bf(const void *const hw, hri_adc_winlt_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->WINLT.reg ^= ADC_WINLT_WINLT(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_WINLT);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_winlt_reg_t hri_adc_read_WINLT_WINLT_bf(const void *const hw)
+{
+ uint16_t tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_WINLT);
+ tmp = ((Adc *)hw)->WINLT.reg;
+ tmp = (tmp & ADC_WINLT_WINLT_Msk) >> ADC_WINLT_WINLT_Pos;
+ return tmp;
+}
+
+static inline void hri_adc_set_WINLT_reg(const void *const hw, hri_adc_winlt_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->WINLT.reg |= mask;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_WINLT);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_winlt_reg_t hri_adc_get_WINLT_reg(const void *const hw, hri_adc_winlt_reg_t mask)
+{
+ uint16_t tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_WINLT);
+ tmp = ((Adc *)hw)->WINLT.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline void hri_adc_write_WINLT_reg(const void *const hw, hri_adc_winlt_reg_t data)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->WINLT.reg = data;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_WINLT);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_WINLT_reg(const void *const hw, hri_adc_winlt_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->WINLT.reg &= ~mask;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_WINLT);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_WINLT_reg(const void *const hw, hri_adc_winlt_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->WINLT.reg ^= mask;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_WINLT);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_winlt_reg_t hri_adc_read_WINLT_reg(const void *const hw)
+{
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_WINLT);
+ return ((Adc *)hw)->WINLT.reg;
+}
+
+static inline void hri_adc_set_WINUT_WINUT_bf(const void *const hw, hri_adc_winut_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->WINUT.reg |= ADC_WINUT_WINUT(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_WINUT);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_winut_reg_t hri_adc_get_WINUT_WINUT_bf(const void *const hw, hri_adc_winut_reg_t mask)
+{
+ uint16_t tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_WINUT);
+ tmp = ((Adc *)hw)->WINUT.reg;
+ tmp = (tmp & ADC_WINUT_WINUT(mask)) >> ADC_WINUT_WINUT_Pos;
+ return tmp;
+}
+
+static inline void hri_adc_write_WINUT_WINUT_bf(const void *const hw, hri_adc_winut_reg_t data)
+{
+ uint16_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->WINUT.reg;
+ tmp &= ~ADC_WINUT_WINUT_Msk;
+ tmp |= ADC_WINUT_WINUT(data);
+ ((Adc *)hw)->WINUT.reg = tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_WINUT);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_WINUT_WINUT_bf(const void *const hw, hri_adc_winut_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->WINUT.reg &= ~ADC_WINUT_WINUT(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_WINUT);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_WINUT_WINUT_bf(const void *const hw, hri_adc_winut_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->WINUT.reg ^= ADC_WINUT_WINUT(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_WINUT);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_winut_reg_t hri_adc_read_WINUT_WINUT_bf(const void *const hw)
+{
+ uint16_t tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_WINUT);
+ tmp = ((Adc *)hw)->WINUT.reg;
+ tmp = (tmp & ADC_WINUT_WINUT_Msk) >> ADC_WINUT_WINUT_Pos;
+ return tmp;
+}
+
+static inline void hri_adc_set_WINUT_reg(const void *const hw, hri_adc_winut_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->WINUT.reg |= mask;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_WINUT);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_winut_reg_t hri_adc_get_WINUT_reg(const void *const hw, hri_adc_winut_reg_t mask)
+{
+ uint16_t tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_WINUT);
+ tmp = ((Adc *)hw)->WINUT.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline void hri_adc_write_WINUT_reg(const void *const hw, hri_adc_winut_reg_t data)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->WINUT.reg = data;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_WINUT);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_WINUT_reg(const void *const hw, hri_adc_winut_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->WINUT.reg &= ~mask;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_WINUT);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_WINUT_reg(const void *const hw, hri_adc_winut_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->WINUT.reg ^= mask;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_WINUT);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_winut_reg_t hri_adc_read_WINUT_reg(const void *const hw)
+{
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_WINUT);
+ return ((Adc *)hw)->WINUT.reg;
+}
+
+static inline void hri_adc_set_GAINCORR_GAINCORR_bf(const void *const hw, hri_adc_gaincorr_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->GAINCORR.reg |= ADC_GAINCORR_GAINCORR(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_GAINCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_gaincorr_reg_t hri_adc_get_GAINCORR_GAINCORR_bf(const void *const hw, hri_adc_gaincorr_reg_t mask)
+{
+ uint16_t tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_GAINCORR);
+ tmp = ((Adc *)hw)->GAINCORR.reg;
+ tmp = (tmp & ADC_GAINCORR_GAINCORR(mask)) >> ADC_GAINCORR_GAINCORR_Pos;
+ return tmp;
+}
+
+static inline void hri_adc_write_GAINCORR_GAINCORR_bf(const void *const hw, hri_adc_gaincorr_reg_t data)
+{
+ uint16_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->GAINCORR.reg;
+ tmp &= ~ADC_GAINCORR_GAINCORR_Msk;
+ tmp |= ADC_GAINCORR_GAINCORR(data);
+ ((Adc *)hw)->GAINCORR.reg = tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_GAINCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_GAINCORR_GAINCORR_bf(const void *const hw, hri_adc_gaincorr_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->GAINCORR.reg &= ~ADC_GAINCORR_GAINCORR(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_GAINCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_GAINCORR_GAINCORR_bf(const void *const hw, hri_adc_gaincorr_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->GAINCORR.reg ^= ADC_GAINCORR_GAINCORR(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_GAINCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_gaincorr_reg_t hri_adc_read_GAINCORR_GAINCORR_bf(const void *const hw)
+{
+ uint16_t tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_GAINCORR);
+ tmp = ((Adc *)hw)->GAINCORR.reg;
+ tmp = (tmp & ADC_GAINCORR_GAINCORR_Msk) >> ADC_GAINCORR_GAINCORR_Pos;
+ return tmp;
+}
+
+static inline void hri_adc_set_GAINCORR_reg(const void *const hw, hri_adc_gaincorr_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->GAINCORR.reg |= mask;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_GAINCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_gaincorr_reg_t hri_adc_get_GAINCORR_reg(const void *const hw, hri_adc_gaincorr_reg_t mask)
+{
+ uint16_t tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_GAINCORR);
+ tmp = ((Adc *)hw)->GAINCORR.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline void hri_adc_write_GAINCORR_reg(const void *const hw, hri_adc_gaincorr_reg_t data)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->GAINCORR.reg = data;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_GAINCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_GAINCORR_reg(const void *const hw, hri_adc_gaincorr_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->GAINCORR.reg &= ~mask;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_GAINCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_GAINCORR_reg(const void *const hw, hri_adc_gaincorr_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->GAINCORR.reg ^= mask;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_GAINCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_gaincorr_reg_t hri_adc_read_GAINCORR_reg(const void *const hw)
+{
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_GAINCORR);
+ return ((Adc *)hw)->GAINCORR.reg;
+}
+
+static inline void hri_adc_set_OFFSETCORR_OFFSETCORR_bf(const void *const hw, hri_adc_offsetcorr_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->OFFSETCORR.reg |= ADC_OFFSETCORR_OFFSETCORR(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_offsetcorr_reg_t hri_adc_get_OFFSETCORR_OFFSETCORR_bf(const void *const hw,
+ hri_adc_offsetcorr_reg_t mask)
+{
+ uint16_t tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_OFFSETCORR);
+ tmp = ((Adc *)hw)->OFFSETCORR.reg;
+ tmp = (tmp & ADC_OFFSETCORR_OFFSETCORR(mask)) >> ADC_OFFSETCORR_OFFSETCORR_Pos;
+ return tmp;
+}
+
+static inline void hri_adc_write_OFFSETCORR_OFFSETCORR_bf(const void *const hw, hri_adc_offsetcorr_reg_t data)
+{
+ uint16_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->OFFSETCORR.reg;
+ tmp &= ~ADC_OFFSETCORR_OFFSETCORR_Msk;
+ tmp |= ADC_OFFSETCORR_OFFSETCORR(data);
+ ((Adc *)hw)->OFFSETCORR.reg = tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_OFFSETCORR_OFFSETCORR_bf(const void *const hw, hri_adc_offsetcorr_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->OFFSETCORR.reg &= ~ADC_OFFSETCORR_OFFSETCORR(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_OFFSETCORR_OFFSETCORR_bf(const void *const hw, hri_adc_offsetcorr_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->OFFSETCORR.reg ^= ADC_OFFSETCORR_OFFSETCORR(mask);
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_offsetcorr_reg_t hri_adc_read_OFFSETCORR_OFFSETCORR_bf(const void *const hw)
+{
+ uint16_t tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_OFFSETCORR);
+ tmp = ((Adc *)hw)->OFFSETCORR.reg;
+ tmp = (tmp & ADC_OFFSETCORR_OFFSETCORR_Msk) >> ADC_OFFSETCORR_OFFSETCORR_Pos;
+ return tmp;
+}
+
+static inline void hri_adc_set_OFFSETCORR_reg(const void *const hw, hri_adc_offsetcorr_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->OFFSETCORR.reg |= mask;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_offsetcorr_reg_t hri_adc_get_OFFSETCORR_reg(const void *const hw, hri_adc_offsetcorr_reg_t mask)
+{
+ uint16_t tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_OFFSETCORR);
+ tmp = ((Adc *)hw)->OFFSETCORR.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline void hri_adc_write_OFFSETCORR_reg(const void *const hw, hri_adc_offsetcorr_reg_t data)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->OFFSETCORR.reg = data;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_OFFSETCORR_reg(const void *const hw, hri_adc_offsetcorr_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->OFFSETCORR.reg &= ~mask;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_OFFSETCORR_reg(const void *const hw, hri_adc_offsetcorr_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->OFFSETCORR.reg ^= mask;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_offsetcorr_reg_t hri_adc_read_OFFSETCORR_reg(const void *const hw)
+{
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_OFFSETCORR);
+ return ((Adc *)hw)->OFFSETCORR.reg;
+}
+
+static inline void hri_adc_set_SWTRIG_FLUSH_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->SWTRIG.reg |= ADC_SWTRIG_FLUSH;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_adc_get_SWTRIG_FLUSH_bit(const void *const hw)
+{
+ uint8_t tmp;
+ tmp = ((Adc *)hw)->SWTRIG.reg;
+ tmp = (tmp & ADC_SWTRIG_FLUSH) >> ADC_SWTRIG_FLUSH_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_adc_write_SWTRIG_FLUSH_bit(const void *const hw, bool value)
+{
+ uint8_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->SWTRIG.reg;
+ tmp &= ~ADC_SWTRIG_FLUSH;
+ tmp |= value << ADC_SWTRIG_FLUSH_Pos;
+ ((Adc *)hw)->SWTRIG.reg = tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_SWTRIG_FLUSH_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->SWTRIG.reg &= ~ADC_SWTRIG_FLUSH;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_SWTRIG_FLUSH_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->SWTRIG.reg ^= ADC_SWTRIG_FLUSH;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_set_SWTRIG_START_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->SWTRIG.reg |= ADC_SWTRIG_START;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_adc_get_SWTRIG_START_bit(const void *const hw)
+{
+ uint8_t tmp;
+ tmp = ((Adc *)hw)->SWTRIG.reg;
+ tmp = (tmp & ADC_SWTRIG_START) >> ADC_SWTRIG_START_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_adc_write_SWTRIG_START_bit(const void *const hw, bool value)
+{
+ uint8_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->SWTRIG.reg;
+ tmp &= ~ADC_SWTRIG_START;
+ tmp |= value << ADC_SWTRIG_START_Pos;
+ ((Adc *)hw)->SWTRIG.reg = tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_SWTRIG_START_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->SWTRIG.reg &= ~ADC_SWTRIG_START;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_SWTRIG_START_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->SWTRIG.reg ^= ADC_SWTRIG_START;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_set_SWTRIG_reg(const void *const hw, hri_adc_swtrig_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->SWTRIG.reg |= mask;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_swtrig_reg_t hri_adc_get_SWTRIG_reg(const void *const hw, hri_adc_swtrig_reg_t mask)
+{
+ uint8_t tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ tmp = ((Adc *)hw)->SWTRIG.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline void hri_adc_write_SWTRIG_reg(const void *const hw, hri_adc_swtrig_reg_t data)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->SWTRIG.reg = data;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_SWTRIG_reg(const void *const hw, hri_adc_swtrig_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->SWTRIG.reg &= ~mask;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_SWTRIG_reg(const void *const hw, hri_adc_swtrig_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->SWTRIG.reg ^= mask;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_swtrig_reg_t hri_adc_read_SWTRIG_reg(const void *const hw)
+{
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ return ((Adc *)hw)->SWTRIG.reg;
+}
+
+static inline void hri_adc_set_DSEQCTRL_INPUTCTRL_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQCTRL.reg |= ADC_DSEQCTRL_INPUTCTRL;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_adc_get_DSEQCTRL_INPUTCTRL_bit(const void *const hw)
+{
+ uint32_t tmp;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ tmp = ((Adc *)hw)->DSEQCTRL.reg;
+ tmp = (tmp & ADC_DSEQCTRL_INPUTCTRL) >> ADC_DSEQCTRL_INPUTCTRL_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_adc_write_DSEQCTRL_INPUTCTRL_bit(const void *const hw, bool value)
+{
+ uint32_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->DSEQCTRL.reg;
+ tmp &= ~ADC_DSEQCTRL_INPUTCTRL;
+ tmp |= value << ADC_DSEQCTRL_INPUTCTRL_Pos;
+ ((Adc *)hw)->DSEQCTRL.reg = tmp;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_DSEQCTRL_INPUTCTRL_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQCTRL.reg &= ~ADC_DSEQCTRL_INPUTCTRL;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_DSEQCTRL_INPUTCTRL_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQCTRL.reg ^= ADC_DSEQCTRL_INPUTCTRL;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_set_DSEQCTRL_CTRLB_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQCTRL.reg |= ADC_DSEQCTRL_CTRLB;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_adc_get_DSEQCTRL_CTRLB_bit(const void *const hw)
+{
+ uint32_t tmp;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ tmp = ((Adc *)hw)->DSEQCTRL.reg;
+ tmp = (tmp & ADC_DSEQCTRL_CTRLB) >> ADC_DSEQCTRL_CTRLB_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_adc_write_DSEQCTRL_CTRLB_bit(const void *const hw, bool value)
+{
+ uint32_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->DSEQCTRL.reg;
+ tmp &= ~ADC_DSEQCTRL_CTRLB;
+ tmp |= value << ADC_DSEQCTRL_CTRLB_Pos;
+ ((Adc *)hw)->DSEQCTRL.reg = tmp;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_DSEQCTRL_CTRLB_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQCTRL.reg &= ~ADC_DSEQCTRL_CTRLB;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_DSEQCTRL_CTRLB_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQCTRL.reg ^= ADC_DSEQCTRL_CTRLB;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_set_DSEQCTRL_REFCTRL_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQCTRL.reg |= ADC_DSEQCTRL_REFCTRL;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_adc_get_DSEQCTRL_REFCTRL_bit(const void *const hw)
+{
+ uint32_t tmp;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ tmp = ((Adc *)hw)->DSEQCTRL.reg;
+ tmp = (tmp & ADC_DSEQCTRL_REFCTRL) >> ADC_DSEQCTRL_REFCTRL_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_adc_write_DSEQCTRL_REFCTRL_bit(const void *const hw, bool value)
+{
+ uint32_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->DSEQCTRL.reg;
+ tmp &= ~ADC_DSEQCTRL_REFCTRL;
+ tmp |= value << ADC_DSEQCTRL_REFCTRL_Pos;
+ ((Adc *)hw)->DSEQCTRL.reg = tmp;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_DSEQCTRL_REFCTRL_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQCTRL.reg &= ~ADC_DSEQCTRL_REFCTRL;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_DSEQCTRL_REFCTRL_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQCTRL.reg ^= ADC_DSEQCTRL_REFCTRL;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_set_DSEQCTRL_AVGCTRL_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQCTRL.reg |= ADC_DSEQCTRL_AVGCTRL;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_adc_get_DSEQCTRL_AVGCTRL_bit(const void *const hw)
+{
+ uint32_t tmp;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ tmp = ((Adc *)hw)->DSEQCTRL.reg;
+ tmp = (tmp & ADC_DSEQCTRL_AVGCTRL) >> ADC_DSEQCTRL_AVGCTRL_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_adc_write_DSEQCTRL_AVGCTRL_bit(const void *const hw, bool value)
+{
+ uint32_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->DSEQCTRL.reg;
+ tmp &= ~ADC_DSEQCTRL_AVGCTRL;
+ tmp |= value << ADC_DSEQCTRL_AVGCTRL_Pos;
+ ((Adc *)hw)->DSEQCTRL.reg = tmp;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_DSEQCTRL_AVGCTRL_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQCTRL.reg &= ~ADC_DSEQCTRL_AVGCTRL;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_DSEQCTRL_AVGCTRL_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQCTRL.reg ^= ADC_DSEQCTRL_AVGCTRL;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_set_DSEQCTRL_SAMPCTRL_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQCTRL.reg |= ADC_DSEQCTRL_SAMPCTRL;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_adc_get_DSEQCTRL_SAMPCTRL_bit(const void *const hw)
+{
+ uint32_t tmp;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ tmp = ((Adc *)hw)->DSEQCTRL.reg;
+ tmp = (tmp & ADC_DSEQCTRL_SAMPCTRL) >> ADC_DSEQCTRL_SAMPCTRL_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_adc_write_DSEQCTRL_SAMPCTRL_bit(const void *const hw, bool value)
+{
+ uint32_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->DSEQCTRL.reg;
+ tmp &= ~ADC_DSEQCTRL_SAMPCTRL;
+ tmp |= value << ADC_DSEQCTRL_SAMPCTRL_Pos;
+ ((Adc *)hw)->DSEQCTRL.reg = tmp;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_DSEQCTRL_SAMPCTRL_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQCTRL.reg &= ~ADC_DSEQCTRL_SAMPCTRL;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_DSEQCTRL_SAMPCTRL_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQCTRL.reg ^= ADC_DSEQCTRL_SAMPCTRL;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_set_DSEQCTRL_WINLT_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQCTRL.reg |= ADC_DSEQCTRL_WINLT;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_adc_get_DSEQCTRL_WINLT_bit(const void *const hw)
+{
+ uint32_t tmp;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ tmp = ((Adc *)hw)->DSEQCTRL.reg;
+ tmp = (tmp & ADC_DSEQCTRL_WINLT) >> ADC_DSEQCTRL_WINLT_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_adc_write_DSEQCTRL_WINLT_bit(const void *const hw, bool value)
+{
+ uint32_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->DSEQCTRL.reg;
+ tmp &= ~ADC_DSEQCTRL_WINLT;
+ tmp |= value << ADC_DSEQCTRL_WINLT_Pos;
+ ((Adc *)hw)->DSEQCTRL.reg = tmp;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_DSEQCTRL_WINLT_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQCTRL.reg &= ~ADC_DSEQCTRL_WINLT;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_DSEQCTRL_WINLT_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQCTRL.reg ^= ADC_DSEQCTRL_WINLT;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_set_DSEQCTRL_WINUT_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQCTRL.reg |= ADC_DSEQCTRL_WINUT;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_adc_get_DSEQCTRL_WINUT_bit(const void *const hw)
+{
+ uint32_t tmp;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ tmp = ((Adc *)hw)->DSEQCTRL.reg;
+ tmp = (tmp & ADC_DSEQCTRL_WINUT) >> ADC_DSEQCTRL_WINUT_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_adc_write_DSEQCTRL_WINUT_bit(const void *const hw, bool value)
+{
+ uint32_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->DSEQCTRL.reg;
+ tmp &= ~ADC_DSEQCTRL_WINUT;
+ tmp |= value << ADC_DSEQCTRL_WINUT_Pos;
+ ((Adc *)hw)->DSEQCTRL.reg = tmp;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_DSEQCTRL_WINUT_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQCTRL.reg &= ~ADC_DSEQCTRL_WINUT;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_DSEQCTRL_WINUT_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQCTRL.reg ^= ADC_DSEQCTRL_WINUT;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_set_DSEQCTRL_GAINCORR_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQCTRL.reg |= ADC_DSEQCTRL_GAINCORR;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_adc_get_DSEQCTRL_GAINCORR_bit(const void *const hw)
+{
+ uint32_t tmp;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ tmp = ((Adc *)hw)->DSEQCTRL.reg;
+ tmp = (tmp & ADC_DSEQCTRL_GAINCORR) >> ADC_DSEQCTRL_GAINCORR_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_adc_write_DSEQCTRL_GAINCORR_bit(const void *const hw, bool value)
+{
+ uint32_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->DSEQCTRL.reg;
+ tmp &= ~ADC_DSEQCTRL_GAINCORR;
+ tmp |= value << ADC_DSEQCTRL_GAINCORR_Pos;
+ ((Adc *)hw)->DSEQCTRL.reg = tmp;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_DSEQCTRL_GAINCORR_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQCTRL.reg &= ~ADC_DSEQCTRL_GAINCORR;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_DSEQCTRL_GAINCORR_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQCTRL.reg ^= ADC_DSEQCTRL_GAINCORR;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_set_DSEQCTRL_OFFSETCORR_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQCTRL.reg |= ADC_DSEQCTRL_OFFSETCORR;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_adc_get_DSEQCTRL_OFFSETCORR_bit(const void *const hw)
+{
+ uint32_t tmp;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ tmp = ((Adc *)hw)->DSEQCTRL.reg;
+ tmp = (tmp & ADC_DSEQCTRL_OFFSETCORR) >> ADC_DSEQCTRL_OFFSETCORR_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_adc_write_DSEQCTRL_OFFSETCORR_bit(const void *const hw, bool value)
+{
+ uint32_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->DSEQCTRL.reg;
+ tmp &= ~ADC_DSEQCTRL_OFFSETCORR;
+ tmp |= value << ADC_DSEQCTRL_OFFSETCORR_Pos;
+ ((Adc *)hw)->DSEQCTRL.reg = tmp;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_DSEQCTRL_OFFSETCORR_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQCTRL.reg &= ~ADC_DSEQCTRL_OFFSETCORR;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_DSEQCTRL_OFFSETCORR_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQCTRL.reg ^= ADC_DSEQCTRL_OFFSETCORR;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_set_DSEQCTRL_AUTOSTART_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQCTRL.reg |= ADC_DSEQCTRL_AUTOSTART;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_adc_get_DSEQCTRL_AUTOSTART_bit(const void *const hw)
+{
+ uint32_t tmp;
+ tmp = ((Adc *)hw)->DSEQCTRL.reg;
+ tmp = (tmp & ADC_DSEQCTRL_AUTOSTART) >> ADC_DSEQCTRL_AUTOSTART_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_adc_write_DSEQCTRL_AUTOSTART_bit(const void *const hw, bool value)
+{
+ uint32_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->DSEQCTRL.reg;
+ tmp &= ~ADC_DSEQCTRL_AUTOSTART;
+ tmp |= value << ADC_DSEQCTRL_AUTOSTART_Pos;
+ ((Adc *)hw)->DSEQCTRL.reg = tmp;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_DSEQCTRL_AUTOSTART_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQCTRL.reg &= ~ADC_DSEQCTRL_AUTOSTART;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_DSEQCTRL_AUTOSTART_bit(const void *const hw)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQCTRL.reg ^= ADC_DSEQCTRL_AUTOSTART;
+ hri_adc_wait_for_sync(hw, ADC_SYNCBUSY_MASK);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_set_DSEQCTRL_reg(const void *const hw, hri_adc_dseqctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQCTRL.reg |= mask;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_dseqctrl_reg_t hri_adc_get_DSEQCTRL_reg(const void *const hw, hri_adc_dseqctrl_reg_t mask)
+{
+ uint32_t tmp;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ tmp = ((Adc *)hw)->DSEQCTRL.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline void hri_adc_write_DSEQCTRL_reg(const void *const hw, hri_adc_dseqctrl_reg_t data)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQCTRL.reg = data;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_DSEQCTRL_reg(const void *const hw, hri_adc_dseqctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQCTRL.reg &= ~mask;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_DSEQCTRL_reg(const void *const hw, hri_adc_dseqctrl_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQCTRL.reg ^= mask;
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_dseqctrl_reg_t hri_adc_read_DSEQCTRL_reg(const void *const hw)
+{
+ hri_adc_wait_for_sync(hw,
+ ADC_SYNCBUSY_INPUTCTRL | ADC_SYNCBUSY_CTRLB | ADC_SYNCBUSY_REFCTRL | ADC_SYNCBUSY_AVGCTRL
+ | ADC_SYNCBUSY_SAMPCTRL | ADC_SYNCBUSY_WINLT | ADC_SYNCBUSY_WINUT | ADC_SYNCBUSY_GAINCORR
+ | ADC_SYNCBUSY_OFFSETCORR);
+ return ((Adc *)hw)->DSEQCTRL.reg;
+}
+
+static inline void hri_adc_set_CALIB_BIASCOMP_bf(const void *const hw, hri_adc_calib_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CALIB.reg |= ADC_CALIB_BIASCOMP(mask);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_calib_reg_t hri_adc_get_CALIB_BIASCOMP_bf(const void *const hw, hri_adc_calib_reg_t mask)
+{
+ uint16_t tmp;
+ tmp = ((Adc *)hw)->CALIB.reg;
+ tmp = (tmp & ADC_CALIB_BIASCOMP(mask)) >> ADC_CALIB_BIASCOMP_Pos;
+ return tmp;
+}
+
+static inline void hri_adc_write_CALIB_BIASCOMP_bf(const void *const hw, hri_adc_calib_reg_t data)
+{
+ uint16_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->CALIB.reg;
+ tmp &= ~ADC_CALIB_BIASCOMP_Msk;
+ tmp |= ADC_CALIB_BIASCOMP(data);
+ ((Adc *)hw)->CALIB.reg = tmp;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_CALIB_BIASCOMP_bf(const void *const hw, hri_adc_calib_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CALIB.reg &= ~ADC_CALIB_BIASCOMP(mask);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_CALIB_BIASCOMP_bf(const void *const hw, hri_adc_calib_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CALIB.reg ^= ADC_CALIB_BIASCOMP(mask);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_calib_reg_t hri_adc_read_CALIB_BIASCOMP_bf(const void *const hw)
+{
+ uint16_t tmp;
+ tmp = ((Adc *)hw)->CALIB.reg;
+ tmp = (tmp & ADC_CALIB_BIASCOMP_Msk) >> ADC_CALIB_BIASCOMP_Pos;
+ return tmp;
+}
+
+static inline void hri_adc_set_CALIB_BIASR2R_bf(const void *const hw, hri_adc_calib_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CALIB.reg |= ADC_CALIB_BIASR2R(mask);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_calib_reg_t hri_adc_get_CALIB_BIASR2R_bf(const void *const hw, hri_adc_calib_reg_t mask)
+{
+ uint16_t tmp;
+ tmp = ((Adc *)hw)->CALIB.reg;
+ tmp = (tmp & ADC_CALIB_BIASR2R(mask)) >> ADC_CALIB_BIASR2R_Pos;
+ return tmp;
+}
+
+static inline void hri_adc_write_CALIB_BIASR2R_bf(const void *const hw, hri_adc_calib_reg_t data)
+{
+ uint16_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->CALIB.reg;
+ tmp &= ~ADC_CALIB_BIASR2R_Msk;
+ tmp |= ADC_CALIB_BIASR2R(data);
+ ((Adc *)hw)->CALIB.reg = tmp;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_CALIB_BIASR2R_bf(const void *const hw, hri_adc_calib_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CALIB.reg &= ~ADC_CALIB_BIASR2R(mask);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_CALIB_BIASR2R_bf(const void *const hw, hri_adc_calib_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CALIB.reg ^= ADC_CALIB_BIASR2R(mask);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_calib_reg_t hri_adc_read_CALIB_BIASR2R_bf(const void *const hw)
+{
+ uint16_t tmp;
+ tmp = ((Adc *)hw)->CALIB.reg;
+ tmp = (tmp & ADC_CALIB_BIASR2R_Msk) >> ADC_CALIB_BIASR2R_Pos;
+ return tmp;
+}
+
+static inline void hri_adc_set_CALIB_BIASREFBUF_bf(const void *const hw, hri_adc_calib_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CALIB.reg |= ADC_CALIB_BIASREFBUF(mask);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_calib_reg_t hri_adc_get_CALIB_BIASREFBUF_bf(const void *const hw, hri_adc_calib_reg_t mask)
+{
+ uint16_t tmp;
+ tmp = ((Adc *)hw)->CALIB.reg;
+ tmp = (tmp & ADC_CALIB_BIASREFBUF(mask)) >> ADC_CALIB_BIASREFBUF_Pos;
+ return tmp;
+}
+
+static inline void hri_adc_write_CALIB_BIASREFBUF_bf(const void *const hw, hri_adc_calib_reg_t data)
+{
+ uint16_t tmp;
+ ADC_CRITICAL_SECTION_ENTER();
+ tmp = ((Adc *)hw)->CALIB.reg;
+ tmp &= ~ADC_CALIB_BIASREFBUF_Msk;
+ tmp |= ADC_CALIB_BIASREFBUF(data);
+ ((Adc *)hw)->CALIB.reg = tmp;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_CALIB_BIASREFBUF_bf(const void *const hw, hri_adc_calib_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CALIB.reg &= ~ADC_CALIB_BIASREFBUF(mask);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_CALIB_BIASREFBUF_bf(const void *const hw, hri_adc_calib_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CALIB.reg ^= ADC_CALIB_BIASREFBUF(mask);
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_calib_reg_t hri_adc_read_CALIB_BIASREFBUF_bf(const void *const hw)
+{
+ uint16_t tmp;
+ tmp = ((Adc *)hw)->CALIB.reg;
+ tmp = (tmp & ADC_CALIB_BIASREFBUF_Msk) >> ADC_CALIB_BIASREFBUF_Pos;
+ return tmp;
+}
+
+static inline void hri_adc_set_CALIB_reg(const void *const hw, hri_adc_calib_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CALIB.reg |= mask;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_calib_reg_t hri_adc_get_CALIB_reg(const void *const hw, hri_adc_calib_reg_t mask)
+{
+ uint16_t tmp;
+ tmp = ((Adc *)hw)->CALIB.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline void hri_adc_write_CALIB_reg(const void *const hw, hri_adc_calib_reg_t data)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CALIB.reg = data;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_clear_CALIB_reg(const void *const hw, hri_adc_calib_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CALIB.reg &= ~mask;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_adc_toggle_CALIB_reg(const void *const hw, hri_adc_calib_reg_t mask)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->CALIB.reg ^= mask;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_adc_calib_reg_t hri_adc_read_CALIB_reg(const void *const hw)
+{
+ return ((Adc *)hw)->CALIB.reg;
+}
+
+static inline void hri_adc_write_DSEQDATA_reg(const void *const hw, hri_adc_dseqdata_reg_t data)
+{
+ ADC_CRITICAL_SECTION_ENTER();
+ ((Adc *)hw)->DSEQDATA.reg = data;
+ ADC_CRITICAL_SECTION_LEAVE();
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _HRI_ADC_E54_H_INCLUDED */
+#endif /* _SAME54_ADC_COMPONENT_ */
diff --git a/Examples/AS5048A_test/AS5048A_test/hri/hri_aes_e54.h b/Examples/AS5048A_test/AS5048A_test/hri/hri_aes_e54.h
new file mode 100644
index 0000000..c1070e2
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hri/hri_aes_e54.h
@@ -0,0 +1,1287 @@
+/**
+ * \file
+ *
+ * \brief SAM AES
+ *
+ * Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifdef _SAME54_AES_COMPONENT_
+#ifndef _HRI_AES_E54_H_INCLUDED_
+#define _HRI_AES_E54_H_INCLUDED_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+#include
+
+#if defined(ENABLE_AES_CRITICAL_SECTIONS)
+#define AES_CRITICAL_SECTION_ENTER() CRITICAL_SECTION_ENTER()
+#define AES_CRITICAL_SECTION_LEAVE() CRITICAL_SECTION_LEAVE()
+#else
+#define AES_CRITICAL_SECTION_ENTER()
+#define AES_CRITICAL_SECTION_LEAVE()
+#endif
+
+typedef uint32_t hri_aes_ciplen_reg_t;
+typedef uint32_t hri_aes_ctrla_reg_t;
+typedef uint32_t hri_aes_ghash_reg_t;
+typedef uint32_t hri_aes_hashkey_reg_t;
+typedef uint32_t hri_aes_indata_reg_t;
+typedef uint32_t hri_aes_intvectv_reg_t;
+typedef uint32_t hri_aes_keyword_reg_t;
+typedef uint32_t hri_aes_randseed_reg_t;
+typedef uint8_t hri_aes_ctrlb_reg_t;
+typedef uint8_t hri_aes_databufptr_reg_t;
+typedef uint8_t hri_aes_dbgctrl_reg_t;
+typedef uint8_t hri_aes_intenset_reg_t;
+typedef uint8_t hri_aes_intflag_reg_t;
+
+static inline bool hri_aes_get_INTFLAG_ENCCMP_bit(const void *const hw)
+{
+ return (((Aes *)hw)->INTFLAG.reg & AES_INTFLAG_ENCCMP) >> AES_INTFLAG_ENCCMP_Pos;
+}
+
+static inline void hri_aes_clear_INTFLAG_ENCCMP_bit(const void *const hw)
+{
+ ((Aes *)hw)->INTFLAG.reg = AES_INTFLAG_ENCCMP;
+}
+
+static inline bool hri_aes_get_INTFLAG_GFMCMP_bit(const void *const hw)
+{
+ return (((Aes *)hw)->INTFLAG.reg & AES_INTFLAG_GFMCMP) >> AES_INTFLAG_GFMCMP_Pos;
+}
+
+static inline void hri_aes_clear_INTFLAG_GFMCMP_bit(const void *const hw)
+{
+ ((Aes *)hw)->INTFLAG.reg = AES_INTFLAG_GFMCMP;
+}
+
+static inline bool hri_aes_get_interrupt_ENCCMP_bit(const void *const hw)
+{
+ return (((Aes *)hw)->INTFLAG.reg & AES_INTFLAG_ENCCMP) >> AES_INTFLAG_ENCCMP_Pos;
+}
+
+static inline void hri_aes_clear_interrupt_ENCCMP_bit(const void *const hw)
+{
+ ((Aes *)hw)->INTFLAG.reg = AES_INTFLAG_ENCCMP;
+}
+
+static inline bool hri_aes_get_interrupt_GFMCMP_bit(const void *const hw)
+{
+ return (((Aes *)hw)->INTFLAG.reg & AES_INTFLAG_GFMCMP) >> AES_INTFLAG_GFMCMP_Pos;
+}
+
+static inline void hri_aes_clear_interrupt_GFMCMP_bit(const void *const hw)
+{
+ ((Aes *)hw)->INTFLAG.reg = AES_INTFLAG_GFMCMP;
+}
+
+static inline hri_aes_intflag_reg_t hri_aes_get_INTFLAG_reg(const void *const hw, hri_aes_intflag_reg_t mask)
+{
+ uint8_t tmp;
+ tmp = ((Aes *)hw)->INTFLAG.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline hri_aes_intflag_reg_t hri_aes_read_INTFLAG_reg(const void *const hw)
+{
+ return ((Aes *)hw)->INTFLAG.reg;
+}
+
+static inline void hri_aes_clear_INTFLAG_reg(const void *const hw, hri_aes_intflag_reg_t mask)
+{
+ ((Aes *)hw)->INTFLAG.reg = mask;
+}
+
+static inline void hri_aes_set_INTEN_ENCCMP_bit(const void *const hw)
+{
+ ((Aes *)hw)->INTENSET.reg = AES_INTENSET_ENCCMP;
+}
+
+static inline bool hri_aes_get_INTEN_ENCCMP_bit(const void *const hw)
+{
+ return (((Aes *)hw)->INTENSET.reg & AES_INTENSET_ENCCMP) >> AES_INTENSET_ENCCMP_Pos;
+}
+
+static inline void hri_aes_write_INTEN_ENCCMP_bit(const void *const hw, bool value)
+{
+ if (value == 0x0) {
+ ((Aes *)hw)->INTENCLR.reg = AES_INTENSET_ENCCMP;
+ } else {
+ ((Aes *)hw)->INTENSET.reg = AES_INTENSET_ENCCMP;
+ }
+}
+
+static inline void hri_aes_clear_INTEN_ENCCMP_bit(const void *const hw)
+{
+ ((Aes *)hw)->INTENCLR.reg = AES_INTENSET_ENCCMP;
+}
+
+static inline void hri_aes_set_INTEN_GFMCMP_bit(const void *const hw)
+{
+ ((Aes *)hw)->INTENSET.reg = AES_INTENSET_GFMCMP;
+}
+
+static inline bool hri_aes_get_INTEN_GFMCMP_bit(const void *const hw)
+{
+ return (((Aes *)hw)->INTENSET.reg & AES_INTENSET_GFMCMP) >> AES_INTENSET_GFMCMP_Pos;
+}
+
+static inline void hri_aes_write_INTEN_GFMCMP_bit(const void *const hw, bool value)
+{
+ if (value == 0x0) {
+ ((Aes *)hw)->INTENCLR.reg = AES_INTENSET_GFMCMP;
+ } else {
+ ((Aes *)hw)->INTENSET.reg = AES_INTENSET_GFMCMP;
+ }
+}
+
+static inline void hri_aes_clear_INTEN_GFMCMP_bit(const void *const hw)
+{
+ ((Aes *)hw)->INTENCLR.reg = AES_INTENSET_GFMCMP;
+}
+
+static inline void hri_aes_set_INTEN_reg(const void *const hw, hri_aes_intenset_reg_t mask)
+{
+ ((Aes *)hw)->INTENSET.reg = mask;
+}
+
+static inline hri_aes_intenset_reg_t hri_aes_get_INTEN_reg(const void *const hw, hri_aes_intenset_reg_t mask)
+{
+ uint8_t tmp;
+ tmp = ((Aes *)hw)->INTENSET.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline hri_aes_intenset_reg_t hri_aes_read_INTEN_reg(const void *const hw)
+{
+ return ((Aes *)hw)->INTENSET.reg;
+}
+
+static inline void hri_aes_write_INTEN_reg(const void *const hw, hri_aes_intenset_reg_t data)
+{
+ ((Aes *)hw)->INTENSET.reg = data;
+ ((Aes *)hw)->INTENCLR.reg = ~data;
+}
+
+static inline void hri_aes_clear_INTEN_reg(const void *const hw, hri_aes_intenset_reg_t mask)
+{
+ ((Aes *)hw)->INTENCLR.reg = mask;
+}
+
+static inline void hri_aes_set_CTRLA_SWRST_bit(const void *const hw)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg |= AES_CTRLA_SWRST;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_aes_get_CTRLA_SWRST_bit(const void *const hw)
+{
+ uint32_t tmp;
+ tmp = ((Aes *)hw)->CTRLA.reg;
+ tmp = (tmp & AES_CTRLA_SWRST) >> AES_CTRLA_SWRST_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_aes_set_CTRLA_ENABLE_bit(const void *const hw)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg |= AES_CTRLA_ENABLE;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_aes_get_CTRLA_ENABLE_bit(const void *const hw)
+{
+ uint32_t tmp;
+ tmp = ((Aes *)hw)->CTRLA.reg;
+ tmp = (tmp & AES_CTRLA_ENABLE) >> AES_CTRLA_ENABLE_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_aes_write_CTRLA_ENABLE_bit(const void *const hw, bool value)
+{
+ uint32_t tmp;
+ AES_CRITICAL_SECTION_ENTER();
+ tmp = ((Aes *)hw)->CTRLA.reg;
+ tmp &= ~AES_CTRLA_ENABLE;
+ tmp |= value << AES_CTRLA_ENABLE_Pos;
+ ((Aes *)hw)->CTRLA.reg = tmp;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_clear_CTRLA_ENABLE_bit(const void *const hw)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg &= ~AES_CTRLA_ENABLE;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_toggle_CTRLA_ENABLE_bit(const void *const hw)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg ^= AES_CTRLA_ENABLE;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_set_CTRLA_CIPHER_bit(const void *const hw)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg |= AES_CTRLA_CIPHER;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_aes_get_CTRLA_CIPHER_bit(const void *const hw)
+{
+ uint32_t tmp;
+ tmp = ((Aes *)hw)->CTRLA.reg;
+ tmp = (tmp & AES_CTRLA_CIPHER) >> AES_CTRLA_CIPHER_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_aes_write_CTRLA_CIPHER_bit(const void *const hw, bool value)
+{
+ uint32_t tmp;
+ AES_CRITICAL_SECTION_ENTER();
+ tmp = ((Aes *)hw)->CTRLA.reg;
+ tmp &= ~AES_CTRLA_CIPHER;
+ tmp |= value << AES_CTRLA_CIPHER_Pos;
+ ((Aes *)hw)->CTRLA.reg = tmp;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_clear_CTRLA_CIPHER_bit(const void *const hw)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg &= ~AES_CTRLA_CIPHER;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_toggle_CTRLA_CIPHER_bit(const void *const hw)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg ^= AES_CTRLA_CIPHER;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_set_CTRLA_STARTMODE_bit(const void *const hw)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg |= AES_CTRLA_STARTMODE;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_aes_get_CTRLA_STARTMODE_bit(const void *const hw)
+{
+ uint32_t tmp;
+ tmp = ((Aes *)hw)->CTRLA.reg;
+ tmp = (tmp & AES_CTRLA_STARTMODE) >> AES_CTRLA_STARTMODE_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_aes_write_CTRLA_STARTMODE_bit(const void *const hw, bool value)
+{
+ uint32_t tmp;
+ AES_CRITICAL_SECTION_ENTER();
+ tmp = ((Aes *)hw)->CTRLA.reg;
+ tmp &= ~AES_CTRLA_STARTMODE;
+ tmp |= value << AES_CTRLA_STARTMODE_Pos;
+ ((Aes *)hw)->CTRLA.reg = tmp;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_clear_CTRLA_STARTMODE_bit(const void *const hw)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg &= ~AES_CTRLA_STARTMODE;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_toggle_CTRLA_STARTMODE_bit(const void *const hw)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg ^= AES_CTRLA_STARTMODE;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_set_CTRLA_LOD_bit(const void *const hw)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg |= AES_CTRLA_LOD;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_aes_get_CTRLA_LOD_bit(const void *const hw)
+{
+ uint32_t tmp;
+ tmp = ((Aes *)hw)->CTRLA.reg;
+ tmp = (tmp & AES_CTRLA_LOD) >> AES_CTRLA_LOD_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_aes_write_CTRLA_LOD_bit(const void *const hw, bool value)
+{
+ uint32_t tmp;
+ AES_CRITICAL_SECTION_ENTER();
+ tmp = ((Aes *)hw)->CTRLA.reg;
+ tmp &= ~AES_CTRLA_LOD;
+ tmp |= value << AES_CTRLA_LOD_Pos;
+ ((Aes *)hw)->CTRLA.reg = tmp;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_clear_CTRLA_LOD_bit(const void *const hw)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg &= ~AES_CTRLA_LOD;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_toggle_CTRLA_LOD_bit(const void *const hw)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg ^= AES_CTRLA_LOD;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_set_CTRLA_KEYGEN_bit(const void *const hw)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg |= AES_CTRLA_KEYGEN;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_aes_get_CTRLA_KEYGEN_bit(const void *const hw)
+{
+ uint32_t tmp;
+ tmp = ((Aes *)hw)->CTRLA.reg;
+ tmp = (tmp & AES_CTRLA_KEYGEN) >> AES_CTRLA_KEYGEN_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_aes_write_CTRLA_KEYGEN_bit(const void *const hw, bool value)
+{
+ uint32_t tmp;
+ AES_CRITICAL_SECTION_ENTER();
+ tmp = ((Aes *)hw)->CTRLA.reg;
+ tmp &= ~AES_CTRLA_KEYGEN;
+ tmp |= value << AES_CTRLA_KEYGEN_Pos;
+ ((Aes *)hw)->CTRLA.reg = tmp;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_clear_CTRLA_KEYGEN_bit(const void *const hw)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg &= ~AES_CTRLA_KEYGEN;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_toggle_CTRLA_KEYGEN_bit(const void *const hw)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg ^= AES_CTRLA_KEYGEN;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_set_CTRLA_XORKEY_bit(const void *const hw)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg |= AES_CTRLA_XORKEY;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_aes_get_CTRLA_XORKEY_bit(const void *const hw)
+{
+ uint32_t tmp;
+ tmp = ((Aes *)hw)->CTRLA.reg;
+ tmp = (tmp & AES_CTRLA_XORKEY) >> AES_CTRLA_XORKEY_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_aes_write_CTRLA_XORKEY_bit(const void *const hw, bool value)
+{
+ uint32_t tmp;
+ AES_CRITICAL_SECTION_ENTER();
+ tmp = ((Aes *)hw)->CTRLA.reg;
+ tmp &= ~AES_CTRLA_XORKEY;
+ tmp |= value << AES_CTRLA_XORKEY_Pos;
+ ((Aes *)hw)->CTRLA.reg = tmp;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_clear_CTRLA_XORKEY_bit(const void *const hw)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg &= ~AES_CTRLA_XORKEY;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_toggle_CTRLA_XORKEY_bit(const void *const hw)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg ^= AES_CTRLA_XORKEY;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_set_CTRLA_AESMODE_bf(const void *const hw, hri_aes_ctrla_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg |= AES_CTRLA_AESMODE(mask);
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_aes_ctrla_reg_t hri_aes_get_CTRLA_AESMODE_bf(const void *const hw, hri_aes_ctrla_reg_t mask)
+{
+ uint32_t tmp;
+ tmp = ((Aes *)hw)->CTRLA.reg;
+ tmp = (tmp & AES_CTRLA_AESMODE(mask)) >> AES_CTRLA_AESMODE_Pos;
+ return tmp;
+}
+
+static inline void hri_aes_write_CTRLA_AESMODE_bf(const void *const hw, hri_aes_ctrla_reg_t data)
+{
+ uint32_t tmp;
+ AES_CRITICAL_SECTION_ENTER();
+ tmp = ((Aes *)hw)->CTRLA.reg;
+ tmp &= ~AES_CTRLA_AESMODE_Msk;
+ tmp |= AES_CTRLA_AESMODE(data);
+ ((Aes *)hw)->CTRLA.reg = tmp;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_clear_CTRLA_AESMODE_bf(const void *const hw, hri_aes_ctrla_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg &= ~AES_CTRLA_AESMODE(mask);
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_toggle_CTRLA_AESMODE_bf(const void *const hw, hri_aes_ctrla_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg ^= AES_CTRLA_AESMODE(mask);
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_aes_ctrla_reg_t hri_aes_read_CTRLA_AESMODE_bf(const void *const hw)
+{
+ uint32_t tmp;
+ tmp = ((Aes *)hw)->CTRLA.reg;
+ tmp = (tmp & AES_CTRLA_AESMODE_Msk) >> AES_CTRLA_AESMODE_Pos;
+ return tmp;
+}
+
+static inline void hri_aes_set_CTRLA_CFBS_bf(const void *const hw, hri_aes_ctrla_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg |= AES_CTRLA_CFBS(mask);
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_aes_ctrla_reg_t hri_aes_get_CTRLA_CFBS_bf(const void *const hw, hri_aes_ctrla_reg_t mask)
+{
+ uint32_t tmp;
+ tmp = ((Aes *)hw)->CTRLA.reg;
+ tmp = (tmp & AES_CTRLA_CFBS(mask)) >> AES_CTRLA_CFBS_Pos;
+ return tmp;
+}
+
+static inline void hri_aes_write_CTRLA_CFBS_bf(const void *const hw, hri_aes_ctrla_reg_t data)
+{
+ uint32_t tmp;
+ AES_CRITICAL_SECTION_ENTER();
+ tmp = ((Aes *)hw)->CTRLA.reg;
+ tmp &= ~AES_CTRLA_CFBS_Msk;
+ tmp |= AES_CTRLA_CFBS(data);
+ ((Aes *)hw)->CTRLA.reg = tmp;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_clear_CTRLA_CFBS_bf(const void *const hw, hri_aes_ctrla_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg &= ~AES_CTRLA_CFBS(mask);
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_toggle_CTRLA_CFBS_bf(const void *const hw, hri_aes_ctrla_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg ^= AES_CTRLA_CFBS(mask);
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_aes_ctrla_reg_t hri_aes_read_CTRLA_CFBS_bf(const void *const hw)
+{
+ uint32_t tmp;
+ tmp = ((Aes *)hw)->CTRLA.reg;
+ tmp = (tmp & AES_CTRLA_CFBS_Msk) >> AES_CTRLA_CFBS_Pos;
+ return tmp;
+}
+
+static inline void hri_aes_set_CTRLA_KEYSIZE_bf(const void *const hw, hri_aes_ctrla_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg |= AES_CTRLA_KEYSIZE(mask);
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_aes_ctrla_reg_t hri_aes_get_CTRLA_KEYSIZE_bf(const void *const hw, hri_aes_ctrla_reg_t mask)
+{
+ uint32_t tmp;
+ tmp = ((Aes *)hw)->CTRLA.reg;
+ tmp = (tmp & AES_CTRLA_KEYSIZE(mask)) >> AES_CTRLA_KEYSIZE_Pos;
+ return tmp;
+}
+
+static inline void hri_aes_write_CTRLA_KEYSIZE_bf(const void *const hw, hri_aes_ctrla_reg_t data)
+{
+ uint32_t tmp;
+ AES_CRITICAL_SECTION_ENTER();
+ tmp = ((Aes *)hw)->CTRLA.reg;
+ tmp &= ~AES_CTRLA_KEYSIZE_Msk;
+ tmp |= AES_CTRLA_KEYSIZE(data);
+ ((Aes *)hw)->CTRLA.reg = tmp;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_clear_CTRLA_KEYSIZE_bf(const void *const hw, hri_aes_ctrla_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg &= ~AES_CTRLA_KEYSIZE(mask);
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_toggle_CTRLA_KEYSIZE_bf(const void *const hw, hri_aes_ctrla_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg ^= AES_CTRLA_KEYSIZE(mask);
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_aes_ctrla_reg_t hri_aes_read_CTRLA_KEYSIZE_bf(const void *const hw)
+{
+ uint32_t tmp;
+ tmp = ((Aes *)hw)->CTRLA.reg;
+ tmp = (tmp & AES_CTRLA_KEYSIZE_Msk) >> AES_CTRLA_KEYSIZE_Pos;
+ return tmp;
+}
+
+static inline void hri_aes_set_CTRLA_CTYPE_bf(const void *const hw, hri_aes_ctrla_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg |= AES_CTRLA_CTYPE(mask);
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_aes_ctrla_reg_t hri_aes_get_CTRLA_CTYPE_bf(const void *const hw, hri_aes_ctrla_reg_t mask)
+{
+ uint32_t tmp;
+ tmp = ((Aes *)hw)->CTRLA.reg;
+ tmp = (tmp & AES_CTRLA_CTYPE(mask)) >> AES_CTRLA_CTYPE_Pos;
+ return tmp;
+}
+
+static inline void hri_aes_write_CTRLA_CTYPE_bf(const void *const hw, hri_aes_ctrla_reg_t data)
+{
+ uint32_t tmp;
+ AES_CRITICAL_SECTION_ENTER();
+ tmp = ((Aes *)hw)->CTRLA.reg;
+ tmp &= ~AES_CTRLA_CTYPE_Msk;
+ tmp |= AES_CTRLA_CTYPE(data);
+ ((Aes *)hw)->CTRLA.reg = tmp;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_clear_CTRLA_CTYPE_bf(const void *const hw, hri_aes_ctrla_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg &= ~AES_CTRLA_CTYPE(mask);
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_toggle_CTRLA_CTYPE_bf(const void *const hw, hri_aes_ctrla_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg ^= AES_CTRLA_CTYPE(mask);
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_aes_ctrla_reg_t hri_aes_read_CTRLA_CTYPE_bf(const void *const hw)
+{
+ uint32_t tmp;
+ tmp = ((Aes *)hw)->CTRLA.reg;
+ tmp = (tmp & AES_CTRLA_CTYPE_Msk) >> AES_CTRLA_CTYPE_Pos;
+ return tmp;
+}
+
+static inline void hri_aes_set_CTRLA_reg(const void *const hw, hri_aes_ctrla_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg |= mask;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_aes_ctrla_reg_t hri_aes_get_CTRLA_reg(const void *const hw, hri_aes_ctrla_reg_t mask)
+{
+ uint32_t tmp;
+ tmp = ((Aes *)hw)->CTRLA.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline void hri_aes_write_CTRLA_reg(const void *const hw, hri_aes_ctrla_reg_t data)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg = data;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_clear_CTRLA_reg(const void *const hw, hri_aes_ctrla_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg &= ~mask;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_toggle_CTRLA_reg(const void *const hw, hri_aes_ctrla_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLA.reg ^= mask;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_aes_ctrla_reg_t hri_aes_read_CTRLA_reg(const void *const hw)
+{
+ return ((Aes *)hw)->CTRLA.reg;
+}
+
+static inline void hri_aes_set_CTRLB_START_bit(const void *const hw)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLB.reg |= AES_CTRLB_START;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_aes_get_CTRLB_START_bit(const void *const hw)
+{
+ uint8_t tmp;
+ tmp = ((Aes *)hw)->CTRLB.reg;
+ tmp = (tmp & AES_CTRLB_START) >> AES_CTRLB_START_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_aes_write_CTRLB_START_bit(const void *const hw, bool value)
+{
+ uint8_t tmp;
+ AES_CRITICAL_SECTION_ENTER();
+ tmp = ((Aes *)hw)->CTRLB.reg;
+ tmp &= ~AES_CTRLB_START;
+ tmp |= value << AES_CTRLB_START_Pos;
+ ((Aes *)hw)->CTRLB.reg = tmp;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_clear_CTRLB_START_bit(const void *const hw)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLB.reg &= ~AES_CTRLB_START;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_toggle_CTRLB_START_bit(const void *const hw)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLB.reg ^= AES_CTRLB_START;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_set_CTRLB_NEWMSG_bit(const void *const hw)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLB.reg |= AES_CTRLB_NEWMSG;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_aes_get_CTRLB_NEWMSG_bit(const void *const hw)
+{
+ uint8_t tmp;
+ tmp = ((Aes *)hw)->CTRLB.reg;
+ tmp = (tmp & AES_CTRLB_NEWMSG) >> AES_CTRLB_NEWMSG_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_aes_write_CTRLB_NEWMSG_bit(const void *const hw, bool value)
+{
+ uint8_t tmp;
+ AES_CRITICAL_SECTION_ENTER();
+ tmp = ((Aes *)hw)->CTRLB.reg;
+ tmp &= ~AES_CTRLB_NEWMSG;
+ tmp |= value << AES_CTRLB_NEWMSG_Pos;
+ ((Aes *)hw)->CTRLB.reg = tmp;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_clear_CTRLB_NEWMSG_bit(const void *const hw)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLB.reg &= ~AES_CTRLB_NEWMSG;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_toggle_CTRLB_NEWMSG_bit(const void *const hw)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLB.reg ^= AES_CTRLB_NEWMSG;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_set_CTRLB_EOM_bit(const void *const hw)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLB.reg |= AES_CTRLB_EOM;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_aes_get_CTRLB_EOM_bit(const void *const hw)
+{
+ uint8_t tmp;
+ tmp = ((Aes *)hw)->CTRLB.reg;
+ tmp = (tmp & AES_CTRLB_EOM) >> AES_CTRLB_EOM_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_aes_write_CTRLB_EOM_bit(const void *const hw, bool value)
+{
+ uint8_t tmp;
+ AES_CRITICAL_SECTION_ENTER();
+ tmp = ((Aes *)hw)->CTRLB.reg;
+ tmp &= ~AES_CTRLB_EOM;
+ tmp |= value << AES_CTRLB_EOM_Pos;
+ ((Aes *)hw)->CTRLB.reg = tmp;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_clear_CTRLB_EOM_bit(const void *const hw)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLB.reg &= ~AES_CTRLB_EOM;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_toggle_CTRLB_EOM_bit(const void *const hw)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLB.reg ^= AES_CTRLB_EOM;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_set_CTRLB_GFMUL_bit(const void *const hw)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLB.reg |= AES_CTRLB_GFMUL;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_aes_get_CTRLB_GFMUL_bit(const void *const hw)
+{
+ uint8_t tmp;
+ tmp = ((Aes *)hw)->CTRLB.reg;
+ tmp = (tmp & AES_CTRLB_GFMUL) >> AES_CTRLB_GFMUL_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_aes_write_CTRLB_GFMUL_bit(const void *const hw, bool value)
+{
+ uint8_t tmp;
+ AES_CRITICAL_SECTION_ENTER();
+ tmp = ((Aes *)hw)->CTRLB.reg;
+ tmp &= ~AES_CTRLB_GFMUL;
+ tmp |= value << AES_CTRLB_GFMUL_Pos;
+ ((Aes *)hw)->CTRLB.reg = tmp;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_clear_CTRLB_GFMUL_bit(const void *const hw)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLB.reg &= ~AES_CTRLB_GFMUL;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_toggle_CTRLB_GFMUL_bit(const void *const hw)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLB.reg ^= AES_CTRLB_GFMUL;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_set_CTRLB_reg(const void *const hw, hri_aes_ctrlb_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLB.reg |= mask;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_aes_ctrlb_reg_t hri_aes_get_CTRLB_reg(const void *const hw, hri_aes_ctrlb_reg_t mask)
+{
+ uint8_t tmp;
+ tmp = ((Aes *)hw)->CTRLB.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline void hri_aes_write_CTRLB_reg(const void *const hw, hri_aes_ctrlb_reg_t data)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLB.reg = data;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_clear_CTRLB_reg(const void *const hw, hri_aes_ctrlb_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLB.reg &= ~mask;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_toggle_CTRLB_reg(const void *const hw, hri_aes_ctrlb_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CTRLB.reg ^= mask;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_aes_ctrlb_reg_t hri_aes_read_CTRLB_reg(const void *const hw)
+{
+ return ((Aes *)hw)->CTRLB.reg;
+}
+
+static inline void hri_aes_set_DATABUFPTR_INDATAPTR_bf(const void *const hw, hri_aes_databufptr_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->DATABUFPTR.reg |= AES_DATABUFPTR_INDATAPTR(mask);
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_aes_databufptr_reg_t hri_aes_get_DATABUFPTR_INDATAPTR_bf(const void *const hw,
+ hri_aes_databufptr_reg_t mask)
+{
+ uint8_t tmp;
+ tmp = ((Aes *)hw)->DATABUFPTR.reg;
+ tmp = (tmp & AES_DATABUFPTR_INDATAPTR(mask)) >> AES_DATABUFPTR_INDATAPTR_Pos;
+ return tmp;
+}
+
+static inline void hri_aes_write_DATABUFPTR_INDATAPTR_bf(const void *const hw, hri_aes_databufptr_reg_t data)
+{
+ uint8_t tmp;
+ AES_CRITICAL_SECTION_ENTER();
+ tmp = ((Aes *)hw)->DATABUFPTR.reg;
+ tmp &= ~AES_DATABUFPTR_INDATAPTR_Msk;
+ tmp |= AES_DATABUFPTR_INDATAPTR(data);
+ ((Aes *)hw)->DATABUFPTR.reg = tmp;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_clear_DATABUFPTR_INDATAPTR_bf(const void *const hw, hri_aes_databufptr_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->DATABUFPTR.reg &= ~AES_DATABUFPTR_INDATAPTR(mask);
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_toggle_DATABUFPTR_INDATAPTR_bf(const void *const hw, hri_aes_databufptr_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->DATABUFPTR.reg ^= AES_DATABUFPTR_INDATAPTR(mask);
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_aes_databufptr_reg_t hri_aes_read_DATABUFPTR_INDATAPTR_bf(const void *const hw)
+{
+ uint8_t tmp;
+ tmp = ((Aes *)hw)->DATABUFPTR.reg;
+ tmp = (tmp & AES_DATABUFPTR_INDATAPTR_Msk) >> AES_DATABUFPTR_INDATAPTR_Pos;
+ return tmp;
+}
+
+static inline void hri_aes_set_DATABUFPTR_reg(const void *const hw, hri_aes_databufptr_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->DATABUFPTR.reg |= mask;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_aes_databufptr_reg_t hri_aes_get_DATABUFPTR_reg(const void *const hw, hri_aes_databufptr_reg_t mask)
+{
+ uint8_t tmp;
+ tmp = ((Aes *)hw)->DATABUFPTR.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline void hri_aes_write_DATABUFPTR_reg(const void *const hw, hri_aes_databufptr_reg_t data)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->DATABUFPTR.reg = data;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_clear_DATABUFPTR_reg(const void *const hw, hri_aes_databufptr_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->DATABUFPTR.reg &= ~mask;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_toggle_DATABUFPTR_reg(const void *const hw, hri_aes_databufptr_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->DATABUFPTR.reg ^= mask;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_aes_databufptr_reg_t hri_aes_read_DATABUFPTR_reg(const void *const hw)
+{
+ return ((Aes *)hw)->DATABUFPTR.reg;
+}
+
+static inline void hri_aes_set_DBGCTRL_DBGRUN_bit(const void *const hw)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->DBGCTRL.reg |= AES_DBGCTRL_DBGRUN;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline bool hri_aes_get_DBGCTRL_DBGRUN_bit(const void *const hw)
+{
+ uint8_t tmp;
+ tmp = ((Aes *)hw)->DBGCTRL.reg;
+ tmp = (tmp & AES_DBGCTRL_DBGRUN) >> AES_DBGCTRL_DBGRUN_Pos;
+ return (bool)tmp;
+}
+
+static inline void hri_aes_write_DBGCTRL_DBGRUN_bit(const void *const hw, bool value)
+{
+ uint8_t tmp;
+ AES_CRITICAL_SECTION_ENTER();
+ tmp = ((Aes *)hw)->DBGCTRL.reg;
+ tmp &= ~AES_DBGCTRL_DBGRUN;
+ tmp |= value << AES_DBGCTRL_DBGRUN_Pos;
+ ((Aes *)hw)->DBGCTRL.reg = tmp;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_clear_DBGCTRL_DBGRUN_bit(const void *const hw)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->DBGCTRL.reg &= ~AES_DBGCTRL_DBGRUN;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_toggle_DBGCTRL_DBGRUN_bit(const void *const hw)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->DBGCTRL.reg ^= AES_DBGCTRL_DBGRUN;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_set_DBGCTRL_reg(const void *const hw, hri_aes_dbgctrl_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->DBGCTRL.reg |= mask;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_aes_dbgctrl_reg_t hri_aes_get_DBGCTRL_reg(const void *const hw, hri_aes_dbgctrl_reg_t mask)
+{
+ uint8_t tmp;
+ tmp = ((Aes *)hw)->DBGCTRL.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline void hri_aes_write_DBGCTRL_reg(const void *const hw, hri_aes_dbgctrl_reg_t data)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->DBGCTRL.reg = data;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_clear_DBGCTRL_reg(const void *const hw, hri_aes_dbgctrl_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->DBGCTRL.reg &= ~mask;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_toggle_DBGCTRL_reg(const void *const hw, hri_aes_dbgctrl_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->DBGCTRL.reg ^= mask;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_aes_dbgctrl_reg_t hri_aes_read_DBGCTRL_reg(const void *const hw)
+{
+ return ((Aes *)hw)->DBGCTRL.reg;
+}
+
+static inline void hri_aes_set_INDATA_reg(const void *const hw, hri_aes_indata_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->INDATA.reg |= mask;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_aes_indata_reg_t hri_aes_get_INDATA_reg(const void *const hw, hri_aes_indata_reg_t mask)
+{
+ uint32_t tmp;
+ tmp = ((Aes *)hw)->INDATA.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline void hri_aes_write_INDATA_reg(const void *const hw, hri_aes_indata_reg_t data)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->INDATA.reg = data;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_clear_INDATA_reg(const void *const hw, hri_aes_indata_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->INDATA.reg &= ~mask;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_toggle_INDATA_reg(const void *const hw, hri_aes_indata_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->INDATA.reg ^= mask;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_aes_indata_reg_t hri_aes_read_INDATA_reg(const void *const hw)
+{
+ return ((Aes *)hw)->INDATA.reg;
+}
+
+static inline void hri_aes_set_HASHKEY_reg(const void *const hw, uint8_t index, hri_aes_hashkey_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->HASHKEY[index].reg |= mask;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_aes_hashkey_reg_t hri_aes_get_HASHKEY_reg(const void *const hw, uint8_t index,
+ hri_aes_hashkey_reg_t mask)
+{
+ uint32_t tmp;
+ tmp = ((Aes *)hw)->HASHKEY[index].reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline void hri_aes_write_HASHKEY_reg(const void *const hw, uint8_t index, hri_aes_hashkey_reg_t data)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->HASHKEY[index].reg = data;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_clear_HASHKEY_reg(const void *const hw, uint8_t index, hri_aes_hashkey_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->HASHKEY[index].reg &= ~mask;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_toggle_HASHKEY_reg(const void *const hw, uint8_t index, hri_aes_hashkey_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->HASHKEY[index].reg ^= mask;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_aes_hashkey_reg_t hri_aes_read_HASHKEY_reg(const void *const hw, uint8_t index)
+{
+ return ((Aes *)hw)->HASHKEY[index].reg;
+}
+
+static inline void hri_aes_set_GHASH_reg(const void *const hw, uint8_t index, hri_aes_ghash_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->GHASH[index].reg |= mask;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_aes_ghash_reg_t hri_aes_get_GHASH_reg(const void *const hw, uint8_t index, hri_aes_ghash_reg_t mask)
+{
+ uint32_t tmp;
+ tmp = ((Aes *)hw)->GHASH[index].reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline void hri_aes_write_GHASH_reg(const void *const hw, uint8_t index, hri_aes_ghash_reg_t data)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->GHASH[index].reg = data;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_clear_GHASH_reg(const void *const hw, uint8_t index, hri_aes_ghash_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->GHASH[index].reg &= ~mask;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_toggle_GHASH_reg(const void *const hw, uint8_t index, hri_aes_ghash_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->GHASH[index].reg ^= mask;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_aes_ghash_reg_t hri_aes_read_GHASH_reg(const void *const hw, uint8_t index)
+{
+ return ((Aes *)hw)->GHASH[index].reg;
+}
+
+static inline void hri_aes_set_CIPLEN_reg(const void *const hw, hri_aes_ciplen_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CIPLEN.reg |= mask;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_aes_ciplen_reg_t hri_aes_get_CIPLEN_reg(const void *const hw, hri_aes_ciplen_reg_t mask)
+{
+ uint32_t tmp;
+ tmp = ((Aes *)hw)->CIPLEN.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline void hri_aes_write_CIPLEN_reg(const void *const hw, hri_aes_ciplen_reg_t data)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CIPLEN.reg = data;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_clear_CIPLEN_reg(const void *const hw, hri_aes_ciplen_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CIPLEN.reg &= ~mask;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_toggle_CIPLEN_reg(const void *const hw, hri_aes_ciplen_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->CIPLEN.reg ^= mask;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_aes_ciplen_reg_t hri_aes_read_CIPLEN_reg(const void *const hw)
+{
+ return ((Aes *)hw)->CIPLEN.reg;
+}
+
+static inline void hri_aes_set_RANDSEED_reg(const void *const hw, hri_aes_randseed_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->RANDSEED.reg |= mask;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_aes_randseed_reg_t hri_aes_get_RANDSEED_reg(const void *const hw, hri_aes_randseed_reg_t mask)
+{
+ uint32_t tmp;
+ tmp = ((Aes *)hw)->RANDSEED.reg;
+ tmp &= mask;
+ return tmp;
+}
+
+static inline void hri_aes_write_RANDSEED_reg(const void *const hw, hri_aes_randseed_reg_t data)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->RANDSEED.reg = data;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_clear_RANDSEED_reg(const void *const hw, hri_aes_randseed_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->RANDSEED.reg &= ~mask;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_toggle_RANDSEED_reg(const void *const hw, hri_aes_randseed_reg_t mask)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->RANDSEED.reg ^= mask;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline hri_aes_randseed_reg_t hri_aes_read_RANDSEED_reg(const void *const hw)
+{
+ return ((Aes *)hw)->RANDSEED.reg;
+}
+
+static inline void hri_aes_write_KEYWORD_reg(const void *const hw, uint8_t index, hri_aes_keyword_reg_t data)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->KEYWORD[index].reg = data;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+static inline void hri_aes_write_INTVECTV_reg(const void *const hw, uint8_t index, hri_aes_intvectv_reg_t data)
+{
+ AES_CRITICAL_SECTION_ENTER();
+ ((Aes *)hw)->INTVECTV[index].reg = data;
+ AES_CRITICAL_SECTION_LEAVE();
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _HRI_AES_E54_H_INCLUDED */
+#endif /* _SAME54_AES_COMPONENT_ */
diff --git a/Examples/AS5048A_test/AS5048A_test/hri/hri_can_e54.h b/Examples/AS5048A_test/AS5048A_test/hri/hri_can_e54.h
new file mode 100644
index 0000000..2c02884
--- /dev/null
+++ b/Examples/AS5048A_test/AS5048A_test/hri/hri_can_e54.h
@@ -0,0 +1,16997 @@
+/**
+ * \file
+ *
+ * \brief SAM CAN
+ *
+ * Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifdef _SAME54_CAN_COMPONENT_
+#ifndef _HRI_CAN_E54_H_INCLUDED_
+#define _HRI_CAN_E54_H_INCLUDED_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+#include