delay.h
Go to the documentation of this file.
1 
33 /*
34  * Support and FAQ: visit <a href="https://www.microchip.com/support/">Microchip Support</a>
35  */
36 #ifndef _DELAY_H_
37 #define _DELAY_H_
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 #include <sysclk.h>
44 
45 #if UC3
46 # include <cycle_counter.h>
47 #elif XMEGA
48 # include "xmega/cycle_counter.h"
49 #elif MEGA
50 # include "mega/cycle_counter.h"
51 #elif SAM
52 # include "sam/cycle_counter.h"
53 #endif
54 
79 #ifndef F_CPU
80 # define F_CPU sysclk_get_cpu_hz()
81 #endif
82 
98 #define delay_init(fcpu_hz)
99 
105 #define delay_s(delay) ((delay) ? cpu_delay_ms(1000 * delay, F_CPU) : cpu_delay_us(1, F_CPU))
106 
112 #define delay_ms(delay) ((delay) ? cpu_delay_ms(delay, F_CPU) : cpu_delay_us(1, F_CPU))
113 
119 #define delay_us(delay) ((delay) ? cpu_delay_us(delay, F_CPU) : cpu_delay_us(1, F_CPU))
120 
121 #ifdef __cplusplus
122 }
123 #endif
124 
129 #endif /* _DELAY_H_ */
ARM functions for busy-wait delay loops.


inertial_sense_ros
Author(s):
autogenerated on Sun Feb 28 2021 03:17:57