ubinos
stimer.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_STIMER_H_
31 #define UBIK_STIMER_H_
32 
33 #ifdef __cplusplus
34 extern "C"
35 {
36 #endif
37 
162 #include <ubinos_config.h>
163 #include <ubinos/type.h>
164 
165 #include "sem.h"
166 #include "signal.h"
167 
169 #define STIMER_OPT__ONESHOT 0x80
170 
173 #define STIMER_OPT__BROADCAST 0x40
174 
176 typedef struct __stimer_tip_t
177 {
178  unsigned int type :8;
179  unsigned int valid :1;
180  unsigned int reserved :7;
181  unsigned int reserved2 :16;
182 } _stimer_tip_t;
183 
186 
198 int stimer_create(stimer_pt * stimer_p);
199 
213 int stimer_delete(stimer_pt * stimer_p);
214 
236 int stimer_set(stimer_pt stimer, unsigned int tick, sem_pt sem,
237  unsigned int option);
238 
260 int stimer_setms(stimer_pt stimer, unsigned int timems, sem_pt sem,
261  unsigned int option);
262 
286 int stimer_set_signal(stimer_pt stimer, unsigned int tick, signal_pt signal,
287  int sigtype, unsigned int option);
288 
312 int stimer_setms_signal(stimer_pt stimer, unsigned int timems, signal_pt signal,
313  int sigtype, unsigned int option);
314 
326 int stimer_start(stimer_pt stimer);
327 
339 int stimer_stop(stimer_pt stimer);
340 
341 #ifdef __cplusplus
342 }
343 #endif
344 
345 #endif /* UBIK_STIMER_H_ */
__stimer_tip_t::reserved2
unsigned int reserved2
Definition: stimer.h:181
stimer_start
int stimer_start(stimer_pt stimer)
stimer_setms_signal
int stimer_setms_signal(stimer_pt stimer, unsigned int timems, signal_pt signal, int sigtype, unsigned int option)
stimer_pt
_stimer_tip_t * stimer_pt
Definition: stimer.h:185
__stimer_tip_t
Definition: stimer.h:176
sem.h
ubik semaphore API
stimer_stop
int stimer_stop(stimer_pt stimer)
__stimer_tip_t::type
unsigned int type
Definition: stimer.h:178
stimer_set_signal
int stimer_set_signal(stimer_pt stimer, unsigned int tick, signal_pt signal, int sigtype, unsigned int option)
type.h
ubinos basic data type
stimer_set
int stimer_set(stimer_pt stimer, unsigned int tick, sem_pt sem, unsigned int option)
stimer_delete
int stimer_delete(stimer_pt *stimer_p)
__stimer_tip_t::valid
unsigned int valid
Definition: stimer.h:179
__stimer_tip_t::reserved
unsigned int reserved
Definition: stimer.h:180
signal.h
ubik signal API
_stimer_tip_t
struct __stimer_tip_t _stimer_tip_t
__sem_tip_t
Definition: sem.h:151
stimer_setms
int stimer_setms(stimer_pt stimer, unsigned int timems, sem_pt sem, unsigned int option)
__signal_tip_t
Definition: signal.h:59
stimer_create
int stimer_create(stimer_pt *stimer_p)