4 #include <twr_scheduler.h>
14 #define TWR_TD1207R_TX_FIFO_BUFFER_SIZE 64
15 #define TWR_TD1207R_RX_FIFO_BUFFER_SIZE 64
45 TWR_TD1207R_STATE_READY = 0,
46 TWR_TD1207R_STATE_ERROR = 1,
47 TWR_TD1207R_STATE_INITIALIZE = 2,
48 TWR_TD1207R_STATE_INITIALIZE_RESET_L = 3,
49 TWR_TD1207R_STATE_INITIALIZE_RESET_H = 4,
50 TWR_TD1207R_STATE_INITIALIZE_AT_COMMAND = 5,
51 TWR_TD1207R_STATE_INITIALIZE_AT_RESPONSE = 6,
52 TWR_TD1207R_STATE_SEND_RF_FRAME_COMMAND = 7,
53 TWR_TD1207R_STATE_SEND_RF_FRAME_RESPONSE = 8
55 } twr_td1207r_state_t;
62 twr_td1207r_state_t _state;
65 uint8_t _tx_fifo_buffer[TWR_TD1207R_TX_FIFO_BUFFER_SIZE];
66 uint8_t _rx_fifo_buffer[TWR_TD1207R_RX_FIFO_BUFFER_SIZE];
69 char _command[TWR_TD1207R_TX_FIFO_BUFFER_SIZE];
70 char _response[TWR_TD1207R_RX_FIFO_BUFFER_SIZE];
71 uint8_t _message_buffer[12];
72 size_t _message_length;
twr_gpio_channel_t
GPIO channels.
size_t twr_scheduler_task_id_t
Task ID assigned by scheduler.
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_channel_t
UART channels.
Structure of FIFO instance.