mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-24 17:27:21 +00:00
touch_sensor: add description to distinguish the API on different target
Closes https://github.com/espressif/esp-idf/issues/9067
This commit is contained in:

committed by
Kevin (Lao Kaiyao)

parent
0b0befc2a6
commit
d5e55e0563
@@ -116,26 +116,58 @@ esp_err_t touch_pad_isr_register(intr_handler_t fn, void *arg, touch_pad_intr_ma
|
||||
return ret;
|
||||
}
|
||||
|
||||
esp_err_t touch_pad_set_meas_time(uint16_t sleep_cycle, uint16_t meas_times)
|
||||
esp_err_t touch_pad_set_measurement_interval(uint16_t interval_cycle)
|
||||
{
|
||||
TOUCH_ENTER_CRITICAL();
|
||||
touch_hal_set_meas_times(meas_times);
|
||||
touch_hal_set_sleep_time(sleep_cycle);
|
||||
touch_hal_set_sleep_time(interval_cycle);
|
||||
TOUCH_EXIT_CRITICAL();
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t touch_pad_get_measurement_interval(uint16_t *interval_cycle)
|
||||
{
|
||||
TOUCH_NULL_POINTER_CHECK(interval_cycle, "interval_cycle");
|
||||
TOUCH_ENTER_CRITICAL();
|
||||
touch_hal_get_sleep_time(interval_cycle);
|
||||
TOUCH_EXIT_CRITICAL();
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t touch_pad_set_charge_discharge_times(uint16_t charge_discharge_times)
|
||||
{
|
||||
TOUCH_ENTER_CRITICAL();
|
||||
touch_hal_set_meas_times(charge_discharge_times);
|
||||
TOUCH_EXIT_CRITICAL();
|
||||
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t touch_pad_get_meas_time(uint16_t *sleep_cycle, uint16_t *meas_times)
|
||||
esp_err_t touch_pad_get_charge_discharge_times(uint16_t *charge_discharge_times)
|
||||
{
|
||||
TOUCH_NULL_POINTER_CHECK(charge_discharge_times, "charge_discharge_times");
|
||||
TOUCH_ENTER_CRITICAL();
|
||||
touch_hal_get_measure_times(meas_times);
|
||||
touch_hal_get_sleep_time(sleep_cycle);
|
||||
touch_hal_get_measure_times(charge_discharge_times);
|
||||
TOUCH_EXIT_CRITICAL();
|
||||
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t touch_pad_set_meas_time(uint16_t sleep_cycle, uint16_t meas_times)
|
||||
{
|
||||
touch_pad_set_charge_discharge_times(meas_times);
|
||||
touch_pad_set_measurement_interval(sleep_cycle);
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t touch_pad_get_meas_time(uint16_t *sleep_cycle, uint16_t *meas_times)
|
||||
{
|
||||
TOUCH_NULL_POINTER_CHECK(sleep_cycle, "sleep_cycle");
|
||||
TOUCH_NULL_POINTER_CHECK(meas_times, "meas_times");
|
||||
touch_pad_get_measurement_interval(sleep_cycle);
|
||||
touch_pad_get_charge_discharge_times(meas_times);
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t touch_pad_set_idle_channel_connect(touch_pad_conn_type_t type)
|
||||
{
|
||||
ESP_RETURN_ON_FALSE(type < TOUCH_PAD_CONN_MAX, ESP_ERR_INVALID_ARG, TOUCH_TAG, TOUCH_PARAM_CHECK_STR("type"));
|
||||
|
Reference in New Issue
Block a user