This repository has been archived on 2025-01-02. You can view files and clone it, but cannot push or open issues or pull requests.
torsion/User/board/pdctrl.h

17 lines
356 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef _PDCTRL_H_
#define _PDCTRL_H_
#include "lib.h"
#define PDCTRL_SYS_FREQUENCY (32 * 1000) // 主频KHZ
typedef enum
{
PDCTRL_DAC = 1,
PDCTRL_PWM = 2,
} pdctrl_mode_e;
void pdctrl_init(pdctrl_mode_e mode, uint8_t pwm_frequency);
void pdctrl_out(uint16_t out);
uint16_t pdctrl_pwm_duty_convert_ccr(float32 pwm_duty);
#endif // _PDCTRL_H_