OSDN Git Service

Merge remote-tracking branch 'origin/abt/topic/gmin/l-dev/sensors/master' into mr1
[android-x86/hardware-intel-libsensors.git] / utils.h
1 /*
2  * Copyright (C) 2014-2015 Intel Corporation.
3  */
4
5 #ifndef __UTILS_H__
6 #define __UTILS_H__
7
8 #include "common.h"
9
10 int     sysfs_read_int   (const char path[PATH_MAX], int *value);
11 int     sysfs_write_int  (const char path[PATH_MAX], int value);
12
13 int     sysfs_read_str   (const char path[PATH_MAX], char *buf, int buf_len);
14 int     sysfs_write_str  (const char path[PATH_MAX], const char *buf);
15
16 int     sysfs_read_float (const char path[PATH_MAX], float *value);
17 int     sysfs_write_float(const char path[PATH_MAX], float value);
18
19 int     sysfs_read_uint64(const char path[PATH_MAX], uint64_t *value);
20
21 void    set_timestamp   (struct timespec *out, int64_t target_ns);
22
23 int64_t get_timestamp_boot      (void);
24 int64_t get_timestamp_realtime  (void);
25 int64_t get_timestamp_monotonic (void);
26
27 #endif
28
29
30