TI Easylink API  5.10.00.04
EasyLink.h File Reference

Detailed Description

EasyLink RF API for CC13xx/CC26xx family.

Overview

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.

General Behavior

Before using the EasyLink API:

  • The EasyLink Layer is initialized by calling EasyLink_init(). This initializes and opens the RF driver and configuring a modulation scheme passed to EasyLink_init().
  • The RX and TX can operate independently of each other.

The following is true for receive operation:

The following apply for transmit operation:

Error handling

The EasyLink API will return EasyLink_Status containing success or error code. The EasyLink_Status code are:

  • EasyLink_Status_Success
  • EasyLink_Status_Config_Error
  • EasyLink_Status_Param_Error
  • EasyLink_Status_Mem_Error
  • EasyLink_Status_Cmd_Error
  • EasyLink_Status_Tx_Error
  • EasyLink_Status_Rx_Error
  • EasyLink_Status_Rx_Timeout
  • EasyLink_Status_Busy_Error
  • EasyLink_Status_Aborted
  • EasyLink_Status_Cmd_Rejected

Power Management

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 |

Frame Structure

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()
 

Enumerations

enum  EasyLink_Status {
  EasyLink_Status_Success = 0, EasyLink_Status_Config_Error = 1, EasyLink_Status_Param_Error = 2, EasyLink_Status_Mem_Error = 3,
  EasyLink_Status_Cmd_Error = 4, EasyLink_Status_Tx_Error = 5, EasyLink_Status_Rx_Error = 6, EasyLink_Status_Rx_Timeout = 7,
  EasyLink_Status_Rx_Buffer_Error = 8, EasyLink_Status_Busy_Error = 9, EasyLink_Status_Aborted = 10, EasyLink_Status_Cmd_Rejected = 11
}
 EasyLink Status and error codes. More...
 
enum  EasyLink_PhyType {
  EasyLink_Phy_Custom = 0, EasyLink_Phy_50kbps2gfsk = 1, EasyLink_Phy_625bpsLrm = 2, EasyLink_Phy_2_4_200kbps2gfsk = 3,
  EasyLink_Phy_5kbpsSlLr = 4, EasyLink_Phy_2_4_100kbps2gfsk = 5, EasyLink_Phy_2_4_250kbps2gfsk = 6, EasyLink_Phy_200kbps2gfsk = 7,
  EasyLink_Num_Phy_Settings
}
 Phy Type passed to EasyLink_init() More...
 
enum  EasyLink_CtrlOption {
  EasyLink_Ctrl_AddSize = 0, EasyLink_Ctrl_Idle_TimeOut = 1, EasyLink_Ctrl_MultiClient_Mode = 2, EasyLink_Ctrl_AsyncRx_TimeOut = 3,
  EasyLink_Ctrl_Cmd_Priority = 4, EasyLink_Ctrl_Test_Tone = 5, EasyLink_Ctrl_Test_Signal = 6, EasyLink_Ctrl_Rx_Test_Tone = 7
}
 Advance configuration options. More...
 
enum  EasyLink_Activity { EasyLink_Activity_Tx = 0x309, EasyLink_Activity_Rx = 0x307 }
 Activity table. More...
 
enum  EasyLink_Priority { EasyLink_Priority_Normal = 0x0, EasyLink_Priority_High = 0x1, EasyLink_Priority_Urgent = 0x2, EasyLink_Priority_NEntries }
 Transmit and Receive Command Priority - These are only applicable in a multi-client use-case.
 

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.