mFrame
載入中...
搜尋中...
無符合項目
CoreInterrupt.h
1
7#ifndef CORE_CFDA1805_E0A7_4F00_906B_F2046472F77B
8#define CORE_CFDA1805_E0A7_4F00_906B_F2046472F77B
9
10/* ***************************************************************************************
11 * Include
12 */
13
14//----------------------------------------------------------------------------------------
15#include "hal.h"
16#include "mframe.h"
17
18//----------------------------------------------------------------------------------------
19
20/* ***************************************************************************************
21 * Namespace
22 */
23namespace core {
24 class CoreInterrupt;
25}
26
27/* ***************************************************************************************
28 * Class/Interface/Struct/Enum
29 */
31 public hal::InterruptEvent {
32 /* *************************************************************************************
33 * Sub Class
34 */
35 public:
36 enum Service {
37 IRQ_GPIO0 = 0,
38 IRQ_GPIO1 = 1,
39 IRQ_GPIO2 = 2,
40 IRQ_GPIO3 = 3,
41 IRQ_LPUART0 = 4,
42 IRQ_LPUART1 = 5,
43 IRQ_LPUART2 = 6,
44 IRQ_LPI2C0 = 7,
45 IRQ_MAX_QUANTITY
46 };
47 /* *************************************************************************************
48 * Variable
49 */
50 public:
51 hal::InterruptEvent* vHandle[IRQ_MAX_QUANTITY];
52
53 /* *************************************************************************************
54 * Abstract Method
55 */
56
57 /* *************************************************************************************
58 * Construct Method
59 */
60 private:
65 CoreInterrupt(void);
66
71 virtual ~CoreInterrupt(void) override;
72
73 /* *************************************************************************************
74 * Operator Method
75 */
76
77 /* *************************************************************************************
78 * Public Method <Override> - hal::InterruptEvent
79 */
80 public:
81 void interruptEvent(void) override;
82
83 /* *************************************************************************************
84 * Public Method
85 */
86 public:
93 void setHandler(Service service, hal::InterruptEvent* runnable);
94
102
109 void serviceEnable(Service service, bool enable);
110
111 /* *************************************************************************************
112 * Protected Method
113 */
114
115 /* *************************************************************************************
116 * Private Method
117 */
118
119 /* *************************************************************************************
120 * Static Variable
121 */
122 private:
123 static CoreInterrupt* vInstance;
124 /* *************************************************************************************
125 * Static Method
126 */
127 public:
133 static inline CoreInterrupt& getInstance(void) {
134 return *CoreInterrupt::vInstance;
135 }
136
141 static void instantiation(void);
142};
143
144/* ***************************************************************************************
145 * End of file
146 */
147
148#endif /* CORE_CFDA1805_E0A7_4F00_906B_F2046472F77B */
Definition CoreInterrupt.h:31
static CoreInterrupt & getInstance(void)
取得該類單例實例。
Definition CoreInterrupt.h:133
static void instantiation(void)
類單例實例化。
void interruptEvent(void) override
硬體中斷觸發事件
void serviceEnable(Service service, bool enable)
啟用中斷服務事件
void setHandler(Service service, hal::InterruptEvent *runnable)
設定中斷服務事件。
hal::InterruptEvent * getHandler(Service service)
Get the Handler object.
Definition Object.h:34
Definition glikey/Mask.h:22
[Interface]硬體抽象層,硬體中斷觸發事件。
Definition InterruptEvent.h:35