From 22744026da9ad847d931e05192508f05f38bd5e8 Mon Sep 17 00:00:00 2001 From: "Morgan 'ARR\\!' Allen" Date: Sat, 22 Feb 2020 08:33:50 -0800 Subject: [PATCH] include DIO0 mode for CAD --- include/esp32-lora.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/esp32-lora.h b/include/esp32-lora.h index acbb6ae..1882eac 100644 --- a/include/esp32-lora.h +++ b/include/esp32-lora.h @@ -72,6 +72,7 @@ #define DIO0_MODE_RXDONE 0x00 #define DIO0_MODE_TXDONE 0x40 +#define DIO0_MODE_CADDET 0x80 #define EV_DIO0 (1 << 0) @@ -88,6 +89,8 @@ const long bandwidths[9]; typedef void (*receiveCallback)(uint8_t size); typedef void (*txdoneCallback)(); +typedef void (*cadDoneCallback)(bool detected); +typedef void (*cadDetectedCallback)(); typedef struct { EventGroupHandle_t events; @@ -111,6 +114,9 @@ typedef struct lora32_cfg_t { receiveCallback receive; txdoneCallback tx_done; + cadDoneCallback cad_done; + cadDetectedCallback cad_detected; + spi_device_handle_t spi; lora32_handle_t handle; @@ -123,6 +129,7 @@ void lora32_send(lora32_cfg_t *config, uint8_t *data, uint8_t len); void lora32_set_spreadfactor(lora32_cfg_t *lora, uint8_t factor); void lora32_dump_regs(lora32_cfg_t *lora); void lora32_enable_continuous_rx(lora32_cfg_t *lora); +void lora32_enable_cad(lora32_cfg_t *lora); void lora32_set_coding_rate(lora32_cfg_t *lora, uint8_t d); void lora32_read_data(lora32_cfg_t *lora, uint8_t *data);