From 5b375c21bbb0db480c4e65d4d30214864a207d76 Mon Sep 17 00:00:00 2001 From: Ken Van Hoeylandt Date: Sat, 8 Feb 2025 21:08:23 +0100 Subject: [PATCH] Implemented new driver projects (#210) Moved drivers from the `Boards` projects to `Drivers` folder: - BQ24295 - AW9523 - AXP2101 The I2C drivers are theoretically cross-platform, but for now they are only built for ESP32. --- Boards/M5stackCoreS3/CMakeLists.txt | 4 ++-- Boards/M5stackCoreS3/Source/InitBoot.cpp | 5 ++--- Boards/M5stackCoreS3/Source/hal/CoreS3Power.h | 3 +-- Boards/UnPhone/CMakeLists.txt | 4 ++-- Boards/UnPhone/Source/UnPhoneFeatures.h | 2 +- Drivers/AW9523/CMakeLists.txt | 5 +++++ Drivers/AW9523/README.md | 5 +++++ .../Source/Aw9523 => Drivers/AW9523/Source}/Aw9523.cpp | 0 .../Source/Aw9523 => Drivers/AW9523/Source}/Aw9523.h | 0 Drivers/AXP2101/CMakeLists.txt | 5 +++++ Drivers/AXP2101/README.md | 6 ++++++ .../Source/Axp2101 => Drivers/AXP2101/Source}/Axp2101.cpp | 0 .../Source/Axp2101 => Drivers/AXP2101/Source}/Axp2101.h | 0 Drivers/BQ24295/CMakeLists.txt | 5 +++++ Drivers/BQ24295/README.md | 5 +++++ .../Source/bq24295 => Drivers/BQ24295/Source}/Bq24295.cpp | 0 .../Source/bq24295 => Drivers/BQ24295/Source}/Bq24295.h | 0 17 files changed, 39 insertions(+), 10 deletions(-) create mode 100644 Drivers/AW9523/CMakeLists.txt create mode 100644 Drivers/AW9523/README.md rename {Boards/M5stackCoreS3/Source/Aw9523 => Drivers/AW9523/Source}/Aw9523.cpp (100%) rename {Boards/M5stackCoreS3/Source/Aw9523 => Drivers/AW9523/Source}/Aw9523.h (100%) create mode 100644 Drivers/AXP2101/CMakeLists.txt create mode 100644 Drivers/AXP2101/README.md rename {Boards/M5stackCoreS3/Source/Axp2101 => Drivers/AXP2101/Source}/Axp2101.cpp (100%) rename {Boards/M5stackCoreS3/Source/Axp2101 => Drivers/AXP2101/Source}/Axp2101.h (100%) create mode 100644 Drivers/BQ24295/CMakeLists.txt create mode 100644 Drivers/BQ24295/README.md rename {Boards/UnPhone/Source/bq24295 => Drivers/BQ24295/Source}/Bq24295.cpp (100%) rename {Boards/UnPhone/Source/bq24295 => Drivers/BQ24295/Source}/Bq24295.h (100%) diff --git a/Boards/M5stackCoreS3/CMakeLists.txt b/Boards/M5stackCoreS3/CMakeLists.txt index 9d0e9cb6..affa0632 100644 --- a/Boards/M5stackCoreS3/CMakeLists.txt +++ b/Boards/M5stackCoreS3/CMakeLists.txt @@ -1,5 +1,5 @@ idf_component_register( - SRC_DIRS "Source" "Source/hal" "Source/Axp2101" "Source/Aw9523" + SRC_DIRS "Source" "Source/hal" INCLUDE_DIRS "Source" - REQUIRES Tactility esp_lvgl_port esp_lcd esp_lcd_ili9341 ILI934x esp_lcd_touch_ft5x06 driver vfs fatfs + REQUIRES Tactility esp_lvgl_port esp_lcd esp_lcd_ili9341 ILI934x AXP2101 AW9523 esp_lcd_touch_ft5x06 driver vfs fatfs ) diff --git a/Boards/M5stackCoreS3/Source/InitBoot.cpp b/Boards/M5stackCoreS3/Source/InitBoot.cpp index 14daa942..6b67e201 100644 --- a/Boards/M5stackCoreS3/Source/InitBoot.cpp +++ b/Boards/M5stackCoreS3/Source/InitBoot.cpp @@ -1,9 +1,8 @@ -#include "Axp2101/Axp2101.h" -#include "Aw9523/Aw9523.h" +#include +#include #include #include -#include #define TAG "cores3" diff --git a/Boards/M5stackCoreS3/Source/hal/CoreS3Power.h b/Boards/M5stackCoreS3/Source/hal/CoreS3Power.h index 9fe434e8..7820643d 100644 --- a/Boards/M5stackCoreS3/Source/hal/CoreS3Power.h +++ b/Boards/M5stackCoreS3/Source/hal/CoreS3Power.h @@ -1,7 +1,6 @@ #pragma once -#include "Axp2101/Axp2101.h" - +#include #include #include #include diff --git a/Boards/UnPhone/CMakeLists.txt b/Boards/UnPhone/CMakeLists.txt index b119021a..06be3b4f 100644 --- a/Boards/UnPhone/CMakeLists.txt +++ b/Boards/UnPhone/CMakeLists.txt @@ -1,5 +1,5 @@ idf_component_register( - SRC_DIRS "Source" "Source/hal" "Source/hx8357" "Source/bq24295" + SRC_DIRS "Source" "Source/hal" "Source/hx8357" INCLUDE_DIRS "Source" - REQUIRES Tactility esp_lvgl_port esp_io_expander esp_io_expander_tca95xx_16bit esp_lcd_touch esp_lcd_touch_xpt2046 + REQUIRES Tactility esp_lvgl_port esp_io_expander esp_io_expander_tca95xx_16bit BQ24295 esp_lcd_touch esp_lcd_touch_xpt2046 ) diff --git a/Boards/UnPhone/Source/UnPhoneFeatures.h b/Boards/UnPhone/Source/UnPhoneFeatures.h index 9d5ba8e3..adc06ef3 100644 --- a/Boards/UnPhone/Source/UnPhoneFeatures.h +++ b/Boards/UnPhone/Source/UnPhoneFeatures.h @@ -1,6 +1,6 @@ #pragma once -#include "bq24295/Bq24295.h" +#include #include #include diff --git a/Drivers/AW9523/CMakeLists.txt b/Drivers/AW9523/CMakeLists.txt new file mode 100644 index 00000000..8074f3b3 --- /dev/null +++ b/Drivers/AW9523/CMakeLists.txt @@ -0,0 +1,5 @@ +idf_component_register( + SRC_DIRS "Source" + INCLUDE_DIRS "Source" + REQUIRES Tactility +) diff --git a/Drivers/AW9523/README.md b/Drivers/AW9523/README.md new file mode 100644 index 00000000..474c6bfc --- /dev/null +++ b/Drivers/AW9523/README.md @@ -0,0 +1,5 @@ +# AW9523 + +Multi-functional GPIO expander and LED driver with I2C interface. + +[Datasheet](https://www.alldatasheet.com/datasheet-pdf/download/1148542/AWINIC/AW9523B.html) \ No newline at end of file diff --git a/Boards/M5stackCoreS3/Source/Aw9523/Aw9523.cpp b/Drivers/AW9523/Source/Aw9523.cpp similarity index 100% rename from Boards/M5stackCoreS3/Source/Aw9523/Aw9523.cpp rename to Drivers/AW9523/Source/Aw9523.cpp diff --git a/Boards/M5stackCoreS3/Source/Aw9523/Aw9523.h b/Drivers/AW9523/Source/Aw9523.h similarity index 100% rename from Boards/M5stackCoreS3/Source/Aw9523/Aw9523.h rename to Drivers/AW9523/Source/Aw9523.h diff --git a/Drivers/AXP2101/CMakeLists.txt b/Drivers/AXP2101/CMakeLists.txt new file mode 100644 index 00000000..8074f3b3 --- /dev/null +++ b/Drivers/AXP2101/CMakeLists.txt @@ -0,0 +1,5 @@ +idf_component_register( + SRC_DIRS "Source" + INCLUDE_DIRS "Source" + REQUIRES Tactility +) diff --git a/Drivers/AXP2101/README.md b/Drivers/AXP2101/README.md new file mode 100644 index 00000000..bda3c583 --- /dev/null +++ b/Drivers/AXP2101/README.md @@ -0,0 +1,6 @@ +# AXP2101 + +Power management with I2C interface: a single cell NVDC PMU with E-gauge. + +- [Datasheet](http://file.whycan.com/files/members/6736/AXP2101_Datasheet_V1.0_en_3832.pdf) +- [M5Unified implementation](https://github.com/m5stack/M5Unified/blob/master/src/utility/AXP2101_Class.cpp) diff --git a/Boards/M5stackCoreS3/Source/Axp2101/Axp2101.cpp b/Drivers/AXP2101/Source/Axp2101.cpp similarity index 100% rename from Boards/M5stackCoreS3/Source/Axp2101/Axp2101.cpp rename to Drivers/AXP2101/Source/Axp2101.cpp diff --git a/Boards/M5stackCoreS3/Source/Axp2101/Axp2101.h b/Drivers/AXP2101/Source/Axp2101.h similarity index 100% rename from Boards/M5stackCoreS3/Source/Axp2101/Axp2101.h rename to Drivers/AXP2101/Source/Axp2101.h diff --git a/Drivers/BQ24295/CMakeLists.txt b/Drivers/BQ24295/CMakeLists.txt new file mode 100644 index 00000000..8074f3b3 --- /dev/null +++ b/Drivers/BQ24295/CMakeLists.txt @@ -0,0 +1,5 @@ +idf_component_register( + SRC_DIRS "Source" + INCLUDE_DIRS "Source" + REQUIRES Tactility +) diff --git a/Drivers/BQ24295/README.md b/Drivers/BQ24295/README.md new file mode 100644 index 00000000..5ecc1181 --- /dev/null +++ b/Drivers/BQ24295/README.md @@ -0,0 +1,5 @@ +# BQ24295 + +Power management: I2C-controlled 3A single cell USB charger with narrow VDC 4.5-5.5V adjustable voltage at 1.5A synchronous boost operation. + +[Datasheet](https://www.ti.com/lit/ds/symlink/bq24295.pdf) diff --git a/Boards/UnPhone/Source/bq24295/Bq24295.cpp b/Drivers/BQ24295/Source/Bq24295.cpp similarity index 100% rename from Boards/UnPhone/Source/bq24295/Bq24295.cpp rename to Drivers/BQ24295/Source/Bq24295.cpp diff --git a/Boards/UnPhone/Source/bq24295/Bq24295.h b/Drivers/BQ24295/Source/Bq24295.h similarity index 100% rename from Boards/UnPhone/Source/bq24295/Bq24295.h rename to Drivers/BQ24295/Source/Bq24295.h