📄 phy_layer.h
字号:
/*********************************************************************************
* ST 7538 DEMOBOARD SOFTWARE Phy_Layer.h *
* *
* SPI uc<->modem functions V1.2 *
***********************************************************************************/
#ifndef __PHY_LAYER_H__
#define __PHY_LAYER_H__
/**********************************************************************************
* SPI_Init function: HW initialization
**********************************************************************************/
void SPI_Init(void);
/**********************************************************************************
* SPI_Enable function: enable SPI interrupt on falling edge of CLR/T pin
**********************************************************************************/
void SPI_Enable(void);
/**********************************************************************************
* SPI_Disable function: disable SPI interrupt
**********************************************************************************/
void SPI_Disable(void);
/**********************************************************************************
* GetControlRegister function: get always 48 bit and put them on RS-232 buffer.
* If lsbits (from 24 to 0 bits )are all "0" or "1" invert three upper bytes with three
* lower bytes in order to have always in last positions of RS-232 buffer [4,5,6] the CR
* bits from 24 to 0.
**********************************************************************************/
BYTE GetControlRegister(unsigned char *CTRL_Reg);
/**********************************************************************************
* SetControlRegister function: write 24 or 48 CR
**********************************************************************************/
BYTE SetControlRegister(unsigned char *CTRL_Reg);
/**********************************************************************************
* SPI_OnRx function: return 1 if SPI is running in RX mode, 0 otherwise
**********************************************************************************/
unsigned char SPI_OnRx(void);
/**********************************************************************************
* SPI_OnTx function: return 1 if SPI is running in TX mode, 0 otherwise
**********************************************************************************/
unsigned char SPI_OnTx(void);
/**********************************************************************************
* SPI_OnRun function: return 1 if SPI is running in RX or Tx mode, 0 otherwise
**********************************************************************************/
unsigned char SPI_OnRun(void);
/**********************************************************************************
* Tx_Data function: copy data to sent in SPI buffer and set TX flags depending of type of Tx
**********************************************************************************/
void Tx_Data(unsigned char, unsigned char, char *);
/**********************************************************************************
* Rx_Data function: set RX flags depending of type of Rx
**********************************************************************************/
void Rx_Data(unsigned char,unsigned short,unsigned short,unsigned char);
/**********************************************************************************
* RepMode_Analyze function: manages repeated Tx mode (every 200ms)
**********************************************************************************/
void RepMode_Analyze(void);
/**********************************************************************************
* SPI_Interrupt function: SPI interrupt routine
**********************************************************************************/
void SPI_Interrupt(void);
#endif // __PHY_LAYER_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -