Zephyr API Documentation 4.4.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Sensor-state values used by the Microchip PTC driver. More...

Macros

#define QTM_KEY_STATE_DISABLE   0x00u
 Disabled sensor state.
 
#define QTM_KEY_STATE_INIT   0x01u
 Sensor initialization state.
 
#define QTM_KEY_STATE_CAL   0x02u
 Sensor calibration state.
 
#define QTM_KEY_STATE_NO_DET   0x03u
 No-touch-detected sensor state.
 
#define QTM_KEY_STATE_FILT_IN   0x04u
 Touch filter-in state.
 
#define QTM_KEY_STATE_DETECT   0x85u
 Touch-detected sensor state.
 
#define QTM_KEY_STATE_FILT_OUT   0x86u
 Touch filter-out state.
 
#define QTM_KEY_STATE_ANTI_TCH   0x07u
 Anti-touch sensor state.
 
#define QTM_KEY_STATE_SUSPEND   0x08u
 Sensor suspend state.
 
#define QTM_KEY_STATE_CAL_ERR   0x09u
 Sensor calibration-error state.
 
#define KEY_TOUCHED_MASK   0x80u
 Mask for the logical in-detect state.
 

Functions

uint16_t get_sensor_node_signal (const struct device *dev, uint16_t sensor_node)
 Get the signal value of a sensor node.
 
void update_sensor_node_signal (const struct device *dev, uint16_t sensor_node, uint16_t new_signal)
 Update the signal value of a sensor node.
 
uint16_t get_sensor_node_reference (const struct device *dev, uint16_t sensor_node)
 Get the reference value of a sensor node.
 
void update_sensor_node_reference (const struct device *dev, uint16_t sensor_node, uint16_t new_reference)
 Update the reference value of a sensor node.
 
uint16_t get_sensor_cc_val (const struct device *dev, uint16_t sensor_node)
 Get the compensation capacitance of a sensor node.
 
void update_sensor_cc_val (const struct device *dev, uint16_t sensor_node, uint16_t new_cc_value)
 Update the compensation capacitance of a sensor node.
 
uint8_t get_sensor_state (const struct device *dev, uint16_t sensor_node)
 Get the state of a sensor node.
 
void update_sensor_state (const struct device *dev, uint16_t sensor_node, uint8_t new_state)
 Update the state of a sensor node.
 
void calibrate_node (const struct device *dev, uint16_t sensor_node)
 Calibrate a sensor node.
 
void suspend_sensor (const struct device *dev, uint16_t sensor_node)
 Suspend a sensor node.
 
void resume_sensor (const struct device *dev, uint16_t sensor_node)
 Resume a suspended sensor node.
 
uint8_t get_def_no_of_sensors (const struct device *dev)
 Get the number of configured sensor nodes.
 
uint8_t get_scroller_state (const struct device *dev, uint16_t sensor_node)
 Get the state of a scroller sensor.
 
uint16_t get_scroller_position (const struct device *dev, uint16_t sensor_node)
 Get the position of a scroller sensor.
 

Detailed Description

Sensor-state values used by the Microchip PTC driver.

Macro Definition Documentation

◆ KEY_TOUCHED_MASK

#define KEY_TOUCHED_MASK   0x80u

#include <zephyr/input/input_mchp_touch_api.h>

Mask for the logical in-detect state.

Bit 7 indicates that the sensor is in a touch-detection state. This bit is set for the detect and filter-out states.

◆ QTM_KEY_STATE_ANTI_TCH

#define QTM_KEY_STATE_ANTI_TCH   0x07u

#include <zephyr/input/input_mchp_touch_api.h>

Anti-touch sensor state.

The sensor is in the anti-touch state.

◆ QTM_KEY_STATE_CAL

#define QTM_KEY_STATE_CAL   0x02u

#include <zephyr/input/input_mchp_touch_api.h>

Sensor calibration state.

The sensor is undergoing calibration.

◆ QTM_KEY_STATE_CAL_ERR

#define QTM_KEY_STATE_CAL_ERR   0x09u

#include <zephyr/input/input_mchp_touch_api.h>

Sensor calibration-error state.

The sensor calibration operation failed.

◆ QTM_KEY_STATE_DETECT

#define QTM_KEY_STATE_DETECT   0x85u

#include <zephyr/input/input_mchp_touch_api.h>

Touch-detected sensor state.

An active touch is detected on the sensor.

◆ QTM_KEY_STATE_DISABLE

#define QTM_KEY_STATE_DISABLE   0x00u

#include <zephyr/input/input_mchp_touch_api.h>

Disabled sensor state.

Measurement is disabled for the sensor.

◆ QTM_KEY_STATE_FILT_IN

#define QTM_KEY_STATE_FILT_IN   0x04u

#include <zephyr/input/input_mchp_touch_api.h>

Touch filter-in state.

A confirmation scan is in progress to verify that a touch has occurred.

◆ QTM_KEY_STATE_FILT_OUT

#define QTM_KEY_STATE_FILT_OUT   0x86u

#include <zephyr/input/input_mchp_touch_api.h>

Touch filter-out state.

A confirmation scan is in progress to verify that the touch has ended.

◆ QTM_KEY_STATE_INIT

#define QTM_KEY_STATE_INIT   0x01u

#include <zephyr/input/input_mchp_touch_api.h>

Sensor initialization state.

The sensor is being initialized.

◆ QTM_KEY_STATE_NO_DET

#define QTM_KEY_STATE_NO_DET   0x03u

