?? fesc_5554lib.h
字號:
#define SSP_LOOP_TASK_PRIORITY 1
#define SPITX_SCAN_TASK_PRIORITY 3
#define SPIRX_SCAN_TASK_PRIORITY 5
//1MHz frenquency
#define EMIOS_IRQ_100MS 100000
#define EMIOS_IRQ_10MS 10000
#define EMIOS_IRQ_1000US 1000
#define EMIOS_IRQ_200US 200
#define EMIOS_IRQ_100US 100
#define EMIOS_IRQ_50US 50
#define EMIOS_IRQ_20US 20
#define EMIOS_IRQ_10US 10
#define SSP_TICK_PERIOD EMIOS_IRQ_100MS
#define SPI_MASTER_DAEMON_PERIOD EMIOS_IRQ_200US
#define SPIRX_SCAN_TASK_PERIOD EMIOS_IRQ_50US
/*====================================================================*/
/* @ */
/* ################################
## ##
## SSP special ##
## ##
################################ */
void SYNC_ONE_SSP_LOOP(void);
void init_MBCtrlBlock(MBCtrlBlock_tag* pt);
void SendMTData(void);
uint8_t ReadMFData(void);
/*====================================================================*/
/* @ */
/* ################################
## ##
## general ##
## ##
################################ */
void delay(uint32_t cnt);
uint8_t char2num(uint8_t inch);
void sys_clock_tick(void);
/*====================================================================*/
/* @ */
/* ################################
## ##
## DualPort buffer ##
## ##
################################ */
#define DP_BUF_FULL 0x11
#define DP_BUF_EMPTY 0x12
#define DP_BUF_SBP_RTSTUS_OK 0x01
void init_dpb (DP_BUF_tag* pt,uint8_t* mem ,uint32_t len);
uint8_t push_dpb_data(DP_BUF_tag* pt,uint8_t data);
uint8_t push_dpb_block(DP_BUF_tag* pt,uint8_t* buf,uint8_t len);
uint8_t pop_dpb_data (DP_BUF_tag* pt,uint8_t* data);
/*====================================================================*/
/* @ */
/* ################################
## ##
## Daemon ##
## ##
################################ */
void send_c_ESCIA_dpb(uint8_t schar);
void ESCIA_out_daemon(void);
void SYS_TICK_Daemon(void);
void FPGA_SPI_master_daemon(void);
void MT_SPI_master_daemon(void);
void MF_SPI_slave_daemon(void);
void MF_SPI_ALL_DONE_daemon(void);
/*====================================================================*/
/* @ */
/* ################################
## ##
## initial ##
## ##
################################ */
void pad_func_config( uint16_t port, uint16_t config);
void FESC_5554_init(void);
void init_GloVar(void);
/*====================================================================*/
/* @ */
/* ################################
## ##
## IRQ ##
## ##
################################ */
#define PRIO_CRITICAL_IRQ 10 /*The IRQ-prio lower than this will be masked in critical-operation*/
#define PRIO_SW4IRQ 0
#define EnableIRQ() {asm(" wrteei 1");}
#define DisableIRQ() {asm(" wrteei 0");}
/* 'uint8_t _cur_prio_save;' must be defined to use EnterCritical()/ExitCritical()*/
//#define EnterCritical() {_cur_prio_save = INTC.CPR.B.PRI;\
// INTC.CPR.B.PRI = PRIO_CRITICAL_IRQ;}
//#define ExitCritical() {INTC.CPR.B.PRI = _cur_prio_save;}
#define EnterCritical() DisableIRQ()
#define ExitCritical() EnableIRQ()
void init_IRQ(void);
void init_FPGA_GEN_MF_SPI_ALL_DONE_IRQ(void);
void init_FPGA_GEN_MF_SPI_slave_DAEMON_IRQ(void);
void init_EMIOS_GEN_SSP_LOOP_IRQ(void);
void init_EMIOS_GEN_SPI_master_DAEMON_IRQ(void);
void InvSBP_RTSTUS_OKe_SWI4(void);
void SwIrq4ISR(void);
/*====================================================================*/
/* @ */
/* ################################
## ##
## EMISO & GPIO ##
## ##
################################ */
#define SSP_MB_LED_ON 0
#define SSP_MB_LED_OFF 1
#define SSP_MB_LED_TOGGLE 2
#define LED_ROLE0 PIN_EMIOS2
#define LED_ROLE1 PIN_EMIOS3
#define LED_2OO2 PIN_EMIOS4
#define LED_MCU_STATUS PIN_EMIOS15
void init_EMIOS(void);
void set_GPIO(uint8_t pin,uint8_t val);
void set_led(uint8_t led,uint8_t status);
void refresh_SPI_Indicate_LED(void);
/*====================================================================*/
/* @ */
/* ################################
## ##
## ESCI ##
## ##
################################ */
void init_ESCI();
void send_c_ESCIA(uint8_t schar);
void send_c_ESCIB(uint8_t schar);
uint8_t get_c_ESCI_A(void);
uint8_t get_c_ESCI_B(void);
/*====================================================================*/
/* @ */
/* ################################
## ##
## SPI ##
## ##
################################ */
#define B_OL 0
#define B_IL 1
#define B_CL 2
#define B_OR 3
#define B_IR 4
#define B_CR 5
#define B_MT 6 //到對系去 to
#define B_MF 7 //從對系來 from
//-----------FPGA---------
void init_FPGA_SPI(void);
uint8_t FPGA_SPI_ready_send(uint8_t ch);
uint8_t FPGA_SPI_ready_read(uint8_t ch);
void FPGA_SPI_Send(uint8_t ch,uint8_t TxDATA);
uint8_t FPGA_SPI_Read(uint8_t ch);
uint8_t FPGA_SPI_Swap(uint8_t ch,uint8_t TxDATA);
/*====================================================================*/
/* @ */
/* ################################
## ##
## comm protocol ##
## ##
################################ */
void spiCommReset(uint8_t brd_no);
void init_SBP_Buf(uint8_t brd_no);
void dump_SBP_lastPack(uint8_t brd_no);
uint8_t SBP_Master_Parser(uint8_t brd_no,uint8_t cRx);
uint8_t SBP_Slave_Parser(SBPBuffer* SBPbufPt,uint8_t cRx);
void Quene_SPIMaster_Send(uint8_t brd_no,uint8_t command,uint16_t LID,uint8_t* buf,uint32_t len);
void Quene_SPIMaster_Read(uint8_t brd_no,uint8_t command,uint16_t LID);
/*====================================================================*/
/* @ */
/* ################################
## ##
## SPI cross check ##
## ##
################################ */
void init_SXC(void);
void SXC_master_verify(uint8_t brd_no);
void dump_SXC_CH_info(uint8_t brd_no);
/*====================================================================*/
/* @ */
/* ################################
## ##
## Terminal ##
## ##
################################ */
void TermActivityScan(void) ;
unsigned long TermGetNum(void);
uint8_t command_line_interface(void);
void printp(void (*PortToPut)(uint8_t), uint8_t * ctrl, ...);
/*====================================================================*/
/* @ */
/* ################################
## ##
## define Sys Error info ##
## ##
################################ */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -