include DIO0 mode for CAD

This commit is contained in:
Morgan 'ARR\!' Allen 2020-02-22 08:33:50 -08:00
parent c01099eb16
commit 22744026da

View file

@ -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);