wdomski / SX1278-example

Example for STM32 HAL driver for LoRa SX1278 module
MIT License
97 stars 46 forks source link

Does the SX1278_hw_DelayMs function have to be used? #7

Open chltmdwmf opened 2 years ago

chltmdwmf commented 2 years ago

For example, the SX1278_hw_Reset function has SX1278_hw_DelayMs (100). Is this necessary? __weak void SX1278_hw_Reset(SX1278_hw_t *hw) { SX1278_hw_SetNSS(hw, 1); HAL_GPIO_WritePin(hw->reset.port, hw->reset.pin, GPIO_PIN_RESET); SX1278_hw_DelayMs(1); HAL_GPIO_WritePin(hw->reset.port, hw->reset.pin, GPIO_PIN_SET); SX1278_hw_DelayMs(100); <--------- THIS }

In addition to the SX1278_hw_Reset function, other functions also use the delay function, but is delay a required element?

wdomski commented 10 months ago

It could be minimized. The period for holding reset line is required to be > 100 us, so fixing it to 1ms is fine. Although, the period after reset is indeed much smaller than what is in the code. The datasheet speaks about 5 ms. I think it would be safe to reduce it down to 10 ms.