Skip to content

Commit 64e68c2

Browse files
committed
Merge branch 'feat/add_touch_button_example' into 'master'
feat(touch_button): add touch button component See merge request ae_group/esp-iot-solution!1251
2 parents 4aca00f + e2cb6ab commit 64e68c2

File tree

27 files changed

+915
-5
lines changed

27 files changed

+915
-5
lines changed

.github/workflows/upload_component.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ jobs:
8484
components/sensors/sensor_hub;
8585
components/spi_bus;
8686
components/storage/eeprom/at24c02;
87+
components/touch/touch_button;
8788
components/touch/touch_button_sensor;
8889
components/touch/touch_proximity_sensor;
8990
components/usb/esp_msc_ota;

.gitlab/ci/build.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,18 @@ build_example_sensors_sensor_hub_monitor:
712712
variables:
713713
EXAMPLE_DIR: examples/sensors/sensor_hub_monitor
714714

715+
build_example_touch_button:
716+
extends:
717+
- .build_examples_template
718+
- .rules:build:example_touch_touch_button
719+
parallel:
720+
matrix:
721+
- IMAGE: espressif/idf:release-v4.4
722+
- IMAGE: espressif/idf:release-v5.1
723+
- IMAGE: espressif/idf:release-v5.4
724+
variables:
725+
EXAMPLE_DIR: examples/touch/touch_button
726+
715727
build_example_touch_button_sensor:
716728
extends:
717729
- .build_examples_template
@@ -1509,6 +1521,16 @@ build_components_touch_touch_proximity_sensor_test_apps:
15091521
variables:
15101522
EXAMPLE_DIR: components/touch/touch_proximity_sensor/test_apps
15111523

1524+
build_components_touch_touch_button_test_apps:
1525+
extends:
1526+
- .build_examples_template
1527+
- .rules:build:components_touch_touch_button_test_apps
1528+
parallel:
1529+
matrix:
1530+
- IMAGE: espressif/idf:release-v5.3
1531+
variables:
1532+
EXAMPLE_DIR: components/touch/touch_button/test_apps
1533+
15121534
build_components_touch_touch_button_sensor_test_apps:
15131535
extends:
15141536
- .build_examples_template

.gitlab/ci/rules.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@
206206

207207
.patterns-components_sensors_power_measure: &patterns-components_sensors_power_measure
208208
- "components/sensors/power_measure/**/*"
209-
- "components/tools/cmake_utilities/package_manager.cmake"
209+
- "tools/cmake_utilities/package_manager.cmake"
210210

211211
.patterns-components_sensors_adc_mcp3201: &patterns-components_sensors_adc_mcp3201
212212
- "components/sensors/adc/mcp3201/**/*"
@@ -287,6 +287,10 @@
287287
- "components/touch/touch_proximity_sensor/**/*"
288288
- "tools/cmake_utilities/package_manager.cmake"
289289

290+
.patterns-components_touch_touch_button: &patterns-components_touch_touch_button
291+
- "components/touch/touch_button/**/*"
292+
- "tools/cmake_utilities/package_manager.cmake"
293+
290294
.patterns-components_touch_touch_button_sensor: &patterns-components_touch_touch_button_sensor
291295
- "components/touch/touch_button_sensor/**/*"
292296
- "tools/cmake_utilities/package_manager.cmake"
@@ -1296,6 +1300,17 @@
12961300
- <<: *if-dev-push
12971301
changes: *patterns-example_sensors_sensor_hub_monitor
12981302

1303+
.rules:build:example_touch_touch_button:
1304+
rules:
1305+
- <<: *if-protected
1306+
- <<: *if-label-build
1307+
- <<: *if-dev-push
1308+
changes: *patterns-build_system
1309+
- <<: *if-dev-push
1310+
changes: *patterns-example_touch_touch_button
1311+
- <<: *if-dev-push
1312+
changes: *patterns-components_touch_touch_button
1313+
12991314
.rules:build:example_touch_touch_button_sensor:
13001315
rules:
13011316
- <<: *if-protected
@@ -2352,6 +2367,17 @@
23522367
- <<: *if-dev-push
23532368
changes: *patterns-components_touch_touch_proximity_sensor
23542369

