STM32 LL(Low Layer) timer delay library.
Hardware timer in the microcontroller. Can be used with TIM_Delay
- Ultra lightweight
- Easy to use
- Good precision
- No HAL dependency
- Hardware timer will be occupied
How to add CPM to the project, check the link
CPMAddPackage(
NAME TIMDelay
GITHUB_REPOSITORY ximtech/TIMDelay
GIT_TAG origin/main)
include_directories(${TIM_DELAY_DIRECTORY}) # add directory to project
file(GLOB_RECURSE SOURCES ${TIM_DELAY_SOURCES}) # add source files
#define TIMER_DELAY TIM1 // set timer in main.h or use default(TIM1)
timDelayInit();
timerDelay_us(10); // microseconds delay
timerDelay_ms(100); // milliseconds delay