TI Easylink API  5.10.00.04
EasyLink

Files

 

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
 
#define EASYLINK_DEFAULT_ADDR   {0xAA}
 Defines the address that will accompany each packet sent from this device when EASYLINK_USE_DEFAULT_ADDR is true. It can also be thought of as this device's own address. Organized in little endian format (e.g.an address of 0xABCD should be defined as {0xCD,0xAB})
 
#define EASYLINK_USE_DEFAULT_ADDR   false
 When false, the Easylink stack expects the application to provide an accompanying address for each EasyLink_TxPacket passed to the EasyLink_transmit(), EasyLink_transmitAsync(), and EasyLink_transmitCcaAsync() APIs. Otherwise, these APIs will use the address defined in EASYLINK_DEFAULT_ADDR.
 
#define EASYLINK_MAX_DATA_LENGTH   128
 Defines the largest Tx/Rx payload that the interface can support.
 
#define EASYLINK_ADDR_SIZE   1
 Defines the default address size for rx and tx operations.
 
#define EASYLINK_ENABLE_ADDR_FILTERING   true
 Enables of disables address filtering by default.
 
#define EASYLINK_NUM_ADDR_FILTER   1
 The table for setting the Rx Address Filters.
 
#define EASYLINK_ADDR_FILTER_TABLE   {0xAA}
 The table for setting the Rx Address Filters.
 
#define EASYLINK_IDLE_TIMEOUT   EasyLink_ms_To_RadioTime(1)
 Defines the time for the radio to return to idle after inactivity.
 
#define EASYLINK_ENABLE_MULTI_CLIENT   false
 Enables or disables the application to use multiple RF clients.
 
#define EASYLINK_ASYNC_RX_TIMEOUT   EasyLink_ms_To_RadioTime(0)
 Defines the relative time from async RX start to timeout. A value of 0 means no timeout.
 
#define EASYLINK_MIN_CCA_BACKOFF_WINDOW   5
 Minimum CCA back-off window in units of EASYLINK_CCA_BACKOFF_TIMEUNITS, as a power of 2.
 
#define EASYLINK_MAX_CCA_BACKOFF_WINDOW   8
 Maximum CCA back-off window in units of EASYLINK_CCA_BACKOFF_TIMEUNITS, as a power of 2.
 
#define EASYLINK_CCA_BACKOFF_TIMEUNITS   250
 The back-off time units in microseconds.
 
#define EASYLINK_CS_RSSI_THRESHOLD_DBM   -80
 RSSI threshold for Clear Channel Assessment (CCA)
 
#define EASYLINK_CHANNEL_IDLE_TIME_US   5000
 Time for which the channel RSSI must remain below the specified threshold for the channel to be considered idle.
 
#define EASYLINK_PARAM_CONFIG
 EasyLink default parameter configuration. More...
 

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.
 

Detailed Description

Macro Definition Documentation

§ EASYLINK_PARAM_CONFIG

#define EASYLINK_PARAM_CONFIG
Value:
{.ui32ModType = EasyLink_Phy_Custom, \
.pClientEventCb = NULL, \
.nClientEventMask = 0, \
.pGrnFxn = (EasyLink_GetRandomNumber)rand\
}

EasyLink default parameter configuration.

Enumeration Type Documentation

§ EasyLink_Activity

Activity table.

+-----------—+-----------------------------------—+ | Activity | Priority | +-----------—+---------—+---------—+---------—+ | | Normal | High | Urgent | | TX | 0X03090000 | 0X03090001 | 0X03090002 | | RX | 0X03070000 | 0X03070001 | 0X03070002 | +-----------—+-----------------------------------—+

Enumerator
EasyLink_Activity_Tx 

Activity code for the Tx operation.

EasyLink_Activity_Rx 

Activity code for the Rx operation.

§ EasyLink_CtrlOption

Advance configuration options.

Enumerator
EasyLink_Ctrl_AddSize 

Set the number of bytes in Addr for both Addr Filter and Tx/Rx operations

EasyLink_Ctrl_Idle_TimeOut 

Set a timeout value for inactivity on the radio, i.e. if the radio stays idle for this amount of time it is automatically powered down

