mbed library sources, mbed-dev only for TYBLE16
Fork of mbed-dev by
Please refer flowing link.
/users/kenjiArai/notebook/tyble16-module-will-become-a-mbed-family--mbedliza/
platform/mbed_wait_api.h@178:79309dc6340a, 2017-11-23 (annotated)
- Committer:
- AnnaBridge
- Date:
- Thu Nov 23 11:57:25 2017 +0000
- Revision:
- 178:79309dc6340a
- Parent:
- 167:e84263d55307
mbed-dev library. Release version 156
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
<> | 160:d5399cc887bb | 1 | |
<> | 160:d5399cc887bb | 2 | /** \addtogroup platform */ |
<> | 160:d5399cc887bb | 3 | /** @{*/ |
AnnaBridge | 178:79309dc6340a | 4 | /** |
AnnaBridge | 178:79309dc6340a | 5 | * \defgroup platform_wait_api wait_api functions |
AnnaBridge | 178:79309dc6340a | 6 | * @{ |
AnnaBridge | 178:79309dc6340a | 7 | */ |
AnnaBridge | 178:79309dc6340a | 8 | |
<> | 160:d5399cc887bb | 9 | /* mbed Microcontroller Library |
<> | 160:d5399cc887bb | 10 | * Copyright (c) 2006-2013 ARM Limited |
<> | 160:d5399cc887bb | 11 | * |
<> | 160:d5399cc887bb | 12 | * Licensed under the Apache License, Version 2.0 (the "License"); |
<> | 160:d5399cc887bb | 13 | * you may not use this file except in compliance with the License. |
<> | 160:d5399cc887bb | 14 | * You may obtain a copy of the License at |
<> | 160:d5399cc887bb | 15 | * |
<> | 160:d5399cc887bb | 16 | * http://www.apache.org/licenses/LICENSE-2.0 |
<> | 160:d5399cc887bb | 17 | * |
<> | 160:d5399cc887bb | 18 | * Unless required by applicable law or agreed to in writing, software |
<> | 160:d5399cc887bb | 19 | * distributed under the License is distributed on an "AS IS" BASIS, |
<> | 160:d5399cc887bb | 20 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
<> | 160:d5399cc887bb | 21 | * See the License for the specific language governing permissions and |
<> | 160:d5399cc887bb | 22 | * limitations under the License. |
<> | 160:d5399cc887bb | 23 | */ |
<> | 160:d5399cc887bb | 24 | #ifndef MBED_WAIT_API_H |
<> | 160:d5399cc887bb | 25 | #define MBED_WAIT_API_H |
<> | 160:d5399cc887bb | 26 | |
<> | 160:d5399cc887bb | 27 | #ifdef __cplusplus |
<> | 160:d5399cc887bb | 28 | extern "C" { |
<> | 160:d5399cc887bb | 29 | #endif |
<> | 160:d5399cc887bb | 30 | |
<> | 160:d5399cc887bb | 31 | /** Generic wait functions. |
<> | 160:d5399cc887bb | 32 | * |
<> | 160:d5399cc887bb | 33 | * These provide simple NOP type wait capabilities. |
<> | 160:d5399cc887bb | 34 | * |
<> | 160:d5399cc887bb | 35 | * Example: |
<> | 160:d5399cc887bb | 36 | * @code |
<> | 160:d5399cc887bb | 37 | * #include "mbed.h" |
<> | 160:d5399cc887bb | 38 | * |
<> | 160:d5399cc887bb | 39 | * DigitalOut heartbeat(LED1); |
<> | 160:d5399cc887bb | 40 | * |
<> | 160:d5399cc887bb | 41 | * int main() { |
<> | 160:d5399cc887bb | 42 | * while (1) { |
<> | 160:d5399cc887bb | 43 | * heartbeat = 1; |
<> | 160:d5399cc887bb | 44 | * wait(0.5); |
<> | 160:d5399cc887bb | 45 | * heartbeat = 0; |
<> | 160:d5399cc887bb | 46 | * wait(0.5); |
<> | 160:d5399cc887bb | 47 | * } |
<> | 160:d5399cc887bb | 48 | * } |
AnnaBridge | 167:e84263d55307 | 49 | * @endcode |
<> | 160:d5399cc887bb | 50 | */ |
<> | 160:d5399cc887bb | 51 | |
<> | 160:d5399cc887bb | 52 | /** Waits for a number of seconds, with microsecond resolution (within |
<> | 160:d5399cc887bb | 53 | * the accuracy of single precision floating point). |
<> | 160:d5399cc887bb | 54 | * |
<> | 160:d5399cc887bb | 55 | * @param s number of seconds to wait |
<> | 160:d5399cc887bb | 56 | */ |
<> | 160:d5399cc887bb | 57 | void wait(float s); |
<> | 160:d5399cc887bb | 58 | |
<> | 160:d5399cc887bb | 59 | /** Waits a number of milliseconds. |
<> | 160:d5399cc887bb | 60 | * |
<> | 160:d5399cc887bb | 61 | * @param ms the whole number of milliseconds to wait |
<> | 160:d5399cc887bb | 62 | */ |
<> | 160:d5399cc887bb | 63 | void wait_ms(int ms); |
<> | 160:d5399cc887bb | 64 | |
<> | 160:d5399cc887bb | 65 | /** Waits a number of microseconds. |
<> | 160:d5399cc887bb | 66 | * |
<> | 160:d5399cc887bb | 67 | * @param us the whole number of microseconds to wait |
<> | 160:d5399cc887bb | 68 | */ |
<> | 160:d5399cc887bb | 69 | void wait_us(int us); |
<> | 160:d5399cc887bb | 70 | |
<> | 160:d5399cc887bb | 71 | #ifdef __cplusplus |
<> | 160:d5399cc887bb | 72 | } |
<> | 160:d5399cc887bb | 73 | #endif |
<> | 160:d5399cc887bb | 74 | |
<> | 160:d5399cc887bb | 75 | #endif |
<> | 160:d5399cc887bb | 76 | |
<> | 160:d5399cc887bb | 77 | /** @}*/ |
AnnaBridge | 178:79309dc6340a | 78 | /** @}*/ |