1 /* Freescale Semiconductor Inc.
2 * (c) Copyright 2004-2005 Freescale Semiconductor, Inc.
3 * (c) Copyright 2001-2004 Motorola, Inc.
5 * mbed Microcontroller Library
6 * (c) Copyright 2009-2012 ARM Limited.
8 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
9 * and associated documentation files (the "Software"), to deal in the Software without
10 * restriction, including without limitation the rights to use, copy, modify, merge, publish,
11 * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included in all copies or
15 * substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
18 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
20 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32 * #include "TSISensor.h"
35 * PwmOut led(LED_GREEN);
39 * led = 1.0 - tsi.readPercentage();
48 * Initialize the TSI Touch Sensor
53 * Read Touch Sensor percentage value
55 * @returns percentage value between [0 ... 1]
57 float readPercentage();
60 * Read Touch Sensor distance
62 * @returns distance in mm. The value is between [0 ... 40]
64 uint8_t readDistance();
65 uint16_t readValue(uint8_t);
66 void TSISensor_reset(void);
69 void sliderRead(void);
70 void selfCalibration(void);