2017-10-15 22:41:59 +08:00
|
|
|
/*
|
2018-10-14 19:28:18 +08:00
|
|
|
* Copyright (c) 2006-2018, RT-Thread Development Team
|
2017-10-15 22:41:59 +08:00
|
|
|
*
|
2018-10-14 19:28:18 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2017-10-15 22:41:59 +08:00
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
|
|
|
* 2017/10/15 bernard the first version
|
|
|
|
*/
|
2013-01-08 22:40:58 +08:00
|
|
|
#ifndef __RTT_LIBC_H__
|
|
|
|
#define __RTT_LIBC_H__
|
|
|
|
|
2018-09-30 09:41:43 +08:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <string.h>
|
2013-01-08 22:40:58 +08:00
|
|
|
#include <sys/time.h>
|
|
|
|
|
2018-09-30 09:41:43 +08:00
|
|
|
#ifndef _EXFUN
|
|
|
|
#define _EXFUN(name, proto) name proto
|
|
|
|
#endif
|
|
|
|
|
2015-03-26 19:58:05 +08:00
|
|
|
#define MILLISECOND_PER_SECOND 1000UL
|
|
|
|
#define MICROSECOND_PER_SECOND 1000000UL
|
|
|
|
#define NANOSECOND_PER_SECOND 1000000000UL
|
2013-01-08 22:40:58 +08:00
|
|
|
|
2015-03-26 19:58:05 +08:00
|
|
|
#define MILLISECOND_PER_TICK (MILLISECOND_PER_SECOND / RT_TICK_PER_SECOND)
|
|
|
|
#define MICROSECOND_PER_TICK (MICROSECOND_PER_SECOND / RT_TICK_PER_SECOND)
|
|
|
|
#define NANOSECOND_PER_TICK (NANOSECOND_PER_SECOND / RT_TICK_PER_SECOND)
|
2013-01-08 22:40:58 +08:00
|
|
|
|
2015-03-26 19:58:05 +08:00
|
|
|
int libc_system_init(void);
|
2017-10-15 22:41:59 +08:00
|
|
|
int libc_stdio_set_console(const char* device_name, int mode);
|
2018-01-12 16:55:47 +08:00
|
|
|
int libc_stdio_get_console(void);
|
2013-01-08 22:40:58 +08:00
|
|
|
|
|
|
|
/* some time related function */
|
|
|
|
int libc_set_time(const struct timespec *time);
|
|
|
|
int libc_get_time(struct timespec *time);
|
|
|
|
int libc_time_to_tick(const struct timespec *time);
|
|
|
|
|
|
|
|
#endif
|