51 lines
1.2 KiB
C
Executable File
51 lines
1.2 KiB
C
Executable File
#ifndef _LIB_TWACS_API_H_
|
||
#define _LIB_TWACS_API_H_
|
||
|
||
|
||
#include "fzsb.h"
|
||
#define LIB_ADDR48_SZ (6)
|
||
#define FLASH_SAVE_DATA_LEN (2+LIB_ADDR48_SZ+5+7+20+3)
|
||
|
||
#define PCB_ID_ZCT 0 // 耦合线圈方案
|
||
#define PCB_ID_OPT 1 // 光耦过零电路方案
|
||
#ifndef PCB_ID
|
||
#define PCB_ID PCB_ID_ZCT
|
||
#endif
|
||
|
||
//interface define
|
||
#define ITF_IDLE (0)
|
||
#define ITF_RX_DAT (1)
|
||
#define ITF_RX485_DAT (2)
|
||
|
||
#define PB5_LOW HT_GPIOB->PTDAT &=0xFFDF
|
||
#define PB5_HIGH HT_GPIOB->PTDAT |=0x0020
|
||
#define PB6_LOW HT_GPIOB->PTDAT &=0xFFBF
|
||
#define PB6_HIGH HT_GPIOB->PTDAT |=0x0040
|
||
|
||
typedef enum {
|
||
DB_DISABLE, // 调试模式开关
|
||
DB_MODE1, // 模式1,打印超过32的峰值,格式:68+peak(2byte)+thrd(2byte)
|
||
DB_MODE2, // 模式2,打印解调前的数据,格式:11+num(1byte)+[intv(1byte)+peak(2byte)]*num
|
||
DB_MODE3, // 模式3,打印所有峰值,格式:77+peak(2byte)
|
||
DB_MODE4, // 保留,和关闭功能一样
|
||
} debug_mode_t;
|
||
|
||
|
||
|
||
|
||
|
||
extern twacs_itf_t twacs_itf;
|
||
extern twacs_zc_vars_t twacs_zc_vars;
|
||
//extern flash_save_t flash_save;
|
||
|
||
void clk_init(void);
|
||
|
||
// PHY对外接口,与主芯片交互等功能,需要在主循环中调用
|
||
void lib_phy_background_task(void);
|
||
void lib_twacs_init(void);
|
||
void lib_zc_inter(void);
|
||
|
||
// FLASH 参数读写函数
|
||
|
||
#endif
|