EasyLink_Ctrl_MultiClient_Mode 

Set Multiclient mode for application that will use multiple RF clients. Must be set before calling EasyLink_init().

EasyLink_Ctrl_AsyncRx_TimeOut 

Relative time in ticks from Async Rx start to TimeOut. A value of 0 means no timeout

EasyLink_Ctrl_Cmd_Priority 

Set the command priority with a value from EasyLink_Priority

EasyLink_Ctrl_Test_Tone 

Enable/Disable Test mode for Tone.

EasyLink_Ctrl_Test_Signal 

Enable/Disable Test mode for Signal.

EasyLink_Ctrl_Rx_Test_Tone 

Enable/Disable Rx Test mode for Tone.

§ EasyLink_PhyType

Phy Type passed to EasyLink_init()

Enumerator
EasyLink_Phy_Custom 

Customer Phy specific settings exported from SmartRF Studio.

EasyLink_Phy_50kbps2gfsk 

Phy settings for Sub1G 50kbps data rate, IEEE 802.15.4g GFSK.

EasyLink_Phy_625bpsLrm 

Phy settings for Sub1G 625bps data rate, Long Range Mode.

EasyLink_Phy_2_4_200kbps2gfsk 

Phy settings for 2.4Ghz 200kbps data rate, IEEE 802.15.4g GFSK.

EasyLink_Phy_5kbpsSlLr 

SimpleLink Long Range (5 kbps)

EasyLink_Phy_2_4_100kbps2gfsk 

Phy settings for 2.4Ghz 100kbps data rate, IEEE 802.15.4g GFSK.

EasyLink_Phy_2_4_250kbps2gfsk 

Phy settings for 2.4Ghz 250kbps data rate, IEEE 802.15.4g GFSK.

EasyLink_Phy_200kbps2gfsk 

Phy settings for 200kbps data rate, IEEE 802.15.4g GFSK.

§ EasyLink_Status

EasyLink Status and error codes.

Enumerator
EasyLink_Status_Success 

Success.

EasyLink_Status_Config_Error 

Configuration error.

EasyLink_Status_Param_Error 

Param error.

EasyLink_Status_Mem_Error 

Memory Error.

EasyLink_Status_Cmd_Error 

Memory Error.

EasyLink_Status_Tx_Error 

Tx Error.

EasyLink_Status_Rx_Error 

Rx Error.

EasyLink_Status_Rx_Timeout 

Rx Error.

EasyLink_Status_Rx_Buffer_Error 

Rx Buffer Error.

EasyLink_Status_Busy_Error 

Busy Error.

EasyLink_Status_Aborted 

Command stopped or aborted.

EasyLink_Status_Cmd_Rejected 

Command Rejected by RF Driver (Scheduling conflict)

Function Documentation

§ EasyLink_abort()

EasyLink_Status EasyLink_abort ( void  )

Abort a previously call Async Tx/Rx.

This function is a blocking call to abort a previous Async Tx/Rx

Returns
EasyLink_Status

§ EasyLink_enableRxAddrFilter()

EasyLink_Status EasyLink_enableRxAddrFilter ( uint8_t *  pui8AddrFilterTable,
uint8_t  ui8AddrSize,
uint8_t  ui8NumAddrs 
)

Enables the address filter.

This function enables the address filter to filter out address that are not in the address table provided.

Parameters
pui8AddrFilterTableA uint8 pointer to a variable size 2d array containing the addresses to filter on.
ui8AddrSizeThe size of the address elements
ui8NumAddrsThe number of address elements
Returns
EasyLink_Status

§ EasyLink_getAbsTime()

EasyLink_Status EasyLink_getAbsTime ( uint32_t *  pui32AbsTime)

Gets the absolute radio time.

This function returns the absolute radio time and can be used for monitoring or Tx/Rx events using the EasyLink_TxPacket and EasyLink_RxPacket::absTime field.

Parameters
pui32AbsTimePointer to return the signed RSSI value (dBm)
Returns
EasyLink_Status

§ EasyLink_getCtrl()

EasyLink_Status EasyLink_getCtrl ( EasyLink_CtrlOption  Ctrl,
uint32_t *  pui32Value 
)

