mFrame
載入中...
搜尋中...
無符合項目
SimpleLED.h
1
7#ifndef MFRAME_877232BF_9465_46D9_A47B_D8FFD57AD217
8#define MFRAME_877232BF_9465_46D9_A47B_D8FFD57AD217
9
10/* ***************************************************************************************
11 * Include
12 */
13
14//----------------------------------------------------------------------------------------
15#include "./../../hal/digital/GeneralOutput.h"
16#include "./../lang/Object.h"
17#include "./../lang/Updatable.h"
18#include "./../util/ElapsedTimer.h"
19
20//----------------------------------------------------------------------------------------
21
22/* ***************************************************************************************
23 * Namespace
24 */
25namespace ufm::hw {
26 class SimpleLED;
27} // namespace ufm::hw
28
29/* ***************************************************************************************
30 * Class/Interface/Struct/Enum
31 */
32
53 /* *************************************************************************************
54 * Variable
55 */
56 public:
62
68
75
83
84 /* *************************************************************************************
85 * Abstract Method
86 */
87
88 /* *************************************************************************************
89 * Construct Method
90 */
91 public:
108 SimpleLED(hal::digital::GeneralOutput& output, bool inverted = false);
109
115 virtual ~SimpleLED(void) override;
116
117 /* *************************************************************************************
118 * Operator Method
119 */
120
121 /* *************************************************************************************
122 * Override - ufm::lang::Updatable
123 */
124 public:
138 virtual void update(void) override;
139
140 /* *************************************************************************************
141 * Public Method
142 */
143 public:
156 void setOn(void);
157
170 void setOff(void);
171
190 void setBlink(uint32 microseconds);
191 /* *************************************************************************************
192 * Protected Method
193 */
194
195 /* *************************************************************************************
196 * Private Method
197 */
198
199 /* *************************************************************************************
200 * Static Variable
201 */
202
203 /* *************************************************************************************
204 * Static Method
205 */
206};
207
208/* ***************************************************************************************
209 * End of file
210 */
211
212#endif /* MFRAME_877232BF_9465_46D9_A47B_D8FFD57AD217 */
簡單LED控制類別
Definition SimpleLED.h:52
virtual void update(void) override
更新LED狀態
void setBlink(uint32 microseconds)
設定LED為指定週期的閃爍模式
SimpleLED(hal::digital::GeneralOutput &output, bool inverted=false)
建構新的SimpleLED物件
bool vInverted
反向輸出邏輯旗標
Definition SimpleLED.h:82
void setOn(void)
開啟LED
virtual ~SimpleLED(void) override
銷毀SimpleLED物件
ufm::util::ElapsedTimer vTimer
LED控制計時器
Definition SimpleLED.h:67
void setOff(void)
關閉LED
hal::digital::GeneralOutput & vOutput
LED輸出介面
Definition SimpleLED.h:61
uint32 vBlinkPeriod
LED閃爍週期(微秒)
Definition SimpleLED.h:74
物件基底類別
Definition Object.h:63
經過時間計時器,提供高精度的時間測量功能。
Definition ElapsedTimer.h:145
Definition Ammeter.h:22
[Interface] GPIO輸出控制介面。
Definition GeneralOutput.h:40
[Interface] 定義可更新的物件介面
Definition Updatable.h:38