|
|
@ -76,9 +76,9 @@ esp_err_t sx127x_init(const sx127x_config_t *config, sx127x_t **handle_ptr) { |
|
|
|
|
|
|
|
|
|
|
|
// perform reset
|
|
|
|
// perform reset
|
|
|
|
gpio_set_level(config->rst_io_num, 0); |
|
|
|
gpio_set_level(config->rst_io_num, 0); |
|
|
|
vTaskDelay(RESET_DELAY); |
|
|
|
vTaskDelay(SX127X_RESET_DELAY); |
|
|
|
gpio_set_level(config->rst_io_num, 1); |
|
|
|
gpio_set_level(config->rst_io_num, 1); |
|
|
|
vTaskDelay(RESET_DELAY); |
|
|
|
vTaskDelay(SX127X_RESET_DELAY); |
|
|
|
|
|
|
|
|
|
|
|
spi_bus_config_t bus_config = { |
|
|
|
spi_bus_config_t bus_config = { |
|
|
|
.mosi_io_num = config->mosi_io_num, |
|
|
|
.mosi_io_num = config->mosi_io_num, |
|
|
@ -100,7 +100,7 @@ esp_err_t sx127x_init(const sx127x_config_t *config, sx127x_t **handle_ptr) { |
|
|
|
.duty_cycle_pos = 0, |
|
|
|
.duty_cycle_pos = 0, |
|
|
|
.cs_ena_pretrans = 0, |
|
|
|
.cs_ena_pretrans = 0, |
|
|
|
.cs_ena_posttrans = 0, |
|
|
|
.cs_ena_posttrans = 0, |
|
|
|
.clock_speed_hz = SPI_CLOCK_HZ, // 8mhz
|
|
|
|
.clock_speed_hz = SX127X_SPI_CLOCK_HZ, // 8mhz
|
|
|
|
.input_delay_ns = 0, |
|
|
|
.input_delay_ns = 0, |
|
|
|
.spics_io_num = config->cs_io_num, |
|
|
|
.spics_io_num = config->cs_io_num, |
|
|
|
.flags = 0, |
|
|
|
.flags = 0, |
|
|
|