si4421.h

来自「芯科rf资料」· C头文件 代码 · 共 99 行

H
99
字号
/*** ============================================================================**** FILE**  Si4421.h**** DESCRIPTION**  Header files for Si4421 usage, contains RF specific definition and type declaration**** CREATED**  Silicon Laboratories Hungary Ltd**** COPYRIGHT**  Copyright 2008 Silicon Laboratories, Inc.  **	http://www.silabs.com**** ============================================================================*/#ifndef Ezlink_Si4421H#define Ezlink_Si4421H#include "S8051.h"#include "Setup_IA4421.h"#include "uart.h"                /* ======================================= *                 *          D E F I N I T I O N S          *                 * ======================================= *///Receive state machine states#define	NODATA          		(0)#define	DATA_RECEIVED   		(1)#define	PACKET_RECEIVED 		(2)//Packet structure definitions#define	MAX_PAYLOAD_LENGTH  	(40)#define	HEADER_LENGTH      		(5)      // preamble(2) + synchron word (2) + packet length (1) #define MAX_LENGTH				(MAX_PAYLOAD_LENGTH + 1)#define SYNCH_WORD_H		2			//this definitions help to address the header fields in the array#define SYNCH_WORD_L		3		#define LENGTH				4//Register write definition#define TX_REGISTER_WRITE   	(0xB800)			                     /* ======================================= *                 *     T Y P E   D E C L A R A T I O N     *                 * ======================================= */typedef struct _s_rf_packet		//packet structure{   	uint8 header[HEADER_LENGTH];   	uint8 payload[MAX_LENGTH];} s_rf_packet;typedef union _rf_packet{   s_rf_packet   	name;   uint8      		_data[HEADER_LENGTH + MAX_PAYLOAD_LENGTH];} rf_packet;typedef enum _rx_states{	sWaitForLength,	sReceivePayload,}RX_STATES;			                /* ======================================= *                 *  F U N C T I O N   P R O T O T Y P E S  *                 * ======================================= */void init_ezradio(void);void ia4421_enable_tx(void);void ia4421_enable_rx(void);uint16 ia4421_status_read(void);uint8 Receive_packet(void);void ia4421_get_received_payload(uint8 * length, uint8 * payload);void ia4421_send_packet(uint8 length, uint8 * payload);uint16 set_frq(uint8 ch);uint16 set_tx(uint8 dev, uint8 pwr);uint16 set_dr(uint16 dr);#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?