The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.
Dependents: hello SerialTestv11 SerialTestv12 Sierpinski ... more
mbed 2
This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.
TARGET_SAMR21G18A/TOOLCHAIN_ARM_MICRO/delay.h@172:65be27845400, 2019-02-20 (annotated)
- Committer:
- AnnaBridge
- Date:
- Wed Feb 20 20:53:29 2019 +0000
- Revision:
- 172:65be27845400
- Parent:
- 171:3a7713b1edbc
mbed library release version 165
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kojto | 111:4336505e4b1c | 1 | #ifndef DELAY_H_INCLUDED |
Kojto | 111:4336505e4b1c | 2 | #define DELAY_H_INCLUDED |
Kojto | 111:4336505e4b1c | 3 | |
Kojto | 111:4336505e4b1c | 4 | #ifdef __cplusplus |
Kojto | 111:4336505e4b1c | 5 | extern "C" { |
Kojto | 111:4336505e4b1c | 6 | #endif |
Kojto | 111:4336505e4b1c | 7 | |
Kojto | 111:4336505e4b1c | 8 | /** |
Kojto | 111:4336505e4b1c | 9 | * @defgroup group_common_services_delay Busy-Wait Delay Routines |
Kojto | 111:4336505e4b1c | 10 | * |
Kojto | 111:4336505e4b1c | 11 | * This module provides simple loop-based delay routines for those |
Kojto | 111:4336505e4b1c | 12 | * applications requiring a brief wait during execution. Common for |
Kojto | 111:4336505e4b1c | 13 | * API ver. 2. |
Kojto | 111:4336505e4b1c | 14 | * |
Kojto | 111:4336505e4b1c | 15 | * @{ |
Kojto | 111:4336505e4b1c | 16 | */ |
Kojto | 111:4336505e4b1c | 17 | #include <compiler.h> |
Kojto | 111:4336505e4b1c | 18 | #include <gclk.h> |
Kojto | 111:4336505e4b1c | 19 | |
Kojto | 111:4336505e4b1c | 20 | // TEMP: Added by V |
Kojto | 111:4336505e4b1c | 21 | #include "sam0/systick_counter.h" |
Kojto | 111:4336505e4b1c | 22 | #ifdef SYSTICK_MODE |
Kojto | 111:4336505e4b1c | 23 | #include "sam0/systick_counter.h" |
Kojto | 111:4336505e4b1c | 24 | #endif |
Kojto | 111:4336505e4b1c | 25 | #ifdef CYCLE_MODE |
Kojto | 111:4336505e4b1c | 26 | #include "sam0/cycle_counter.h" |
Kojto | 111:4336505e4b1c | 27 | #endif |
Kojto | 111:4336505e4b1c | 28 | |
Kojto | 111:4336505e4b1c | 29 | void delay_init(void); |
Kojto | 111:4336505e4b1c | 30 | |
Kojto | 111:4336505e4b1c | 31 | /** |
Kojto | 111:4336505e4b1c | 32 | * \def delay_s |
Kojto | 111:4336505e4b1c | 33 | * \brief Delay in at least specified number of seconds. |
Kojto | 111:4336505e4b1c | 34 | * \param delay Delay in seconds |
Kojto | 111:4336505e4b1c | 35 | */ |
Kojto | 111:4336505e4b1c | 36 | #define delay_s(delay) cpu_delay_s(delay) |
Kojto | 111:4336505e4b1c | 37 | |
Kojto | 111:4336505e4b1c | 38 | /** |
Kojto | 111:4336505e4b1c | 39 | * \def delay_ms |
Kojto | 111:4336505e4b1c | 40 | * \brief Delay in at least specified number of milliseconds. |
Kojto | 111:4336505e4b1c | 41 | * \param delay Delay in milliseconds |
Kojto | 111:4336505e4b1c | 42 | */ |
Kojto | 111:4336505e4b1c | 43 | #define delay_ms(delay) cpu_delay_ms(delay) |
Kojto | 111:4336505e4b1c | 44 | |
Kojto | 111:4336505e4b1c | 45 | /** |
Kojto | 111:4336505e4b1c | 46 | * \def delay_us |
Kojto | 111:4336505e4b1c | 47 | * \brief Delay in at least specified number of microseconds. |
Kojto | 111:4336505e4b1c | 48 | * \param delay Delay in microseconds |
Kojto | 111:4336505e4b1c | 49 | */ |
Kojto | 111:4336505e4b1c | 50 | #define delay_us(delay) cpu_delay_us(delay) |
Kojto | 111:4336505e4b1c | 51 | |
Kojto | 111:4336505e4b1c | 52 | #ifdef __cplusplus |
Kojto | 111:4336505e4b1c | 53 | } |
Kojto | 111:4336505e4b1c | 54 | #endif |
Kojto | 111:4336505e4b1c | 55 | |
Kojto | 111:4336505e4b1c | 56 | /** |
Kojto | 111:4336505e4b1c | 57 | * @} |
Kojto | 111:4336505e4b1c | 58 | */ |
Kojto | 111:4336505e4b1c | 59 | |
Kojto | 111:4336505e4b1c | 60 | #endif /* DELAY_H_INCLUDED */ |