Skip to content

Commit

Permalink
Merge branch 'feature/touch_driver_ng_on_p4' into 'master'
Browse files Browse the repository at this point in the history
feat(touch_sensor): touch driver ng on p4

Closes IDF-7477

See merge request espressif/esp-idf!25941
  • Loading branch information
L-KAYA committed Jun 12, 2024
2 parents 2a7ff33 + d263ab3 commit c23165b
Show file tree
Hide file tree
Showing 76 changed files with 4,272 additions and 309 deletions.
8 changes: 5 additions & 3 deletions components/driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@ endif()

# Touch Sensor related source files
if(CONFIG_SOC_TOUCH_SENSOR_SUPPORTED)
list(APPEND srcs "touch_sensor/touch_sensor_common.c"
"touch_sensor/${target}/touch_sensor.c")
list(APPEND includes "touch_sensor/${target}/include")
if(CONFIG_SOC_TOUCH_SENSOR_VERSION LESS 3)
list(APPEND srcs "touch_sensor/touch_sensor_common.c"
"touch_sensor/${target}/touch_sensor.c")
list(APPEND includes "touch_sensor/${target}/include")
endif()
endif()

# TWAI related source files
Expand Down
1 change: 1 addition & 0 deletions components/driver/touch_sensor/esp32s2/touch_sensor.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "esp_log.h"
#include "sys/lock.h"
#include "soc/soc_pins.h"
#include "soc/rtc_cntl_reg.h"
#include "freertos/FreeRTOS.h"
#include "freertos/semphr.h"
#include "freertos/timers.h"
Expand Down
1 change: 1 addition & 0 deletions components/driver/touch_sensor/esp32s3/touch_sensor.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "esp_log.h"
#include "sys/lock.h"
#include "soc/soc_pins.h"
#include "soc/rtc_cntl_reg.h"
#include "freertos/FreeRTOS.h"
#include "freertos/semphr.h"
#include "freertos/timers.h"
Expand Down
2 changes: 1 addition & 1 deletion components/driver/touch_sensor/include/driver/touch_pad.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

#include "soc/soc_caps.h"

#if SOC_TOUCH_SENSOR_SUPPORTED
#if SOC_TOUCH_SENSOR_SUPPORTED && SOC_TOUCH_SENSOR_VERSION < 3
#include "driver/touch_sensor.h"
#endif
21 changes: 21 additions & 0 deletions components/esp_driver_touch_sens/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
idf_build_get_property(target IDF_TARGET)

if(${target} STREQUAL "linux")
return() # This component is not supported by the POSIX/Linux simulator
endif()

set(srcs)
set(public_inc)

if(CONFIG_SOC_TOUCH_SENSOR_SUPPORTED)
if(CONFIG_SOC_TOUCH_SENSOR_VERSION EQUAL 3)
list(APPEND srcs "hw_ver3/touch_version_specific.c"
"common/touch_sens_common.c")
list(APPEND public_inc "include" "hw_ver3/include")
endif()
endif()

idf_component_register(SRCS ${srcs}
PRIV_REQUIRES esp_driver_gpio
INCLUDE_DIRS ${public_inc}
)
25 changes: 25 additions & 0 deletions components/esp_driver_touch_sens/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
menu "ESP-Driver:Touch Sensor Configurations"
depends on SOC_TOUCH_SENSOR_SUPPORTED
config TOUCH_CTRL_FUNC_IN_IRAM
bool "Place touch sensor control functions into IRAM"
default n
help
Place touch sensor oneshot scanning and continuous scanning functions into IRAM,
so that these function can be IRAM-safe and able to be called when the flash cache is disabled.
Enabling this option can improve driver performance as well.

config TOUCH_ISR_IRAM_SAFE
bool "Touch sensor ISR IRAM-Safe"
default n
help
Ensure the touch sensor interrupt is IRAM-Safe by allowing the interrupt handler to be
executable when the cache is disabled (e.g. SPI Flash write).

config TOUCH_ENABLE_DEBUG_LOG
bool "Enable debug log"
default n
help
Whether to enable the debug log message for touch driver.
Note that, this option only controls the touch driver log, won't affect other drivers.

endmenu # Touch Sensor Configuration
Loading

0 comments on commit c23165b

Please sign in to comment.