You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.1 KiB
50 lines
1.1 KiB
#pragma once
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
#include "thisdevice.h"
|
|
|
|
typedef void (*ozone_onexception_cb_t)(error_t error);
|
|
|
|
typedef struct {
|
|
uint32_t minfreq; //
|
|
uint32_t maxfreq;
|
|
uint32_t stepfreq;
|
|
|
|
float level1_expect_power;
|
|
float level2_expect_power;
|
|
|
|
ozone_onexception_cb_t onexception;
|
|
|
|
} ozone_control_config_t;
|
|
|
|
void ozone_control_init(ozone_control_config_t *config);
|
|
|
|
void ozone_control_set_level(level_t level);
|
|
void ozone_control_start();
|
|
void ozone_control_stop();
|
|
|
|
float ozone_control_get_power();
|
|
void ozone_control_schedule();
|
|
|
|
/**
|
|
*
|
|
* 策略1
|
|
* 先扫频扫到谐振频率点,在频率点后面,找到拼配功率的频率,并设置频率
|
|
*
|
|
* 运行中:
|
|
* 如果频率大于 (期望频率+窗口/2),减小频率,直到功率小于期望功率
|
|
* 如果频率小于 (期望频率-窗口/2),增加频率,直到功率大于期望功率
|
|
*
|
|
*
|
|
* 正常情况:
|
|
* 滑窗找到最小值,第一最小值,和第二最小值,就是第一个频率,和第二个频率。
|
|
*
|
|
* 非正常情况:
|
|
* 平均值
|
|
*
|
|
*
|
|
*
|
|
*
|
|
*
|
|
*/
|