mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-09-29 05:17:33 +00:00
Move STM32 related code to sta-stm32-core repo
This commit is contained in:
68
include/sta/stm32/delay.hpp
Normal file
68
include/sta/stm32/delay.hpp
Normal file
@@ -0,0 +1,68 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief Delay functions.
|
||||
*/
|
||||
#ifndef STA_STM32_DELAY_HPP
|
||||
#define STA_STM32_DELAY_HPP
|
||||
|
||||
/**
|
||||
* @defgroup stm32Delay Delay
|
||||
* @ingroup stm32
|
||||
* @brief STM32 Delay module.
|
||||
*/
|
||||
|
||||
#ifdef DOXYGEN
|
||||
/**
|
||||
* @def STA_STM32_DELAY_ENABLE
|
||||
* @brief Enable module.
|
||||
*
|
||||
* @ingroup stm32BuildConfig
|
||||
*/
|
||||
# define STA_STM32_DELAY_ENABLE
|
||||
|
||||
/**
|
||||
* @def STA_STM32_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 stm32BuildConfig
|
||||
*/
|
||||
# define STA_STM32_DELAY_US_TIM
|
||||
#endif // DOXYGEN
|
||||
|
||||
|
||||
#include <sta/config.hpp>
|
||||
#ifdef STA_STM32_DELAY_ENABLE
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
|
||||
namespace sta
|
||||
{
|
||||
/**
|
||||
* @brief Millisecond delay.
|
||||
*
|
||||
* @param ms Milliseconds
|
||||
*
|
||||
* @ingroup stm32Delay
|
||||
*/
|
||||
void delayMs(uint32_t ms);
|
||||
|
||||
#ifdef STA_STM32_DELAY_US_TIM
|
||||
/**
|
||||
* @brief Microsecond delay.
|
||||
*
|
||||
* @param us Microseconds
|
||||
*
|
||||
* @ingroup stm32Delay
|
||||
*/
|
||||
void delayUs(uint32_t us);
|
||||
#endif // STA_STM32_DELAY_US_TIM
|
||||
} // namespace sta
|
||||
|
||||
|
||||
#endif // STA_STM32_DELAY_ENABLE
|
||||
|
||||
#endif // STA_STM32_DELAY_HPP
|
Reference in New Issue
Block a user