mirror of
https://github.com/manuelbl/ttn-esp32.git
synced 2025-06-15 04:14:28 +02:00
New config option: TTN_RADIO_RST_KEEP_ASSERTED
This commit is contained in:
parent
e29477fa7e
commit
45778d2186
7
Kconfig
7
Kconfig
@ -55,6 +55,13 @@ config TTN_SPI_FREQ
|
|||||||
help
|
help
|
||||||
SPI frequency to communicate between ESP32 and SX127x radio chip
|
SPI frequency to communicate between ESP32 and SX127x radio chip
|
||||||
|
|
||||||
|
config TTN_RADIO_RST_KEEP_ASSERTED
|
||||||
|
bool "Keep RST pin asserted instead of floating"
|
||||||
|
default n
|
||||||
|
help
|
||||||
|
Some hardware needs RST pin to be always high for LoRa chip to function
|
||||||
|
|
||||||
|
|
||||||
config TTN_BG_TASK_PRIO
|
config TTN_BG_TASK_PRIO
|
||||||
int "Background task priority"
|
int "Background task priority"
|
||||||
default 10
|
default 10
|
||||||
|
@ -128,9 +128,16 @@ void hal_pin_rst(u1_t val)
|
|||||||
gpio_set_direction(ttn_hal.pinRst, GPIO_MODE_OUTPUT);
|
gpio_set_direction(ttn_hal.pinRst, GPIO_MODE_OUTPUT);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // keep pin floating
|
{
|
||||||
|
#ifdef CONFIG_TTN_RADIO_RST_KEEP_ASSERTED
|
||||||
|
// drive up the pin because the hardware is nonstandard
|
||||||
|
gpio_set_level(ttn_hal.pinRst, 1);
|
||||||
|
gpio_set_direction(ttn_hal.pinRst, GPIO_MODE_OUTPUT);
|
||||||
|
#else
|
||||||
|
// keep pin floating
|
||||||
gpio_set_level(ttn_hal.pinRst, val);
|
gpio_set_level(ttn_hal.pinRst, val);
|
||||||
gpio_set_direction(ttn_hal.pinRst, GPIO_MODE_INPUT);
|
gpio_set_direction(ttn_hal.pinRst, GPIO_MODE_INPUT);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user