12345678910111213141516171819202122232425262728293031323334353637383940 |
- #ifndef __HAL_PWM_H__
- #define __HAL_PWM_H__
-
- #include "hc32_ll.h"
- #include "hc32_ll_tmra.h"
- #include "hc32_ll_fcg.h"
- #define TMRA_UNIT1 (CM_TMRA_3)
- #define TMRA_PERIPH_CLK1 (PWC_FCG2_TMRA_3)
- #define TMRA_PWM_CH1 (TMRA_CH5)
- #define TMRA_PWM_PORT1 (GPIO_PORT_E)
- #define TMRA_PWM_PIN1 (GPIO_PIN_02)
- #define TMRA_PWM_PIN_FUNC1 (GPIO_FUNC_4)
- #define TMRA_MD1 (TMRA_MD_SAWTOOTH)
- #define TMRA_DIR1 (TMRA_DIR_UP)
- #define TMRA_PERIOD_VAL1 (1000U - 1U)
- #define TMRA_PWM_CMP_VAL1 (200U - 1U)
- #define TMRA_UNIT2 (CM_TMRA_3)
- #define TMRA_PERIPH_CLK2 (PWC_FCG2_TMRA_3)
- #define TMRA_PWM_CH2 (TMRA_CH6)
- #define TMRA_PWM_PORT2 (GPIO_PORT_E)
- #define TMRA_PWM_PIN2 (GPIO_PIN_03)
- #define TMRA_PWM_PIN_FUNC2 (GPIO_FUNC_4)
- #define TMRA_MD2 (TMRA_MD_SAWTOOTH)
- #define TMRA_DIR2 (TMRA_DIR_UP)
- #define TMRA_PERIOD_VAL2 (1000U - 1U)
- #define TMRA_PWM_CMP_VAL2 (300U - 1U)
- void time_pwm_out(void);
- #endif
|