semf
|
Timer
implementation for STM32 as peripheral timer.
More...
#include <stm32timer.h>
Public Types | |
enum class | ErrorCode : uint8_t { Start_HalError = 0 , Start_HalBusy , Start_HalTimeout , Stop_HalError , Stop_HalBusy , Stop_HalTimeout } |
Public Member Functions | |
Stm32Timer (TIM_HandleTypeDef &hwHandle) | |
Constructor. More... | |
Stm32Timer (const Stm32Timer &other)=delete | |
virtual | ~Stm32Timer ()=default |
void | start () override |
void | stop () override |
void | reset () override |
void | isr (TIM_HandleTypeDef &hwHandle) |
Interrupt service routine for adc conversion finished. More... | |
Public Member Functions inherited from semf::app::Timer | |
virtual | ~Timer ()=default |
virtual void | start ()=0 |
virtual void | stop ()=0 |
virtual void | reset ()=0 |
Public Member Functions inherited from semf::LinkedQueue< T >::Node | |
virtual | ~Node ()=default |
T * | next () const |
Returns a pointer to the next element in a queue. More... | |
void | setNext (T *next) |
Sets a pointer to the next element in a list. More... | |
bool | isInQueue (LinkedQueue &queue) |
Returns if a node is part of this LinkedQueue . More... | |
Static Public Member Functions | |
static LinkedQueue< Stm32Timer > * | queue () |
Get the list with all timers. More... | |
static void | systemIsr (TIM_HandleTypeDef &hwHandle) |
System-wide interrupt service routine for adc conversion finished. More... | |
Additional Inherited Members | |
Public Attributes inherited from semf::app::Timer | |
Signal | timeout |
Signal< Error > | error |
Timer
implementation for STM32 as peripheral timer.
HAL_TIM_PeriodElapsedCallback
. In some cases STM32CubeIDE implements this function on its own which results in a multiple definitions linking error. In that case define SEMF_TIMER_USE_CUSTOM_CALLBACK
and extend STM32CubeIDE's implementation accordingly. Definition at line 26 of file stm32timer.h.
|
strong |
Error codes for this class. Error ID identify a unique error() / onError call (excluding transferring).
Enumerator | |
---|---|
Start_HalError | |
Start_HalBusy | |
Start_HalTimeout | |
Stop_HalError | |
Stop_HalBusy | |
Stop_HalTimeout |
Definition at line 30 of file stm32timer.h.
|
explicit |
Constructor.
hwHandle | Hardware handler. |
Definition at line 24 of file stm32timer.cpp.
|
explicitdelete |
|
virtualdefault |
void semf::Stm32Timer::isr | ( | TIM_HandleTypeDef & | hwHandle | ) |
Interrupt service routine for adc conversion finished.
hwHandle | Hardware handler. |
Definition at line 95 of file stm32timer.cpp.
|
static |
Get the list with all timers.
Definition at line 83 of file stm32timer.cpp.
|
overridevirtual |
|
overridevirtual |
Starts the timer.
Start_HalError | If HAL_TIM_Base_Start_IT() returns HAL_ERROR. |
Start_HalBusy | If HAL_TIM_Base_Start_IT() returns HAL_BUSY. |
Start_HalTimeout | If HAL_TIM_Base_Start_IT() returns HAL_TIMEOUT. |
Implements semf::app::Timer.
Definition at line 30 of file stm32timer.cpp.
|
overridevirtual |
Stops the timer.
Stop_HalError | If HAL_TIM_Base_Stop_IT() returns HAL_ERROR. |
Stop_HalBusy | If HAL_TIM_Base_Stop_IT() returns HAL_BUSY. |
Stop_HalTimeout | If HAL_TIM_Base_Stop_IT() returns HAL_TIMEOUT. |
Implements semf::app::Timer.
Definition at line 54 of file stm32timer.cpp.
|
static |
System-wide interrupt service routine for adc conversion finished.
hwHandle | Hardware handler. |
Definition at line 89 of file stm32timer.cpp.