1#include "sx1262/sx1262.h"
5#include "metrics/metrics.h"
6extern byte sx1262_initialized;
8void sx1262_process_packet_from_chip(
struct network_context *nctx,
int len,
int pos) {
20 printf(
"[sx1262] lora Received rssi=0x%x, snr=0x%x, est_rssi=0x%x: \"%s\"\r\n", pkt_status.rssi_pkt_in_dbm, pkt_status.snr_pkt_in_db, pkt_status.signal_rssi_pkt_in_dbm, buf);
21 sx1262_switch_to_rx(nctx);
24 com = command_parse(buf, len);
26 IncMetric_PKTS_LORA_INVALID;
30 com->sourcedev = SOURCE_LORA;
32 IncMetric_PKTS_LORA_CTR_IN;
36void sx1262_irq(
int pin,
void *opaque) {
39 if (!sx1262_initialized) {
42 sx126x_irq_mask_t irqs;
50 printf(
"[sx1262] IRQ Masks: %p\r\n", irqs);
53 if ((irqs & (1 << 0)) || (irqs & (1 << 9))) {
55 transmit_complete_irq();
57 if (irqs & (1 << 1)) {
61 sx1262_process_packet_from_chip(nctx, bufstat.pld_len_in_bytes, bufstat.buffer_start_pointer);
byte got_new_packet(struct command *com, uint8_t signal_indicator)
stack received a new packet (signal indicator is a 0-255 byte value, interface specific)
SX126X LoRa packet status structure definition.
SX126X RX buffer status structure definition.
SX126x radio driver definition.
sx126x_status_t sx126x_get_lora_pkt_status(struct network_context *nctx, sx126x_pkt_status_lora_t *pkt_status)
Get the status of the last LoRa packet received.
sx126x_status_t sx126x_get_irq_status(struct network_context *nctx, sx126x_irq_mask_t *irq)
Get system interrupt status.
sx126x_status_t sx126x_read_buffer(struct network_context *nctx, const uint8_t offset, uint8_t *buffer, const uint8_t size)
Read data from radio Rx buffer memory space.
sx126x_status_t sx126x_get_rx_buffer_status(struct network_context *nctx, sx126x_rx_buffer_status_t *rx_buffer_status)
Get the current Rx buffer status for both LoRa and GFSK Rx operations.
sx126x_status_t sx126x_clear_irq_status(struct network_context *nctx, const sx126x_irq_mask_t irq_mask)
Clear selected system interrupts.