/** * @file * @brief Delay functions. * * Configuration: * * STA_STM32_DELAY_US_TIM: 1 MHz TIM instance used by sta::delayUs * * NOTE: TIM time base must be started before use of sta::delayUs by calling sta::initHAL. * When using startup system task this is handled automatically. */ #ifndef STA_CORE_STM32_DELAY_HPP #define STA_CORE_STM32_DELAY_HPP /** * @defgroup stm32Delay Delay * @ingroup stm32 * @brief STM32 Delay module. */ // Only enable module on STM32 platform #include #if defined(STA_PLATFORM_STM32) || defined(DOXYGEN) #include namespace sta { /** * @brief Millisecond delay. * * @param ms Milliseconds * * @ingroup stm32Delay */ void delayMs(uint32_t ms); #if defined(STA_STM32_DELAY_US_TIM) || defined(DOXYGEN) /** * @brief Microsecond delay. * * @param us Microseconds * * @ingroup stm32Delay */ void delayUs(uint32_t us); #endif // STA_STM32_DELAY_US_TIM } // namespace sta #endif // STA_PLATFORM_STM32 #endif // STA_CORE_STM32_DELAY_HPP