Обновление

This commit is contained in:
cfif 2026-02-11 16:54:49 +03:00
parent 712e430fb5
commit 05ae1da3b1
1 changed files with 22 additions and 21 deletions

43
Pwms.c
View File

@ -46,7 +46,7 @@ void Bsp_Tpu_PwmRearOverflowCallBack(void) {
} }
void Bsp_Tpu_PwmRearCaptureCallback(void) { void Bsp_Tpu_PwmRearCaptureCallback(void) {
Get_Set_Tpu_PwmCaptureCallback(&PWMS.pwmFrontCapture); Get_Set_Tpu_PwmCaptureCallback(&PWMS.pwmRearCapture);
} }
void Bsp_Tpu_PwmRearCapture_OverflowCallBack(void) { void Bsp_Tpu_PwmRearCapture_OverflowCallBack(void) {
@ -160,7 +160,7 @@ void Pwms_Init(tLoggerInterface *logger) {
PWM_Initial( PWM_Initial(
&env->pwmRear, &env->pwmRear,
true, false,
PERIOD_TICKS, PERIOD_TICKS,
PERIOD_TICKS * 5 / 100, PERIOD_TICKS * 5 / 100,
27U, 27U,
@ -169,7 +169,7 @@ void Pwms_Init(tLoggerInterface *logger) {
Bsp_Tpu_PwmRearOverflowCallBack Bsp_Tpu_PwmRearOverflowCallBack
); );
env->pwmFrontIo = vPwmGetIo(&env->pwmFront); env->pwmRearIo = vPwmGetIo(&env->pwmRear);
// TPU_CH17: PortD 21: ALT4 // TPU_CH17: PortD 21: ALT4
@ -188,6 +188,7 @@ void Pwms_Init(tLoggerInterface *logger) {
env->pwmRearCaptureIO = vPwmCaptureGetIo(&env->pwmRearCapture); env->pwmRearCaptureIO = vPwmCaptureGetIo(&env->pwmRearCapture);
//конец--------------------------PwmRear------------------------------------------------- //конец--------------------------PwmRear-------------------------------------------------
//конец--------------------------PwmRear------------------------------------------------- //конец--------------------------PwmRear-------------------------------------------------
//конец--------------------------PwmRear------------------------------------------------- //конец--------------------------PwmRear-------------------------------------------------
@ -196,34 +197,34 @@ void Pwms_Init(tLoggerInterface *logger) {
//начало--------------------------PwmFrontReserve------------------------------------------------- //начало--------------------------PwmFrontReserve-------------------------------------------------
//начало--------------------------PwmFrontReserve------------------------------------------------- //начало--------------------------PwmFrontReserve-------------------------------------------------
// TPU_CH23: PortD 30: ALT6 // TPU_CH15: PortD 30: ALT6
tInitStruct.u32PortPins = PORT_PIN_31; tInitStruct.u32PortPins = PORT_PIN_30;
tInitStruct.uPortPinMux.u32PortPinMode = PORT_ALT6_FUNC_MODE; tInitStruct.uPortPinMux.u32PortPinMode = PORT_ALT6_FUNC_MODE;
PORT_InitPins(PORT_C, &tInitStruct); PORT_InitPins(PORT_D, &tInitStruct);
PWM_Initial( PWM_Initial(
&env->pwmFrontReserved, &env->pwmFrontReserved,
true, false,
PERIOD_TICKS, PERIOD_TICKS,
PERIOD_TICKS * 5 / 100, PERIOD_TICKS * 5 / 100,
23U, 15U,
0xFF, 0xFF,
Bsp_Tpu_PwmFrontReserveCallback, Bsp_Tpu_PwmFrontReserveCallback,
Bsp_Tpu_PwmFrontReserveOverflowCallBack Bsp_Tpu_PwmFrontReserveOverflowCallBack
); );
env->pwmFrontIo = vPwmGetIo(&env->pwmFrontReserved); env->pwmFrontReservedIo = vPwmGetIo(&env->pwmFrontReserved);
// TPU_CH21: PortC 29: ALT6 // TPU_CH16: PortC 29: ALT6
tInitStruct.u32PortPins = PORT_PIN_29; tInitStruct.u32PortPins = PORT_PIN_29;
tInitStruct.uPortPinMux.u32PortPinMode = PORT_ALT6_FUNC_MODE; tInitStruct.uPortPinMux.u32PortPinMode = PORT_ALT6_FUNC_MODE;
PORT_InitPins(PORT_C, &tInitStruct); PORT_InitPins(PORT_D, &tInitStruct);
PWM_Capture_Initial( PWM_Capture_Initial(
&env->pwmFrontReservedCapture, &env->pwmFrontReservedCapture,
false, false,
21U, 14U,
0xFF, 0xFF,
Bsp_Tpu_PwmFrontReserveCaptureCallback, Bsp_Tpu_PwmFrontReserveCaptureCallback,
Bsp_Tpu_PwmFrontReserveCapture_OverflowCallBack Bsp_Tpu_PwmFrontReserveCapture_OverflowCallBack
@ -239,34 +240,34 @@ void Pwms_Init(tLoggerInterface *logger) {
//начало--------------------------PwmRearReserve------------------------------------------------- //начало--------------------------PwmRearReserve-------------------------------------------------
//начало--------------------------PwmRearReserve------------------------------------------------- //начало--------------------------PwmRearReserve-------------------------------------------------
// TPU_CH15: PortD 30: ALT6 // TPU_CH23: PortC 31: ALT6
tInitStruct.u32PortPins = PORT_PIN_30; tInitStruct.u32PortPins = PORT_PIN_31;
tInitStruct.uPortPinMux.u32PortPinMode = PORT_ALT6_FUNC_MODE; tInitStruct.uPortPinMux.u32PortPinMode = PORT_ALT6_FUNC_MODE;
PORT_InitPins(PORT_D, &tInitStruct); PORT_InitPins(PORT_C, &tInitStruct);
PWM_Initial( PWM_Initial(
&env->pwmRearReserved, &env->pwmRearReserved,
true, false,
PERIOD_TICKS, PERIOD_TICKS,
PERIOD_TICKS * 5 / 100, PERIOD_TICKS * 5 / 100,
15U, 23U,
0xFF, 0xFF,
Bsp_Tpu_PwmRearReserveCallback, Bsp_Tpu_PwmRearReserveCallback,
Bsp_Tpu_PwmRearReserveOverflowCallBack Bsp_Tpu_PwmRearReserveOverflowCallBack
); );
env->pwmFrontIo = vPwmGetIo(&env->pwmRearReserved); env->pwmRearReservedIo = vPwmGetIo(&env->pwmRearReserved);
// TPU_CH14: PortD 29: ALT6 // TPU_CH21: PortD 29: ALT6
tInitStruct.u32PortPins = PORT_PIN_29; tInitStruct.u32PortPins = PORT_PIN_29;
tInitStruct.uPortPinMux.u32PortPinMode = PORT_ALT6_FUNC_MODE; tInitStruct.uPortPinMux.u32PortPinMode = PORT_ALT6_FUNC_MODE;
PORT_InitPins(PORT_D, &tInitStruct); PORT_InitPins(PORT_C, &tInitStruct);
PWM_Capture_Initial( PWM_Capture_Initial(
&env->pwmRearReservedCapture, &env->pwmRearReservedCapture,
false, false,
14U, 21U,
0xFF, 0xFF,
Bsp_Tpu_PwmRearReserveCaptureCallback, Bsp_Tpu_PwmRearReserveCaptureCallback,
Bsp_Tpu_PwmRearReserveCapture_OverflowCallBack Bsp_Tpu_PwmRearReserveCapture_OverflowCallBack