• R
    Touch Sensor IDF Refactoring (#6194) · 0ea485e5
    Rodrigo Garcia 提交于
    Summary
    
    Touch Sensor refactoring to be based on IDF 4.4.
    Adds support to ESP32S2 and future ESP32S3.
    
    Adds some new APIs:
    
    For all chips:
    
    void touchAttachInterruptArg(uint8_t pin, void (*userFunc)(void*), void *arg, uint32_t threshold);
    This function allows the user to add and pass a void* parameter to the ISR user callback.
    
    void touchDetachInterrupt(uint8_t pin);
    This function detaches ISR call back for the touch pad pin.
    
    Only ESP32 chip
    
    void touchInterruptSetThresholdDirection(bool mustbeLower);
    This function allows the user to set if the ISR callback will be activated when the touch sensor readings are lower or higher than the threshold defined. See example TouchButton.ino.
    
    Only ESP32-S2 and ESP32-S3 chips
    
    bool touchInterruptGetLastStatus(uint8_t pin);
    This function reports if the touch pad pin is touched or untouched. It can be used with ISR to identify when it is touched and untouched (released). See example TouchButtonV2.ino.
    
    Impact
    
    None. ll original APIs and examples now run on ESP32 and ESP32-S2.
    
    Related links
    
    Fix #6095
    Fix #6034
    Fix #5799
    Fix #5745
    Fix #5527
    Fix #5493
    Fix #4321
    Fix #4044
    Fix #2722
    Fix #2625
    0ea485e5
.skip.esp32s2 0 字节