rflib
|
RF HID command interface for CC13x2, CC26x2.
To use the CMD_HID_TX and CMD_HID_RX commands, make sure that the following override list is being used:
The HID commands are designed to be compatible with CC254x devices, using the same protocol as the CC254x. The packet are defined as: 8 bit preamble, 32 bit sync word, optional 8 bit address, 8 or 9 bit header, [0-n] byte payload and 16 bit CRC at 2 Mbps. The HID commands uses the same automode functionality as found in the CC254x devices, see CC254x user guide.
The CMD_HID_TX utlizes a TX queue to evaluate if the subsequent packet should be sent, given that the device is not retranmitting the previous packet. On submission of the CMD_HID_TX, the radio will check if there are TX entries in the queue. If TX entires are present, the radio will start sending the packets as defined by the startTrigger. If no packets are present, the radio will enter a wait-state, waiting on CMD_TRIGGER_HID_TX. Once CMD_TRIGGER_HID_TX is submitted, the radio will re-evaluate the TX queue, and if packets are present , the radio will start sending the TX packets as defined by the startTrigger. If no entries in the TX queue has been submitted, or CMD_STOP/CMD_ABORT was submitted, the CMD_HID_TX will end and the radio is ready for another command.
This documentation provides basic rf_hid_settings.c, rf_hid_settings.h and a set of examples in the form of commented code fragments. Detailed descriptions of the APIs are provided in subsequent sections.
The following code example opens the RF driver, setup the radio for CMD_HID_TX, initiates the TX/RX queues so that the packet is being transmitted as fast as possible once the CMD_HID_TX is submitted.
The example below does not use the CMD_HID_TRIGGER_TX, since the queues are committed to the command before the RF_cmdTxHID is submitted. The radio will evaluate the TX queue as containing data and proceed to start the transmission. The radio will continue to send packets and receive ACK's as long as there are enough space in the queues to allow reception of ACK's, TX queue is filled and retramission count is below the threshold, and no other error has occured. The command will terminate if the RX queue ran out of free entries, or the maximum number of retransmissions (RF_cmdTxHID.maxRetrans) was done, or the CMD_STOP/CMD_ABORT command was submitted, or any error occured. If the TX queue runs out of valid entires, the radio will enter the same wait state as if command is submitted without committed TX queues.
The example below is using the CMD_HID_TRIGGER_TX to trigger the transmission of the TX packet and ACK reception. The setup for the command is the same as for the example without the trigger, with the only difference being that the queues are commited to the command after it has been submitted. This is a way to enable faster TX start up, compared to regular command submission.
The example below is using the same data as the above. The transmission is then triggered 500 usec after CMD_HID_TX command submission. The delta between RF_runCmd(..., RF_cmdTxHID, ...) and TX start without trigger is greater than delta between RF_runDirectCmd(rfHandle, CMD_TRIGGER_HID_TX) and TX start, but will consume more power.
The CMD_HID_RX is not using the trigger as done with the CMD_HID_TX, instead the reception is handled by the startTrigger.
The TX queues are used for sending the ACK's, and the TX queue to use is decided by the address entry, meaning that it's possible to have different TX queues for different received addresses, allowing for different ACK's for different addresses.
If pktConf.bIncludeAddr is zero, meaning that no address is sent, the address entry used will be the first entry that matches the received sync word with the sync word ID in the address entry.
The command will terminate if the RX queue is full, CMD_STOP/CMD_ABORT is being sent or if any error occured.
An example of the CMD_HID_RX is shown below.
Go to the source code of this file.
Data Structures | |
struct | rfc_CMD_HID_TX_s |
HID Transmit Command with Auto Retransmission. More... | |
struct | rfc_CMD_HID_RX_s |
HID Recieve Command with Auto Ack. More... | |
struct | rfc_hidAddrEntry_s |
struct | rfc_hidRxTxOutput_s |
struct | rfc_hidRxStatus_s |
Macros | |
#define | __RFC_STRUCT |
#define | __RFC_STRUCT_ATTR |
#define | CMD_HID_TX 0x5801 |
#define | CMD_HID_RX 0x5802 |
Typedefs | |
typedef struct rfc_CMD_HID_TX_s | rfc_CMD_HID_TX_t |
typedef struct rfc_CMD_HID_RX_s | rfc_CMD_HID_RX_t |
typedef struct rfc_hidAddrEntry_s | rfc_hidAddrEntry_t |
typedef struct rfc_hidRxTxOutput_s | rfc_hidRxTxOutput_t |
typedef struct rfc_hidRxStatus_s | rfc_hidRxStatus_t |
#define __RFC_STRUCT |
#define __RFC_STRUCT_ATTR |