TI Easylink API
5.20.00.03
|
EasyLink RF API for CC13xx/CC26xx family.
The EasyLink API should be used in application code. The EasyLink API is intended to abstract the RF Driver in order to give a simple API for customers to use as is or extend to suit their application use cases.
Before using the EasyLink API:
The following is true for receive operation:
The following apply for transmit operation:
The EasyLink API will return EasyLink_Status containing success or error code. The EasyLink_Status code are:
The TI-RTOS power management framework will try to put the device into the most power efficient mode whenever possible. Please see the technical reference manual for further details on each power mode.
The EasyLink Layer uses the power management offered by the RF driver Refer to the RF drive documentation for more details.
# Supported Functions # | Generic API function | Description | |-------------------------------|----------------------------------------------------| | EasyLink_init() | Init's and opens the RF driver and configures the | | | specified settings based on EasyLink_Params struct | | EasyLink_transmit() | Blocking Transmit | | EasyLink_transmitAsync() | Non-blocking Transmit | | EasyLink_transmitCcaAsync() | Non-blocking Transmit with Clear Channel Assessment| | EasyLink_receive() | Blocking Receive | | EasyLink_receiveAsync() | Nonblocking Receive | | EasyLink_abort() | Aborts a non blocking call | | EasyLink_enableRxAddrFilter() | Enables/Disables RX filtering on the Addr | | EasyLink_getIeeeAddr() | Gets the IEEE Address | | EasyLink_setFrequency() | Sets the frequency | | EasyLink_getFrequency() | Gets the frequency | | EasyLink_setRfPower() | Sets the Tx Power | | EasyLink_getRfPower() | Gets the Tx Power | | EasyLink_getRssi() | Gets the RSSI | | EasyLink_getAbsTime() | Gets the absolute time in RAT ticks | | EasyLink_setCtrl() | Set RF parameters, test modes or EasyLink options | | EasyLink_getCtrl() | Get RF parameters or EasyLink options |
The EasyLink implements a basic header for transmitting and receiving data. This header supports addressing for a star or point-to-point network with acknowledgments.
Packet structure:
_________________________________________________________ | | | | | 1B Length | 1-64b Dst Address | Payload | |___________|___________________|_________________________|
#include <stdbool.h>
#include <stdint.h>
#include <ti/drivers/rf/RF.h>
#include <stdlib.h>
#include "ti_easylink_config.h"
#include "ti_drivers_config.h"
#include "ti_radio_config.h"
Classes | |
struct | EasyLink_Params |
Structure for EasyLink_init() and EasyLink_Params_init() More... | |
struct | EasyLink_RfSetting |
Structure for EasyLink_init() containing pointers to all the commands necessary to define an RF setting. More... | |
struct | EasyLink_TxPacket |
Structure for the TX Packet. More... | |
struct | EasyLink_RxPacket |
Structure for the RX'ed Packet. More... | |
Macros | |
#define | EASYLINK_API_VERSION "EasyLink-v4.40.00" |
EasyLink API Version. | |
#define | EASYLINK_MAX_ADDR_SIZE 8 |
defines the Tx/Rx Max Address Size | |
#define | EASYLINK_MAX_ADDR_FILTERS 8 |
defines the Max number of Rx Address filters | |
#define | EASYLINK_WHITENING_MODE 2 |
defines the whitening mode | |
#define | EasyLink_RadioTime_To_ms(radioTime) (radioTime / (4000000/1000)) |
macro to convert from Radio Time Ticks to ms | |
#define | EasyLink_ms_To_RadioTime(ms) (ms*(4000000/1000)) |
macro to convert from ms to Radio Time Ticks | |
#define | EasyLink_us_To_RadioTime(us) (us*(4000000/1000000)) |
macro to convert from us to Radio Time Ticks | |
#define | EasyLink_PHY_CUSTOM 0 |
Phy Type defines so we can use them in checks. | |
#define | EasyLink_PHY_50KBPS2GFSK 1 |
#define | EasyLink_PHY_625BPSLRM 2 |
#define | EasyLink_PHY_2_4_200KBPS2GFSK 3 |
#define | EasyLink_PHY_5KBPSSLLR 4 |
#define | EasyLink_PHY_2_4_100KBPS2GFSK 5 |
#define | EasyLink_PHY_2_4_250KBPS2GFSK 6 |
#define | EasyLink_PHY_200KBPS2GFSK 7 |
Typedefs | |
typedef uint32_t(* | EasyLink_GetRandomNumber) (void) |
EasyLink 32-bit Random number generator function type used in the clear channel assessment algorithm. | |
typedef void(* | EasyLink_ReceiveCb) (EasyLink_RxPacket *rxPacket, EasyLink_Status status) |
EasyLink Callback function type for Received packet, registered with EasyLink_ReceiveAsync() | |
typedef void(* | EasyLink_TxDoneCb) (EasyLink_Status status) |
EasyLink Callback function type for Tx Done registered with EasyLink_TransmitAsync() | |
Functions | |
void | EasyLink_Params_init (EasyLink_Params *params) |
Initializes the radio with specified Phy settings and RF client events. More... | |
EasyLink_Status | EasyLink_init (EasyLink_Params *params) |
Initializes the radio with specified Phy settings, CCA random number generator, and RF client events. More... | |
EasyLink_Status | EasyLink_getAbsTime (uint32_t *pui32AbsTime) |
Gets the absolute radio time. More... | |
EasyLink_Status | EasyLink_getRssi (int8_t *pi8Rssi) |
Gets the RSSI value of an ongoing Radio Operation. More... | |
EasyLink_Status | EasyLink_transmit (EasyLink_TxPacket *txPacket) |
Sends a Packet with blocking call. More... | |
EasyLink_Status | EasyLink_transmitAsync (EasyLink_TxPacket *txPacket, EasyLink_TxDoneCb cb) |
Sends a Packet with non blocking call. More... | |
EasyLink_Status | EasyLink_transmitCcaAsync (EasyLink_TxPacket *txPacket, EasyLink_TxDoneCb cb) |
Sends a Packet with non blocking call if the channel is idle. More... | |
EasyLink_Status | EasyLink_receive (EasyLink_RxPacket *rxPacket) |
Blocking call that waits for an Rx Packet. More... | |
EasyLink_Status | EasyLink_receiveAsync (EasyLink_ReceiveCb cb, uint32_t absTime) |
Enables Asynchronous Packet Rx with non blocking call. More... | |
EasyLink_Status | EasyLink_abort (void) |
Abort a previously call Async Tx/Rx. More... | |
EasyLink_Status | EasyLink_setFrequency (uint32_t ui32Frequency) |
Sets the Frequency. More... | |
uint32_t | EasyLink_getFrequency (void) |
Gets the Frequency. More... | |
EasyLink_Status | EasyLink_enableRxAddrFilter (uint8_t *pui8AddrFilterTable, uint8_t ui8AddrSize, uint8_t ui8NumAddrs) |
Enables the address filter. More... | |
EasyLink_Status | EasyLink_getIeeeAddr (uint8_t *ieeeAddr) |
Gets the IEEE address. More... | |
EasyLink_Status | EasyLink_setRfPower (int8_t i8TxPowerDbm) |
Sets the TX Power. More... | |
EasyLink_Status | EasyLink_getRfPower (int8_t *pi8TxPowerDbm) |
Gets the TX Power. More... | |
EasyLink_Status | EasyLink_setCtrl (EasyLink_CtrlOption Ctrl, uint32_t ui32Value) |
Sets advanced configuration options. More... | |
EasyLink_Status | EasyLink_getCtrl (EasyLink_CtrlOption Ctrl, uint32_t *pui32Value) |
Gets advanced configuration options. More... | |
Variables | |
EasyLink_RfSetting | EasyLink_supportedPhys [] |
Array containing all the supported EasyLink_rfSettings. | |
const uint8_t | EasyLink_numSupportedPhys |
Size of the EasyLink_supportedPhys array. | |