Files
stm32f407ve_black/HAL/Src/hal_delay.c

50 lines
1.2 KiB
C

/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file : hal_delay.c
* @brief : Delay hardware abstraction layer source file
******************************************************************************
*/
/* USER CODE END Header */
#include "hal.h"
#include "hal_delay.h"
/**
* @brief Initialize delay module
*/
void hal_delay_init(void) {
/* Call architecture specific delay initialization */
#if HAL_TARGET_ARCH == HAL_ARCH_STM32F4
hal_stm32f4_delay_init();
#else
#error "Unsupported HAL architecture"
#endif
}
/**
* @brief Delay in milliseconds
* @param ms: Delay time in milliseconds
*/
void hal_delay_ms(uint32_t ms) {
/* Call architecture specific delay implementation */
#if HAL_TARGET_ARCH == HAL_ARCH_STM32F4
hal_stm32f4_delay_ms(ms);
#else
#error "Unsupported HAL architecture"
#endif
}
/**
* @brief Delay in microseconds
* @param us: Delay time in microseconds
*/
void hal_delay_us(uint32_t us) {
/* Call architecture specific delay implementation */
#if HAL_TARGET_ARCH == HAL_ARCH_STM32F4
hal_stm32f4_delay_us(us);
#else
#error "Unsupported HAL architecture"
#endif
}