mirror of
https://github.com/0xFEEDC0DE64/arduino-esp32.git
synced 2025-07-12 10:16:30 +02:00
Update IDF to aaf1239 (#1539)
* fix sdmmc config * Fix warnings in EEPROM from @Curclamas * remove leftover TAG in EEPROM * Initial add of @stickbreaker i2c * Add log_n * fix warnings when log is off * i2c code clean up and reorganization * add flags to interrupt allocator * fix sdmmc config * Fix warnings in EEPROM from @Curclamas * remove leftover TAG in EEPROM * fix errors with latest IDF * fix debug optimization (#1365) incorrect optimization for debugging tick markers. * Fix some missing BT header * Change BTSerial log calls * Update BLE lib * Arduino-ESP32 release management scripted (#1515) * Calculate an absolute path for a custom partitions table (#1452) * * Arduino-ESP32 release management scripted (ready-to-merge) * * secure env for espressif/arduino-esp32 * * build tests enabled * gitter webhook enabled * * gitter room link fixed * better comment * * filepaths fixed * BT Serial adjustments * * don't run sketch builds & tests for tagged builds * Return false from WiFi.hostByName() if hostname is not resolved * Free BT Memory when BT is not used * WIFI_MODE_NULL is not supported anymore * Select some key examples to build with PlatformIO to save some time * Update BLE lib * Fixed BLE lib * Major WiFi overhaul - auto reconnect on connection loss now works - moved to event groups - some code clean up and procedure optimizations - new methods to get a more elaborate system ststus * Add cmake tests to travis * Add initial AsyncUDP * Add NetBIOS lib and fix CMake includes * Add Initial WebServer * Fix WebServer and examples * travis not quiting on build fail * Try different travis build * Update IDF to aaf1239 * Fix WPS Example * fix script permission and add some fail tests to sketch builder * Add missing space in WiFiClient::write(Stream &stream)
This commit is contained in:
@ -103,14 +103,17 @@ typedef enum {
|
||||
typedef intr_handle_t touch_isr_handle_t;
|
||||
|
||||
#define TOUCH_PAD_SLEEP_CYCLE_DEFAULT (0x1000) /*!<The timer frequency is RTC_SLOW_CLK (can be 150k or 32k depending on the options), max value is 0xffff */
|
||||
#define TOUCH_PAD_MEASURE_CYCLE_DEFAULT (0xffff) /*!<The timer frequency is 8Mhz, the max value is 0xffff */
|
||||
#define TOUCH_FSM_MODE_DEFAULT (TOUCH_FSM_MODE_TIMER) /*!<The touch FSM my be started by the software or timer */
|
||||
#define TOUCH_PAD_MEASURE_CYCLE_DEFAULT (0x7fff) /*!<The timer frequency is 8Mhz, the max value is 0x7fff */
|
||||
#define TOUCH_PAD_MEASURE_WAIT_DEFAULT (0xFF) /*!<The timer frequency is 8Mhz, the max value is 0xff */
|
||||
#define TOUCH_FSM_MODE_DEFAULT (TOUCH_FSM_MODE_SW) /*!<The touch FSM my be started by the software or timer */
|
||||
#define TOUCH_TRIGGER_MODE_DEFAULT (TOUCH_TRIGGER_BELOW) /*!<Interrupts can be triggered if sensor value gets below or above threshold */
|
||||
#define TOUCH_TRIGGER_SOURCE_DEFAULT (TOUCH_TRIGGER_SOURCE_SET1) /*!<The wakeup trigger source can be SET1 or both SET1 and SET2 */
|
||||
#define TOUCH_PAD_BIT_MASK_MAX (0x3ff)
|
||||
|
||||
/**
|
||||
* @brief Initialize touch module.
|
||||
* @note The default FSM mode is 'TOUCH_FSM_MODE_SW'. If you want to use interrupt trigger mode,
|
||||
* then set it using function 'touch_pad_set_fsm_mode' to 'TOUCH_FSM_MODE_TIMER' after calling 'touch_pad_init'.
|
||||
* @return
|
||||
* - ESP_OK Success
|
||||
* - ESP_FAIL Touch pad init error
|
||||
@ -127,8 +130,12 @@ esp_err_t touch_pad_deinit();
|
||||
|
||||
/**
|
||||
* @brief Configure touch pad interrupt threshold.
|
||||
*
|
||||
* @note If FSM mode is set to TOUCH_FSM_MODE_TIMER, this function will be blocked for one measurement cycle and wait for data to be valid.
|
||||
*
|
||||
* @param touch_num touch pad index
|
||||
* @param threshold interrupt threshold,
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK Success
|
||||
* - ESP_ERR_INVALID_ARG if argument wrong
|
||||
@ -138,34 +145,82 @@ esp_err_t touch_pad_config(touch_pad_t touch_num, uint16_t threshold);
|
||||
|
||||
/**
|
||||
* @brief get touch sensor counter value.
|
||||
* Each touch sensor has a counter to count the number of charge/discharge cycles.
|
||||
* When the pad is not 'touched', we can get a number of the counter.
|
||||
* When the pad is 'touched', the value in counter will get smaller because of the larger equivalent capacitance.
|
||||
* User can use this function to determine the interrupt trigger threshold.
|
||||
* Each touch sensor has a counter to count the number of charge/discharge cycles.
|
||||
* When the pad is not 'touched', we can get a number of the counter.
|
||||
* When the pad is 'touched', the value in counter will get smaller because of the larger equivalent capacitance.
|
||||
*
|
||||
* @note This API requests hardware measurement once. If IIR filter mode is enabled,
|
||||
* please use 'touch_pad_read_raw_data' interface instead.
|
||||
*
|
||||
* @param touch_num touch pad index
|
||||
* @param touch_value pointer to accept touch sensor value
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK Success
|
||||
* - ESP_ERR_INVALID_ARG Touch pad error
|
||||
* - ESP_ERR_INVALID_ARG Touch pad parameter error
|
||||
* - ESP_ERR_INVALID_STATE This touch pad hardware connection is error, the value of "touch_value" is 0.
|
||||
* - ESP_FAIL Touch pad not initialized
|
||||
*/
|
||||
esp_err_t touch_pad_read(touch_pad_t touch_num, uint16_t * touch_value);
|
||||
|
||||
/**
|
||||
* @brief get filtered touch sensor counter value by IIR filter.
|
||||
*
|
||||
* @note touch_pad_filter_start has to be called before calling touch_pad_read_filtered.
|
||||
* This function can be called from ISR
|
||||
*
|
||||
* @param touch_num touch pad index
|
||||
* @param touch_value pointer to accept touch sensor value
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK Success
|
||||
* - ESP_ERR_INVALID_ARG Touch pad error
|
||||
* - ESP_ERR_INVALID_ARG Touch pad parameter error
|
||||
* - ESP_ERR_INVALID_STATE This touch pad hardware connection is error, the value of "touch_value" is 0.
|
||||
* - ESP_FAIL Touch pad not initialized
|
||||
*/
|
||||
esp_err_t touch_pad_read_filtered(touch_pad_t touch_num, uint16_t *touch_value);
|
||||
|
||||
/**
|
||||
* @brief get raw data (touch sensor counter value) from IIR filter process.
|
||||
* Need not request hardware measurements.
|
||||
*
|
||||
* @note touch_pad_filter_start has to be called before calling touch_pad_read_raw_data.
|
||||
* This function can be called from ISR
|
||||
*
|
||||
* @param touch_num touch pad index
|
||||
* @param touch_value pointer to accept touch sensor value
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK Success
|
||||
* - ESP_ERR_INVALID_ARG Touch pad parameter error
|
||||
* - ESP_ERR_INVALID_STATE This touch pad hardware connection is error, the value of "touch_value" is 0.
|
||||
* - ESP_FAIL Touch pad not initialized
|
||||
*/
|
||||
esp_err_t touch_pad_read_raw_data(touch_pad_t touch_num, uint16_t *touch_value);
|
||||
|
||||
/**
|
||||
* @brief Callback function that is called after each IIR filter calculation.
|
||||
* @note This callback is called in timer task in each filtering cycle.
|
||||
* @note This callback should not be blocked.
|
||||
* @param raw_value The latest raw data(touch sensor counter value) that
|
||||
* points to all channels(raw_value[0..TOUCH_PAD_MAX-1]).
|
||||
* @param filtered_value The latest IIR filtered data(calculated from raw data) that
|
||||
* points to all channels(filtered_value[0..TOUCH_PAD_MAX-1]).
|
||||
*
|
||||
*/
|
||||
typedef void (* filter_cb_t)(uint16_t *raw_value, uint16_t *filtered_value);
|
||||
|
||||
/**
|
||||
* @brief Register the callback function that is called after each IIR filter calculation.
|
||||
* @note The 'read_cb' callback is called in timer task in each filtering cycle.
|
||||
* @param read_cb Pointer to filtered callback function.
|
||||
* If the argument passed in is NULL, the callback will stop.
|
||||
* @return
|
||||
* - ESP_OK Success
|
||||
* - ESP_ERR_INVALID_ARG set error
|
||||
*/
|
||||
esp_err_t touch_pad_set_filter_read_cb(filter_cb_t read_cb);
|
||||
|
||||
/**
|
||||
* @brief Register touch-pad ISR,
|
||||
* @note Deprecated function, users should replace this with touch_pad_isr_register,
|
||||
@ -177,6 +232,7 @@ esp_err_t touch_pad_read_filtered(touch_pad_t touch_num, uint16_t *touch_value);
|
||||
* @return
|
||||
* - ESP_OK Success ;
|
||||
* - ESP_ERR_INVALID_ARG GPIO error
|
||||
* - ESP_ERR_NO_MEM No memory
|
||||
*/
|
||||
esp_err_t touch_pad_isr_handler_register(void(*fn)(void *), void *arg, int unused, intr_handle_t *handle_unused) __attribute__ ((deprecated));
|
||||
|
||||
@ -188,6 +244,7 @@ esp_err_t touch_pad_isr_handler_register(void(*fn)(void *), void *arg, int unuse
|
||||
* @return
|
||||
* - ESP_OK Success ;
|
||||
* - ESP_ERR_INVALID_ARG GPIO error
|
||||
* - ESP_ERR_NO_MEM No memory
|
||||
*/
|
||||
esp_err_t touch_pad_isr_register(intr_handler_t fn, void* arg);
|
||||
|
||||
@ -462,8 +519,6 @@ esp_err_t touch_pad_get_filter_period(uint32_t* p_period_ms);
|
||||
* when detecting slight change of capacitance.
|
||||
* Need to call touch_pad_filter_start before all touch filter APIs
|
||||
*
|
||||
* If filter is not initialized, this API will initialize the filter with given period.
|
||||
* If filter is already initialized, this API will update the filter period.
|
||||
* @note This filter uses FreeRTOS timer, which is dispatched from a task with
|
||||
* priority 1 by default on CPU 0. So if some application task with higher priority
|
||||
* takes a lot of CPU0 time, then the quality of data obtained from this filter will be affected.
|
||||
|
Reference in New Issue
Block a user