EasyLink Layer¶
Overview¶
The EasyLink API is a simple abstraction layer on top of the RF Driver and is intended as a starting point for customers creating a proprietary Sub-1 GHz protocol. The EasyLink layer does not support any regional RF conformance such as Listen Before Talk required for the license free frequency band. Customers need to add support for the regional conformance that their product requires under the EasyLink API.
The EasyLink Example can be found in the examples/{rtos or nortos}/{development
board}/easylink
folder. You can find descriptions of the examples in the
Examples User’s Guide.
The EasyLink layer also supports a simple network processor configuration. This is showcased in the EasyLink Network Processor (NP) example project. Here, the EasyLink API has been exposed over an AT Command Interface such that it can be used by Host SW (running on a PC, MPU or MCU), or by using a serial terminal emulator over a UART. The specific commands can be found in the rfEasyLinkNp.
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.
For API descriptions, see the EasyLink API reference.
General Behavior¶
Before using the EasyLink API the EasyLink Layer is initialized by calling
EasyLink_init()
. This initializes and opens the RF driver and
configures the modulation scheme passed to EasyLink_init.
The RX and TX can operate independently of each other.
RX is enabled by calling
EasyLink_receive()
or EasyLink_receiveAsync()
. Entering RX can
be immediate or scheduled by using the EasyLink_RxPacket::absTime
field.
EasyLink_receive()
is blocking and EasyLink_receiveAsync()
is
nonblocking. The EasyLink API does not queue messages so calling another API
function while in EasyLink_receiveAsync() will return
EasyLink_Status_Busy_Error
. An Asynchronous Rx operation can be canceled with
EasyLink_abort()
.
TX is enabled by calling EasyLink_transmit()
or EasyLink_transmitAsync()
.
TX can be immediate or scheduled by using the EasyLink_TxPacket::absTime
field.
EasyLink_transmit()
is blocking and EasyLink_transmitAsync()
is nonblocking. The EasyLink API does not queue messages so calling another API
function while in EasyLink_transmitAsync()
will return EasyLink_Status_Busy_Error
An Asynchronous operation can be canceled with EasyLink_abort()
.
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 |
Supported Functions¶
Generic API function | Description |
---|---|
EasyLink_init() |
Inits and opens the RF driver and configures the specified modulation |
EasyLink_transmit() |
Blocking Transmit |
EasyLink_transmitAsync() |
Nonblocking Transmit |
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_SetFreq() |
Sets the frequency |
EasyLink_GetFreq() |
Gets the frequency |
EasyLink_SetRfPwr() |
Sets the Tx Power |
EasyLink_GetRfPwr() |
Gets the Tx Power |
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