1 #include <twr_module_sigfox.h>
9 memset(
self, 0,
sizeof(*
self));
11 self->_revision = revision;
29 self->_event_handler = event_handler;
31 self->_event_param = event_param;
108 twr_module_sigfox_t *
self = event_param;
110 if (self->_event_handler != NULL)
135 twr_module_sigfox_t *
self = event_param;
137 if (self->_event_handler != NULL)
@ TWR_GPIO_P6
GPIO channel P6.
void twr_module_sigfox_set_event_handler(twr_module_sigfox_t *self, void(*event_handler)(twr_module_sigfox_t *, twr_module_sigfox_event_t, void *), void *event_param)
Set callback function.
bool twr_module_sigfox_get_device_pac(twr_module_sigfox_t *self, char *buffer, size_t buffer_size)
Get device PAC (can be called only in TWR_WSSFM10R1AT_EVENT_READ_DEVICE_ID event)
bool twr_module_sigfox_read_device_pac(twr_module_sigfox_t *self)
Read device PAC command.
bool twr_module_sigfox_read_device_id(twr_module_sigfox_t *self)
Read device ID command.
twr_module_sigfox_revision_t
SigFox Module hardware revision.
bool twr_module_sigfox_is_ready(twr_module_sigfox_t *self)
Check if modem is ready for commands.
bool twr_module_sigfox_send_rf_frame(twr_module_sigfox_t *self, const void *buffer, size_t length)
Send RF frame command.
twr_module_sigfox_event_t
Callback events.
void twr_module_sigfox_init(twr_module_sigfox_t *self, twr_module_sigfox_revision_t revision)
Initialize HARDWARIO SigFox Module.
bool twr_module_sigfox_continuous_wave(twr_module_sigfox_t *self)
Generate continuous wave command.
bool twr_module_sigfox_get_device_id(twr_module_sigfox_t *self, char *buffer, size_t buffer_size)
Get device ID (can be called only in TWR_WSSFM10R1AT_EVENT_READ_DEVICE_ID event)
@ TWR_MODULE_SIGFOX_REVISION_R1
Hardware revision R1.
@ TWR_MODULE_SIGFOX_EVENT_READ_DEVICE_PAC
Device PAC has been read event.
@ TWR_MODULE_SIGFOX_EVENT_SEND_RF_FRAME_DONE
RF frame transmission finished event.
@ TWR_MODULE_SIGFOX_EVENT_ERROR
Error event.
@ TWR_MODULE_SIGFOX_EVENT_READY
Ready event.
@ TWR_MODULE_SIGFOX_EVENT_READ_DEVICE_ID
Device ID has been read event.
@ TWR_MODULE_SIGFOX_EVENT_SEND_RF_FRAME_START
RF frame transmission started event.
bool twr_td1207r_send_rf_frame(twr_td1207r_t *self, const void *buffer, size_t length)
Send RF frame command.
bool twr_td1207r_is_ready(twr_td1207r_t *self)
Check if modem is ready for commands.
void twr_td1207r_init(twr_td1207r_t *self, twr_gpio_channel_t reset_signal, twr_uart_channel_t uart_channel)
Initialize TD1207R.
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.
twr_td1207r_event_t
Callback events.
struct twr_td1207r_t twr_td1207r_t
TD1207R instance.
@ TWR_TD1207R_EVENT_SEND_RF_FRAME_DONE
RF frame transmission finished event.
@ TWR_TD1207R_EVENT_READY
Ready event.
@ TWR_TD1207R_EVENT_SEND_RF_FRAME_START
RF frame transmission started event.
@ TWR_TD1207R_EVENT_ERROR
Error event.
@ TWR_UART_UART1
UART channel UART1.
bool twr_wssfm10r1at_get_device_id(twr_wssfm10r1at_t *self, char *buffer, size_t buffer_size)
Get device ID (can be called only in TWR_WSSFM10R1AT_EVENT_READ_DEVICE_ID event)
void twr_wssfm10r1at_set_event_handler(twr_wssfm10r1at_t *self, void(*event_handler)(twr_wssfm10r1at_t *, twr_wssfm10r1at_event_t, void *), void *event_param)
Set callback function.
twr_wssfm10r1at_event_t
Callback events.
bool twr_wssfm10r1at_is_ready(twr_wssfm10r1at_t *self)
Check if modem is ready for commands.
bool twr_wssfm10r1at_send_rf_frame(twr_wssfm10r1at_t *self, const void *buffer, size_t length)
Send RF frame command.
bool twr_wssfm10r1at_read_device_id(twr_wssfm10r1at_t *self)
Read device ID command.
void twr_wssfm10r1at_init(twr_wssfm10r1at_t *self, twr_gpio_channel_t reset_signal, twr_uart_channel_t uart_channel)
Initialize WSSFM10R1AT.
struct twr_wssfm10r1at_t twr_wssfm10r1at_t
WSSFM10R1AT instance.
bool twr_wssfm10r1at_read_device_pac(twr_wssfm10r1at_t *self)
Read device PAC command.
bool twr_wssfm10r1at_get_device_pac(twr_wssfm10r1at_t *self, char *buffer, size_t buffer_size)
Get device PAC (can be called only in TWR_WSSFM10R1AT_EVENT_READ_DEVICE_PAC event)
bool twr_wssfm10r1at_continuous_wave(twr_wssfm10r1at_t *self)
Generate continuous wave command.
@ TWR_WSSFM10R1AT_EVENT_SEND_RF_FRAME_DONE
RF frame transmission finished event.
@ TWR_WSSFM10R1AT_EVENT_ERROR
Error event.
@ TWR_WSSFM10R1AT_EVENT_SEND_RF_FRAME_START
RF frame transmission started event.
@ TWR_WSSFM10R1AT_EVENT_READY
Ready event.
@ TWR_WSSFM10R1AT_EVENT_READ_DEVICE_PAC
Device PAC has been read event.
@ TWR_WSSFM10R1AT_EVENT_READ_DEVICE_ID
Device ID has been read event.