Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LED_Matrix_Game
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bs_uc
ss21
LED_Matrix_Game
Commits
581ed93e
Commit
581ed93e
authored
4 years ago
by
pichlerbi76568
Browse files
Options
Downloads
Patches
Plain Diff
SCR
parent
45cc72f9
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Core/Inc/DWT_Delay.h
+40
-0
40 additions, 0 deletions
Core/Inc/DWT_Delay.h
with
40 additions
and
0 deletions
Core/Inc/DWT_Delay.h
0 → 100644
+
40
−
0
View file @
581ed93e
/*
* File: DWT_Delay.h
* Driver Name: [[ DWT Delay ]]
* SW Layer: ECUAL
* Created on: Jun 28, 2020
* Author: Khaled Magdy
* -------------------------------------------
* For More Information, Tutorials, etc.
* Visit Website: www.DeepBlueMbedded.com
*
*/
#ifndef DWT_DELAY_H_
#define DWT_DELAY_H_
#include
"stm32f4xx_hal.h"
uint32_t
DWT_Delay_Init
(
void
);
// This Function Provides Delay In Microseconds Using DWT
__STATIC_INLINE
void
DWT_Delay_us
(
volatile
uint32_t
au32_microseconds
)
{
uint32_t
au32_initial_ticks
=
DWT
->
CYCCNT
;
uint32_t
au32_ticks
=
(
HAL_RCC_GetHCLKFreq
()
/
1000000
);
au32_microseconds
*=
au32_ticks
;
while
((
DWT
->
CYCCNT
-
au32_initial_ticks
)
<
au32_microseconds
-
au32_ticks
);
}
// This Function Provides Delay In Milliseconds Using DWT
__STATIC_INLINE
void
DWT_Delay_ms
(
volatile
uint32_t
au32_milliseconds
)
{
uint32_t
au32_initial_ticks
=
DWT
->
CYCCNT
;
uint32_t
au32_ticks
=
(
HAL_RCC_GetHCLKFreq
()
/
1000
);
au32_milliseconds
*=
au32_ticks
;
while
((
DWT
->
CYCCNT
-
au32_initial_ticks
)
<
au32_milliseconds
);
}
#endif
/* DWT_DELAY_H_ */
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment