diff --git a/LICENSE b/LICENSE index 6831ef1..98d36b6 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2025 M5Stack Technology CO LTD +Copyright (c) 2026 M5Stack Technology CO LTD Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/examples/interrupt_hardware/interrupt_hardware.ino b/examples/interrupt_hardware/interrupt_hardware.ino index 75bb739..6c0705a 100644 --- a/examples/interrupt_hardware/interrupt_hardware.ino +++ b/examples/interrupt_hardware/interrupt_hardware.ino @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2025 M5Stack Technology CO LTD + * SPDX-FileCopyrightText: 2026 M5Stack Technology CO LTD * * SPDX-License-Identifier: MIT */ @@ -40,7 +40,7 @@ M5IOE1 ioe1; #define INT_PIN 1 // M5IOE1 I2C address (default 0x6F) -#define I2C_ADDR 0x6F +#define I2C_ADDR M5IOE1_DEFAULT_ADDR // Pin definitions for M5IOE1 GPIOs #define IOE1_PIN_1 M5IOE1_PIN_1 // IO1 on M5IOE1 (pin index 0) diff --git a/examples/interrupt_polling/interrupt_polling.ino b/examples/interrupt_polling/interrupt_polling.ino index e975e07..0feecaf 100644 --- a/examples/interrupt_polling/interrupt_polling.ino +++ b/examples/interrupt_polling/interrupt_polling.ino @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2025 M5Stack Technology CO LTD + * SPDX-FileCopyrightText: 2026 M5Stack Technology CO LTD * * SPDX-License-Identifier: MIT */ @@ -35,7 +35,7 @@ M5IOE1 ioe1; #define I2C_FREQ 400000 // M5IOE1 I2C address (default 0x6F) -#define I2C_ADDR 0x6F +#define I2C_ADDR M5IOE1_DEFAULT_ADDR // Pin definitions #define IOE1_PIN_1 M5IOE1_PIN_1 // IO1 on M5IOE1 (pin index 0) diff --git a/src/M5IOE1.cpp b/src/M5IOE1.cpp index 6ee40e6..73eb065 100644 --- a/src/M5IOE1.cpp +++ b/src/M5IOE1.cpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2025 M5Stack Technology CO LTD + * SPDX-FileCopyrightText: 2026 M5Stack Technology CO LTD * * SPDX-License-Identifier: MIT */ @@ -1190,7 +1190,7 @@ bool M5IOE1::refreshAw8737aPulse() { // RTC RAM 功能 / RTC RAM Functions // ============================ -bool M5IOE1::writeRtcRam(uint8_t offset, const uint8_t* data, uint8_t length) { +bool M5IOE1::writeRtcRAM(uint8_t offset, const uint8_t* data, uint8_t length) { if (data == nullptr || offset >= M5IOE1_RTC_RAM_SIZE || length == 0 || (offset + length) > M5IOE1_RTC_RAM_SIZE || !_initialized) { return false; @@ -1200,7 +1200,7 @@ bool M5IOE1::writeRtcRam(uint8_t offset, const uint8_t* data, uint8_t length) { return _writeBytes(regAddr, data, length); } -bool M5IOE1::readRtcRam(uint8_t offset, uint8_t* data, uint8_t length) { +bool M5IOE1::readRtcRAM(uint8_t offset, uint8_t* data, uint8_t length) { if (data == nullptr || offset >= M5IOE1_RTC_RAM_SIZE || length == 0 || (offset + length) > M5IOE1_RTC_RAM_SIZE || !_initialized) { return false; diff --git a/src/M5IOE1.h b/src/M5IOE1.h index f4d2060..7c30b20 100644 --- a/src/M5IOE1.h +++ b/src/M5IOE1.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2025 M5Stack Technology CO LTD + * SPDX-FileCopyrightText: 2026 M5Stack Technology CO LTD * * SPDX-License-Identifier: MIT */ @@ -24,21 +24,23 @@ // ============================ // IO 引脚定义 / IO Pin Definitions // ============================ -#define M5IOE1_PIN_NC -1 -#define M5IOE1_PIN_1 0 -#define M5IOE1_PIN_2 1 -#define M5IOE1_PIN_3 2 -#define M5IOE1_PIN_4 3 -#define M5IOE1_PIN_5 4 -#define M5IOE1_PIN_6 5 -#define M5IOE1_PIN_7 6 -#define M5IOE1_PIN_8 7 -#define M5IOE1_PIN_9 8 -#define M5IOE1_PIN_10 9 -#define M5IOE1_PIN_11 10 -#define M5IOE1_PIN_12 11 -#define M5IOE1_PIN_13 12 -#define M5IOE1_PIN_14 13 +typedef enum { + M5IOE1_PIN_NC = -1, + M5IOE1_PIN_1 = 0, + M5IOE1_PIN_2 = 1, + M5IOE1_PIN_3 = 2, + M5IOE1_PIN_4 = 3, + M5IOE1_PIN_5 = 4, + M5IOE1_PIN_6 = 5, + M5IOE1_PIN_7 = 6, + M5IOE1_PIN_8 = 7, + M5IOE1_PIN_9 = 8, + M5IOE1_PIN_10 = 9, + M5IOE1_PIN_11 = 10, + M5IOE1_PIN_12 = 11, + M5IOE1_PIN_13 = 12, + M5IOE1_PIN_14 = 13 +} m5ioe1_pin_t; // ============================ // 设备常量 / Device Constants @@ -592,8 +594,8 @@ public: // ======================== // RTC RAM 功能 / RTC RAM Functions // ======================== - bool writeRtcRam(uint8_t offset, const uint8_t* data, uint8_t length); - bool readRtcRam(uint8_t offset, uint8_t* data, uint8_t length); + bool writeRtcRAM(uint8_t offset, const uint8_t* data, uint8_t length); + bool readRtcRAM(uint8_t offset, uint8_t* data, uint8_t length); // ======================== // 系统配置 / System Configuration diff --git a/src/M5IOE1_i2c_compat.h b/src/M5IOE1_i2c_compat.h index 10395fd..39dd858 100644 --- a/src/M5IOE1_i2c_compat.h +++ b/src/M5IOE1_i2c_compat.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2025 M5Stack Technology CO LTD + * SPDX-FileCopyrightText: 2026 M5Stack Technology CO LTD * * SPDX-License-Identifier: MIT */