79 static volatile uint16_t
test = 0;
95 static volatile uint16_t
VDC_bus[] = {0, 0};
98 static volatile uint16_t
Temp[] = {0, 0, 0};
179 10, 11, 12, 14, 15, 17, 20, 24, 28, \
180 29, 31, 33, 35, 37, 41, 43, 47, 51, 56};
218 __attribute__((section(
".ram_code")))
229 if(XMC_USIC_CH_RXFIFO_GetLevel(UART_XMC13.channel))
232 retval = (uint16_t) UART_XMC13.channel->OUTR;
238 if ((UART_XMC13.channel->RBUFSR & 0x200))
281 __attribute__((section(
".ram_code")))
293 else if (ps_on.gpio_port->IN & 0x8)
307 else if (!(ps_on.gpio_port->IN & 0x8))
370 XMC_CCU8_SLICE_StopTimer(llc_pwm.ccu8_slice_ptr);
371 XMC_CCU8_SLICE_StopTimer(sync1.ccu8_slice_ptr);
372 XMC_CCU8_SLICE_StopTimer(sync2.ccu8_slice_ptr);
375 XMC_CCU8_SLICE_ClearTimer(llc_pwm.ccu8_slice_ptr);
376 XMC_CCU8_SLICE_ClearTimer(sync1.ccu8_slice_ptr);
377 XMC_CCU8_SLICE_ClearTimer(sync2.ccu8_slice_ptr);
381 llc_pwm.ccu8_slice_ptr->PRS =
PR_START;
383 llc_pwm.ccu8_slice_ptr->CR2S =
ADC_START;
390 sync1.ccu8_slice_ptr->CR1S = 0;
391 sync1.ccu8_slice_ptr->CR2S = 0;
394 sync2.ccu8_slice_ptr->CR1S = 0;
395 sync2.ccu8_slice_ptr->CR2S = 0;
402 XMC_CCU8_SLICE_StartTimer(sync1.ccu8_slice_ptr);
403 XMC_CCU8_SLICE_StartTimer(sync2.ccu8_slice_ptr);
411 NVIC_ClearPendingIRQ(start_sequence.node);
412 NVIC_EnableIRQ(start_sequence.node);
452 CCU80_CC83->CR1S = 0;
453 CCU80->GCSS |= CCU8_GCSS_S3SE_Msk;
470 NVIC_ClearPendingIRQ(HRPWM_3_IRQn);
471 NVIC_DisableIRQ(HRPWM_3_IRQn);
497 XMC_GPIO_SetOutputLow(P0_7);
498 XMC_GPIO_SetOutputHigh(P0_8);
517 XMC_VADC_GROUP_QueueTriggerConversion(VADC_G0);
521 CCU80_CC83->CR1S = 0xFFFF;
522 CCU80->GCSS |= CCU8_GCSS_S3SE_Msk;
528 XMC_GPIO_SetOutputLow(P0_7);
529 XMC_GPIO_SetOutputLow(P0_8);
538 llc_pwm.ccu8_slice_ptr->TCSET |= CCU8_CC8_TCSET_TRBS_Msk;
613 CCU80_CC83->CR1S = 0xFFFF;
614 CCU80->GCSS |= CCU8_GCSS_S3SE_Msk;
657 __attribute__((section(
".ram_code")))
769 if (voltage_int_ctr.
error[0] < 150)
818 voltage_int_ctr.
error[2] = voltage_int_ctr.
error[0];
819 voltage_int_ctr.
error[1] = voltage_int_ctr.
error[0];
832 voltage_int_ctr.
int_calc = (int32_t)voltage_int_ctr.
a[0] * (int32_t)voltage_int_ctr.
error[0];
833 voltage_int_ctr.
int_calc += (int32_t)voltage_int_ctr.
a[1] * (int32_t)voltage_int_ctr.
error[1];
834 voltage_int_ctr.
int_calc += (int32_t)voltage_int_ctr.
a[2] * (int32_t)voltage_int_ctr.
error[2];
882 llc_pwm.ccu8_slice_ptr->CR1S = (*voltage_int_ctr.
output >> 1)+1;
883 llc_pwm.ccu8_slice_ptr->CR2S = (*voltage_int_ctr.
output >> 2);
884 llc_pwm.ccu8_slice_ptr->PRS = *voltage_int_ctr.
output;
887 llc_pwm.hrc_slice_ptr->SDCR = LLC.
deadtime;
888 llc_pwm.hrc_slice_ptr->SDCF = LLC.
deadtime;
911 timer_replica.ccu8_slice_ptr->PRS = *voltage_int_ctr.
output;
923 voltage_int_ctr.
error[2] = voltage_int_ctr.
error[1];
924 voltage_int_ctr.
error[1] = voltage_int_ctr.
error[0];
942 __attribute__((section(
".ram_code")))
956 CCU80_CC83->CR1S = 0;
957 CCU80->GCSS |= CCU8_GCSS_S3SE_Msk;
967 llc_pwm.ccu8_slice_ptr->CR1S = (*voltage_int_ctr.
output >> 1)+1;
971 llc_pwm.hrc_slice_ptr->SDCR = LLC.
deadtime;
972 llc_pwm.hrc_slice_ptr->SDCF = LLC.
deadtime;
975 sync1.ccu8_slice_ptr->CR1S = 43+LLC.
deadtime;
977 sync2.ccu8_slice_ptr->CR1S = 43+LLC.
deadtime;
1004 #ifndef DOXYGEN_SKIP
1005 __attribute__((section(
".ram_code")))
1011 if (XMC_USIC_CH_TXFIFO_GetLevel(UART_XMC13.channel) > 4)
1018 UART_XMC13.channel->IN[0U] = (0x8000 | 0x1000 |
fault_reg);
1019 UART_XMC13.channel->IN[0U] = (((uint16_t)(LLC.
qIout) << 3));
1044 __attribute__((section(
".ram_code")))
1098 __attribute__((section(
".ram_code")))
1106 llc_pwm.ccu8_slice_ptr->PRS = 111;
1107 llc_pwm.ccu8_slice_ptr->CR1S = 48;
1108 llc_pwm.ccu8_slice_ptr->CR2S = 14;
1109 llc_pwm.ccu8_module_ptr->GCSS |= llc_pwm.shadow_txfr_msk;
1116 llc_pwm.ccu8_slice_ptr->PRS = 111;
1117 llc_pwm.ccu8_slice_ptr->CR1S = 56;
1118 llc_pwm.ccu8_slice_ptr->CR2S = 14;
1119 llc_pwm.ccu8_module_ptr->GCSS |= llc_pwm.shadow_txfr_msk;
1127 llc_pwm.ccu8_slice_ptr->CR1S =
START_FREQ >> 1;
1128 llc_pwm.ccu8_slice_ptr->CR2S =
START_FREQ >> 2;
1129 llc_pwm.ccu8_module_ptr->GCSS |= llc_pwm.shadow_txfr_msk;
1132 NVIC_DisableIRQ(start_sequence.node);
1135 NVIC_ClearPendingIRQ(HRPWM_3_IRQn);
1136 NVIC_EnableIRQ(HRPWM_3_IRQn);
1150 __attribute__((section(
".ram_code")))
1161 XMC_CCU8_SLICE_StopTimer(llc_pwm.ccu8_slice_ptr);