mFrame
載入中...
搜尋中...
無符合項目
CoreIIC.h
1
7#ifndef MCXA153_C907AFC6_A375_4FFB_B72E_DD0E8B616FD5
8#define MCXA153_C907AFC6_A375_4FFB_B72E_DD0E8B616FD5
9
10/* ***************************************************************************************
11 * Include
12 */
13#include "mframe.h"
14
15//----------------------------------------------------------------------------------------
16#include "./CoreDescriptor.h"
17
18//----------------------------------------------------------------------------------------
19
20/* ***************************************************************************************
21 * Namespace
22 */
23namespace mcxa153::core {
24 class CoreIIC;
25} // namespace mcxa153::core
26
27/* ***************************************************************************************
28 * Class/Interface/Struct/Enum
29 */
74 public hal::serial::IIC,
78 public hal::InterruptEvent {
79 /* *************************************************************************************
80 * Enum - Select
81 */
82 public:
83 enum struct Select : unsigned char;
84
85 /* *************************************************************************************
86 * Variable
87 */
88 public:
91
94
95 protected:
111
127
144
145 /* *************************************************************************************
146 * Abstract Method
147 */
148 // 此類別為具體實作,所有虛擬方法均有實體實作
149
150 /* *************************************************************************************
151 * Construct Method
152 */
153 public:
170 CoreIIC(Select select, const mcxa153::core::CoreDescriptor* descriptor = nullptr);
171
181 virtual ~CoreIIC(void) override;
182
183 /* *************************************************************************************
184 * Operator Method
185 */
186
187 /* *************************************************************************************
188 * Override Method - hal::Base
189 */
190 public:
207 virtual bool deinit(void) override;
208
220 virtual bool isInit(void) override;
221
222 /* *************************************************************************************
223 * Override Method - hal::serial::IIC
224 */
225 public:
240
255
269 virtual void setEventStop(hal::serial::IIC::EventStop* event) override;
270
271 /* *************************************************************************************
272 * Override Method - hal::serial::IIC::EventReceiver
273 */
274 public:
295 virtual bool onReceiver(const uint8 data) override;
296
297 /* *************************************************************************************
298 * Override Method - hal::serial::IIC::EventTransfer
299 */
300 public:
322 virtual bool onTransfer(uint8& data) override;
323
324 /* *************************************************************************************
325 * Override Method - hal::serial::IIC::EventStop
326 */
327 public:
351 virtual void onStop(int queueRemainingCount) override;
352
353 /* *************************************************************************************
354 * Public Method
355 */
356
357 /* *************************************************************************************
358 * Protected Method
359 */
360
361 /* *************************************************************************************
362 * Private Method
363 */
364
365 /* *************************************************************************************
366 * Static Variable
367 */
368 public:
369 static constexpr mcxa153::core::CoreDescriptor DESCRPITORS[1] = {
370 // LPI2C0
372 mcxa153::chip::reset::Control::LPI2C0,
376
377 /* *************************************************************************************
378 * Static Method
379 */
380 public:
396 static inline constexpr mcxa153::chip::lpi2c::Register* toRegister(Select select) {
397 return mcxa153::chip::lpi2c::LPI2C[static_cast<unsigned char>(select)];
398 }
399
414 static inline constexpr const mcxa153::core::CoreDescriptor* toDescriptor(
415 Select select) {
416 return &DESCRPITORS[static_cast<unsigned char>(select)];
417 }
418};
419
441enum struct mcxa153::core::CoreIIC::Select : unsigned char {
442 LPI2C0 = 0
443};
444
445/* ***************************************************************************************
446 * End of file
447 */
448
449#endif /* MCXA153_C907AFC6_A375_4FFB_B72E_DD0E8B616FD5 */
MCXA153 低功耗 I2C (Low Power I2C) 控制器靜態工具類別
Definition LPI2C.h:96
MCXA153 I2C通訊控制器
Definition CoreIIC.h:78
hal::serial::IIC::EventStop * vEventStop
通訊停止事件處理器指標
Definition CoreIIC.h:143
const mcxa153::core::CoreDescriptor *const vDescriptor
控制器描述物件指標
Definition CoreIIC.h:93
hal::serial::IIC::EventReceiver * vEventReceiver
資料接收事件處理器指標
Definition CoreIIC.h:110
virtual bool isInit(void) override
檢查I2C控制器初始化狀態
hal::serial::IIC::EventTransfer * vEventTransfer
資料傳輸事件處理器指標
Definition CoreIIC.h:126
virtual bool deinit(void) override
反初始化I2C控制器
virtual ~CoreIIC(void) override
解構I2C通訊控制器物件
virtual void setEventReceiver(hal::serial::IIC::EventReceiver *event) override
設定資料接收事件處理器
static constexpr mcxa153::chip::lpi2c::Register * toRegister(Select select)
將I2C控制器選擇轉換為硬體暫存器位址
Definition CoreIIC.h:396
mcxa153::chip::lpi2c::Register *const vBase
I2C控制器基底暫存器位址
Definition CoreIIC.h:90
virtual void setEventStop(hal::serial::IIC::EventStop *event) override
設定通訊停止事件處理器
virtual void onStop(int queueRemainingCount) override
通訊停止事件回調方法
virtual bool onReceiver(const uint8 data) override
資料接收事件回調方法
Select
I2C控制器選擇枚舉
Definition CoreIIC.h:441
CoreIIC(Select select, const mcxa153::core::CoreDescriptor *descriptor=nullptr)
建構I2C通訊控制器物件
static constexpr const mcxa153::core::CoreDescriptor * toDescriptor(Select select)
將I2C控制器選擇轉換為描述物件指標
Definition CoreIIC.h:414
virtual bool onTransfer(uint8 &data) override
資料傳輸事件回調方法
virtual void setEventTransfer(hal::serial::IIC::EventTransfer *event) override
設定資料傳輸事件處理器
@ IRQ_LPI2C0
低功耗I2C0中斷服務
Definition CoreInterrupt.h:127
物件基底類別
Definition Object.h:63
Definition glikey/Mask.h:22
[Interface] 硬體中斷事件介面
Definition InterruptEvent.h:37
[Interface] IIC接收事件處理器
Definition IIC.h:81
[Interface] IIC停止事件監聽器
Definition IIC.h:105
[Interface] IIC傳輸事件處理器
Definition IIC.h:127
[Interface] IIC基礎介面
Definition IIC.h:38
LPI2C 週邊暫存器存取層
Definition lpi2c/Register.h:40
Definition CoreDescriptor.h:31