How to use LPTIM_TimeOut for a simple one-shot delay ?
I'm trying to realize some simple timings/delays in my application using the LPTIM, and although most of it is working, I don't understand it 100%.
So the LPTIM is set up to run on the LSE clock (32768 Hz) (with a prescaler of 16, so the LPTIM is running at 2048 Hz)
To start a delay there is this HAL function :
HAL_LPTIM_TimeOut_Start_IT(&lptim1, uint32_t Period, uint32_t Timeout)
but why are there 2 parameters ?
If I set Timeout to (eg). 2048, I get the LPTIM interrupt one second later.
But what is Period doing ? What value should it be set in this simple case ?
If I set Period to (eg) 2048 as well, I observed that the first time, I get 2 interrupts, io 1...
Also I found that the timer after expiring, is restarted automatically, so I have to stop it. Would it be possible to start it as a one-shot timer, so it expires automatically ?
It all seemed like a simple application of LPTIM, but I could not find how to do it in the HAL docs not in the forums..
Thanks.
