mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-06-12 17:45:59 +00:00
70 lines
1.1 KiB
C++
70 lines
1.1 KiB
C++
/**
|
|
* @file
|
|
* @brief Delay functions.
|
|
*/
|
|
#ifndef STA_HAL_DELAY_HPP
|
|
#define STA_HAL_DELAY_HPP
|
|
|
|
/**
|
|
* @defgroup halDelay Delay
|
|
* @ingroup hal
|
|
* @brief HAL Delay module
|
|
*/
|
|
|
|
#ifdef DOXYGEN
|
|
/**
|
|
* @def STA_HAL_DELAY_ENABLE
|
|
* @brief Enable module.
|
|
*
|
|
* @ingroup halBuildConfig
|
|
*/
|
|
# define STA_HAL_DELAY_ENABLE
|
|
|
|
/**
|
|
* @def STA_HAL_DELAY_US_TIM
|
|
* @brief 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.
|
|
*
|
|
* @ingroup halBuildConfig
|
|
*/
|
|
# define STA_HAL_DELAY_US_TIM
|
|
#endif // DOXYGEN
|
|
|
|
|
|
#include <sta/config.hpp>
|
|
#ifdef STA_HAL_DELAY_ENABLE
|
|
|
|
#include <cstdint>
|
|
|
|
|
|
namespace sta
|
|
{
|
|
/**
|
|
* @brief Millisecond delay.
|
|
*
|
|
* @param ms Milliseconds
|
|
*
|
|
* @ingroup halDelay
|
|
*/
|
|
void delayMs(uint32_t ms);
|
|
|
|
#ifdef STA_HAL_DELAY_US_TIM
|
|
/**
|
|
* @brief Microsecond delay.
|
|
*
|
|
* @param us Microseconds
|
|
*
|
|
* @ingroup halDelay
|
|
*/
|
|
void delayUs(uint32_t us);
|
|
#endif // STA_HAL_DELAY_US_TIM
|
|
} // namespace sta
|
|
|
|
|
|
#endif // STA_HAL_DELAY_TIM
|
|
|
|
#endif // STA_HAL_DELAY_HPP
|
|
/** @} */
|