OK
This commit is contained in:
Regular → Executable
@@ -0,0 +1,570 @@
|
||||
#
|
||||
# For a description of the syntax of this configuration file,
|
||||
# see the file kconfig-language.txt in the NuttX tools repository.
|
||||
#
|
||||
|
||||
menuconfig INPUT
|
||||
bool "Input Device Support"
|
||||
default n
|
||||
---help---
|
||||
This directory holds implementations of input device drivers.
|
||||
This includes such things as touchscreen and keypad drivers.
|
||||
See include/nuttx/input/*.h for registration information.
|
||||
|
||||
if INPUT
|
||||
|
||||
config INPUT_MOUSE
|
||||
bool "Enable mouse support"
|
||||
default n
|
||||
---help---
|
||||
Enable support for mouse devices.
|
||||
|
||||
if INPUT_MOUSE
|
||||
|
||||
config INPUT_MOUSE_WHEEL
|
||||
bool "Enable mouse wheel support"
|
||||
default n
|
||||
---help---
|
||||
Enable support for a 4-button mouse report that includes a while
|
||||
position.
|
||||
|
||||
endif # INPUT_MOUSE
|
||||
|
||||
config INPUT_TOUCHSCREEN
|
||||
bool
|
||||
default n
|
||||
|
||||
config INPUT_MAX11802
|
||||
bool "MAX11802 touchscreen controller"
|
||||
default n
|
||||
select SPI
|
||||
select INPUT_TOUCHSCREEN
|
||||
---help---
|
||||
Enable support for the MAX11802 touchscreen controller
|
||||
|
||||
config INPUT_TSC2007
|
||||
bool "TI TSC2007 touchscreen controller"
|
||||
default n
|
||||
select I2C
|
||||
select INPUT_TOUCHSCREEN
|
||||
---help---
|
||||
Enable support for the TI TSC2007 touchscreen controller
|
||||
|
||||
if INPUT_TSC2007
|
||||
|
||||
config TSC2007_8BIT
|
||||
bool "TSC2007 8-bit Conversions"
|
||||
default n
|
||||
---help---
|
||||
Use faster, but less accurate, 8-bit conversions. Default: 12-bit conversions.
|
||||
|
||||
config TSC2007_MULTIPLE
|
||||
bool "Multiple TSC2007 Devices"
|
||||
default n
|
||||
---help---
|
||||
Can be defined to support multiple TSC2007 devices on board.
|
||||
|
||||
config TSC2007_NPOLLWAITERS
|
||||
int "Number TSC2007 poll waiters"
|
||||
default 4
|
||||
---help---
|
||||
Maximum number of threads that can be waiting on poll()
|
||||
|
||||
endif # INPUT_TSC2007
|
||||
|
||||
config INPUT_FT5X06
|
||||
bool "FocalTech FT5x06 multi-touch, capacitive touch panel controller"
|
||||
default n
|
||||
select I2C
|
||||
select INPUT_TOUCHSCREEN
|
||||
---help---
|
||||
Enable support for the FocalTech FT5x06 multi-touch, capacitive
|
||||
touch panel controller
|
||||
|
||||
config INPUT_GT9XX
|
||||
bool "Goodix GT9XX touch panel controller"
|
||||
default n
|
||||
select I2C
|
||||
select INPUT_TOUCHSCREEN
|
||||
---help---
|
||||
Enable support for the Goodix GT9XX multi-touch, capacitive
|
||||
touch panel controller
|
||||
|
||||
config INPUT_FT5336
|
||||
bool "FocalTech FT5336 multi-touch, capacitive touch panel controller"
|
||||
default n
|
||||
select I2C
|
||||
select INPUT_FT5X06
|
||||
select INPUT_TOUCHSCREEN
|
||||
depends on EXPERIMENTAL
|
||||
---help---
|
||||
Enable support for the FocalTech FT5x06 multi-touch, capacitive
|
||||
touch panel controller
|
||||
|
||||
if INPUT_FT5X06
|
||||
|
||||
config FT5X06_POLLMODE
|
||||
bool "Polled mode"
|
||||
default n
|
||||
---help---
|
||||
Run the FT5x06 in a non-interrupt driven polled mode. Events will
|
||||
not be driven by interrupts but rather based on a timed poll.
|
||||
|
||||
This is a non-optimal design both because (1) it will lead to delays
|
||||
in detecting touch related events and (2) it will consume a
|
||||
significant amount of CPU time to perform the polling.
|
||||
|
||||
config FT5X06_SWAPXY
|
||||
bool "Swap X/Y"
|
||||
default n
|
||||
---help---
|
||||
Reverse the meaning of X and Y to handle different LCD orientations.
|
||||
|
||||
config FT5X06_SINGLEPOINT
|
||||
bool "Single point"
|
||||
default n
|
||||
---help---
|
||||
Do no report multi-touch events
|
||||
|
||||
if FT5X06_SINGLEPOINT
|
||||
|
||||
config FT5X06_THRESHX
|
||||
int "X threshold"
|
||||
default 12
|
||||
---help---
|
||||
New touch positions will only be reported when the X or Y data changes by these
|
||||
thresholds. This trades reduced data rates for some loss in dragging accuracy. For
|
||||
12-bit values the raw ranges are 0-4095. So for example, if your display is
|
||||
320x240, then THRESHX=13 and THRESHY=17 would correspond to one pixel. Default: 12
|
||||
|
||||
config FT5X06_THRESHY
|
||||
int "Y threshold"
|
||||
default 12
|
||||
---help---
|
||||
New touch positions will only be reported when the X or Y data changes by these
|
||||
thresholds. This trades reduced data rates for some loss in dragging accuracy. For
|
||||
12-bit values the raw ranges are 0-4095. So for example, if your display is
|
||||
320x240, then THRESHX=13 and THRESHY=17 would correspond to one pixel. Default: 12
|
||||
|
||||
endif # FT5X06_SINGLEPOINT
|
||||
|
||||
config FT5X06_NPOLLWAITERS
|
||||
int "Number FT5336/FT5x06 poll waiters"
|
||||
default 4
|
||||
---help---
|
||||
Maximum number of threads that can be waiting on poll()
|
||||
|
||||
endif # INPUT_FT5X06
|
||||
|
||||
config INPUT_ADS7843E
|
||||
bool "TI ADS7843/TSC2046 touchscreen controller"
|
||||
default n
|
||||
select SPI
|
||||
select INPUT_TOUCHSCREEN
|
||||
---help---
|
||||
Enable support for the TI/Burr-Brown ADS7842 touchscreen controller. I believe
|
||||
that driver should be compatible with the TI/Burr-Brown TSC2046 and XPT2046
|
||||
touchscreen controllers as well.
|
||||
|
||||
if INPUT_ADS7843E
|
||||
|
||||
config ADS7843E_MULTIPLE
|
||||
bool "Multiple ADS7843E Devices"
|
||||
default n
|
||||
---help---
|
||||
Can be defined to support multiple ADS7843E devices on board.
|
||||
|
||||
config ADS7843E_NPOLLWAITERS
|
||||
int "Number poll waiters"
|
||||
default 4
|
||||
---help---
|
||||
Maximum number of threads that can be waiting on poll()
|
||||
|
||||
config ADS7843E_SPIDEV
|
||||
int "SPI bus number"
|
||||
default 0
|
||||
---help---
|
||||
Selects the SPI bus number identifying that SPI interface that
|
||||
connects the ADS843E to the MCU.
|
||||
|
||||
config ADS7843E_DEVMINOR
|
||||
int "Input device minor number"
|
||||
default 0
|
||||
---help---
|
||||
The ADS7843E device will be registered as /dev/inputN where N is the
|
||||
value provided by this setting.
|
||||
|
||||
config ADS7843E_SPIMODE
|
||||
int "SPI mode"
|
||||
default 0
|
||||
range 0 3
|
||||
---help---
|
||||
Controls the SPI mode. The device should work in mode 0, but
|
||||
sometimes you need to experiment.
|
||||
|
||||
config ADS7843E_FREQUENCY
|
||||
int "SPI frequency"
|
||||
default 100000
|
||||
---help---
|
||||
Define to use a different SPI bus frequency.
|
||||
|
||||
config ADS7843E_SWAPXY
|
||||
bool "Swap X/Y"
|
||||
default n
|
||||
---help---
|
||||
Reverse the meaning of X and Y to handle different LCD orientations.
|
||||
|
||||
config ADS7843E_THRESHX
|
||||
int "X threshold"
|
||||
default 12
|
||||
---help---
|
||||
New touch positions will only be reported when the X or Y data changes by these
|
||||
thresholds. This trades reduced data rates for some loss in dragging accuracy. For
|
||||
12-bit values the raw ranges are 0-4095. So for example, if your display is
|
||||
320x240, then THRESHX=13 and THRESHY=17 would correspond to one pixel. Default: 12
|
||||
|
||||
config ADS7843E_THRESHY
|
||||
int "Y threshold"
|
||||
default 12
|
||||
---help---
|
||||
New touch positions will only be reported when the X or Y data changes by these
|
||||
thresholds. This trades reduced data rates for some loss in dragging accuracy. For
|
||||
12-bit values the raw ranges are 0-4095. So for example, if your display is
|
||||
320x240, then THRESHX=13 and THRESHY=17 would correspond to one pixel. Default: 12
|
||||
|
||||
endif # INPUT_ADS7843E
|
||||
|
||||
config INPUT_MXT
|
||||
bool "Atmel maXTouch Driver"
|
||||
select INPUT_TOUCHSCREEN
|
||||
default n
|
||||
---help---
|
||||
Enables support for the Atmel maXTouch driver
|
||||
|
||||
if INPUT_MXT
|
||||
|
||||
config MXT_THRESHX
|
||||
int "X threshold"
|
||||
default 5
|
||||
---help---
|
||||
New touch positions will only be reported when the X or Y data
|
||||
changes by these thresholds. This trades reduced data rates for some
|
||||
loss in dragging accuracy. For 12-bit values the raw ranges are
|
||||
0-4095. So for example, if your display is 800x480, then THRESHX=5
|
||||
and THRESHY=8 would correspond to a one pixel change. Default: 5
|
||||
|
||||
NOTE: This does nothing to reduce the interrupt rate. It only
|
||||
reduces the rate at which touch events are reports.
|
||||
|
||||
config MXT_THRESHY
|
||||
int "Y threshold"
|
||||
default 8
|
||||
---help---
|
||||
New touch positions will only be reported when the X or Y data
|
||||
changes by these thresholds. This trades reduced data rates for some
|
||||
loss in dragging accuracy. For 12-bit values the raw ranges are
|
||||
0-4095. So for example, if your display is 800x480, then THRESHX=5
|
||||
and THRESHY=8 would correspond to a one pixel change. Default: 8
|
||||
|
||||
NOTE: This does nothing to reduce the interrupt rate. It only
|
||||
reduces the rate at which touch events are reports.
|
||||
|
||||
config MXT_NPOLLWAITERS
|
||||
int "Number poll waiters"
|
||||
default 4
|
||||
---help---
|
||||
Maximum number of threads that can be waiting on poll()
|
||||
|
||||
config MXT_DISABLE_CONFIG_DEBUG_INFO
|
||||
bool "Disable verbose debug output"
|
||||
default y
|
||||
depends on DEBUG_INPUT_INFO
|
||||
---help---
|
||||
The maXTouch tends to generate interrupts at a high rate during the
|
||||
contact. If verbose debug is enabled in this driver, you may not
|
||||
be able to get anything done because of the high debug output rate.
|
||||
|
||||
This setting will allow you to keep verbose touchscreen debug output
|
||||
in other modules, but to specifically suppress the debug out from
|
||||
the MXT driver. Debug (non-verbose) errors will still be generated,
|
||||
but the chit-chat level will be eliminated.
|
||||
|
||||
endif # INPUT_MXT
|
||||
|
||||
config INPUT_STMPE811
|
||||
bool "STMicro STMPE811 Driver"
|
||||
default n
|
||||
select INPUT_TOUCHSCREEN
|
||||
---help---
|
||||
Enables support for the STMPE811 driver
|
||||
|
||||
if INPUT_STMPE811
|
||||
|
||||
choice
|
||||
prompt "STMPE Interface"
|
||||
default STMPE811_I2C
|
||||
|
||||
config STMPE811_SPI
|
||||
bool "SPI Interface"
|
||||
select SPI
|
||||
---help---
|
||||
Enables support for the SPI interface (not currently supported)
|
||||
|
||||
config STMPE811_I2C
|
||||
bool "STMPE811 I2C Interface"
|
||||
select I2C
|
||||
---help---
|
||||
Enables support for the I2C interface
|
||||
|
||||
endchoice
|
||||
|
||||
config STMPE811_ACTIVELOW
|
||||
bool "Active Low Interrupt"
|
||||
default n
|
||||
---help---
|
||||
The STMPE811 interrupt is provided by a discrete input (usually a
|
||||
GPIO interrupt on most MCU architectures). This setting determines
|
||||
whether the interrupt is active high (or rising edge triggered) or
|
||||
active low (or falling edge triggered). Default: Active
|
||||
high/rising edge.
|
||||
|
||||
config STMPE811_EDGE
|
||||
bool "Edge triggered Interrupt"
|
||||
default n
|
||||
---help---
|
||||
The STMPE811 interrupt is provided by a discrete input (usually a
|
||||
GPIO interrupt on most MCU architectures). This setting determines
|
||||
whether the interrupt is edge or level triggered. Default: Level
|
||||
triggered.
|
||||
|
||||
config STMPE811_MULTIPLE
|
||||
bool "Multiple STMPE811 Devices"
|
||||
default n
|
||||
---help---
|
||||
Can be defined to support multiple STMPE811 devices on board.
|
||||
|
||||
config STMPE811_NPOLLWAITERS
|
||||
int "Number poll waiters"
|
||||
default 4
|
||||
---help---
|
||||
Maximum number of threads that can be waiting on poll()
|
||||
|
||||
config STMPE811_TSC_DISABLE
|
||||
bool "Disable STMPE811 Touchscreen Support"
|
||||
default n
|
||||
---help---
|
||||
Disable driver touchscreen functionality.
|
||||
|
||||
config STMPE811_SWAPXY
|
||||
bool "Swap X/Y"
|
||||
default n
|
||||
depends on !STMPE811_TSC_DISABLE
|
||||
---help---
|
||||
Reverse the meaning of X and Y to handle different LCD orientations.
|
||||
|
||||
config STMPE811_THRESHX
|
||||
int "X threshold"
|
||||
default 12
|
||||
depends on !STMPE811_TSC_DISABLE
|
||||
---help---
|
||||
STMPE811 touchscreen data comes in a a very high rate. New touch positions
|
||||
will only be reported when the X or Y data changes by these thresholds.
|
||||
This trades reduced data rates for some loss in dragging accuracy. The
|
||||
STMPE811 is configure for 12-bit values the raw ranges are 0-4095. So
|
||||
for example, if your display is 320x240, then THRESHX=13 and THRESHY=17
|
||||
would correspond to one pixel. Default: 12
|
||||
|
||||
config STMPE811_THRESHY
|
||||
int "Y threshold"
|
||||
default 12
|
||||
depends on !STMPE811_TSC_DISABLE
|
||||
---help---
|
||||
STMPE811 touchscreen data comes in a a very high rate. New touch positions
|
||||
will only be reported when the X or Y data changes by these thresholds.
|
||||
This trades reduced data rates for some loss in dragging accuracy. The
|
||||
STMPE811 is configure for 12-bit values the raw ranges are 0-4095. So
|
||||
for example, if your display is 320x240, then THRESHX=13 and THRESHY=17
|
||||
would correspond to one pixel. Default: 12
|
||||
|
||||
config STMPE811_ADC_DISABLE
|
||||
bool "Disable STMPE811 ADC Support"
|
||||
default y
|
||||
---help---
|
||||
Disable driver ADC functionality.
|
||||
|
||||
config STMPE811_GPIO_DISABLE
|
||||
bool "Disable STMPE811 GPIO Support"
|
||||
default y
|
||||
---help---
|
||||
Disable driver GPIO functionality.
|
||||
|
||||
config STMPE811_GPIOINT_DISABLE
|
||||
bool "Disable STMPE811 GPIO Interrupt Support"
|
||||
default y
|
||||
depends on !STMPE811_GPIO_DISABLE
|
||||
---help---
|
||||
Disable driver GPIO interrupt functionality (ignored if GPIO functionality is
|
||||
disabled).
|
||||
|
||||
config STMPE811_TEMP_DISABLE
|
||||
bool "Disable STMPE811 Temperature Sensor Support"
|
||||
default y
|
||||
---help---
|
||||
Disable driver temperature sensor functionality.
|
||||
|
||||
config STMPE811_REGDEBUG
|
||||
bool "Enable Register-Level STMPE811 Debug"
|
||||
default n
|
||||
depends on DEBUG_FEATURES
|
||||
---help---
|
||||
Enable very low register-level debug output.
|
||||
|
||||
endif # INPUT_STMPE811
|
||||
|
||||
config INPUT_CYPRESS_MBR3108
|
||||
bool "Enable Cypress MBR3108 CapSense driver"
|
||||
default n
|
||||
select INPUT_TOUCHSCREEN
|
||||
---help---
|
||||
Enable support for Cypress MBR3108 CapSense touch button & proximity
|
||||
input sensor.
|
||||
|
||||
if INPUT_CYPRESS_MBR3108
|
||||
|
||||
config INPUT_CYPRESS_MBR3108_DEBUG
|
||||
bool "Enable debug support for Cypress sensor"
|
||||
default n
|
||||
depends on DEBUG_FEATURES
|
||||
---help---
|
||||
Enable debugging traces for MBR3108 driver
|
||||
|
||||
config INPUT_CYPRESS_MBR3108_NPOLLWAITERS
|
||||
int "Number of waiters to poll"
|
||||
default 1
|
||||
---help---
|
||||
Maximum number of threads that can be waiting on poll()
|
||||
|
||||
endif # INPUT_CYPRESS_MBR3108
|
||||
|
||||
config INPUT_BUTTONS
|
||||
bool "Button Inputs"
|
||||
default n
|
||||
---help---
|
||||
Enable standard button upper half driver.
|
||||
|
||||
if INPUT_BUTTONS
|
||||
|
||||
config INPUT_BUTTONS_LOWER
|
||||
bool "Generic Lower Half Button Driver"
|
||||
default n
|
||||
depends on ARCH_BUTTONS && ARCH_IRQBUTTONS
|
||||
---help---
|
||||
If the board supports the standard button interfaces as
|
||||
defined in include/nuttx/board.h header file, then this
|
||||
standard button lower half driver might be usable.
|
||||
|
||||
In order for this generic driver to be usable:
|
||||
|
||||
1. The board implementation must provide the button
|
||||
interfaces as defined in include/nuttx/board.h
|
||||
2. The board implementation must support interrupts for each
|
||||
button.
|
||||
|
||||
If your board does not meet these requirements, then the
|
||||
button_lower.c file can still be copied to your your
|
||||
board src/ directory and modified for your specific board
|
||||
requirements.
|
||||
|
||||
config INPUT_BUTTONS_NPOLLWAITERS
|
||||
int "Max Number of Poll Waiters"
|
||||
default 2
|
||||
|
||||
endif # INPUT_BUTTONS
|
||||
|
||||
config INPUT_DJOYSTICK
|
||||
bool "Discrete Joystick"
|
||||
default n
|
||||
---help---
|
||||
Enable standard discrete joystick upper half driver. A discrete
|
||||
joystick refers to a joystick that could be implemented entirely
|
||||
with GPIO input pins. So up, down, left, and right are all discrete
|
||||
values like buttons (as opposed to integer values like you might
|
||||
obtain from an analog joystick).
|
||||
|
||||
if INPUT_DJOYSTICK
|
||||
|
||||
config INPUT_DJOYSTICK_NPOLLWAITERS
|
||||
int "Max Number of Poll Waiters"
|
||||
default 2
|
||||
|
||||
endif # INPUT_DJOYSTICK
|
||||
|
||||
config INPUT_AJOYSTICK
|
||||
bool "Analog Joystick"
|
||||
default n
|
||||
---help---
|
||||
Enable standard analog joystick upper half driver. An analog
|
||||
joystick refers to a joystick that provides position data as an
|
||||
integer value that might have been obtained through Analog-
|
||||
to-Digital Conversion (ADC). The analog positional data may also
|
||||
be accompanied by discrete button data.
|
||||
|
||||
if INPUT_AJOYSTICK
|
||||
|
||||
config INPUT_AJOYSTICK_NPOLLWAITERS
|
||||
int "Max Number of Poll Waiters"
|
||||
default 2
|
||||
|
||||
endif # INPUT_AJOYSTICK
|
||||
|
||||
config INPUT_NUNCHUCK
|
||||
bool "Nintendo Wii Nunchuck Joystick (White Model)"
|
||||
default n
|
||||
select I2C
|
||||
---help---
|
||||
Enable a Nintendo Wii Nunchuck joystick upper half driver. The
|
||||
nunchuck joystick provides position data as an integer value.The
|
||||
analog positional data may also be accompanied by discrete
|
||||
button data.
|
||||
|
||||
if INPUT_NUNCHUCK
|
||||
|
||||
config NUNCHUCK_NPOLLWAITERS
|
||||
int "Max Number of Poll Waiters"
|
||||
default 2
|
||||
|
||||
endif # INPUT_NUNCHUCK
|
||||
|
||||
config INPUT_SPQ10KBD
|
||||
bool "Solder Party Q10 BlackBerry Keyboard"
|
||||
default n
|
||||
select I2C
|
||||
---help---
|
||||
Enable the Solder Party Q10 BlackBerry Keyboard support. This
|
||||
exposes itself as a standard keyboard at /dev/kbdN.
|
||||
This keyboard exists both as a standalone module and integrated
|
||||
into the Solder Party Keyboard FeatherWing. Information on this
|
||||
can be found at https://www.solder.party/docs/keyboard-pmod/
|
||||
|
||||
if INPUT_SPQ10KBD
|
||||
|
||||
config SPQ10KBD_DJOY
|
||||
bool "Joystick Interface for Buttons"
|
||||
select INPUT_DJOYSTICK
|
||||
default n
|
||||
|
||||
config SPQ10KBD_REGDBG
|
||||
bool "Keyboard Register Debug"
|
||||
default n
|
||||
|
||||
config SPQ10KBD_BUFSIZE
|
||||
int "Keyboard Buffer Size"
|
||||
default 10
|
||||
|
||||
config SPQ10KBD_NPOLLWAITERS
|
||||
int "Max Number of Poll Waiters"
|
||||
default 2
|
||||
|
||||
endif # INPUT_SPQ10KBD
|
||||
|
||||
endif # INPUT
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
############################################################################
|
||||
# drivers/input/Make.defs
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
# Don't build anything if there is no support for input devices
|
||||
|
||||
ifeq ($(CONFIG_INPUT),y)
|
||||
|
||||
# Include the selected touchscreen drivers
|
||||
|
||||
ifeq ($(CONFIG_INPUT_TSC2007),y)
|
||||
CSRCS += tsc2007.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_INPUT_FT5X06),y)
|
||||
CSRCS += ft5x06.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_INPUT_GT9XX),y)
|
||||
CSRCS += gt9xx.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_INPUT_ADS7843E),y)
|
||||
CSRCS += ads7843e.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_INPUT_MAX11802),y)
|
||||
CSRCS += max11802.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_INPUT_MXT),y)
|
||||
CSRCS += mxt.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_INPUT_STMPE811),y)
|
||||
CSRCS += stmpe811_base.c
|
||||
ifneq ($(CONFIG_INPUT_STMPE811_TSC_DISABLE),y)
|
||||
CSRCS += stmpe811_tsc.c
|
||||
endif
|
||||
ifneq ($(CONFIG_INPUT_STMPE811_GPIO_DISABLE),y)
|
||||
CSRCS += stmpe811_gpio.c
|
||||
endif
|
||||
ifneq ($(CONFIG_INPUT_STMPE811_ADC_DISABLE),y)
|
||||
CSRCS += stmpe811_adc.c
|
||||
endif
|
||||
ifneq ($(CONFIG_INPUT_STMPE811_TEMP_DISABLE),y)
|
||||
CSRCS += stmpe811_temp.c
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_INPUT_CYPRESS_MBR3108),y)
|
||||
CSRCS += cypress_mbr3108.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_INPUT_BUTTONS),y)
|
||||
CSRCS += button_upper.c
|
||||
ifeq ($(CONFIG_INPUT_BUTTONS_LOWER),y)
|
||||
CSRCS += button_lower.c
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_INPUT_DJOYSTICK),y)
|
||||
CSRCS += djoystick.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_INPUT_AJOYSTICK),y)
|
||||
CSRCS += ajoystick.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_INPUT_NUNCHUCK),y)
|
||||
CSRCS += nunchuck.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_INPUT_SPQ10KBD),y)
|
||||
CSRCS += spq10kbd.c
|
||||
endif
|
||||
|
||||
# Include input device driver build support
|
||||
|
||||
DEPPATH += --dep-path input
|
||||
VPATH += :input
|
||||
CFLAGS += ${shell $(INCDIR) "$(CC)" $(TOPDIR)$(DELIM)drivers$(DELIM)input}
|
||||
endif
|
||||
+1417
File diff suppressed because it is too large
Load Diff
+165
@@ -0,0 +1,165 @@
|
||||
/*
|
||||
* Copyright (c) 2022 AIIT XUOS Lab
|
||||
* XiUOS is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file gt9xx.h
|
||||
* @brief API for gt9xx.
|
||||
* @version 1.0
|
||||
* @author AIIT XUOS Lab
|
||||
* @date 2022.5.31
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __GT9XX_H_
|
||||
#define __GT9XX_H_
|
||||
|
||||
#define GT9XX_MAX_TOUCHES (1)
|
||||
#define GT9XX_TOUCH_DATA_LEN (8 * GT9XX_MAX_TOUCHES + 4)
|
||||
|
||||
#define TOUCH_POINT_GET_EVENT(t) ((t).xh >> 6)
|
||||
#define TOUCH_POINT_GET_ID(t) ((t).yh >> 4)
|
||||
#define TOUCH_POINT_GET_X(t) ((((t).xh & 0x0f) << 8) | (t).xl)
|
||||
#define TOUCH_POINT_GET_Y(t) ((((t).yh & 0x0f) << 8) | (t).yl)
|
||||
|
||||
|
||||
#define GT9XX_MAX_HEIGHT 272
|
||||
#define GT9XX_MAX_WIDTH 480
|
||||
#define GT9XX_INT_TRIGGER 0
|
||||
|
||||
#define GT9XX_ADDR_LENGTH 2
|
||||
#define GT9XX_CONFIG_MIN_LENGTH 186
|
||||
#define GT9XX_CONFIG_MAX_LENGTH 240
|
||||
|
||||
#define GT9XX_REG_BAK_REF 0x99D0
|
||||
#define GT9XX_REG_MAIN_CLK 0x8020
|
||||
#define GT9XX_REG_CHIP_TYPE 0x8000
|
||||
#define GT9XX_REG_HAVE_KEY 0x804E
|
||||
#define GT9XX_REG_MATRIX_DRVNUM 0x8069
|
||||
#define GT9XX_REG_MATRIX_SENNUM 0x806A
|
||||
#define GT9XX_REG_COMMAND 0x8040
|
||||
|
||||
#define GT9XX_COMMAND_READSTATUS 0
|
||||
#define GT9XX_COMMAND_DIFFERENCE 1
|
||||
#define GT9XX_COMMAND_SOFTRESET 2
|
||||
#define GT9XX_COMMAND_UPDATE 3
|
||||
#define GT9XX_COMMAND_CALCULATE 4
|
||||
#define GT9XX_COMMAND_TURNOFF 5
|
||||
|
||||
#define GT9XX_REG_READ_COOR 0x814E
|
||||
#define GT9XX_REG_SLEEP 0x8040
|
||||
#define GT9XX_REG_SENSOR_ID 0x814A
|
||||
#define GT9XX_REG_CONFIG_DATA 0x8047
|
||||
#define GT9XX_REG_VERSION 0x8140
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
enum touch_event_e
|
||||
{
|
||||
GT9XX_DOWN = 0, /* The state changed to touched */
|
||||
GT9XX_UP = 1, /* The state changed to not touched */
|
||||
GT9XX_CONTACT = 2, /* There is a continuous touch being detected */
|
||||
GT9XX_INVALID = 3 /* No touch information available */
|
||||
};
|
||||
|
||||
/* Describes on touchpoint returned by the GT9xx */
|
||||
|
||||
struct gt9xx_touch_point_s
|
||||
{
|
||||
uint8_t xl;
|
||||
uint8_t xh;
|
||||
uint8_t yl;
|
||||
uint8_t yh;
|
||||
uint8_t weight;
|
||||
uint8_t area;
|
||||
};
|
||||
|
||||
/* Describes all touch data returned by the GT9xx */
|
||||
|
||||
struct gt9xx_touch_data_s
|
||||
{
|
||||
uint8_t tdstatus; /* Touch status */
|
||||
struct gt9xx_touch_point_s touch[GT9XX_MAX_TOUCHES];
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
/* Maximum number of threads than can be waiting for POLL events */
|
||||
|
||||
#ifndef CONFIG_GT9XX_NPOLLWAITERS
|
||||
# define CONFIG_GT9XX_NPOLLWAITERS 2
|
||||
#endif
|
||||
|
||||
/* Check for some required settings. This can save the user a lot of time
|
||||
* in getting the right configuration.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_SCHED_WORKQUEUE
|
||||
# error "Work queue support required. CONFIG_SCHED_WORKQUEUE must be selected."
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
/* A reference to a structure of this type must be passed to the GT9XX
|
||||
* driver. This structure provides information about the configuration
|
||||
* of the FT5x06 and provides some board-specific hooks.
|
||||
*
|
||||
* Memory for this structure is provided by the caller. It is not copied
|
||||
* by the driver and is presumed to persist while the driver is active. The
|
||||
* memory must be writeable because, under certain circumstances, the driver
|
||||
* may modify frequency or X plate resistance values.
|
||||
*/
|
||||
|
||||
struct gt9xx_config_s
|
||||
{
|
||||
/* Device characterization */
|
||||
|
||||
uint8_t address; /* 7-bit I2C address (only bits 0-6 used) */
|
||||
uint32_t frequency; /* Default I2C frequency */
|
||||
|
||||
/* IRQ/GPIO access callbacks. These operations all hidden behind
|
||||
* callbacks to isolate the GT9XX driver from differences in GPIO
|
||||
* interrupt handling by varying boards and MCUs.
|
||||
*
|
||||
* attach - Attach an FT5x06 interrupt handler to a GPIO interrupt
|
||||
* enable - Enable or disable a GPIO interrupt
|
||||
* clear - Acknowledge/clear any pending GPIO interrupt
|
||||
* wakeup - Issue WAKE interrupt to FT5x06 to change the FT5x06 from
|
||||
* Hibernate to Active mode.
|
||||
* nreset - Control the chip reset pin (active low)
|
||||
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_GT9XX_POLLMODE
|
||||
int (*attach)(FAR const struct gt9xx_config_s *config, xcpt_t isr,
|
||||
FAR void *arg);
|
||||
void (*enable)(FAR const struct gt9xx_config_s *config, bool enable);
|
||||
void (*clear)(FAR const struct gt9xx_config_s *config);
|
||||
#endif
|
||||
void (*wakeup)(FAR const struct gt9xx_config_s *config);
|
||||
void (*nreset)(FAR const struct gt9xx_config_s *config,
|
||||
bool state);
|
||||
};
|
||||
|
||||
|
||||
int gt9xx_register(FAR struct i2c_master_s *i2c,
|
||||
FAR const struct gt9xx_config_s *config, int minor);
|
||||
|
||||
|
||||
#endif /* __GT9XX_H__ */
|
||||
Reference in New Issue
Block a user