| FRDM-KW40Z Demo Software Reference Manual Rev 0.0 NXP Semiconductors |

Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
TSI Sensor
Input Report

## Overview

TSI Sensor implements functions to detect touch events in capacitive pads.

## Data Structures
union | tsi_sensor_electrode_flags_t
struct | tsi_sensor_electrode_flags_t.activeFlag
struct | tsi_sensor_electrode_data_t

## Macros
#define | TSI_SENSOR_THRESHOLD_ADDER

## Typedefs
typedef void(* | tsi_sensor_callback_t) (tsi_sensor_electrode_flags_t *pElectrodeFlags)

## Enumerations
enum | tsi_sensor_status_t { kTsiOk, kTsiInitError, kTsiStartError }

## Functions
tsi_sensor_status_t | tsi_sensor_init (tsi_sensor_callback_t pCallbackFunc)
tsi_sensor_status_t | tsi_sensor_start_single_measurement (void)

## Variables
tsi_sensor_electrode_flags_t | tsiSensorActiveElectrodeFlag

## Data Structure Documentation

union tsi_sensor_electrode_flags_t

TSI Electrode flags array.

Data Fields
uint16_t | overallFlagStatus | Status of all TSI flags.
struct tsi_sensor_electrode_flags_t | activeFlag | Status of each TSI flag.

struct tsi_sensor_electrode_flags_t.activeFlag

Data Fields
uint16_t | electrode1: 1 |
uint16_t | electrode2: 1 |
uint16_t | electrode3: 1 |
uint16_t | electrode4: 1 |
uint16_t | electrode5: 1 |
uint16_t | electrode6: 1 |
uint16_t | electrode7: 1 |
uint16_t | electrode8: 1 |
uint16_t | electrode9: 1 |
uint16_t | electrode10: 1 |
uint16_t | electrode11: 1 |
uint16_t | electrode12: 1 |
uint16_t | electrode13: 1 |
uint16_t | electrode14: 1 |
uint16_t | electrode15: 1 |
uint16_t | electrode16: 1 |

struct tsi_sensor_electrode_data_t

TSI electrode data structure.

Data Fields
uint8_t | channel | Electrode channel.
uint16_t | threshold | Electrode threshold.

## Macro Definition Documentation

#define TSI_SENSOR_THRESHOLD_ADDER

Threshold value to detect a touch event.

## Typedef Documentation

typedef void(* tsi_sensor_callback_t) (tsi_sensor_electrode_flags_t *pElectrodeFlags)

TSI Sensor callback function type.

## Enumeration Type Documentation

enum tsi_sensor_status_t

TSI Sensor return status for functions.

Enumerator
kTsiOk | No error.
kTsiInitError | Error initializing the module.
kTsiStartError | Error starting the measurements.

## Function Documentation

tsi_sensor_status_t tsi_sensor_init | ( | tsi_sensor_callback_t | pCallbackFunc | ) |

Initializes the TSI sensor.

Parameters

  [in] | Function | to execute when a TSI touch is sensed.

Returns
  tsi_sensor_status_t Error status.

tsi_sensor_status_t tsi_sensor_start_single_measurement | ( | void |  | ) |

Starts a single TSI sensor measurement.

Parameters

  [in] | None. |

Returns
  tsi_sensor_status_t Error status.

## Variable Documentation

tsi_sensor_electrode_flags_t tsiSensorActiveElectrodeFlag

TSI electrode flags.