Firmware SDK
twr_td1207r

Driver for TD1207R SigFox modem. More...

Typedefs

typedef struct twr_td1207r_t twr_td1207r_t
 TD1207R instance.
 

Enumerations

enum  twr_td1207r_event_t {
  TWR_TD1207R_EVENT_READY = 0 ,
  TWR_TD1207R_EVENT_ERROR = 1 ,
  TWR_TD1207R_EVENT_SEND_RF_FRAME_START = 2 ,
  TWR_TD1207R_EVENT_SEND_RF_FRAME_DONE = 3
}
 Callback events. More...
 

Functions

void twr_td1207r_init (twr_td1207r_t *self, twr_gpio_channel_t reset_signal, twr_uart_channel_t uart_channel)
 Initialize TD1207R. More...
 
void twr_td1207r_set_event_handler (twr_td1207r_t *self, void(*event_handler)(twr_td1207r_t *, twr_td1207r_event_t, void *), void *event_param)
 Set callback function. More...
 
bool twr_td1207r_is_ready (twr_td1207r_t *self)
 Check if modem is ready for commands. More...
 
bool twr_td1207r_send_rf_frame (twr_td1207r_t *self, const void *buffer, size_t length)
 Send RF frame command. More...
 

Detailed Description

Driver for TD1207R SigFox modem.

Enumeration Type Documentation

◆ twr_td1207r_event_t

Callback events.

Enumerator
TWR_TD1207R_EVENT_READY 

Ready event.

TWR_TD1207R_EVENT_ERROR 

Error event.

TWR_TD1207R_EVENT_SEND_RF_FRAME_START 

RF frame transmission started event.

TWR_TD1207R_EVENT_SEND_RF_FRAME_DONE 

RF frame transmission finished event.

Definition at line 21 of file twr_td1207r.h.

Function Documentation

◆ twr_td1207r_init()

void twr_td1207r_init ( twr_td1207r_t self,
twr_gpio_channel_t  reset_signal,
twr_uart_channel_t  uart_channel 
)

Initialize TD1207R.

Parameters
[in]selfInstance
[in]reset_signalGPIO channel where RST signal is connected
[in]uart_channelUART channel where TX and RX signals are connected

Definition at line 13 of file twr_td1207r.c.

Referenced by twr_module_sigfox_init().

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

◆ twr_td1207r_is_ready()

bool twr_td1207r_is_ready ( twr_td1207r_t self)

Check if modem is ready for commands.

Parameters
[in]selfInstance
Returns
true If ready
false If not ready

Definition at line 42 of file twr_td1207r.c.

Referenced by twr_module_sigfox_is_ready(), and twr_td1207r_send_rf_frame().

Here is the caller graph for this function:

◆ twr_td1207r_send_rf_frame()

bool twr_td1207r_send_rf_frame ( twr_td1207r_t self,
const void *  buffer,
size_t  length 
)

Send RF frame command.

Parameters
[in]selfInstance
[in]bufferPointer to data to be transmitted
[in]lengthLength of data to be transmitted in bytes (must be from 1 to 12 bytes)
Returns
true If command was accepted for processing
false If command was denied for processing

Definition at line 47 of file twr_td1207r.c.

Referenced by twr_module_sigfox_send_rf_frame().

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

◆ twr_td1207r_set_event_handler()

void twr_td1207r_set_event_handler ( twr_td1207r_t self,
void(*)(twr_td1207r_t *, twr_td1207r_event_t, void *)  event_handler,
void *  event_param 
)

Set callback function.

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

Definition at line 36 of file twr_td1207r.c.

Referenced by twr_module_sigfox_init().

Here is the caller graph for this function: