1#include "sx1262/sx1262.h"
6#include "metrics/metrics.h"
7static volatile byte transmitting = 0;
8int sx1262_transmit_fail_counter = 0;
9void sx1262_done_transmit() {
11 printf(
"[sx1262] lora transmit lock released\r\n");
13int sx1262_is_transmitting() {
21void transmit_complete_irq() {
23 printf(
"[sx1262] Transmit complete\r\n");
24 sx1262_switch_to_rx();
28int sx1262_transmit(
struct network_context *nctx,
const uint8_t *buf, uint16_t size) {
30 printf(
"[sx1262] LoRA maximum packet size is 255 bytes. attempt to send %i bytes\r\n", size);
33 sx1262_clear_rx_mode();
34 printf(
"[sx1262] Transmitting %i bytes\r\n", size);
37 sx1262_set_lora_packet_type(nctx);
45 sx1262_set_lora_parameters(nctx);
47 sx1262_set_packet_params(nctx, size);
54 print_chip_status(nctx, 1);
55 IncMetric_PKTS_LORA_CTR_OUT;
SX126x radio driver definition.
sx126x_status_t sx126x_set_tx(struct network_context *nctx, const uint32_t timeout_in_ms)
Set the chip in transmission mode.
sx126x_status_t sx126x_write_buffer(struct network_context *nctx, const uint8_t offset, const uint8_t *buffer, const uint8_t size)
Write data into radio Tx buffer memory space.
sx126x_status_t sx126x_set_buffer_base_address(struct network_context *nctx, const uint8_t tx_base_address, const uint8_t rx_base_address)
Set buffer start addresses for both Tx and Rx operations.
sx126x_status_t sx126x_set_tx_params(struct network_context *nctx, const int8_t pwr_in_dbm, const sx126x_ramp_time_t ramp_time)
Set the parameters for TX power and power amplifier ramp time.
Hardware Abstraction Layer for SX126x.