![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Color Oled(SSD1331) connect to STMicroelectronics Nucleo-F466
mbed-os/platform/mbed_wait_api.h@0:8fdf9a60065b, 2018-10-10 (annotated)
- Committer:
- kadonotakashi
- Date:
- Wed Oct 10 00:33:53 2018 +0000
- Revision:
- 0:8fdf9a60065b
how to make mbed librry
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kadonotakashi | 0:8fdf9a60065b | 1 | |
kadonotakashi | 0:8fdf9a60065b | 2 | /** \addtogroup platform */ |
kadonotakashi | 0:8fdf9a60065b | 3 | /** @{*/ |
kadonotakashi | 0:8fdf9a60065b | 4 | /** |
kadonotakashi | 0:8fdf9a60065b | 5 | * \defgroup platform_wait_api wait_api functions |
kadonotakashi | 0:8fdf9a60065b | 6 | * @{ |
kadonotakashi | 0:8fdf9a60065b | 7 | */ |
kadonotakashi | 0:8fdf9a60065b | 8 | |
kadonotakashi | 0:8fdf9a60065b | 9 | /* mbed Microcontroller Library |
kadonotakashi | 0:8fdf9a60065b | 10 | * Copyright (c) 2006-2013 ARM Limited |
kadonotakashi | 0:8fdf9a60065b | 11 | * |
kadonotakashi | 0:8fdf9a60065b | 12 | * Licensed under the Apache License, Version 2.0 (the "License"); |
kadonotakashi | 0:8fdf9a60065b | 13 | * you may not use this file except in compliance with the License. |
kadonotakashi | 0:8fdf9a60065b | 14 | * You may obtain a copy of the License at |
kadonotakashi | 0:8fdf9a60065b | 15 | * |
kadonotakashi | 0:8fdf9a60065b | 16 | * http://www.apache.org/licenses/LICENSE-2.0 |
kadonotakashi | 0:8fdf9a60065b | 17 | * |
kadonotakashi | 0:8fdf9a60065b | 18 | * Unless required by applicable law or agreed to in writing, software |
kadonotakashi | 0:8fdf9a60065b | 19 | * distributed under the License is distributed on an "AS IS" BASIS, |
kadonotakashi | 0:8fdf9a60065b | 20 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
kadonotakashi | 0:8fdf9a60065b | 21 | * See the License for the specific language governing permissions and |
kadonotakashi | 0:8fdf9a60065b | 22 | * limitations under the License. |
kadonotakashi | 0:8fdf9a60065b | 23 | */ |
kadonotakashi | 0:8fdf9a60065b | 24 | #ifndef MBED_WAIT_API_H |
kadonotakashi | 0:8fdf9a60065b | 25 | #define MBED_WAIT_API_H |
kadonotakashi | 0:8fdf9a60065b | 26 | |
kadonotakashi | 0:8fdf9a60065b | 27 | #ifdef __cplusplus |
kadonotakashi | 0:8fdf9a60065b | 28 | extern "C" { |
kadonotakashi | 0:8fdf9a60065b | 29 | #endif |
kadonotakashi | 0:8fdf9a60065b | 30 | |
kadonotakashi | 0:8fdf9a60065b | 31 | /** Generic wait functions. |
kadonotakashi | 0:8fdf9a60065b | 32 | * |
kadonotakashi | 0:8fdf9a60065b | 33 | * These provide simple NOP type wait capabilities. |
kadonotakashi | 0:8fdf9a60065b | 34 | * |
kadonotakashi | 0:8fdf9a60065b | 35 | * Example: |
kadonotakashi | 0:8fdf9a60065b | 36 | * @code |
kadonotakashi | 0:8fdf9a60065b | 37 | * #include "mbed.h" |
kadonotakashi | 0:8fdf9a60065b | 38 | * |
kadonotakashi | 0:8fdf9a60065b | 39 | * DigitalOut heartbeat(LED1); |
kadonotakashi | 0:8fdf9a60065b | 40 | * |
kadonotakashi | 0:8fdf9a60065b | 41 | * int main() { |
kadonotakashi | 0:8fdf9a60065b | 42 | * while (1) { |
kadonotakashi | 0:8fdf9a60065b | 43 | * heartbeat = 1; |
kadonotakashi | 0:8fdf9a60065b | 44 | * wait(0.5); |
kadonotakashi | 0:8fdf9a60065b | 45 | * heartbeat = 0; |
kadonotakashi | 0:8fdf9a60065b | 46 | * wait(0.5); |
kadonotakashi | 0:8fdf9a60065b | 47 | * } |
kadonotakashi | 0:8fdf9a60065b | 48 | * } |
kadonotakashi | 0:8fdf9a60065b | 49 | * @endcode |
kadonotakashi | 0:8fdf9a60065b | 50 | */ |
kadonotakashi | 0:8fdf9a60065b | 51 | |
kadonotakashi | 0:8fdf9a60065b | 52 | /** Waits for a number of seconds, with microsecond resolution (within |
kadonotakashi | 0:8fdf9a60065b | 53 | * the accuracy of single precision floating point). |
kadonotakashi | 0:8fdf9a60065b | 54 | * |
kadonotakashi | 0:8fdf9a60065b | 55 | * @param s number of seconds to wait |
kadonotakashi | 0:8fdf9a60065b | 56 | * |
kadonotakashi | 0:8fdf9a60065b | 57 | * @note |
kadonotakashi | 0:8fdf9a60065b | 58 | * If the RTOS is present, this function always spins to get the exact number of microseconds, |
kadonotakashi | 0:8fdf9a60065b | 59 | * which potentially affects power (such as preventing deep sleep) and multithread performance. |
kadonotakashi | 0:8fdf9a60065b | 60 | * You can avoid it by using Thread::wait(). |
kadonotakashi | 0:8fdf9a60065b | 61 | */ |
kadonotakashi | 0:8fdf9a60065b | 62 | void wait(float s); |
kadonotakashi | 0:8fdf9a60065b | 63 | |
kadonotakashi | 0:8fdf9a60065b | 64 | /** Waits a number of milliseconds. |
kadonotakashi | 0:8fdf9a60065b | 65 | * |
kadonotakashi | 0:8fdf9a60065b | 66 | * @param ms the whole number of milliseconds to wait |
kadonotakashi | 0:8fdf9a60065b | 67 | * |
kadonotakashi | 0:8fdf9a60065b | 68 | * @note |
kadonotakashi | 0:8fdf9a60065b | 69 | * If the RTOS is present, this function always spins to get the exact number of microseconds, |
kadonotakashi | 0:8fdf9a60065b | 70 | * which potentially affects power (such as preventing deep sleep) and multithread performance. |
kadonotakashi | 0:8fdf9a60065b | 71 | * You can avoid it by using Thread::wait(). |
kadonotakashi | 0:8fdf9a60065b | 72 | */ |
kadonotakashi | 0:8fdf9a60065b | 73 | void wait_ms(int ms); |
kadonotakashi | 0:8fdf9a60065b | 74 | |
kadonotakashi | 0:8fdf9a60065b | 75 | /** Waits a number of microseconds. |
kadonotakashi | 0:8fdf9a60065b | 76 | * |
kadonotakashi | 0:8fdf9a60065b | 77 | * @param us the whole number of microseconds to wait |
kadonotakashi | 0:8fdf9a60065b | 78 | * |
kadonotakashi | 0:8fdf9a60065b | 79 | * @note |
kadonotakashi | 0:8fdf9a60065b | 80 | * If the RTOS is present, this function always spins to get the exact number of microseconds, |
kadonotakashi | 0:8fdf9a60065b | 81 | * which potentially affects power (such as preventing deep sleep) and multithread performance. |
kadonotakashi | 0:8fdf9a60065b | 82 | */ |
kadonotakashi | 0:8fdf9a60065b | 83 | void wait_us(int us); |
kadonotakashi | 0:8fdf9a60065b | 84 | |
kadonotakashi | 0:8fdf9a60065b | 85 | #ifdef __cplusplus |
kadonotakashi | 0:8fdf9a60065b | 86 | } |
kadonotakashi | 0:8fdf9a60065b | 87 | #endif |
kadonotakashi | 0:8fdf9a60065b | 88 | |
kadonotakashi | 0:8fdf9a60065b | 89 | #endif |
kadonotakashi | 0:8fdf9a60065b | 90 | |
kadonotakashi | 0:8fdf9a60065b | 91 | /** @}*/ |
kadonotakashi | 0:8fdf9a60065b | 92 | /** @}*/ |