51 lines
1.2 KiB
C
51 lines
1.2 KiB
C
|
#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 // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȧ<EFBFBD><C8A6><EFBFBD><EFBFBD>
|
|||
|
#define PCB_ID_OPT 1 // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD>
|
|||
|
#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, // <20><><EFBFBD><EFBFBD>ģʽ<C4A3><CABD><EFBFBD><EFBFBD>
|
|||
|
DB_MODE1, // ģʽ1<CABD><31><EFBFBD><EFBFBD>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>32<33>ķ<EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD>ʽ:68+peak(2byte)+thrd(2byte)
|
|||
|
DB_MODE2, // ģʽ2<CABD><32><EFBFBD><EFBFBD>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD>ʽ:11+num(1byte)+[intv(1byte)+peak(2byte)]*num
|
|||
|
DB_MODE3, // ģʽ3<CABD><33><EFBFBD><EFBFBD>ӡ<EFBFBD><D3A1><EFBFBD>з<EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD>ʽ:77+peak(2byte)
|
|||
|
DB_MODE4, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>رչ<D8B1><D5B9><EFBFBD>һ<EFBFBD><D2BB>
|
|||
|
} 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<48><59><EFBFBD><EFBFBD><EFBFBD>ӿڣ<D3BF><DAA3><EFBFBD><EFBFBD><EFBFBD>оƬ<D0BE><C6AC><EFBFBD><EFBFBD><EFBFBD>ȹ<EFBFBD><C8B9>ܣ<EFBFBD><DCA3><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD>е<EFBFBD><D0B5><EFBFBD>
|
|||
|
void lib_phy_background_task(void);
|
|||
|
void lib_twacs_init(void);
|
|||
|
void lib_zc_inter(void);
|
|||
|
|
|||
|
// FLASH <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
#endif
|