15#include <zephyr/drivers/lora.h>
16#include <zephyr/kernel.h>
96 size_t length,
size_t *cnt);
110 size_t length,
size_t *cnt);
123 const struct lora_modem_config *config);
154#if defined(CONFIG_ARES_LORA_TRX_BUF_SIZE)
158#define ARES_LORA_TRX_BUF_SIZE CONFIG_ARES_LORA_TRX_BUF_SIZE
163#define ARES_LORA_TRX_BUF_SIZE 512
295#define ARES_LORA_DEFINE(_name, _transport) \
296 static struct ares_lora_ctx UTIL_CAT(_name, _ctx); \
297 static K_KERNEL_STACK_DEFINE(UTIL_CAT(_name, _stack), \
298 CONFIG_ARES_LORA_STACK_SIZE); \
299 static struct k_thread UTIL_CAT(_name, _thread); \
300 static const struct ares_lora _name = {.iface = (_transport), \
301 .ctx = &UTIL_CAT(_name, _ctx), \
302 .name = STRINGIFY(_name), \
304 &UTIL_CAT(_name, _thread), \
305 .stack = UTIL_CAT(_name, _stack)}
330 size_t num_commands);
358 const struct lora_modem_config *config);
void(* lora_transport_handler_t)(enum lora_transport_evt evt, void *ctx)
LoRa transport event handler prototype.
Definition lora.h:33
int ares_lora_register_command_callbacks(const struct ares_lora *lora, const struct ares_lora_command *commands, size_t num_commands)
Function for registering the lora packet handlers.
int ares_lora_set_packet_id(const struct ares_lora *lora, struct ares_packet *packet)
Function to update the packet ID of the given packet from the lora instance.
int ares_lora_write_packet(const struct ares_lora *lora, const struct ares_packet *packet)
Function to write a packet to the LoRa transfer layer.
int ares_lora_configure_lora(const struct ares_lora *lora, const struct lora_modem_config *config)
Function to send new configurations to the LoRa transfer layer.
int ares_lora_init(const struct ares_lora *lora, const void *transport_config)
Function for initializing a transport layer and internal lora state.
#define ARES_LORA_TRX_BUF_SIZE
Definition lora.h:163
ares_lora_signal
Signals for the LoRa interface.
Definition lora.h:146
@ ARES_LORA_SIGNAL_TXDONE
Definition lora.h:148
@ ARES_LORA_SIGNALS
Last enumerator.
Definition lora.h:151
@ ARES_LORA_SIGNAL_RXRDY
Rx data ready.
Definition lora.h:147
lora_transport_evt
Definition lora.h:22
@ LORA_TRANSPORT_EVT_RX_RDY
LoRa Rx data ready.
Definition lora.h:23
@ LORA_TRANSPORT_EVT_TX_RDY
LoRa Tx ready.
Definition lora.h:24
LoRa transport layer header.
ares_packet_payload_type
Packet payload types.
Definition packet.h:111
Unified buffer structure for LoRa.
Definition lora.h:170
uint8_t buf[ARES_LORA_TRX_BUF_SIZE]
Definition lora.h:174
size_t len
Definition lora.h:179
LoRa packet payload handler descriptor.
Definition lora.h:186
void(* handler)(const struct ares_lora *lora, const struct ares_packet *packet)
Definition lora.h:198
enum ares_packet_payload_type type
Definition lora.h:190
Ares LoRa instance context.
Definition lora.h:206
struct k_mutex wr_mtx
Definition lora.h:240
struct ares_lora_buf tx_buf
Definition lora.h:215
uint16_t packet_id
Definition lora.h:250
struct k_poll_signal signals[ARES_LORA_SIGNALS]
Definition lora.h:220
size_t num_commands
Definition lora.h:235
const struct ares_lora_command * commands
Definition lora.h:230
struct ares_lora_buf rx_buf
Definition lora.h:210
uint8_t seq_num
Definition lora.h:255
k_tid_t tid
Definition lora.h:245
struct k_poll_event events[ARES_LORA_SIGNALS]
Definition lora.h:225
Unified LoRa transport interface.
Definition lora.h:45
int(* write)(const struct ares_lora_transport *transport, const void *data, size_t length, size_t *cnt)
Function for writing data to the transfer interface.
Definition lora.h:95
int(* enable)(const struct ares_lora_transport *transport, bool block_tx)
Function for enabling transport in given TX mode.
Definition lora.h:82
int(* read)(const struct ares_lora_transport *transport, void *data, size_t length, size_t *cnt)
Function for reading data from the transport interface.
Definition lora.h:109
int(* init)(const struct ares_lora_transport *transport, const void *config, lora_transport_handler_t evt_handler, void *context)
Function for initializing the LoRa transport interface.
Definition lora.h:57
int(* configure)(const struct ares_lora_transport *transport, const struct lora_modem_config *config)
Function for reconfiguring the LoRa modem defined in the transport interface.
Definition lora.h:122
int(* uninit)(const struct ares_lora_transport *transport)
Function for uninitializing the LoRa transport interface.
Definition lora.h:68
Transfer interface.
Definition lora.h:130
void * ctx
Definition lora.h:139
const struct ares_lora_transport_api * api
Definition lora.h:134
Ares LoRa internals.
Definition lora.h:262
struct ares_lora_ctx * ctx
Definition lora.h:271
struct k_thread * thread
Definition lora.h:281
const struct ares_lora_transport * iface
Definition lora.h:266
const char * name
Definition lora.h:276
k_thread_stack_t * stack
Definition lora.h:286
Structured representation of an ares packet.
Definition packet.h:175