Firmware SDK
twr_spirit

Driver for spirit RF transceiver module. More...

Enumerations

enum  twr_spirit1_event_t {
  TWR_SPIRIT1_EVENT_TX_DONE = 0 ,
  TWR_SPIRIT1_EVENT_RX_DONE = 1 ,
  TWR_SPIRIT1_EVENT_RX_TIMEOUT = 2
}
 Callback events. More...
 

Functions

bool twr_spirit1_init (void)
 Initialize. More...
 
bool twr_spirit1_deinit (void)
 Deitialize. More...
 
void twr_spirit1_set_event_handler (void(*event_handler)(twr_spirit1_event_t, void *), void *event_param)
 Set callback function. More...
 
void * twr_spirit1_get_tx_buffer (void)
 Get TX buffer. More...
 
void twr_spirit1_set_tx_length (size_t length)
 Set TX buffer length. More...
 
size_t twr_spirit1_get_tx_length (void)
 Get TX buffer length. More...
 
void * twr_spirit1_get_rx_buffer (void)
 Get RX buffer. More...
 
size_t twr_spirit1_get_rx_length (void)
 Get RX buffer length. More...
 
int twr_spirit1_get_rx_rssi (void)
 Get RSSI. More...
 
void twr_spirit1_set_rx_timeout (twr_tick_t timeout)
 Set TX timeout. More...
 
void twr_spirit1_tx (void)
 Enter TX state.
 
void twr_spirit1_rx (void)
 Enter RX state.
 
void twr_spirit1_sleep (void)
 Enter sleep state.
 

Detailed Description

Driver for spirit RF transceiver module.

Enumeration Type Documentation

◆ twr_spirit1_event_t

Callback events.

Enumerator
TWR_SPIRIT1_EVENT_TX_DONE 

Event is TX done.

TWR_SPIRIT1_EVENT_RX_DONE 

Event is RX done.

TWR_SPIRIT1_EVENT_RX_TIMEOUT 

Event is RX timeout.

Definition at line 18 of file twr_spirit1.h.

Function Documentation

◆ twr_spirit1_deinit()

bool twr_spirit1_deinit ( void  )

Deitialize.

Returns
true On success
false On failure

Definition at line 150 of file twr_spirit1.c.

Here is the call graph for this function:

◆ twr_spirit1_get_rx_buffer()

void* twr_spirit1_get_rx_buffer ( void  )

Get RX buffer.

Returns
Pointer to buffer

Definition at line 191 of file twr_spirit1.c.

◆ twr_spirit1_get_rx_length()

size_t twr_spirit1_get_rx_length ( void  )

Get RX buffer length.

Returns
Size of buffer

Definition at line 196 of file twr_spirit1.c.

◆ twr_spirit1_get_rx_rssi()

int twr_spirit1_get_rx_rssi ( void  )

Get RSSI.

Returns
RSSI

Definition at line 201 of file twr_spirit1.c.

◆ twr_spirit1_get_tx_buffer()

void* twr_spirit1_get_tx_buffer ( void  )

Get TX buffer.

Returns
Pointer to buffer

Definition at line 176 of file twr_spirit1.c.

◆ twr_spirit1_get_tx_length()

size_t twr_spirit1_get_tx_length ( void  )

Get TX buffer length.

Returns
Size of buffer

Definition at line 186 of file twr_spirit1.c.

◆ twr_spirit1_init()

bool twr_spirit1_init ( void  )

Initialize.

Returns
true On success
false On failure

Definition at line 98 of file twr_spirit1.c.

Referenced by twr_radio_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ twr_spirit1_set_event_handler()

void twr_spirit1_set_event_handler ( void(*)(twr_spirit1_event_t, void *)  event_handler,
void *  event_param 
)

Set callback function.

Parameters
[in]event_handlerFunction address
[in]event_paramOptional event parameter (can be NULL)

Definition at line 170 of file twr_spirit1.c.

Referenced by twr_radio_init().

Here is the caller graph for this function:

◆ twr_spirit1_set_rx_timeout()

void twr_spirit1_set_rx_timeout ( twr_tick_t  timeout)

Set TX timeout.

Parameters
[in]timeoutMaximum timeout for receiving

Definition at line 206 of file twr_spirit1.c.

Here is the call graph for this function:

◆ twr_spirit1_set_tx_length()

void twr_spirit1_set_tx_length ( size_t  length)

Set TX buffer length.

Parameters
[in]lengthTX buffer length

Definition at line 181 of file twr_spirit1.c.