standard keypad inteface and apps/examples/keypadtest from Denis Carikli

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5403 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2012-12-01 15:43:51 +00:00
parent f7bc20f341
commit e4bde1803a
6 changed files with 69 additions and 3 deletions

View file

@ -3719,3 +3719,6 @@
* configs/z16f2800100zcog/ostest - Now supports a native Windows build
(other ZNEO configs may also support the native build, but this has not
been verfiied).
* include/nuttx/input/keypad.h, arch/arm/src/calypso/calypso_keypad.c, and
configs/compal_e99/nsh_highram: First cut at a standard keypad interface
definition. Contributed by Denis Carikli.

View file

@ -369,3 +369,11 @@ void up_keypad(void)
(void)register_driver("/dev/keypad", &keypad_ops, 0444, NULL);
}
int keypad_kbdinit(void)
{
calypso_armio();
up_keypad();
return OK;
}

View file

@ -40,9 +40,8 @@ CONFIGURED_APPS += nshlib
# Path to example in apps/examples
#CONFIGURED_APPS += examples/hello #fails not finding hello_main despite of good config
CONFIGURED_APPS += system/poweroff
CONFIGURED_APPS += examples/ostest
CONFIGURED_APPS += examples/keypadtest
CONFIGURED_APPS += examples/nxtext
CONFIGURED_APPS += examples/nxhello
CONFIGURED_APPS += examples/nxlines

View file

@ -245,6 +245,7 @@ CONFIG_EXAMPLES_NETTEST_CLIENTIP=0x0a000001
# Settings for examples/nsh
CONFIG_NSH_CONSOLE=y
CONFIG_NSH_TELNET=n
CONFIG_NSH_DISABLE_HEXDUMP=n
CONFIG_NSH_IOBUFFER_SIZE=512
CONFIG_NSH_CMD_SIZE=40
CONFIG_NSH_STACKSIZE=4096

View file

@ -197,7 +197,8 @@ int nxgl_splitline(FAR struct nxgl_vector_s *vector,
abs(line.pt2.x - line.pt1.x) < (line.pt2.y - line.pt1.y))
{
/* A close to vertical line of width 1 is basically
* a single parallelogram of width 1 */
* a single parallelogram of width 1.
*/
traps[1].top.x1 = itob16(line.pt1.x);
traps[1].top.x2 = traps[1].top.x1;

View file

@ -0,0 +1,54 @@
/************************************************************************************
* include/nuttx/input/keypad.h
*
* Copyright (C) 2012 Denis Carikli.
* Author: Denis Carikli <GNUtoo@no-log.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
************************************************************************************/
#ifndef __INCLUDE_NUTTX_INPUT_KEYPAD_H
#define __INCLUDE_NUTTX_INPUT_KEYPAD_H
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
int keypad_kbdinit(void);
#ifdef __cplusplus
}
#endif
#endif /* __INCLUDE_NUTTX_INPUT_KEYPAD_H */