#include <zephyr/input/input_mchp_touch_api.h>

No-touch-detected sensor state.

No active touch is detected on the sensor.

◆ QTM_KEY_STATE_SUSPEND

#define QTM_KEY_STATE_SUSPEND   0x08u

#include <zephyr/input/input_mchp_touch_api.h>

Sensor suspend state.

The sensor is suspended.

Function Documentation

◆ calibrate_node()

void calibrate_node ( const struct device dev,
uint16_t  sensor_node 
)

#include <zephyr/input/input_mchp_touch_api.h>

Calibrate a sensor node.

This function starts the calibration process for the specified sensor node.

Parameters
devPointer to the PTC device.
sensor_nodeSensor node number.

◆ get_def_no_of_sensors()

uint8_t get_def_no_of_sensors ( const struct device dev)

#include <zephyr/input/input_mchp_touch_api.h>

Get the number of configured sensor nodes.

Parameters
devPointer to the PTC device.
Returns
The total number of configured sensor nodes.

◆ get_scroller_position()

uint16_t get_scroller_position ( const struct device dev,
uint16_t  sensor_node 
)

#include <zephyr/input/input_mchp_touch_api.h>

Get the position of a scroller sensor.

Parameters
devPointer to the PTC device.
sensor_nodeSensor node number associated with the scroller.
Returns
The current scroller position.

◆ get_scroller_state()

uint8_t get_scroller_state ( const struct device dev,
uint16_t  sensor_node 
)

#include <zephyr/input/input_mchp_touch_api.h>

Get the state of a scroller sensor.

Parameters
devPointer to the PTC device.
sensor_nodeSensor node number associated with the scroller.
Returns
The current scroller state.

◆ get_sensor_cc_val()

uint16_t get_sensor_cc_val ( const struct device dev,
uint16_t  sensor_node 
)

#include <zephyr/input/input_mchp_touch_api.h>

Get the compensation capacitance of a sensor node.

The compensation capacitance is also referred to as the CC value.

Parameters
devPointer to the PTC device.
sensor_nodeSensor node number.
Returns
The compensation capacitance value of the specified sensor node.

◆ get_sensor_node_reference()

uint16_t get_sensor_node_reference ( const struct device dev,
uint16_t  sensor_node 
)

#include <zephyr/input/input_mchp_touch_api.h>

Get the reference value of a sensor node.

Parameters
devPointer to the PTC device.
sensor_nodeSensor node number.
Returns
The reference value of the specified sensor node.

◆ get_sensor_node_signal()

uint16_t get_sensor_node_signal ( const struct device dev,
uint16_t  sensor_node 
)

#include <zephyr/input/input_mchp_touch_api.h>

Get the signal value of a sensor node.

Parameters
devPointer to the PTC device.
sensor_nodeSensor node number.
Returns
The signal value of the specified sensor node.

◆ get_sensor_state()

uint8_t get_sensor_state ( const struct device dev,
uint16_t  sensor_node 
)

#include <zephyr/input/input_mchp_touch_api.h>

Get the state of a sensor node.

Parameters
devPointer to the PTC device.
sensor_nodeSensor node number.
Returns
The current state of the specified sensor node. PTC Sensor States

◆ resume_sensor()

void resume_sensor ( const struct device dev,
uint16_t  sensor_node 
)

#include <zephyr/input/input_mchp_touch_api.h>

Resume a suspended sensor node.

This function resumes operation of the specified sensor node.

Parameters
devPointer to the PTC device.
sensor_nodeSensor node number.

◆ suspend_sensor()

void suspend_sensor ( const struct device dev,
uint16_t  sensor_node 
)

#include <zephyr/input/input_mchp_touch_api.h>

Suspend a sensor node.

This function suspends operation of the specified sensor node.

Parameters
devPointer to the PTC device.
sensor_nodeSensor node number.

◆ update_sensor_cc_val()

void update_sensor_cc_val ( const struct device dev,
uint16_t  sensor_node,
uint16_t  new_cc_value 
)

#include <zephyr/input/input_mchp_touch_api.h>

Update the compensation capacitance of a sensor node.

The compensation capacitance is also referred to as the CC value.

Parameters
devPointer to the PTC device.
sensor_nodeSensor node number.
new_cc_valueNew compensation capacitance value for the sensor node.

◆ update_sensor_node_reference()

void update_sensor_node_reference ( const struct device dev,
uint16_t  sensor_node,
uint16_t  new_reference 
)

#include <zephyr/input/input_mchp_touch_api.h>

Update the reference value of a sensor node.

Parameters
devPointer to the PTC device.
sensor_nodeSensor node number.
new_referenceNew reference value for the sensor node.

◆ update_sensor_node_signal()

void update_sensor_node_signal ( const struct device dev,
uint16_t  sensor_node,
uint16_t  new_signal 
)

#include <zephyr/input/input_mchp_touch_api.h>

Update the signal value of a sensor node.

Parameters
devPointer to the PTC device.
sensor_nodeSensor node number.
new_signalNew signal value for the sensor node.

◆ update_sensor_state()

void update_sensor_state ( const struct device dev,
uint16_t  sensor_node,
uint8_t  new_state 
)

#include <zephyr/input/input_mchp_touch_api.h>

Update the state of a sensor node.

Parameters
devPointer to the PTC device.
sensor_nodeSensor node number.
new_stateNew state for the sensor node. See PTC Sensor States for the valid values.
Note
The KEY_TOUCHED_MASK macro is a bit mask and is not a valid sensor-state value.