41 lines
903 B
C
41 lines
903 B
C
#ifndef __MODE_PWM_H__
|
|
#define __MODE_PWM_H__
|
|
#include "lib.h"
|
|
#include "filter.h"
|
|
|
|
|
|
typedef enum
|
|
{
|
|
PWM_PROCESS_CONTROL = 1,
|
|
PWM_PROCESS_ADJUST,
|
|
PWM_PROCESS_STOP,
|
|
PWM_PROCESS_TEST,
|
|
} mode_pwm_process_state_e; // 处理状态
|
|
|
|
typedef union
|
|
{
|
|
uint8_t data[128];
|
|
} mode_pwm_params_u;
|
|
|
|
typedef struct
|
|
{
|
|
uint16_t arr_default; // 默认值array
|
|
uint16_t current_adc; // 当前位置反馈的AD值
|
|
uint16_t output;
|
|
__IO uint32_t time_ticks;
|
|
uint8_t process_state;
|
|
mode_pwm_params_u *data;
|
|
} mode_pwm_t;
|
|
|
|
extern mode_pwm_t *mode_pwm;
|
|
|
|
void mode_pwm_init(mode_pwm_params_u *params, void (*params_save_cb)(void)); ///< 初始化
|
|
void mode_pwm_dinit(void); ///< 反初始化
|
|
void mode_pwm_process(void); ///< 处理函数
|
|
|
|
#endif
|
|
|
|
/**
|
|
* 实验室 1426 2668 243 285
|
|
*/
|