Rtos API example

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers mbed_wait_api.h Source File

mbed_wait_api.h

00001 
00002 /** \addtogroup platform */
00003 /** @{*/
00004 /**
00005  * \defgroup platform_wait_api wait_api functions
00006  * @{
00007  */
00008  
00009 /* mbed Microcontroller Library
00010  * Copyright (c) 2006-2013 ARM Limited
00011  *
00012  * Licensed under the Apache License, Version 2.0 (the "License");
00013  * you may not use this file except in compliance with the License.
00014  * You may obtain a copy of the License at
00015  *
00016  *     http://www.apache.org/licenses/LICENSE-2.0
00017  *
00018  * Unless required by applicable law or agreed to in writing, software
00019  * distributed under the License is distributed on an "AS IS" BASIS,
00020  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00021  * See the License for the specific language governing permissions and
00022  * limitations under the License.
00023  */
00024 #ifndef MBED_WAIT_API_H
00025 #define MBED_WAIT_API_H
00026 
00027 #ifdef __cplusplus
00028 extern "C" {
00029 #endif
00030 
00031 /** Generic wait functions.
00032  *
00033  * These provide simple NOP type wait capabilities.
00034  *
00035  * Example:
00036  * @code
00037  * #include "mbed.h"
00038  *
00039  * DigitalOut heartbeat(LED1);
00040  *
00041  * int main() {
00042  *     while (1) {
00043  *         heartbeat = 1;
00044  *         wait(0.5);
00045  *         heartbeat = 0;
00046  *         wait(0.5);
00047  *     }
00048  * }
00049  * @endcode
00050  */
00051 
00052 /** Waits for a number of seconds, with microsecond resolution (within
00053  *  the accuracy of single precision floating point).
00054  *
00055  *  @param s number of seconds to wait
00056  */
00057 void wait(float s);
00058 
00059 /** Waits a number of milliseconds.
00060  *
00061  *  @param ms the whole number of milliseconds to wait
00062  */
00063 void wait_ms(int ms);
00064 
00065 /** Waits a number of microseconds.
00066  *
00067  *  @param us the whole number of microseconds to wait
00068  */
00069 void wait_us(int us);
00070 
00071 #ifdef __cplusplus
00072 }
00073 #endif
00074 
00075 #endif
00076 
00077 /** @}*/
00078 /** @}*/