Allow LoRaWAN STM32WL driver debug led to be inverted (#14910)

pull/14978/head
Charles 2021-07-29 11:29:53 +02:00 committed by GitHub
parent 3d362641fb
commit d13aaf408c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 8 deletions

View File

@ -115,11 +115,11 @@ const float lora_symbol_time[3][6] = {{ 32.768, 16.384, 8.192, 4.096, 2.048, 1.0
#ifdef MBED_CONF_STM32WL_LORA_DRIVER_DEBUG_RX
static DigitalOut _rf_dbg_rx(MBED_CONF_STM32WL_LORA_DRIVER_DEBUG_RX, 0);
static DigitalOut _rf_dbg_rx(MBED_CONF_STM32WL_LORA_DRIVER_DEBUG_RX, MBED_CONF_STM32WL_LORA_DRIVER_DEBUG_INVERT);
#endif
#ifdef MBED_CONF_STM32WL_LORA_DRIVER_DEBUG_TX
static DigitalOut _rf_dbg_tx(MBED_CONF_STM32WL_LORA_DRIVER_DEBUG_TX, 0);
static DigitalOut _rf_dbg_tx(MBED_CONF_STM32WL_LORA_DRIVER_DEBUG_TX, MBED_CONF_STM32WL_LORA_DRIVER_DEBUG_INVERT);
#endif
@ -302,7 +302,7 @@ void STM32WL_LoRaRadio::HAL_SUBGHZ_TxCpltCallback(void)
#ifdef MBED_CONF_STM32WL_LORA_DRIVER_DEBUG_TX
/* Reset TX DBG pin */
_rf_dbg_tx = 0;
_rf_dbg_tx = MBED_CONF_STM32WL_LORA_DRIVER_DEBUG_INVERT;
#endif
}
}
@ -330,7 +330,7 @@ void STM32WL_LoRaRadio::HAL_SUBGHZ_RxCpltCallback(void)
#ifdef MBED_CONF_STM32WL_LORA_DRIVER_DEBUG_RX
/* Reset RX DBG pin */
_rf_dbg_rx = 0;
_rf_dbg_rx = MBED_CONF_STM32WL_LORA_DRIVER_DEBUG_INVERT;
#endif
}
}
@ -360,7 +360,7 @@ void STM32WL_LoRaRadio::HAL_SUBGHZ_RxTxTimeoutCallback(void)
#if MBED_CONF_STM32WL_LORA_DRIVER_DEBUG_TX
/* Reset TX DBG pin */
_rf_dbg_tx = 0;
_rf_dbg_tx = MBED_CONF_STM32WL_LORA_DRIVER_DEBUG_INVERT;
#endif
} else if ((_radio_events && _radio_events->rx_timeout) && (_operating_mode == MODE_RX)) {
@ -368,7 +368,7 @@ void STM32WL_LoRaRadio::HAL_SUBGHZ_RxTxTimeoutCallback(void)
#ifdef MBED_CONF_STM32WL_LORA_DRIVER_DEBUG_RX
/* Reset RX DBG pin */
_rf_dbg_rx = 0;
_rf_dbg_rx = MBED_CONF_STM32WL_LORA_DRIVER_DEBUG_INVERT;
#endif
}
}
@ -1079,7 +1079,7 @@ void STM32WL_LoRaRadio::send(uint8_t *buffer, uint8_t size)
#ifdef MBED_CONF_STM32WL_LORA_DRIVER_DEBUG_TX
/* Set TX DBG pin */
_rf_dbg_tx = 1;
_rf_dbg_tx = !MBED_CONF_STM32WL_LORA_DRIVER_DEBUG_INVERT;
#endif
/* Set RF switch */
@ -1137,7 +1137,7 @@ void STM32WL_LoRaRadio::receive(void)
#ifdef MBED_CONF_STM32WL_LORA_DRIVER_DEBUG_RX
/* Set RX DBG pin */
_rf_dbg_rx = 1;
_rf_dbg_rx = !MBED_CONF_STM32WL_LORA_DRIVER_DEBUG_INVERT;
#endif
/* RF switch configuration */

View File

@ -47,6 +47,10 @@
},
"debug_tx": {
"help": "GPIO pin for TX debug"
},
"debug_invert": {
"help": "invert levels of the debug_rx and debug_tx pins. Default: 0 standard, 1 invert",
"value" : 0
}
},
"target_overrides": {