Gets advanced configuration options.

This function allows getting some of the advanced configuration options

Parameters
CtrlThe control option to get
pui32ValuePointer to return the control option value
Returns
EasyLink_Status

§ EasyLink_getFrequency()

uint32_t EasyLink_getFrequency ( void  )

Gets the Frequency.

This function gets Frequency in units of kHz. This function will return the value set in the Frequency Synthesizer, and may not be the same as set using EasyLink_setFrequency(). Note that this value does not include any offsets for deviations due to factors such as temperature and hence this API should not be used to get an accurate measure of frequency.

Returns
Frequency in units of kHz

§ EasyLink_getIeeeAddr()

EasyLink_Status EasyLink_getIeeeAddr ( uint8_t *  ieeeAddr)

Gets the IEEE address.

This function gets the IEEE address

Parameters
ieeeAddrpointer to an 8 element byte array to write the IEEE address to.
Returns
EasyLink_Status

§ EasyLink_getRfPower()

EasyLink_Status EasyLink_getRfPower ( int8_t *  pi8TxPowerDbm)

Gets the TX Power.

This function gets the Tx Power in dBm, values ranging from -10 to 14 dBm should be expect

Parameters
pi8TxPowerDbmPointer to return the transmission power value (dBm)
Returns
EasyLink_Status

§ EasyLink_getRssi()

EasyLink_Status EasyLink_getRssi ( int8_t *  pi8Rssi)

Gets the RSSI value of an ongoing Radio Operation.

This function returns the RSSI from an ongoing receiver radio operation. It is useful in receiver test modes to detect the presence of both modulated and unmodulated carrier waves

Parameters
pi8RssiPointer to return the signed RSSI value (dBm)
Returns
EasyLink_Status
Note
if no RSSI is available the function writes -128 to the value argument

§ EasyLink_init()

EasyLink_Status EasyLink_init ( EasyLink_Params params)

Initializes the radio with specified Phy settings, CCA random number generator, and RF client events.

