Radio abstraction layer common interface.
More...
|
#define | PHR_POS 0 |
|
#define | PHR_SIZE 1 |
|
#define | CRC_SIZE 2 |
|
#define | MAC_FRAME_CTRL_POS 0 |
|
#define | MAC_FRAME_CTRL_SIZE 2 |
|
#define | ACK_REQUEST_MASK 0x20 |
|
#define | SEQ_NUM_POS (MAC_FRAME_CTRL_POS + MAC_FRAME_CTRL_SIZE) |
|
#define | ACK_PD_BIT_MASK 0x0010 |
|
#define | FRAME_TYPE_MASK 0x0007 |
|
#define | FRAME_TYPE_BEACON 0x0000 |
|
#define | FRAME_TYPE_DATA 0x0001 |
|
#define | FRAME_TYPE_ACK 0x0002 |
|
#define | FRAME_TYPE_COMMAND 0x0003 |
|
#define | FRAME_PENDING_MASK 0x0010 |
|
Radio abstraction layer common interface.
These are requirements for the implementation code:
- no frames must be received between new frame indication and
a call to ral_data_ind_read.
void ral_attribute_get |
( |
uint8_t |
id, |
|
|
void * |
p_attr_value |
|
) |
| |
This function is used to get a copy of attribute value stored inside radio module.
- Parameters
-
void ral_attribute_set |
( |
uint8_t |
id, |
|
|
const void * |
p_value |
|
) |
| |
This function is used to set attribute from MAC or PHY layer without checking of its boundaries.
- Parameters
-
Reads indication frame from radio.
- Return values
-
Pointer | on the structure of a PHY data indication with received frame. |
Sends PHY frame.
- Parameters
-
[in] | pd_data | - full data frame to be send. |
RAL automatically adds header and FCS control bytes to pd_data. Caller must reserve 1 byte before psdu pointer and may leave last two bytes of payload (i.e. FCS control field) uninitialized.
RF chip or RAL code is responsible to receive an ACK frame. After ACK is handled, device should be restored to the TX state.
uint8_t ral_rssi_get |
( |
void |
| ) |
|
This function performs RSSI.
- Return values
-
This function is used to define frame start time by it's size and the timestamp, when RX IRQ has been received.
- Parameters
-
irq_time | - moment when IRQ has been received. |
frame_size | - size of received frame in bytes. |
- Return values
-
MAC | timestamp when PHY header has been started to receive. |
Sends request to change radio state.
- Parameters
-
state | - New radio state. One of... |
- Returns
- PHY_SUCCESS, if state has been successfully achieved; current state, if state cannot be reached.