2370+
.rules:build:components_touch_touch_button_test_apps:
2371+
rules:
2372+
- <<: *if-protected
2373+
- <<: *if-label-build
2374+
- <<: *if-label-target_test
2375+
- <<: *if-trigger-job
2376+
- <<: *if-dev-push
2377+
changes: *patterns-build_system
2378+
- <<: *if-dev-push
2379+
changes: *patterns-components_touch_touch_button
2380+
23552381
.rules:build:components_touch_touch_button_sensor_test_apps:
23562382
rules:
23572383
- <<: *if-protected

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ The registered components in ESP-IoT-Solution are listed below:
128128
| [servo](https://components.espressif.com/components/espressif/servo) | [![Component Registry](https://components.espressif.com/components/espressif/servo/badge.svg)](https://components.espressif.com/components/espressif/servo) |
129129
| [sht3x](https://components.espressif.com/components/espressif/sht3x) | [![Component Registry](https://components.espressif.com/components/espressif/sht3x/badge.svg)](https://components.espressif.com/components/espressif/sht3x) |
130130
| [spi_bus](https://components.espressif.com/components/espressif/spi_bus) | [![Component Registry](https://components.espressif.com/components/espressif/spi_bus/badge.svg)](https://components.espressif.com/components/espressif/spi_bus) |
131+
| [touch_button](https://components.espressif.com/components/espressif/touch_button) | [![Component Registry](https://components.espressif.com/components/espressif/touch_button/badge.svg)](https://components.espressif.com/components/espressif/touch_button) |
131132
| [touch_button_sensor](https://components.espressif.com/components/espressif/touch_button_sensor) | [![Component Registry](https://components.espressif.com/components/espressif/touch_button_sensor/badge.svg)](https://components.espressif.com/components/espressif/touch_button_sensor) |
132133
| [touch_proximity_sensor](https://components.espressif.com/components/espressif/touch_proximity_sensor) | [![Component Registry](https://components.espressif.com/components/espressif/touch_proximity_sensor/badge.svg)](https://components.espressif.com/components/espressif/touch_proximity_sensor) |
133134
| [usb_device_uac](https://components.espressif.com/components/espressif/usb_device_uac) | [![Component Registry](https://components.espressif.com/components/espressif/usb_device_uac/badge.svg)](https://components.espressif.com/components/espressif/usb_device_uac) |

README_CN.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ ESP-IoT-Solution 中注册的组件如下:
128128
| [servo](https://components.espressif.com/components/espressif/servo) | [![Component Registry](https://components.espressif.com/components/espressif/servo/badge.svg)](https://components.espressif.com/components/espressif/servo) |
129129
| [sht3x](https://components.espressif.com/components/espressif/sht3x) | [![Component Registry](https://components.espressif.com/components/espressif/sht3x/badge.svg)](https://components.espressif.com/components/espressif/sht3x) |
130130
| [spi_bus](https://components.espressif.com/components/espressif/spi_bus) | [![Component Registry](https://components.espressif.com/components/espressif/spi_bus/badge.svg)](https://components.espressif.com/components/espressif/spi_bus) |
131+
| [touch_button](https://components.espressif.com/components/espressif/touch_button) | [![Component Registry](https://components.espressif.com/components/espressif/touch_button/badge.svg)](https://components.espressif.com/components/espressif/touch_button) |
131132
| [touch_button_sensor](https://components.espressif.com/components/espressif/touch_button_sensor) | [![Component Registry](https://components.espressif.com/components/espressif/touch_button_sensor/badge.svg)](https://components.espressif.com/components/espressif/touch_button_sensor) |
132133
| [touch_proximity_sensor](https://components.espressif.com/components/espressif/touch_proximity_sensor) | [![Component Registry](https://components.espressif.com/components/espressif/touch_proximity_sensor/badge.svg)](https://components.espressif.com/components/espressif/touch_proximity_sensor) |
133134
| [usb_device_uac](https://components.espressif.com/components/espressif/usb_device_uac) | [![Component Registry](https://components.espressif.com/components/espressif/usb_device_uac/badge.svg)](https://components.espressif.com/components/espressif/usb_device_uac) |

components/.build-rules.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ components/avi_player/test_apps:
1212
enable:
1313
- if: IDF_TARGET in ["esp32s3", "esp32p4"]
1414

15+
components/touch/touch_button/test_apps:
16+
enable:
17+
- if: IDF_TARGET in ["esp32s2", "esp32s3", "esp32p4"]
18+
1519
components/touch/touch_button_sensor/test_apps:
1620
enable:
1721
- if: IDF_TARGET in ["esp32", "esp32s2", "esp32s3"] and (IDF_VERSION_MAJOR == 5 and IDF_VERSION_MINOR == 1)

components/button/test_apps/main/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_GREATER_EQUAL "5.0")
33
endif()
44

55
idf_component_register(SRC_DIRS "."
6-
PRIV_REQUIRES esp_event
76
PRIV_INCLUDE_DIRS "."
8-
PRIV_REQUIRES unity test_utils button ${PRIVREQ}
7+
PRIV_REQUIRES esp_event unity test_utils button ${PRIVREQ}
98
WHOLE_ARCHIVE)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# ChangeLog
2+
3+
## v0.1.0 - 2025-03-18
4+
5+
* Add Initial version
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
idf_component_register(SRC_DIRS "."
2+
INCLUDE_DIRS ".")
3+
4+
include(package_manager)
5+
cu_pkg_define_version(${CMAKE_CURRENT_LIST_DIR})
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[![Component Registry](https://components.espressif.com/components/espressif/touch_button/badge.svg)](https://components.espressif.com/components/espressif/touch_button)
2+
3+
# Touch Button
4+
5+
Supports a series of operations on touch buttons, such as press, release, long press, and short press.
6+
7+
**Note:** This component is for developers testing only. It is not intended for production use.
8+
9+
ESP32/ESP32-S2/ESP32-S3 touch-related components are intended for testing or demo purposes only. Due to the poor anti-interference capability of the touch functionality, it may not pass EMS testing, and therefore, it is not recommended for mass production products.
10+
11+
This component is currently applicable to ESP32, ESP32-S2, and ESP32-S3, and ESP32-P4 and requires an IDF version greater than or equal to v4.4 and less than or equal to v5.4.
12+
13+
## Dependencies
14+
15+
- [touch_sensor_fsm](https://components.espressif.com/components/espressif/touch_sensor_fsm)
16+
- [touch_sensor_lowlevel](https://components.espressif.com/components/espressif/touch_sensor_lowlevel)
17+
- [touch_button_sensor](https://components.espressif.com/components/espressif/touch_button_sensor)
18+
19+
## Add component to your project
20+
21+
Please use the component manager command `add-dependency` to add the `touch_button` to your project's dependency, during the `CMake` step the component will be downloaded automatically
22+
23+
```
24+
idf.py add-dependency "espressif/touch_button=*"
25+
```

0 commit comments

Comments
 (0)