This function configures the radio phy settings. If the ui32ModType is EasyLink_Phy_Custom then the configuration is taken from srf_settings.h. If a specific phy configuration is required (and not supported by any of the defined Phy types in EasyLink_PhyType then you can cut and past the RF setting from the SmartRF Studio code export tool. This will copy and use the RF_prop, RF_cmdPropRadioDivSetup and RF_cmdFs commands, as well as the Sync word from the RF_cmdPropTx and RF_cmdPropRx commands. The function configures the callback for client events. The client events that trigger the callback are set using the nClientEventMask type in EasyLink_Params. A pointer to the desired callback should be provided to the pClientEventCb type of the EasyLink_Params structure.

Parameters
paramsThe descriptor for the Phy mode, random number generator, and event callback settings
Returns
EasyLink_Status

§ EasyLink_Params_init()

void EasyLink_Params_init ( EasyLink_Params params)

Initializes the radio with specified Phy settings and RF client events.

This function configures the radio phy settings. If the ui32ModType is EasyLink_Phy_Custom then the configuration is taken from srf_settings.h. If a specific phy configuration is required (and not supported by any of the defined Phy types in EasyLink_PhyType then you can cut and past the RF setting from the SmartRF Studio code export tool. This will copy and use the RF_prop, RF_cmdPropRadioDivSetup and RF_cmdFs commands, as well as the Sync word from the RF_cmdPropTx and RF_cmdPropRx commands. The function configures the callback for client events. The client events that trigger the callback are set using the nClientEventMask type in EasyLink_Params. A pointer to the desired callback should be provided to the pClientEventCb type of the EasyLink_Params structure.

Parameters
paramsThe descriptor for the Phy mode and event callback settings

Default values are: ui32ModType = EasyLink_Phy_50kbps2gfsk RF_ClientCallback = NULL RF_ClientEventMask = 0 pGrnFxn = (EasyLink_GetRandomNumber)rand

Returns
EasyLink_Status

§ EasyLink_receive()

EasyLink_Status EasyLink_receive ( EasyLink_RxPacket rxPacket)

Blocking call that waits for an Rx Packet.

This function is a blocking call to wait for an Rx packet.

Parameters
rxPacketThe descriptor for the packet to be Rx'ed.
Returns
EasyLink_Status

§ EasyLink_receiveAsync()

EasyLink_Status EasyLink_receiveAsync ( EasyLink_ReceiveCb  cb,
uint32_t  absTime 
)

Enables Asynchronous Packet Rx with non blocking call.

This function is a non blocking call to Rx a packet. The Rx is turned on and the Callback is called once a packet is received. The Rx will timeout if EasyLink_Ctrl_AsyncRx_TimeOut ctrl message is used to set the timeout to something other than 0.

Parameters
cbThe rx function pointer.
absTimeStart time of Rx (0: now !0: absolute radio time to start Rx)
Returns
EasyLink_Status

§ EasyLink_setCtrl()

EasyLink_Status EasyLink_setCtrl ( EasyLink_CtrlOption  Ctrl,
uint32_t  ui32Value 
)

Sets advanced configuration options.

This function allows setting some of the advanced configuration options

Parameters
CtrlThe control option to be set
ui32ValueThe value to set the control option to
Returns
EasyLink_Status

§ EasyLink_setFrequency()

EasyLink_Status EasyLink_setFrequency ( uint32_t  ui32Frequency)

Sets the Frequency.

This function set the radio to the specified frequency. Note that this will be rounded to the nearest frequency supported by the Frequency Synthesizer.

Parameters
ui32FrequencyFrequency in units of kHz
Returns
EasyLink_Status

§ EasyLink_setRfPower()

EasyLink_Status EasyLink_setRfPower ( int8_t  i8TxPowerDbm)

Sets the TX Power.

This function sets the Tx Power

Parameters
i8TxPowerDbmThe Tx power in dBm's to be set.
  1. All platforms other than the CC1352P: Value of -10 dBm or values in the range of 0-14 dBm are accepted. Values above 14 are set to 14 dBm while those below 0 are set to -10 dBm
  2. CC1352P Default PA: -20 to 14 dBm. Values above 14 dBm will be set to 14 dBm, while values below -20 dBm will cause a configuration error
  3. CC1352P High PA: 14 to 20 dBm. Values above 20 dBm will be set to 20 dBm, while values below 14 dBm will cause a configuration error
Note
The PA mode is chosen at build time, run-time switching from high PA to default PA (or vice versa) is not supported.
Returns
EasyLink_Status

§ EasyLink_transmit()

EasyLink_Status EasyLink_transmit ( EasyLink_TxPacket txPacket)

Sends a Packet with blocking call.

This function is a blocking call to send a packet. If the Tx is successfully scheduled then the function will block until the Tx is complete.

Parameters
txPacketThe descriptor for the packet to be Tx'ed.
Returns
EasyLink_Status

§ EasyLink_transmitAsync()

EasyLink_Status EasyLink_transmitAsync ( EasyLink_TxPacket txPacket,
EasyLink_TxDoneCb  cb 
)

Sends a Packet with non blocking call.

This function is a non blocking call to send a packet. If the Tx is successfully scheduled then the callback will be call once the Tx is complete.

Parameters
txPacketThe descriptor for the packet to be Tx'ed.
cbThe tx done function pointer.
Returns
EasyLink_Status

§ EasyLink_transmitCcaAsync()

EasyLink_Status EasyLink_transmitCcaAsync ( EasyLink_TxPacket txPacket,
EasyLink_TxDoneCb  cb 
)

Sends a Packet with non blocking call if the channel is idle.

This function is a non blocking call to send a packet. It will check for a clear channel prior to transmission. If the channel is busy it will backoff for a random period, in time units of EASYLINK_CCA_BACKOFF_TIMEUNITS, before reassessing. It does this a certain number (EASYLINK_MAX_CCA_BACKOFF_WINDOW - EASYLINK_MIN_CCA_BACKOFF_WINDOW) of times before quitting unsuccessfully and running to the callback. If the Tx is successfully scheduled then the callback will be called once the Tx is complete.

Parameters
txPacketThe descriptor for the packet to be Tx'ed.
cbThe tx done function pointer.
Returns
EasyLink_Status