📄 rx.h
字号:
/***********************************************************************************
Filename: rx.h
***********************************************************************************/
#ifndef RX_H
#define RX_H
//----------------------------------------------------------------------------------
// Constants
//----------------------------------------------------------------------------------
// In this example, the threshold value is set such that an interrupt is generated
// when the FIFO is half full. It would be possible to set the threshold value
// differently - and thus get an interrupt earlier or later
// (meaning that the FIFO is almost full).
#define RX_FIFO_THRESHOLD 0x07
#define RX_FIFO_START_THRESHOLD 0x00
#define RX_FIFO_SIZE 64
#define RX_OCCUPIED_FIFO 32 // Occupied space
#define RX_AVAILABLE_FIFO 32 // Free space
#define FIXED_PACKET_LENGTH 0x00
#define INFINITE_PACKET_LENGTH 0x02
#define INFINITE 0
#define FIXED 1
#define MAX_FIXED_LENGTH 256
#define RX_STATE_ERROR 3
//----------------------------------------------------------------------------------
// Structs
//----------------------------------------------------------------------------------
// Struct. used to hold information used for RX
typedef struct RXinfoDescr {
uint8 lengthField; // The L-field in the WMBUS packet
uint16 length; // Total number of bytes to to be read from the RX FIFO
uint16 bytesLeft; // Bytes left to to be read from the RX FIFO
uint8 *pByteIndex; // Pointer to current position in the byte array
uint8 format; // Infinite or fixed packet mode
uint8 start; // Start of Packet
uint8 complete; // Packet received complete
uint8 mode; // S-mode or T-mode
} RXinfoDescr;
//----------------------------------------------------------------------------------
// Function declarations
//----------------------------------------------------------------------------------
void rxInitMode(uint8 mode, const HAL_RF_CONFIG *myRfConfig, const uint8 myPaTable[], const uint8 myPaTableLen);
uint16 rxRecvPacket(uint8* packet, uint8* bytes, uint8 mode);
#endif
/***********************************************************************************
Copyright 2008 Texas Instruments Incorporated. All rights reserved.
IMPORTANT: Your use of this Software is limited to those specific rights
granted under the terms of a software license agreement between the user
who downloaded the software, his/her employer (which must be your employer)
and Texas Instruments Incorporated (the "License"). You may not use this
Software unless you agree to abide by the terms of the License. The License
limits your use, and you acknowledge, that the Software may not be modified,
copied or distributed unless embedded on a Texas Instruments microcontroller
or used solely and exclusively in conjunction with a Texas Instruments radio
frequency transceiver, which is integrated into your product. Other than for
the foregoing purpose, you may not use, reproduce, copy, prepare derivative
works of, modify, distribute, perform, display or sell this Software and/or
its documentation for any purpose.
YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
PROVIDED 揂S IS
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -