OSDN Git Service

First commitment for the BlackTank LPC1769.
[blacktank/blacktank.git] / task_menu.h
1 /**
2  * @file task_menu.h
3  * @author Shinichiro Nakamura
4  * @brief メニュータスクの定義(task_menu)
5  * @details
6  * メニュータスクはユーザにシステムのサービスを提示し、
7  * ユーザからの要求をシステムに伝達する役目を果たす。
8  * ユーザからの入力はそれらを管理するタスクからの通知に依存する。
9  */
10
11 #ifndef _TASK_MENU_H_
12 #define _TASK_MENU_H_
13
14 #include "target_test.h"
15
16 /**
17  * @brief タスクプライオリティ。(メニュータスク)
18  */
19 #define TSKPRI_MENU    12
20 #define TSKSTK_MENU    STACK_SIZE
21
22 #ifndef TOPPERS_MACRO_ONLY
23
24 /**
25  * @defgroup BLACKTANK_LPC1769_TASK_MENU_CLIENT
26  * @ingroup BLACKTANK_LPC1769_TASK_MENU
27  * @{
28  */
29
30 #define DEVICE_SW0 0    /**< デバイス:スイッチ0 */
31 #define DEVICE_SW1 1    /**< デバイス:スイッチ1 */
32 #define DEVICE_SW2 2    /**< デバイス:スイッチ2 */
33 #define DEVICE_SW3 3    /**< デバイス:スイッチ3 */
34 #define DEVICE_VOL0 4   /**< デバイス:ボリューム0 */
35 #define DEVICE_VOL1 5   /**< デバイス:ボリューム1 */
36 #define DEVICE_VOL2 6   /**< デバイス:ボリューム2 */
37 #define DEVICE_VOL3 7   /**< デバイス:ボリューム3 */
38
39 /**
40  * @brief menuタスクAPI(ユーザメッセージ)の実行。
41  * @param device デバイス番号。
42  * @param value 値。
43  */
44 #define TSKAPI_MENU_USERMSG(device, value) \
45     snd_dtq(DTQ_USERINPUT, \
46             (intptr_t)(((device & 0x000F) << 12) | ((value & 0x0FFF) << 0)))
47
48 /**
49  * @}
50  */
51
52 /**
53  * @defgroup BLACKTANK_LPC1769_TASK_MENU
54  * @ingroup BLACKTANK_LPC1769_TASK
55  * @{
56  */
57
58 void task_menu(intptr_t exinf);
59
60 /**
61  * @}
62  */
63
64 #endif
65
66 #endif
67