ubinos
hrtick.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2009 Sung Ho Park
3  Contact: ubinos.org@gmail.com
4 
5  This file is part of the itf_ubinos component of the Ubinos.
6 
7  GNU General Public License Usage
8  This file may be used under the terms of the GNU
9  General Public License version 3.0 as published by the Free Software
10  Foundation and appearing in the file license_gpl3.txt included in the
11  packaging of this file. Please review the following information to
12  ensure the GNU General Public License version 3.0 requirements will be
13  met: http://www.gnu.org/copyleft/gpl.html.
14 
15  GNU Lesser General Public License Usage
16  Alternatively, this file may be used under the terms of the GNU Lesser
17  General Public License version 2.1 as published by the Free Software
18  Foundation and appearing in the file license_lgpl.txt included in the
19  packaging of this file. Please review the following information to
20  ensure the GNU Lesser General Public License version 2.1 requirements
21  will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
22 
23  Commercial Usage
24  Alternatively, licensees holding valid commercial licenses may
25  use this file in accordance with the commercial license agreement
26  provided with the software or, alternatively, in accordance with the
27  terms contained in a written agreement between you and rightful owner.
28  */
29 
30 #ifndef UBIK_HRTICK_H_
31 #define UBIK_HRTICK_H_
32 
33 #ifdef __cplusplus
34 extern "C"
35 {
36 #endif
37 
46 #include <ubinos_config.h>
47 #include <ubinos/type.h>
48 
50 typedef struct _hrtick_t
51 {
52  unsigned int high;
53  unsigned int low;
54  unsigned int hrtick;
55 } hrtick_t;
56 
67 int ubik_hrtick_enable(int htimerno);
68 
77 int ubik_hrtick_disable(void);
78 
87 int ubik_hrtick_reset(void);
88 
94 unsigned int ubik_hrtick_gettickpersec(void);
95 
101 unsigned int ubik_hrtick_gethrtickpermsec(void);
102 
113 int ubik_hrtick_gettick(hrtick_t * tick_p);
114 
133 int ubik_hrtick_gettickdiff(hrtick_t * tick1_p, hrtick_t * tick2_p,
134  hrtick_t * tickdiff_p);
135 
155 int ubik_hrtick_hrticktotime(hrtick_t * tick_p, unsigned int * nsec_p,
156  unsigned int * usec_p, unsigned int * msec_p);
157 
170 int ubik_hrtick_hrticktotimens(hrtick_t * tick_p, unsigned int * nsec_p);
171 
184 int ubik_hrtick_hrticktotimeus(hrtick_t * tick_p, unsigned int * usec_p);
185 
186 #ifdef __cplusplus
187 }
188 #endif
189 
190 #endif /* UBIK_HRTICK_H_ */
ubik_hrtick_reset
int ubik_hrtick_reset(void)
_hrtick_t::hrtick
unsigned int hrtick
Definition: hrtick.h:54
ubik_hrtick_disable
int ubik_hrtick_disable(void)
ubik_hrtick_hrticktotimeus
int ubik_hrtick_hrticktotimeus(hrtick_t *tick_p, unsigned int *usec_p)
ubik_hrtick_gettickdiff
int ubik_hrtick_gettickdiff(hrtick_t *tick1_p, hrtick_t *tick2_p, hrtick_t *tickdiff_p)
_hrtick_t::low
unsigned int low
Definition: hrtick.h:53
ubik_hrtick_gettickpersec
unsigned int ubik_hrtick_gettickpersec(void)
ubik_hrtick_hrticktotimens
int ubik_hrtick_hrticktotimens(hrtick_t *tick_p, unsigned int *nsec_p)
type.h
ubinos basic data type
ubik_hrtick_enable
int ubik_hrtick_enable(int htimerno)
ubik_hrtick_gettick
int ubik_hrtick_gettick(hrtick_t *tick_p)
ubik_hrtick_hrticktotime
int ubik_hrtick_hrticktotime(hrtick_t *tick_p, unsigned int *nsec_p, unsigned int *usec_p, unsigned int *msec_p)
_hrtick_t
Definition: hrtick.h:50
_hrtick_t::high
unsigned int high
Definition: hrtick.h:52
hrtick_t
struct _hrtick_t hrtick_t
ubik_hrtick_gethrtickpermsec
unsigned int ubik_hrtick_gethrtickpermsec(void)