41 lines
763 B
C
41 lines
763 B
C
//
|
|
// Created by Cfif on 14.12.23.
|
|
//
|
|
#include <stdbool.h>
|
|
#include "fc7xxx_driver_port.h"
|
|
#include "Pwms.h"
|
|
|
|
|
|
tPwms PWMS;
|
|
|
|
void Bsp_Tpu_PwmCallback(void) {
|
|
Get_Set_Tpu_PwmCallback(&PWMS.pwm);
|
|
}
|
|
|
|
void Bsp_Tpu_OverflowCallBack(void) {
|
|
|
|
}
|
|
|
|
void Pwms_Init() {
|
|
tPwms *env = &PWMS;
|
|
|
|
PORT_InitType tInitStruct = {0};
|
|
|
|
/* TPU_CH0: PortA 18: ALT4 */
|
|
tInitStruct.u32PortPins = PORT_PIN_18;
|
|
tInitStruct.uPortPinMux.u32PortPinMode = PORT_ALT4_FUNC_MODE;
|
|
PORT_InitPins(PORT_A, &tInitStruct);
|
|
|
|
PWM_Initial(
|
|
&env->pwm,
|
|
PERIOD_TICKS,
|
|
PERIOD_TICKS * 10 / 100,
|
|
0,
|
|
0x7,
|
|
Bsp_Tpu_PwmCallback,
|
|
Bsp_Tpu_OverflowCallBack
|
|
);
|
|
|
|
env->pwmIo = vPwmGetIo(&env->pwm);
|
|
}
|