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:
laokaiyao
2022-06-01 15:41:31 +08:00
committed by Kevin (Lao Kaiyao)
parent 0b0befc2a6
commit d5e55e0563
14 changed files with 379 additions and 66 deletions

View File

@@ -90,25 +90,55 @@ 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_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(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_ENTER_CRITICAL();
touch_hal_get_measure_times(meas_times);
touch_hal_get_sleep_time(sleep_cycle);
TOUCH_EXIT_CRITICAL();
touch_pad_get_measurement_interval(sleep_cycle);
touch_pad_get_charge_discharge_times(meas_times);
return ESP_OK;
}