mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-06-10 16:55:58 +00:00
29 lines
593 B
C++
29 lines
593 B
C++
#include <sta/devices/stm32/init.hpp>
|
|
|
|
#include <sta/assert.hpp>
|
|
|
|
#ifdef STA_STM32_DELAY_US_TIM
|
|
|
|
#ifndef HAL_TIM_MODULE_ENABLED
|
|
# error "STM32 HAL TIM module not enabled!"
|
|
#endif // HAL_TIM_MODULE_ENABLED
|
|
|
|
#include <tim.h>
|
|
|
|
#endif // STA_STM32_DELAY_US_TIM
|
|
|
|
|
|
namespace sta
|
|
{
|
|
void initHAL()
|
|
{
|
|
#ifdef STA_STM32_DELAY_US_TIM
|
|
// Validate TIM used for delayUs
|
|
extern bool isValidDelayUsTIM();
|
|
STA_ASSERT(isValidDelayUsTIM());
|
|
// Start timer base
|
|
HAL_TIM_Base_Start(&STA_STM32_DELAY_US_TIM);
|
|
#endif // STA_STM32_DELAY_US_TIM
|
|
}
|
|
} // namespace sta
|