Add support for a USB HID mouse. Untested on initial check-in
This commit is contained in:
parent
7b084fcba8
commit
0e486c953b
7 changed files with 2512 additions and 13 deletions
|
@ -6547,5 +6547,9 @@
|
|||
* Several changes to restore the native Windows build (2014-2-7).
|
||||
* arch/arm/src/lpc17xx/lpc17_usbhost.c: Fix an compilation error
|
||||
that crept intot he LPC17xx USB host driver. What happened here?
|
||||
(2014-2-8).
|
||||
(2014-2-9).
|
||||
* drivers/usbhost/usbhost_hidmouse.c and other files: Add support
|
||||
for a HID boot mouse device. It compiles but is otherwise
|
||||
completely untested on initial check-in (2014-2-9).
|
||||
|
||||
`
|
||||
|
|
|
@ -337,6 +337,7 @@ CONFIG_USBHOST_NPREALLOC=0
|
|||
CONFIG_USBHOST_BULK_DISABLE=y
|
||||
CONFIG_USBHOST_INT_DISABLE=n
|
||||
CONFIG_USBHOST_ISOC_DISABLE=y
|
||||
CONFIG_USBHOST_HIDKBD=y
|
||||
|
||||
#
|
||||
# LPC17xx USB Device Configuration
|
||||
|
|
|
@ -43,7 +43,13 @@ CONFIG_INTELHEX_BINARY=y
|
|||
# Debug Options
|
||||
#
|
||||
# CONFIG_DEBUG is not set
|
||||
CONFIG_ARCH_HAVE_STACKCHECK=y
|
||||
# CONFIG_ARCH_HAVE_HEAPCHECK is not set
|
||||
# CONFIG_DEBUG_SYMBOLS is not set
|
||||
CONFIG_ARCH_HAVE_CUSTOMOPT=y
|
||||
# CONFIG_DEBUG_NOOPT is not set
|
||||
# CONFIG_DEBUG_CUSTOMOPT is not set
|
||||
CONFIG_DEBUG_FULLOPT=y
|
||||
|
||||
#
|
||||
# System Type
|
||||
|
@ -64,6 +70,7 @@ CONFIG_ARCH="arm"
|
|||
#
|
||||
# ARM Options
|
||||
#
|
||||
# CONFIG_ARCH_CHIP_A1X is not set
|
||||
# CONFIG_ARCH_CHIP_C5471 is not set
|
||||
# CONFIG_ARCH_CHIP_CALYPSO is not set
|
||||
# CONFIG_ARCH_CHIP_DM320 is not set
|
||||
|
@ -88,10 +95,11 @@ CONFIG_ARCH_CHIP_LPC17XX=y
|
|||
CONFIG_ARCH_CORTEXM3=y
|
||||
# CONFIG_ARCH_CORTEXM4 is not set
|
||||
# CONFIG_ARCH_CORTEXA5 is not set
|
||||
# CONFIG_ARCH_CORTEXA8 is not set
|
||||
CONFIG_ARCH_FAMILY="armv7-m"
|
||||
CONFIG_ARCH_CHIP="lpc17xx"
|
||||
# CONFIG_ARMV7M_USEBASEPRI is not set
|
||||
# CONFIG_ARCH_HAVE_CMNVECTOR is not set
|
||||
CONFIG_ARCH_HAVE_CMNVECTOR=y
|
||||
# CONFIG_ARMV7M_CMNVECTOR is not set
|
||||
# CONFIG_ARCH_HAVE_FPU is not set
|
||||
CONFIG_ARCH_HAVE_MPU=y
|
||||
|
@ -202,10 +210,13 @@ CONFIG_USBHOST_ISOC_DISABLE=y
|
|||
# CONFIG_ARCH_NOINTC is not set
|
||||
# CONFIG_ARCH_VECNOTIRQ is not set
|
||||
# CONFIG_ARCH_DMA is not set
|
||||
CONFIG_ARCH_IRQPRIO=y
|
||||
CONFIG_ARCH_HAVE_IRQPRIO=y
|
||||
# CONFIG_CUSTOM_STACK is not set
|
||||
# CONFIG_ADDRENV is not set
|
||||
CONFIG_ARCH_HAVE_VFORK=y
|
||||
# CONFIG_ARCH_HAVE_MMU is not set
|
||||
# CONFIG_ARCH_NAND_HWECC is not set
|
||||
CONFIG_ARCH_IRQPRIO=y
|
||||
CONFIG_ARCH_STACKDUMP=y
|
||||
# CONFIG_ENDIAN_BIG is not set
|
||||
# CONFIG_ARCH_HAVE_RAMFUNCS is not set
|
||||
|
@ -217,8 +228,14 @@ CONFIG_ARCH_HAVE_RAMVECTORS=y
|
|||
#
|
||||
CONFIG_BOARD_LOOPSPERMSEC=8111
|
||||
# CONFIG_ARCH_CALIBRATION is not set
|
||||
|
||||
#
|
||||
# Interrupt options
|
||||
#
|
||||
CONFIG_ARCH_HAVE_INTERRUPTSTACK=y
|
||||
CONFIG_ARCH_INTERRUPTSTACK=0
|
||||
CONFIG_ARCH_HAVE_HIPRI_INTERRUPT=y
|
||||
# CONFIG_ARCH_HIPRI_INTERRUPT is not set
|
||||
|
||||
#
|
||||
# Boot options
|
||||
|
@ -234,6 +251,7 @@ CONFIG_BOOT_RUNFROMFLASH=y
|
|||
#
|
||||
CONFIG_RAM_START=0x10000000
|
||||
CONFIG_RAM_SIZE=32768
|
||||
# CONFIG_ARCH_HAVE_SDRAM is not set
|
||||
|
||||
#
|
||||
# Board Selection
|
||||
|
@ -260,6 +278,7 @@ CONFIG_ARCH_HAVE_IRQBUTTONS=y
|
|||
#
|
||||
# CONFIG_BOARD_INITIALIZE is not set
|
||||
CONFIG_MSEC_PER_TICK=10
|
||||
# CONFIG_SYSTEM_TIME64 is not set
|
||||
CONFIG_RR_INTERVAL=200
|
||||
# CONFIG_SCHED_INSTRUMENTATION is not set
|
||||
CONFIG_TASK_NAME_SIZE=0
|
||||
|
@ -328,13 +347,17 @@ CONFIG_DEV_NULL=y
|
|||
# CONFIG_LOOP is not set
|
||||
# CONFIG_RAMDISK is not set
|
||||
# CONFIG_CAN is not set
|
||||
# CONFIG_ARCH_HAVE_PWM_PULSECOUNT is not set
|
||||
# CONFIG_PWM is not set
|
||||
# CONFIG_ARCH_HAVE_I2CRESET is not set
|
||||
# CONFIG_I2C is not set
|
||||
# CONFIG_SPI is not set
|
||||
# CONFIG_I2S is not set
|
||||
# CONFIG_RTC is not set
|
||||
# CONFIG_WATCHDOG is not set
|
||||
# CONFIG_ANALOG is not set
|
||||
# CONFIG_AUDIO_DEVICES is not set
|
||||
# CONFIG_VIDEO_DEVICES is not set
|
||||
# CONFIG_BCH is not set
|
||||
CONFIG_INPUT=y
|
||||
# CONFIG_INPUT_TSC2007 is not set
|
||||
|
@ -353,6 +376,7 @@ CONFIG_MMCSD_NSLOTS=1
|
|||
# CONFIG_PM is not set
|
||||
# CONFIG_POWER is not set
|
||||
# CONFIG_SENSORS is not set
|
||||
# CONFIG_SERCOMM_CONSOLE is not set
|
||||
CONFIG_SERIAL=y
|
||||
# CONFIG_DEV_LOWCONSOLE is not set
|
||||
# CONFIG_16550_UART is not set
|
||||
|
@ -394,6 +418,8 @@ CONFIG_HIDKBD_NPOLLWAITERS=2
|
|||
CONFIG_HIDKBD_ENCODED=y
|
||||
# CONFIG_HIDKBD_ALLSCANCODES is not set
|
||||
# CONFIG_HIDKBD_NODEBOUNCE is not set
|
||||
# CONFIG_USBHOST_HIDMOUSE is not set
|
||||
# CONFIG_USBHOST_TRACE is not set
|
||||
# CONFIG_WIRELESS is not set
|
||||
|
||||
#
|
||||
|
@ -408,6 +434,8 @@ CONFIG_HIDKBD_ENCODED=y
|
|||
#
|
||||
# Networking Support
|
||||
#
|
||||
# CONFIG_ARCH_HAVE_NET is not set
|
||||
# CONFIG_ARCH_HAVE_PHY is not set
|
||||
# CONFIG_NET is not set
|
||||
|
||||
#
|
||||
|
@ -418,11 +446,14 @@ CONFIG_HIDKBD_ENCODED=y
|
|||
# File system configuration
|
||||
#
|
||||
# CONFIG_DISABLE_MOUNTPOINT is not set
|
||||
# CONFIG_FS_READABLE is not set
|
||||
# CONFIG_FS_WRITABLE is not set
|
||||
# CONFIG_FS_RAMMAP is not set
|
||||
# CONFIG_FS_FAT is not set
|
||||
# CONFIG_FS_NXFFS is not set
|
||||
# CONFIG_FS_ROMFS is not set
|
||||
# CONFIG_FS_SMARTFS is not set
|
||||
# CONFIG_FS_PROCFS is not set
|
||||
|
||||
#
|
||||
# System Logging
|
||||
|
@ -441,6 +472,7 @@ CONFIG_HIDKBD_ENCODED=y
|
|||
# CONFIG_MM_MULTIHEAP is not set
|
||||
# CONFIG_MM_SMALL is not set
|
||||
CONFIG_MM_REGIONS=2
|
||||
# CONFIG_ARCH_HAVE_HEAP2 is not set
|
||||
# CONFIG_GRAN is not set
|
||||
|
||||
#
|
||||
|
@ -519,7 +551,7 @@ CONFIG_LIB_KBDCODEC=y
|
|||
#
|
||||
# CONFIG_EXAMPLES_BUTTONS is not set
|
||||
# CONFIG_EXAMPLES_CAN is not set
|
||||
# CONFIG_SYSTEM_COMPOSITE is not set
|
||||
# CONFIG_EXAMPLES_CONFIGDATA is not set
|
||||
# CONFIG_EXAMPLES_DHCPD is not set
|
||||
# CONFIG_EXAMPLES_ELF is not set
|
||||
# CONFIG_EXAMPLES_FTPC is not set
|
||||
|
@ -569,7 +601,6 @@ CONFIG_EXAMPLES_HIDKBD_ENCODED=y
|
|||
# CONFIG_EXAMPLES_UDP is not set
|
||||
# CONFIG_EXAMPLES_UIP is not set
|
||||
# CONFIG_EXAMPLES_USBSERIAL is not set
|
||||
# CONFIG_SYSTEM_USBMSC is not set
|
||||
# CONFIG_EXAMPLES_USBTERM is not set
|
||||
# CONFIG_EXAMPLES_WATCHDOG is not set
|
||||
|
||||
|
@ -592,14 +623,11 @@ CONFIG_EXAMPLES_HIDKBD_ENCODED=y
|
|||
# Networking Utilities
|
||||
#
|
||||
# CONFIG_NETUTILS_CODECS is not set
|
||||
# CONFIG_NETUTILS_DHCPC is not set
|
||||
# CONFIG_NETUTILS_DHCPD is not set
|
||||
# CONFIG_NETUTILS_FTPC is not set
|
||||
# CONFIG_NETUTILS_FTPD is not set
|
||||
# CONFIG_NETUTILS_JSON is not set
|
||||
# CONFIG_NETUTILS_RESOLV is not set
|
||||
# CONFIG_NETUTILS_SMTP is not set
|
||||
# CONFIG_NETUTILS_TELNETD is not set
|
||||
# CONFIG_NETUTILS_TFTPC is not set
|
||||
# CONFIG_NETUTILS_THTTPD is not set
|
||||
# CONFIG_NETUTILS_UIPLIB is not set
|
||||
|
@ -620,7 +648,20 @@ CONFIG_EXAMPLES_HIDKBD_ENCODED=y
|
|||
#
|
||||
|
||||
#
|
||||
# System NSH Add-Ons
|
||||
# Platform-specific Support
|
||||
#
|
||||
# CONFIG_PLATFORM_CONFIGDATA is not set
|
||||
|
||||
#
|
||||
# System Libraries and NSH Add-Ons
|
||||
#
|
||||
|
||||
#
|
||||
# USB CDC/ACM Device Commands
|
||||
#
|
||||
|
||||
#
|
||||
# USB Composite Device Commands
|
||||
#
|
||||
|
||||
#
|
||||
|
@ -632,6 +673,11 @@ CONFIG_EXAMPLES_HIDKBD_ENCODED=y
|
|||
# I2C tool
|
||||
#
|
||||
|
||||
#
|
||||
# INI File Parser
|
||||
#
|
||||
# CONFIG_SYSTEM_INIFILE is not set
|
||||
|
||||
#
|
||||
# FLASH Program Installation
|
||||
#
|
||||
|
@ -641,6 +687,11 @@ CONFIG_EXAMPLES_HIDKBD_ENCODED=y
|
|||
# FLASH Erase-all Command
|
||||
#
|
||||
|
||||
#
|
||||
# NxPlayer media player library / command Line
|
||||
#
|
||||
# CONFIG_SYSTEM_NXPLAYER is not set
|
||||
|
||||
#
|
||||
# RAM test
|
||||
#
|
||||
|
@ -675,6 +726,24 @@ CONFIG_EXAMPLES_HIDKBD_ENCODED=y
|
|||
# USB Monitor
|
||||
#
|
||||
|
||||
#
|
||||
# EMACS-like Command Line Editor
|
||||
#
|
||||
# CONFIG_SYSTEM_CLE is not set
|
||||
|
||||
#
|
||||
# VI Work-Alike Editor
|
||||
#
|
||||
# CONFIG_SYSTEM_VI is not set
|
||||
|
||||
#
|
||||
# Stack Monitor
|
||||
#
|
||||
|
||||
#
|
||||
# USB Mass Storage Device Commands
|
||||
#
|
||||
|
||||
#
|
||||
# Zmodem Commands
|
||||
#
|
||||
|
|
|
@ -47,6 +47,7 @@ config USBHOST_HIDKBD
|
|||
SCHED_WORKQUEUE && !DISABLE_SIGNALS
|
||||
|
||||
if USBHOST_HIDKBD
|
||||
|
||||
config HIDKBD_POLLUSEC
|
||||
int "Keyboard Poll Rate (MSEC)"
|
||||
default 100000
|
||||
|
@ -109,11 +110,117 @@ config HIDKBD_NODEBOUNCE
|
|||
bool "Disable Debounce"
|
||||
default n
|
||||
---help---
|
||||
If set to y normal debouncing is disabled. Default:
|
||||
If set to y normal debouncing is disabled. Default:
|
||||
Debounce enabled (No repeat keys).
|
||||
|
||||
endif
|
||||
|
||||
config USBHOST_HIDMOUSE
|
||||
bool "HID Mouse Class Support"
|
||||
default n
|
||||
depends on !INT_DISABLE
|
||||
---help---
|
||||
Enable support for the mouse class driver. This also depends on
|
||||
SCHED_WORKQUEUE && !DISABLE_SIGNALS
|
||||
|
||||
if USBHOST_HIDMOUSE
|
||||
|
||||
config HIDMOUSE_POLLUSEC
|
||||
int "Mouse Poll Rate (MSEC)"
|
||||
default 100000
|
||||
---help---
|
||||
Device poll rate in microseconds. Default: 100,000 microseconds.
|
||||
|
||||
config HIDMOUSE_DEFPRIO
|
||||
int "Polling Thread Priority"
|
||||
default 50
|
||||
---help---
|
||||
Priority of the polling thread. Default: 50.
|
||||
|
||||
config HIDMOUSE_STACKSIZE
|
||||
int "Polling thread stack size"
|
||||
default 1024
|
||||
---help---
|
||||
Stack size for polling thread. Default: 1024
|
||||
|
||||
config HIDMOUSE_BUFSIZE
|
||||
int "Scancode Buffer Size"
|
||||
default 64
|
||||
---help---
|
||||
Scancode buffer size. Default: 64.
|
||||
|
||||
config HIDMOUSE_NPOLLWAITERS
|
||||
int "Max Number of Waiters for Poll Event"
|
||||
default 2
|
||||
depends on !DISABLE_POLL
|
||||
---help---
|
||||
If the poll() method is enabled, this defines the maximum number
|
||||
of threads that can be waiting for mouse events. Default: 2.
|
||||
|
||||
config HIDMOUSE_SWAPXY
|
||||
bool "Swap X/Y"
|
||||
default n
|
||||
---help---
|
||||
Reverse the meaning of X and Y to handle different display orientations.
|
||||
|
||||
config HIDMOUSE_XMAX
|
||||
int "Maximum X position"
|
||||
default 320
|
||||
range 0 32767
|
||||
---help---
|
||||
This is the maximum value of the X position that will be reported.
|
||||
Default: 320
|
||||
|
||||
config HIDMOUSE_YMAX
|
||||
int "Maximum Y position"
|
||||
default 240
|
||||
range 0 32767
|
||||
---help---
|
||||
This is the maximum value of the Y position that will be reported.
|
||||
Default: 240
|
||||
|
||||
config HIDMOUSE_XSCALE
|
||||
hex "X scaling factor"
|
||||
default 0x00010000
|
||||
---help---
|
||||
Mouse positions are accumumated from X/Y displacements reported by
|
||||
the mouse device. This setting provides a scaling value for the X
|
||||
displacement. This is a fixed precision floating point number with
|
||||
16 bits of fraction. So a value of 0x00010000 is 1.0, 0x00018000
|
||||
is 1.5, 0x00024000 is 2.25, etc.
|
||||
|
||||
Default: 0x00010000 (1.0)
|
||||
|
||||
config HIDMOUSE_YSCALE
|
||||
hex "Y scaling factor"
|
||||
default 0x00010000
|
||||
---help---
|
||||
Mouse positions are accumumated from X/Y displacements reported by
|
||||
the mouse device. This setting provides a scaling value for the Y
|
||||
displacement. This is a fixed precision floating point number with
|
||||
16 bits of fraction. So a value of 0x00010000 is 1.0, 0x00018000
|
||||
is 1.5, 0x00024000 is 2.25, etc.
|
||||
|
||||
Default: 0x00010000 (1.0)
|
||||
|
||||
config HIDMOUSE_XTHRESH
|
||||
int "X threshold"
|
||||
default 12
|
||||
---help---
|
||||
New mouse positions will only be reported when the X or Y data changes by these
|
||||
thresholds. This trades reduces data rate for some loss in dragging accuracy.
|
||||
Default: 12
|
||||
|
||||
config HIDMOUSE_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 reduces data rate for some loss in dragging accuracy.
|
||||
Default: 12
|
||||
|
||||
endif
|
||||
|
||||
config USBHOST_TRACE
|
||||
bool "Enable USB HCD tracing for debug"
|
||||
default n
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
############################################################################
|
||||
# drivers/usbhost/Make.defs
|
||||
#
|
||||
# Copyright (C) 2010-2013 Gregory Nutt. All rights reserved.
|
||||
# Copyright (C) 2010-2014 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
|
@ -40,8 +40,15 @@ ifeq ($(CONFIG_USBHOST),y)
|
|||
# Include built-in USB host driver logic
|
||||
|
||||
CSRCS += usbhost_registry.c usbhost_registerclass.c usbhost_findclass.c
|
||||
CSRCS += usbhost_enumerate.c usbhost_storage.c usbhost_hidkbd.c
|
||||
CSRCS += usbhost_devaddr.c
|
||||
CSRCS += usbhost_enumerate.c usbhost_storage.c usbhost_devaddr.c
|
||||
|
||||
ifeq ($(CONFIG_USBHOST_HIDKBD),y)
|
||||
CSRCS += usbhost_hidkbd.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_USBHOST_HIDMOUSE),y)
|
||||
CSRCS += usbhost_hidmouse.c
|
||||
endif
|
||||
|
||||
# HCD debug/trace logic
|
||||
|
||||
|
|
2292
drivers/usbhost/usbhost_hidmouse.c
Normal file
2292
drivers/usbhost/usbhost_hidmouse.c
Normal file
File diff suppressed because it is too large
Load diff
|
@ -836,6 +836,25 @@ int usbhost_storageinit(void);
|
|||
|
||||
int usbhost_kbdinit(void);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: usbhost_mouse_init
|
||||
*
|
||||
* Description:
|
||||
* Initialize the USB storage HID mouse class driver. This function
|
||||
* should be called be platform-specific code in order to initialize and
|
||||
* register support for the USB host HID mouse class device.
|
||||
*
|
||||
* Input Parameters:
|
||||
* None
|
||||
*
|
||||
* Returned Values:
|
||||
* On success this function will return zero (OK); A negated errno value
|
||||
* will be returned on failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int usbhost_mouse_init(void);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: usbhost_wlaninit
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue