Skip to content

Commit 05c1cbf

Browse files
committed
Merge branch 'develop'
2 parents 9831b84 + 8d30c72 commit 05c1cbf

File tree

4 files changed

+34
-6
lines changed

4 files changed

+34
-6
lines changed

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"m5stack/M5Utility": "*",
1515
"m5stack/M5HAL": "*"
1616
},
17-
"version": "0.1.3",
17+
"version": "0.1.4",
1818
"frameworks": [
1919
"arduino"
2020
],

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=M5UnitUnified
2-
version=0.1.3
2+
version=0.1.4
33
author=M5Stack
44
maintainer=M5Stack
55
sentence=M5UnitUnified is a library for unified handling of various M5 units products. (Alpha version)

src/M5UnitComponent.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,7 @@ bool Component::existsChild(const uint8_t ch) const
4646

4747
bool Component::canAccessI2C() const
4848
{
49-
// TODO
50-
// Tentative decisions until all units' attributes are corrected
51-
// return attribute() & attribute::AccessI2C;
52-
return true;
49+
return attribute() & attribute::AccessI2C;
5350
}
5451

5552
bool Component::canAccessGPIO() const

src/m5_unit_component/adapter_gpio.cpp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ constexpr gpio_config_t gpio_cfg_table[] = {
5050
.pull_up_en = GPIO_PULLUP_DISABLE,
5151
.pull_down_en = GPIO_PULLDOWN_DISABLE,
5252
.intr_type = GPIO_INTR_DISABLE,
53+
#if defined(CONFIG_IDF_TARGET_ESP32P4)
54+
.hys_ctrl_mode = GPIO_HYS_SOFT_ENABLE,
55+
#endif
5356
},
5457
{
5558
// Output
@@ -58,6 +61,9 @@ constexpr gpio_config_t gpio_cfg_table[] = {
5861
.pull_up_en = GPIO_PULLUP_DISABLE,
5962
.pull_down_en = GPIO_PULLDOWN_DISABLE,
6063
.intr_type = GPIO_INTR_DISABLE,
64+
#if defined(CONFIG_IDF_TARGET_ESP32P4)
65+
.hys_ctrl_mode = GPIO_HYS_SOFT_ENABLE,
66+
#endif
6167
},
6268
{
6369
// Pullup
@@ -66,6 +72,9 @@ constexpr gpio_config_t gpio_cfg_table[] = {
6672
.pull_up_en = GPIO_PULLUP_ENABLE,
6773
.pull_down_en = GPIO_PULLDOWN_DISABLE,
6874
.intr_type = GPIO_INTR_DISABLE,
75+
#if defined(CONFIG_IDF_TARGET_ESP32P4)
76+
.hys_ctrl_mode = GPIO_HYS_SOFT_ENABLE,
77+
#endif
6978
},
7079
{
7180
// InputPullup
@@ -74,6 +83,9 @@ constexpr gpio_config_t gpio_cfg_table[] = {
7483
.pull_up_en = GPIO_PULLUP_ENABLE,
7584
.pull_down_en = GPIO_PULLDOWN_DISABLE,
7685
.intr_type = GPIO_INTR_DISABLE,
86+
#if defined(CONFIG_IDF_TARGET_ESP32P4)
87+
.hys_ctrl_mode = GPIO_HYS_SOFT_ENABLE,
88+
#endif
7789
},
7890
{
7991
// Pulldown
@@ -82,6 +94,9 @@ constexpr gpio_config_t gpio_cfg_table[] = {
8294
.pull_up_en = GPIO_PULLUP_DISABLE,
8395
.pull_down_en = GPIO_PULLDOWN_ENABLE,
8496
.intr_type = GPIO_INTR_DISABLE,
97+
#if defined(CONFIG_IDF_TARGET_ESP32P4)
98+
.hys_ctrl_mode = GPIO_HYS_SOFT_ENABLE,
99+
#endif
85100
},
86101
{
87102
// InputPulldown
@@ -90,6 +105,9 @@ constexpr gpio_config_t gpio_cfg_table[] = {
90105
.pull_up_en = GPIO_PULLUP_DISABLE,
91106
.pull_down_en = GPIO_PULLDOWN_ENABLE,
92107
.intr_type = GPIO_INTR_DISABLE,
108+
#if defined(CONFIG_IDF_TARGET_ESP32P4)
109+
.hys_ctrl_mode = GPIO_HYS_SOFT_ENABLE,
110+
#endif
93111
},
94112
{
95113
// OpenDrain
@@ -98,6 +116,9 @@ constexpr gpio_config_t gpio_cfg_table[] = {
98116
.pull_up_en = GPIO_PULLUP_ENABLE, //
99117
.pull_down_en = GPIO_PULLDOWN_DISABLE,
100118
.intr_type = GPIO_INTR_DISABLE,
119+
#if defined(CONFIG_IDF_TARGET_ESP32P4)
120+
.hys_ctrl_mode = GPIO_HYS_SOFT_ENABLE,
121+
#endif
101122
},
102123
{
103124
// OutputOpenDrain,
@@ -106,6 +127,9 @@ constexpr gpio_config_t gpio_cfg_table[] = {
106127
.pull_up_en = GPIO_PULLUP_DISABLE,
107128
.pull_down_en = GPIO_PULLDOWN_DISABLE,
108129
.intr_type = GPIO_INTR_DISABLE,
130+
#if defined(CONFIG_IDF_TARGET_ESP32P4)
131+
.hys_ctrl_mode = GPIO_HYS_SOFT_ENABLE,
132+
#endif
109133
},
110134
{
111135
// Analog
@@ -114,6 +138,9 @@ constexpr gpio_config_t gpio_cfg_table[] = {
114138
.pull_up_en = GPIO_PULLUP_DISABLE,
115139
.pull_down_en = GPIO_PULLDOWN_DISABLE,
116140
.intr_type = GPIO_INTR_DISABLE,
141+
#if defined(CONFIG_IDF_TARGET_ESP32P4)
142+
.hys_ctrl_mode = GPIO_HYS_SOFT_ENABLE,
143+
#endif
117144
},
118145
};
119146

@@ -384,7 +411,11 @@ m5::hal::error::error_t AdapterGPIOBase::GPIOImpl::read_analog(uint16_t& value,
384411

385412
adc_oneshot_unit_handle_t adc_handle{};
386413
adc_oneshot_unit_init_cfg_t init_config = {
414+
#if defined(CONFIG_IDF_TARGET_ESP32C6)
415+
.unit_id = unit, .clk_src = ADC_DIGI_CLK_SRC_DEFAULT, .ulp_mode = ADC_ULP_MODE_DISABLE};
416+
#else
387417
.unit_id = unit, .clk_src = ADC_RTC_CLK_SRC_DEFAULT, .ulp_mode = ADC_ULP_MODE_DISABLE};
418+
#endif
388419

389420
if (adc_oneshot_new_unit(&init_config, &adc_handle) != ESP_OK) {
390421
return m5::hal::error::error_t::UNKNOWN_ERROR;

0 commit comments

Comments
 (0)