18 #error "Do not include this file directly! Use xtimer.h instead"
28 #if (XTIMER_SHIFT != 0)
29 #if (XTIMER_HZ % 15625 != 0)
30 #error XTIMER_HZ must be a multiple of 15625 (5^6) when using XTIMER_SHIFT
32 #if (XTIMER_HZ > 1000000ul)
33 #if (XTIMER_HZ != (1000000ul << XTIMER_SHIFT))
34 #error XTIMER_HZ != (1000000ul << XTIMER_SHIFT)
38 static inline uint32_t _xtimer_ticks_from_usec(uint32_t usec) {
42 static inline uint64_t _xtimer_ticks_from_usec64(uint64_t usec) {
46 static inline uint32_t _xtimer_usec_from_ticks(uint32_t ticks) {
50 static inline uint64_t _xtimer_usec_from_ticks64(uint64_t ticks) {
55 #if ((XTIMER_HZ << XTIMER_SHIFT) != 1000000ul)
56 #error (XTIMER_HZ << XTIMER_SHIFT) != 1000000ul
60 static inline uint32_t _xtimer_ticks_from_usec(uint32_t usec) {
64 static inline uint64_t _xtimer_ticks_from_usec64(uint64_t usec) {
68 static inline uint32_t _xtimer_usec_from_ticks(uint32_t ticks) {
72 static inline uint64_t _xtimer_usec_from_ticks64(uint64_t ticks) {
76 #elif (XTIMER_HZ == (1000000ul)) || defined(MODULE_XTIMER_ON_ZTIMER)
79 static inline uint32_t _xtimer_usec_from_ticks(uint32_t ticks) {
83 static inline uint64_t _xtimer_usec_from_ticks64(uint64_t ticks) {
87 static inline uint32_t _xtimer_ticks_from_usec(uint32_t usec) {
91 static inline uint64_t _xtimer_ticks_from_usec64(uint64_t usec) {
95 #elif XTIMER_HZ == (32768ul)
100 static inline uint32_t _xtimer_ticks_from_usec(uint32_t usec) {
104 static inline uint64_t _xtimer_ticks_from_usec64(uint64_t usec) {
108 static inline uint32_t _xtimer_usec_from_ticks(uint32_t ticks) {
111 uint64_t usec = (uint64_t)ticks * 15625ul;
115 static inline uint64_t _xtimer_usec_from_ticks64(uint64_t ticks) {
117 uint64_t usec = (uint64_t)ticks * 15625ul;
123 #if ((XTIMER_HZ % 15625) == 0)
124 #error Unsupported hardware timer frequency (XTIMER_HZ), missing XTIMER_SHIFT in board.h? See xtimer.h documentation for more info
126 #error Unknown hardware timer frequency (XTIMER_HZ), check board.h and/or add an implementation in sys/include/xtimer/tick_conversion.h
static uint32_t div_u32_by_15625div512(uint32_t val)
Divide val by (15625/512)
static uint64_t div_u64_by_15625div512(uint64_t val)
Divide val by (15625/512)
#define XTIMER_SHIFT
xtimer prescaler value