mFrame
載入中...
搜尋中...
無符合項目
SerialBusQueue.h
1
7#ifndef MFRAME_1571B467_887D_4AC9_A803_148C427F0C68
8#define MFRAME_1571B467_887D_4AC9_A803_148C427F0C68
9
10/* ***************************************************************************************
11 * Include
12 */
13
14//----------------------------------------------------------------------------------------
15
16//----------------------------------------------------------------------------------------
17#include "./../util/ArrayQueue.h"
18#include "./SerialBus.h"
19
20/* ***************************************************************************************
21 * Namespace
22 */
23namespace ufm::io {
24 class SerialBusQueue;
25} // namespace ufm::io
26
27/* ***************************************************************************************
28 * Class/Interface/Struct/Enum
29 */
30
37 /* *************************************************************************************
38 * Struct
39 */
40 public:
53
54 /* *************************************************************************************
55 * Variable
56 */
57 private:
60
61 /* *************************************************************************************
62 * Abstract Method
63 */
64
65 /* *************************************************************************************
66 * Construct Method
67 */
68 public:
74 SerialBusQueue(hal::serial::IICMaster& iicMaster, int queueSize);
75
82 ufm::lang::Memory queueBuffer) noexcept;
83
87 virtual ~SerialBusQueue(void) override;
88
89 /* *************************************************************************************
90 * Operator Method
91 */
92 public:
93 /* *************************************************************************************
94 * Override Method - ufm::io::SerialBus
95 */
96 virtual bool isBusy(void) override;
97
98 virtual bool write(uint16 address,
99 int length,
100 const void* source,
101 SerialBus::Event* event) override;
102
103 virtual bool read(uint16 address,
104 int length,
105 void* buffer,
106 SerialBus::Event* event) override;
107
108 /* *************************************************************************************
109 * Override Method - ufm::io::SerialBusEvent
110 */
111 public:
112 virtual void onComplete(void) override;
113
114 virtual void onNoResponseEvent(int completedQuantity) override;
115
116 virtual void onBusErrorEvent(int completedQuantity) override;
117
118 virtual void onCancel(int completedQuantity) override;
119
120 /* *************************************************************************************
121 * Public Method
122 */
123 public:
127 void cancelAll(void);
128
134 bool isEmpty(void);
135
136 /* *************************************************************************************
137 * Protected Method
138 */
139
140 /* *************************************************************************************
141 * Private Method
142 */
143 private:
154 bool pushBlock(
155 uint16 address, int length, void* buffer, SerialBus::Event* event, bool write);
156
160 void pollBlock(void);
161
162 /* *************************************************************************************
163 * Static Variable
164 */
165
166 /* *************************************************************************************
167 * Static Method
168 */
169};
170
171/* ***************************************************************************************
172 * End of file
173 */
174
175#endif /* MFRAME_1571B467_887D_4AC9_A803_148C427F0C68 */
[Interface] 序列總線裝置
Definition SerialBus.h:43
SerialBus佇列管理器
Definition SerialBusQueue.h:36
virtual ~SerialBusQueue(void) override
解構SerialBusQueue物件
virtual void onBusErrorEvent(int completedQuantity) override
當發生總線忙碌事件時調用
SerialBusQueue(hal::serial::IICMaster &iicMaster, ufm::lang::Memory queueBuffer) noexcept
建構一個新的SerialBusQueue物件
virtual void onNoResponseEvent(int completedQuantity) override
當發生無回應事件時調用
bool isEmpty(void)
檢查佇列是否為空
virtual void onCancel(int completedQuantity) override
當傳輸被取消時調用
void cancelAll(void)
取消所有佇列中的傳輸請求
SerialBusQueue(hal::serial::IICMaster &iicMaster, int queueSize)
建構一個新的SerialBusQueue物件
virtual void onComplete(void) override
當傳輸完成時調用
存儲資料的類別,提供動態記憶體管理功能。
Definition Memory.h:44
指標陣列佇列類別
Definition ArrayQueue.h:40
Definition Buffer.h:24
[Interface] IIC主端設備介面
Definition IICMaster.h:39
[Interface] 序列總線事件監聽器
Definition SerialBus.h:56
SerialBus佇列區塊結構
Definition SerialBusQueue.h:47
uint16 vLength
Definition SerialBusQueue.h:50
uint16 vAddress
Definition SerialBusQueue.h:51
uint8 * vBuffer
Definition SerialBusQueue.h:49
ufm::io::SerialBus::Event * vEvent
Definition SerialBusQueue.h:48