esp-idf/components/hal/esp32/include/hal/touch_sensor_hal.h
Planck (Lu Zeyu) 333553caf2 fix(hal): check the public header files and fix violations
fix(hal/include): fix header violations in hal component
fix(hal/include): Move type definitions from `xx_hal.h` to `xx_types.h`
fix(hal/include): Move type definitions from `xx_hal.h` to `xx_types.h`
fix(hal/include): Add comment for a far away `#endif`
fix(hal/include): change scope for cpp guard
ci: Remove components/hal/ comment from public headers check exceptions
Add missing include macro sdkconfig.h for header files
Add missing include macro stdbool.h for header files
Add missing include macro stdint.h for header files
Add missing capability guard macro for header files
Add missing cpp guard macro for header files
Remove some useless include macros
Add some missing `inline` attribute for functions defined in header files
Remove components/hal/ from public headers check exceptions
fix(hal/include): fix invalid licenses
fix(hal/include): fix invalid licenses
fix(hal/include): add missing soc_caps.h
fix(hal): include soc_caps.h before cap macro is used
fix(hal): Remove unnecessary target check
fix(hal): fix header and macro problems
Add missing include macro
Remove loop dependency in hal
Add comment for far-away endif
fix(hal): Add missing soc_caps.h
ci: update check_copyright_ignore.txt
Change the sequence of `#include` macro, cpp guard macro
Change the wrap scope of capacity macro

fix(hal): Change position of C++ guard to pass test
2023-07-05 17:33:32 +08:00

128 lines
4.0 KiB
C

/*
* SPDX-FileCopyrightText: 2019-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/*******************************************************************************
* NOTICE
* The hal is not public api, don't use in application code.
* See readme.md in hal/include/hal/readme.md
******************************************************************************/
// The HAL layer for touch sensor (esp32 specific part)
#pragma once
#include "hal/touch_sensor_ll.h"
#include "hal/touch_sensor_types.h"
#include_next "hal/touch_sensor_hal.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* Set touch sensor measurement time.
*
* @param meas_time The duration of the touch sensor measurement.
* t_meas = meas_time / (8MHz), the maximum measure time is 0xffff / 8M = 8.19 ms.
*/
#define touch_hal_set_meas_time(meas_time) touch_ll_set_meas_time(meas_time)
/**
* Get touch sensor measurement time.
*
* @param meas_time Pointer to accept measurement cycle count.
*/
#define touch_hal_get_meas_time(meas_time) touch_ll_get_meas_time(meas_time)
/**
* Set touch sensor interrupt trigger mode.
* Interrupt can be triggered either when touch value is less than
* threshold or when touch value is more than threshold.
*
* @param mode Touch sensor interrupt trigger mode.
*/
#define touch_hal_set_trigger_mode(mode) touch_ll_set_trigger_mode(mode)
/**
* Get touch sensor interrupt trigger mode.
* Interrupt can be triggered either when touch value is less than
* threshold or when touch value is more than threshold.
*
* @param mode Touch sensor interrupt trigger mode.
*/
#define touch_hal_get_trigger_mode(mode) touch_ll_get_trigger_mode(mode)
/**
* Set touch sensor interrupt trigger source. There are two sets of touch signals.
* Set1 and set2 can be mapped to several touch signals. Either set will be triggered
* if at least one of its touch signal is 'touched'. The interrupt can be configured to be generated
* if set1 is triggered, or only if both sets are triggered.
*
* @param src Touch sensor interrupt trigger source.
*/
#define touch_hal_set_trigger_source(src) touch_ll_set_trigger_source(src)
/**
* Get touch sensor interrupt trigger source.
*
* @param src Pointer to accept touch sensor interrupt trigger source.
*/
#define touch_hal_get_trigger_source(src) touch_ll_get_trigger_source(src)
/**
* Set touch sensor group mask.
* Touch pad module has two sets of signals, 'Touched' signal is triggered only if
* at least one of touch pad in this group is "touched".
* This function will set the register bits according to the given bitmask.
*
* @param set1_mask bitmask of touch sensor signal group1, it's a 10-bit value
* @param set2_mask bitmask of touch sensor signal group2, it's a 10-bit value
*/
#define touch_hal_set_group_mask(group1_mask, group2_mask) touch_ll_set_group_mask(group1_mask, group2_mask)
/**
* Get touch sensor group mask.
*
* @param set1_mask pointer to accept bitmask of touch sensor signal group1, it's a 10-bit value
* @param set2_mask pointer to accept bitmask of touch sensor signal group2, it's a 10-bit value
*/
#define touch_hal_get_group_mask(group1_mask, group2_mask) touch_ll_get_group_mask(group1_mask, group2_mask)
/**
* Clear touch sensor group mask.
*
* @param set1_mask pointer to accept bitmask of touch sensor signal group1, it's a 10-bit value
* @param set2_mask pointer to accept bitmask of touch sensor signal group2, it's a 10-bit value
*/
#define touch_hal_clear_group_mask(group1_mask, group2_mask) touch_ll_clear_group_mask(group1_mask, group2_mask)
/**
* To enable touch pad interrupt.
*/
#define touch_hal_intr_enable() touch_ll_intr_enable()
/**
* To disable touch pad interrupt.
*/
#define touch_hal_intr_disable() touch_ll_intr_disable()
/**
* To clear touch pad interrupt.
*/
#define touch_hal_intr_clear() touch_ll_intr_clear()
/**
* Get the touch pad which caused wakeup from deep sleep.
*
* @param pad_num pointer to touch pad which caused wakeup.
*/
void touch_hal_get_wakeup_status(touch_pad_t *pad_num);
#ifdef __cplusplus
}
#endif