* drivers/input/tsc2007.h
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
* screen device.
* All peripheral functions are controlled through the command byte and
* onboard state machines.
*/
* "1.2V to 3.6V, 12-Bit, Nanopower, 4-Wire Micro TOUCH SCREEN CONTROLLER
* with I2C Interface," SBAS405A March 2007, Revised, March 2009, Texas
* Instruments Incorporated
*/
#ifndef __DRIVERS_INPUT_TSC2007_H
#define __DRIVERS_INPUT_TSC2007_H
* Included Files
****************************************************************************/
* Pre-processor Definitions
****************************************************************************/
#define TSC2007_ADDRESS_MASK (0xf8)
#define TSC2007_ADDRESS (0x90)
#define TSC2007_A1 (1 << 2)
#define TSC2007_A0 (1 << 1)
#define TSC2007_READ (1 << 0)
#define TSC2007_WRITE (0)
#define TSC2007_CMD_FUNC_SHIFT (4)
#define TSC2007_CMD_FUNC_MASK (15 << TSC2007_CMD_FUNC_SHIFT)
# define TSC2007_CMD_FUNC_TEMP0 (0 << TSC2007_CMD_FUNC_SHIFT)
# define TSC2007_CMD_FUNC_AUX (2 << TSC2007_CMD_FUNC_SHIFT)
# define TSC2007_CMD_FUNC_TEMP1 (4 << TSC2007_CMD_FUNC_SHIFT)
# define TSC2007_CMD_FUNC_XON (8 << TSC2007_CMD_FUNC_SHIFT)
# define TSC2007_CMD_FUNC_YON (9 << TSC2007_CMD_FUNC_SHIFT)
# define TSC2007_CMD_FUNC_YXON (10 << TSC2007_CMD_FUNC_SHIFT)
# define TSC2007_CMD_FUNC_SETUP (11 << TSC2007_CMD_FUNC_SHIFT)
# define TSC2007_CMD_FUNC_XPOS (12 << TSC2007_CMD_FUNC_SHIFT)
# define TSC2007_CMD_FUNC_YPOS (13 << TSC2007_CMD_FUNC_SHIFT)
# define TSC2007_CMD_FUNC_Z1POS (14 << TSC2007_CMD_FUNC_SHIFT)
# define TSC2007_CMD_FUNC_Z2POS (15 << TSC2007_CMD_FUNC_SHIFT)
#define TSC2007_CMD_PWRDN_SHIFT (2)
#define TSC2007_CMD_PWRDN_MASK (3 << TSC2007_CMD_PWRDN_SHIFT)
# define TSC2007_CMD_PWRDN_IRQEN (0 << TSC2007_CMD_PWRDN_SHIFT)
# define TSC2007_CMD_ADCON_IRQDIS (1 << TSC2007_CMD_PWRDN_SHIFT)
# define TSC2007_CMD_ADCOFF_IRQEN (2 << TSC2007_CMD_PWRDN_SHIFT)
#define TSC2007_CMD_12BIT (0)
#define TSC2007_CMD_8BIT (1 << 1)
#define TSC2007_SETUP_CMD TSC2007_CMD_FUNC_SETUP
#define TSC2007_CMD_USEMAV (0)
#define TSC2007_CMD_BYPASSMAV (1 << 1)
#define TSC2007_CMD_PU_50KOHM (0)
#define TSC2007_CMD_PU_90KOHM (1 << 1)
* Public Types
****************************************************************************/
* Public Function Prototypes
****************************************************************************/
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
#undef EXTERN
#ifdef __cplusplus
}
#endif
#endif