Loading files
/*=====================================================================================================*/
/*=====================================================================================================*/
#include "stm32f4_system.h"
#include "stm32f4_delay.h"
/*====================================================================================================*/
/*====================================================================================================*
**函數 : Delay_1us
**功能 : 延遲 1us
**輸入 : nCnt_1us
**輸出 : None
**使用 : Delay_1us(Times);
**====================================================================================================*/
/*====================================================================================================*/
void Delay_1us( uint32_t nCnt_1us )
{
uint32_t nCnt;
for(; nCnt_1us != 0; nCnt_1us--)
for(nCnt = 5; nCnt != 0; nCnt--);
}
/*====================================================================================================*/
/*====================================================================================================*
**函數 : Delay_10us
**功能 : 延遲 10us
**輸入 : nCnt_10us
**輸出 : None
**使用 : Delay_10us(Times);
**====================================================================================================*/
/*====================================================================================================*/
void Delay_10us( uint32_t nCnt_10us )
{
uint32_t nCnt;
for(; nCnt_10us != 0; nCnt_10us--)
for(nCnt = 113; nCnt != 0; nCnt--);
}
/*====================================================================================================*/
/*====================================================================================================*
**函數 : Delay_100us
**功能 : 延遲 100us
**輸入 : nCnt_100us
**輸出 : None
**使用 : Delay_100us(Times);
**====================================================================================================*/
/*====================================================================================================*/
void Delay_100us( uint32_t nCnt_100us )
{
uint32_t nCnt;
for(; nCnt_100us != 0; nCnt_100us--)
for(nCnt = 1190; nCnt != 0; nCnt--);
}
/*====================================================================================================*/
/*====================================================================================================*
**函數 : Delay_1ms
**功能 : 延遲 1ms
**輸入 : nCnt_1ms
**輸出 : None
**使用 : Delay_1ms(Times);
**====================================================================================================*/
/*====================================================================================================*/
void Delay_1ms( uint32_t nCnt_1ms )
{
HAL_Delay(nCnt_1ms);
}
/*====================================================================================================*/
/*====================================================================================================*
**函數 : Delay_10ms
**功能 : 延遲 10ms
**輸入 : nCnt_10ms
**輸出 : None
**使用 : Delay_10ms(Times);
**====================================================================================================*/
/*====================================================================================================*/
void Delay_10ms( uint32_t nCnt_10ms )
{
while(nCnt_10ms--)
HAL_Delay(10);
}
/*====================================================================================================*/
/*====================================================================================================*
**函數 : Delay_100ms
**功能 : 延遲 100ms
**輸入 : nCnt_100ms
**輸出 : None
**使用 : Delay_100ms(Times);
**====================================================================================================*/
/*====================================================================================================*/
void Delay_100ms( uint32_t nCnt_100ms )
{
while(nCnt_100ms--)
HAL_Delay(100);
}
/*=====================================================================================================*/
/*=====================================================================================================*/
0cf3523cfThis file is pinned to the selected release. Download the original to open it in your design tool.