OSDN Git Service

タイマ制御(スリープ)機能追加
[mochi/master.git] / src / kernel / include / TimerMng.h
1 /******************************************************************************/
2 /* src/kernel/include/TimerMng.h                                              */
3 /*                                                                 2018/10/20 */
4 /* Copyright (C) 2018 Mochi.                                                  */
5 /******************************************************************************/
6 #ifndef TIMERMNG_H
7 #define TIMERMNG_H
8 /******************************************************************************/
9 /* インクルード                                                               */
10 /******************************************************************************/
11 #include <IntMng.h>
12
13
14 /******************************************************************************/
15 /* 定義                                                                       */
16 /******************************************************************************/
17 /* タイマID */
18 #define TIMERMNG_TIMERID_MIN  (    0 )                      /**< タイマID最小値 */
19 #define TIMERMNG_TIMERID_MAX  ( 1023 )                      /**< タイマID最大値 */
20 #define TIMERMNG_TIMERID_NUM  ( TIMERMNG_TIMERID_MAX + 1 )  /**< タイマID数     */
21 #define TIMERMNG_TIMERID_NULL ( TIMERMNG_TIMERID_NUM     )  /**< 無効タイマID   */
22
23 /* タイマ種別 */
24 #define TIMERMNG_TYPE_ONESHOT ( 0 )     /**< ワンショットタイマ種別 */
25 #define TIMERMNG_TYPE_REPEAT  ( 1 )     /**< 繰り返しタイマ種別     */
26
27 /** タイマコールバック関数型 */
28 typedef void ( *TimerMngFunc_t )( uint32_t timerId, void *pArg );
29
30
31 /******************************************************************************/
32 /* グローバル関数プロトタイプ宣言                                             */
33 /******************************************************************************/
34 /*----------------*/
35 /* TimerMngCtrl.c */
36 /*----------------*/
37 /* タイマ設定 */
38 extern uint32_t TimerMngCtrlSet( uint32_t       usec,
39                                  uint32_t       type,
40                                  TimerMngFunc_t pFunc,
41                                  void           *pArg  );
42
43 /* タイマ解除 */
44 extern void TimerMngCtrlUnset( uint32_t timerId );
45
46
47 /*----------------*/
48 /* TimerMngInit.c */
49 /*----------------*/
50 /* タイマ管理初期化 */
51 extern void TimerMngInit( void );
52
53
54 /*---------------*/
55 /* TimerMngPit.c */
56 /*---------------*/
57 /* PIT割込みハンドラ */
58 extern void TimerMngPitHdlInt( uint32_t        intNo,
59                                IntMngContext_t context );
60
61
62 /******************************************************************************/
63 #endif