FreeRTOS: Platform
Platform portability layer
Return to main page ↑
iot_clock.h
Go to the documentation of this file.
1 /*
2  * FreeRTOS Platform V1.1.2
3  * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a copy of
6  * this software and associated documentation files (the "Software"), to deal in
7  * the Software without restriction, including without limitation the rights to
8  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9  * the Software, and to permit persons to whom the Software is furnished to do so,
10  * subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in all
13  * copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  *
22  * http://aws.amazon.com/freertos
23  * http://www.FreeRTOS.org
24  */
25 
31 #ifndef IOT_CLOCK_H_
32 #define IOT_CLOCK_H_
33 
34 /* The config header is always included first. */
35 #include "iot_config.h"
36 
37 /* Standard includes. */
38 #include <stdbool.h>
39 #include <stddef.h>
40 #include <stdint.h>
41 
42 /* Platform layer types include. */
44 
110 /* @[declare_platform_clock_gettimestring] */
111 bool IotClock_GetTimestring( char * pBuffer,
112  size_t bufferSize,
113  size_t * pTimestringLength );
114 /* @[declare_platform_clock_gettimestring] */
115 
131 /* @[declare_platform_clock_gettimems] */
132 uint64_t IotClock_GetTimeMs( void );
133 /* @[declare_platform_clock_gettimems] */
134 
142 /* @[declare_platform_clock_sleepms] */
143 void IotClock_SleepMs( uint32_t sleepTimeMs );
144 /* @[declare_platform_clock_sleepms] */
145 
161 /* @[declare_platform_clock_timercreate] */
163  IotThreadRoutine_t expirationRoutine,
164  void * pArgument );
165 /* @[declare_platform_clock_timercreate] */
166 
180 /* @[declare_platform_clock_timerdestroy] */
182 /* @[declare_platform_clock_timerdestroy] */
183 
229 /* @[declare_platform_clock_timerarm] */
231  uint32_t relativeTimeoutMs,
232  uint32_t periodMs );
233 /* @[declare_platform_clock_timerarm] */
234 
235 #endif /* ifndef IOT_CLOCK_H_ */
IotClock_GetTimestring
bool IotClock_GetTimestring(char *pBuffer, size_t bufferSize, size_t *pTimestringLength)
Generates a human-readable timestring, such as "01 Jan 2018 12:00".
IotClock_GetTimeMs
uint64_t IotClock_GetTimeMs(void)
Returns a nonzero, monotonically-increasing system time in milliseconds.
IotTimer_t
_IotSystemTimer_t IotTimer_t
The type used to represent timers, configured with the type _IotSystemTimer_t.
Definition: iot_platform_types.h:126
iot_platform_types.h
Types of the platform layer.
IotClock_TimerArm
bool IotClock_TimerArm(IotTimer_t *pTimer, uint32_t relativeTimeoutMs, uint32_t periodMs)
Arm a timer to expire at the given relative timeout.
IotClock_SleepMs
void IotClock_SleepMs(uint32_t sleepTimeMs)
Delay for the given number of milliseconds.
IotClock_TimerDestroy
void IotClock_TimerDestroy(IotTimer_t *pTimer)
Free resources used by a timer.
IotClock_TimerCreate
bool IotClock_TimerCreate(IotTimer_t *pNewTimer, IotThreadRoutine_t expirationRoutine, void *pArgument)
Create a new timer.
IotThreadRoutine_t
void(* IotThreadRoutine_t)(void *)
Thread routine function.
Definition: iot_platform_types.h:105