Commit | Line | Data |
---|---|---|
4cff3ded AW |
1 | /* Title: wait |
2 | * Generic wait functions. | |
3 | * | |
4 | * These provide simple NOP type wait capabilities. | |
5 | * | |
6 | * Example: | |
7 | * > #include "mbed.h" | |
8 | * > | |
9 | * > DigitalOut heartbeat(LED1); | |
10 | * > | |
11 | * > int main() { | |
12 | * > while (1) { | |
13 | * > heartbeat = 1; | |
14 | * > wait(0.5); | |
15 | * > heartbeat = 0; | |
16 | * > wait(0.5); | |
17 | * > } | |
18 | * > } | |
19 | */ | |
20 | ||
21 | /* mbed Microcontroller Library - wait_api | |
22 | * Copyright (c) 2009 ARM Limited. All rights reserved. | |
23 | * sford | |
24 | */ | |
25 | ||
26 | // GENERIC | |
27 | ||
28 | #ifndef MBED_WAIT_API_H | |
29 | #define MBED_WAIT_API_H | |
30 | ||
31 | #ifdef __cplusplus | |
32 | extern "C" { | |
33 | #endif | |
34 | ||
35 | /* Function: wait | |
36 | * Waits for a number of seconds, with microsecond resolution (within | |
37 | * the accuracy of single precision floating point). | |
38 | * | |
39 | * Variables: | |
40 | * s - number of seconds to wait | |
41 | */ | |
42 | void wait(float s); | |
43 | ||
44 | /* Function: wait_ms | |
45 | * Waits a number of milliseconds. | |
46 | * | |
47 | * Variables: | |
48 | * ms - the whole number of milliseconds to wait | |
49 | */ | |
50 | void wait_ms(int ms); | |
51 | ||
52 | /* Function: wait_us | |
53 | * Waits a number of microseconds. | |
54 | * | |
55 | * Variables: | |
56 | * us - the whole number of microseconds to wait | |
57 | */ | |
58 | void wait_us(int us); | |
59 | ||
60 | #ifdef __cplusplus | |
61 | } | |
62 | #endif | |
63 | ||
64 | #endif |