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 */
33 /* *************************************************************************************
34 * Variable
35 */
36 public:
39
40 uint32 vBlinkPeriod;
41 bool vInverted;
42
43 /* *************************************************************************************
44 * Abstract Method
45 */
46
47 /* *************************************************************************************
48 * Construct Method
49 */
50 public:
56
61 virtual ~SimpleLED(void) override;
62
63 /* *************************************************************************************
64 * Operator Method
65 */
66
67 /* *************************************************************************************
68 * Override - ufm::lang::Updatable
69 */
70 public:
76 virtual void update(void) override;
77
78 /* *************************************************************************************
79 * Public Method
80 */
81 public:
87 void setOn(void);
88
94 void setOff(void);
95
103 void setBlink(uint32 microseconds);
104 /* *************************************************************************************
105 * Protected Method
106 */
107
108 /* *************************************************************************************
109 * Private Method
110 */
111
112 /* *************************************************************************************
113 * Static Variable
114 */
115
116 /* *************************************************************************************
117 * Static Method
118 */
119};
120
121/* ***************************************************************************************
122 * End of file
123 */
124
125#endif /* MFRAME_877232BF_9465_46D9_A47B_D8FFD57AD217 */
Definition SimpleLED.h:32
virtual void update(void) override
更新方法
void setBlink(uint32 microseconds)
設定LED閃爍頻率。
bool vInverted
是否反向輸出,true表示高電平為關閉,低電平為開啟
Definition SimpleLED.h:41
void setOn(void)
設定LED為開啟狀態。
virtual ~SimpleLED(void) override
Destroy the object.
ufm::util::ElapsedTimer vTimer
計時器,用於控制LED閃爍
Definition SimpleLED.h:38
void setOff(void)
設定LED為關閉狀態。
hal::digital::GeneralOutput & vOutput
LED輸出介面
Definition SimpleLED.h:37
uint32 vBlinkPeriod
LED閃爍週期,以微秒為單位
Definition SimpleLED.h:40
SimpleLED(hal::digital::GeneralOutput &output)
Construct a new object.
物件基底類別
Definition Object.h:63
Definition ElapsedTimer.h:29
Definition Ammeter.h:22
[Interface] GPIO輸出控制介面。
Definition GeneralOutput.h:40
[Interface] 定義可更新的物件介面
Definition Updatable.h:38