ESP32_RTOS_SDK V1.1.0

- Main Page
- Modules
- Data Structures
- Files

Enumerations | Functions
Sensor APIs

Temperature Sensor and Touch pad Sensor APIs. More...

## Enumerations

enum | touch_sensor_pad { TOUCH_SENSOR_PAD0 = BIT0, TOUCH_SENSOR_PAD1 = BIT1, TOUCH_SENSOR_PAD2 = BIT2, TOUCH_SENSOR_PAD3 = BIT3, TOUCH_SENSOR_PAD4 = BIT4, TOUCH_SENSOR_PAD5 = BIT5, TOUCH_SENSOR_PAD6 = BIT6, TOUCH_SENSOR_PAD7 = BIT7, TOUCH_SENSOR_PAD8 = BIT8, TOUCH_SENSOR_PAD9 = BIT9
}

## Functions

uint8 | temperature_sensor_read (void)
| Read value from temperature sensor. More...
void | touch_sensor_init (touch_sensor_pad pad)
| Initialize touch pad sensor. More...
void | touch_sensor_read (uint16 *pad_out, uint16 sample_num)
| Read value from touch pad sensor. More...

## Detailed Description

Temperature Sensor and Touch pad Sensor APIs.

## Function Documentation

uint8 temperature_sensor_read | ( | void |  | ) |

Read value from temperature sensor.

Parameters

  null |

Returns
  range [0, 255]

void touch_sensor_init | ( | touch_sensor_pad | pad | ) |

Initialize touch pad sensor.

Parameters

  touch_sensor_pad | pad : enable the corresponding touch_pad[9:0]

Returns
  null

void touch_sensor_read | ( | uint16 * | pad_out,
|  | uint16 | sample_num
| ) |  |

Read value from touch pad sensor.

Example:

            uint16 pad_out[10];
            uint16 sample_num = 10000;
            rtc_touch_read(pad_out, sample_num);

Parameters

  uint16 | *pad_out : pointer of the start address of uint16 pad_out[10], to get the value from touch pad sensor (touch_pad[9:0]).
  uint16 | sample_num : range [0, 65535], meaturing time of touch pad = sample_num*(1/RTC_CLK)

Returns
  null