Files
kunlun/import/sby/inc/lib_twacs_api.h
2024-09-28 14:24:04 +08:00

51 lines
1.2 KiB
C
Executable File
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 _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