Rename up_buttoninit to board_button_intialize

This commit is contained in:
Gregory Nutt 2014-01-24 13:50:23 -06:00
parent a5b8755bea
commit b0c0df84f6
82 changed files with 407 additions and 1470 deletions

View File

@ -6509,3 +6509,7 @@
distribution from ARM mean that we need to be explicit about branch distribution from ARM mean that we need to be explicit about branch
sizes; one or more of the wide branch opcodes results in bad table sizes; one or more of the wide branch opcodes results in bad table
branching. From Mike Smith (2014-1-23). branching. From Mike Smith (2014-1-23).
* Many files: renamed up_buttoninit() to board_button_initialize to
better conform to the naming standard. Now ONLY prototypes in
include/nuttx/arch.h (2014-1024).

View File

@ -1,8 +1,7 @@
/************************************************************************************ /************************************************************************************
* configs/avr32dev1/include/board.h * configs/avr32dev1/include/board.h
* include/arch/board/board.h
* *
* Copyright (C) 2010-2011 Gregory Nutt. All rights reserved. * Copyright (C) 2010-2011, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -34,8 +33,8 @@
* *
************************************************************************************/ ************************************************************************************/
#ifndef __ARCH_BOARD_BOARD_H #ifndef __CONFIGS_AVR32DEV1_INCLUDE_BOARD_H
#define __ARCH_BOARD_BOARD_H #define __CONFIGS_AVR32DEV1_INCLUDE_BOARD_H
/************************************************************************************ /************************************************************************************
* Included Files * Included Files
@ -174,7 +173,8 @@
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)
#define EXTERN extern "C" #define EXTERN extern "C"
extern "C" { extern "C"
{
#else #else
#define EXTERN extern #define EXTERN extern
#endif #endif
@ -192,60 +192,7 @@ extern "C" {
* *
************************************************************************************/ ************************************************************************************/
EXTERN void avr32_boardinitialize(void); void avr32_boardinitialize(void);
/************************************************************************************
* Name: up_buttoninit
*
* Description:
* up_buttoninit() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt
* handlers.
*
* NOTE: Nothing in the "base" NuttX code calls up_buttoninit(). If you want button
* support in an application, your application startup code must call up_buttoninit()
* prior to calling any of the other button interfaces.
*
************************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
EXTERN void up_buttoninit(void);
/************************************************************************************
* Name: up_buttons
*
* Description:
* After up_buttoninit() has been called, up_buttons() may be called to collect
* the state of all buttons. up_buttons() returns an 8-bit bit set with each bit
* associated with a button. See the BUTTON* definitions above for the meaning of
* each bit in the returned value.
*
************************************************************************************/
EXTERN uint8_t up_buttons(void);
/************************************************************************************
* Name: up_irqbutton
*
* Description:
* This function may be called to register an interrupt handler that will be
* called when a button is depressed or released. The ID value is one of the
* BUTTON* definitions provided above. The previous interrupt handler address is
* returned (so that it may restored, if so desired).
*
* Configuration Notes:
* Configuration CONFIG_AVR32_GPIOIRQ must be selected to enable the overall GPIO
* IRQ feature and CONFIG_AVR32_GPIOIRQSETA and/or CONFIG_AVR32_GPIOIRQSETB must
* be enabled to select GPIOs to support interrupts on. For button support, bits
* 2 and 3 must be set in CONFIG_AVR32_GPIOIRQSETB (PB2 and PB3).
*
************************************************************************************/
#ifdef CONFIG_AVR32_GPIOIRQ
EXTERN xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
#endif
#endif /* CONFIG_ARCH_BUTTONS */
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)
@ -253,5 +200,5 @@ EXTERN xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
#endif #endif
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#endif /* __ARCH_BOARD_BOARD_H */ #endif /* __CONFIGS_AVR32DEV1_INCLUDE_BOARD_H */

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/sam3u-ek/src/up_leds.c * configs/sam3u-ek/src/up_leds.c
* *
* Copyright (C) 2010-2011 Gregory Nutt. All rights reserved. * Copyright (C) 2010-2011, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -43,6 +43,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <stdint.h> #include <stdint.h>
#include <nuttx/arch.h>
#include <nuttx/irq.h> #include <nuttx/irq.h>
#include <arch/irq.h> #include <arch/irq.h>
@ -105,17 +106,17 @@ static xcpt_t up_irqbuttonx(int irq, xcpt_t irqhandler)
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources.
* that, up_buttons() may be called to collect the current state of all * After that, up_buttons() may be called to collect the current state of
* buttons or up_irqbutton() may be called to register button interrupt * all buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
(void)at32uc3_configgpio(PINMUX_GPIO_BUTTON1); (void)at32uc3_configgpio(PINMUX_GPIO_BUTTON1);
(void)at32uc3_configgpio(PINMUX_GPIO_BUTTON2); (void)at32uc3_configgpio(PINMUX_GPIO_BUTTON2);
@ -125,10 +126,11 @@ void up_buttoninit(void)
* Name: up_buttons * Name: up_buttons
* *
* Description: * Description:
* After up_buttoninit() has been called, up_buttons() may be called to * After board_button_initialize() has been called, up_buttons() may be
* collect the state of all buttons. up_buttons() returns an 8-bit bit set * called to collect the state of all buttons. up_buttons() returns an
* with each bit associated with a button. See the BUTTON* definitions * 8-bit bit set with each bit associated with a button. See the BUTTON*
* above for the meaning of each bit in the returned value. * definitions in the board.h header file for the meaning of each bit in
* the returned value.
* *
****************************************************************************/ ****************************************************************************/

View File

@ -322,37 +322,6 @@ extern "C" {
void stm32_boardinitialize(void); void stm32_boardinitialize(void);
/************************************************************************************
* Button support.
*
* Description:
* up_buttoninit() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt
* handlers.
*
* After up_buttoninit() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT
* definitions in board.h for the meaning of each bit.
*
* up_irqbutton() may be called to register an interrupt handler that will
* be called when a button is depressed or released. The ID value is a
* button enumeration value that uniquely identifies a button resource. See the
* BUTTON_* and JOYSTICK_* definitions in board.h for the meaning of enumeration
* value. The previous interrupt handler address is returned (so that it may
* restored, if so desired).
*
************************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
EXTERN void up_buttoninit(void);
EXTERN uint8_t up_buttons(void);
#ifdef CONFIG_ARCH_IRQBUTTONS
EXTERN xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
#endif
#endif
/************************************************************************************ /************************************************************************************
* Name: stm32_ledinit, stm32_setled, and stm32_setleds * Name: stm32_ledinit, stm32_setled, and stm32_setleds
* *
@ -364,9 +333,9 @@ EXTERN xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
************************************************************************************/ ************************************************************************************/
#ifndef CONFIG_ARCH_LEDS #ifndef CONFIG_ARCH_LEDS
EXTERN void stm32_ledinit(void); void stm32_ledinit(void);
EXTERN void stm32_setled(int led, bool ledon); void stm32_setled(int led, bool ledon);
EXTERN void stm32_setleds(uint8_t ledset); void stm32_setleds(uint8_t ledset);
#endif #endif
/************************************************************************************ /************************************************************************************
@ -380,7 +349,7 @@ EXTERN void stm32_setleds(uint8_t ledset);
* *
************************************************************************************/ ************************************************************************************/
EXTERN void stm32_lcdclear(uint16_t color); void stm32_lcdclear(uint16_t color);
/************************************************************************************ /************************************************************************************
* Relay control functions * Relay control functions
@ -393,17 +362,17 @@ EXTERN void stm32_lcdclear(uint16_t color);
************************************************************************************/ ************************************************************************************/
#ifdef CONFIG_ARCH_RELAYS #ifdef CONFIG_ARCH_RELAYS
EXTERN void up_relaysinit(void); void up_relaysinit(void);
EXTERN void relays_setstat(int relays, bool stat); void relays_setstat(int relays, bool stat);
EXTERN bool relays_getstat(int relays); bool relays_getstat(int relays);
EXTERN void relays_setstats(uint32_t relays_stat); void relays_setstats(uint32_t relays_stat);
EXTERN uint32_t relays_getstats(void); uint32_t relays_getstats(void);
EXTERN void relays_onoff(int relays, uint32_t mdelay); void relays_onoff(int relays, uint32_t mdelay);
EXTERN void relays_onoffs(uint32_t relays_stat, uint32_t mdelay); void relays_onoffs(uint32_t relays_stat, uint32_t mdelay);
EXTERN void relays_resetmode(int relays); void relays_resetmode(int relays);
EXTERN void relays_powermode(int relays); void relays_powermode(int relays);
EXTERN void relays_resetmodes(uint32_t relays_stat); void relays_resetmodes(uint32_t relays_stat);
EXTERN void relays_powermodes(uint32_t relays_stat); void relays_powermodes(uint32_t relays_stat);
#endif #endif
/************************************************************************************ /************************************************************************************
@ -414,8 +383,8 @@ EXTERN void relays_powermodes(uint32_t relays_stat);
* *
************************************************************************************/ ************************************************************************************/
EXTERN const char *stm32_getchipid(void); const char *stm32_getchipid(void);
EXTERN const char *stm32_getchipid_string(void); const char *stm32_getchipid_string(void);
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/cloudctrl/src/up_buttons.c * configs/cloudctrl/src/up_buttons.c
* *
* Copyright (C) 2012 Gregory Nutt. All rights reserved. * Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* Darcy Gong <darcy.gong@gmail.com> * Darcy Gong <darcy.gong@gmail.com>
* *
@ -42,7 +42,9 @@
#include <stdint.h> #include <stdint.h>
#include <nuttx/arch.h>
#include <arch/board/board.h> #include <arch/board/board.h>
#include "cloudctrl-internal.h" #include "cloudctrl-internal.h"
#ifdef CONFIG_ARCH_BUTTONS #ifdef CONFIG_ARCH_BUTTONS
@ -72,17 +74,17 @@ static const uint16_t g_buttons[NUM_BUTTONS] =
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources.
* that, up_buttons() may be called to collect the current state of all * After that, up_buttons() may be called to collect the current state of
* buttons or up_irqbutton() may be called to register button interrupt * all buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
int i; int i;
@ -130,28 +132,30 @@ uint8_t up_buttons(void)
return ret; return ret;
} }
/************************************************************************************ /****************************************************************************
* Button support. * Button support.
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources.
* that, up_buttons() may be called to collect the current state of all * After that, up_buttons() may be called to collect the current state of
* buttons or up_irqbutton() may be called to register button interrupt * all buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
* After up_buttoninit() has been called, up_buttons() may be called to * After board_button_initialize() has been called, up_buttons() may be
* collect the state of all buttons. up_buttons() returns an 8-bit bit set * called to collect the state of all buttons. up_buttons() returns an
* with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT * 8-bit bit set with each bit associated with a button. See the
* definitions in board.h for the meaning of each bit. * BUTTON_*_BIT and JOYSTICK_*_BIT definitions in board.h for the meaning
* of each bit.
* *
* up_irqbutton() may be called to register an interrupt handler that will * up_irqbutton() may be called to register an interrupt handler that will
* be called when a button is depressed or released. The ID value is a * be called when a button is depressed or released. The ID value is a
* button enumeration value that uniquely identifies a button resource. See the * button enumeration value that uniquely identifies a button resource. See
* BUTTON_* and JOYSTICK_* definitions in board.h for the meaning of enumeration * the
* value. The previous interrupt handler address is returned (so that it may * BUTTON_* and JOYSTICK_* definitions in board.h for the meaning of
* restored, if so desired). * enumeration value. The previous interrupt handler address is returned
* (so that it may restored, if so desired).
* *
************************************************************************************/ ****************************************************************************/
#ifdef CONFIG_ARCH_IRQBUTTONS #ifdef CONFIG_ARCH_IRQBUTTONS
xcpt_t up_irqbutton(int id, xcpt_t irqhandler) xcpt_t up_irqbutton(int id, xcpt_t irqhandler)

View File

@ -117,22 +117,7 @@ extern "C" {
* *
************************************************************************************/ ************************************************************************************/
EXTERN void hcs12_boardinitialize(void); void hcs12_boardinitialize(void);
/************************************************************************************
* Button support.
*
* Description:
* up_buttoninit() must be called to initialize button resources. After that,
* up_buttons() may be called to collect the state of all buttons. up_buttons()
* returns an bit set with bits corresponding to the state of each button.
*
************************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
EXTERN void up_buttoninit(void);
EXTERN uint8_t up_buttons(void);
#endif
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/demo9s12ne64/src/up_leds.c * configs/demo9s12ne64/src/up_leds.c
* *
* Copyright (C) 2009 Gregory Nutt. All rights reserved. * Copyright (C) 2009, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -41,7 +41,9 @@
#include <stdint.h> #include <stdint.h>
#include <nuttx/arch.h>
#include <arch/board/board.h> #include <arch/board/board.h>
#include "demo9s12ne64.h" #include "demo9s12ne64.h"
#ifdef CONFIG_ARCH_BUTTONS #ifdef CONFIG_ARCH_BUTTONS
@ -63,10 +65,10 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
} }

View File

@ -2,7 +2,7 @@
* configs/ea3131/include/board.h * configs/ea3131/include/board.h
* include/arch/board/board.h * include/arch/board/board.h
* *
* Copyright (C) 2009-2010 Gregory Nutt. All rights reserved. * Copyright (C) 2009-2010, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -122,7 +122,8 @@
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)
#define EXTERN extern "C" #define EXTERN extern "C"
extern "C" { extern "C"
{
#else #else
#define EXTERN extern #define EXTERN extern
#endif #endif
@ -140,23 +141,7 @@ extern "C" {
* *
************************************************************************************/ ************************************************************************************/
EXTERN void lpc31_boardinitialize(void); void lpc31_boardinitialize(void);
/************************************************************************************
* Button support.
*
* Description:
* up_buttoninit() must be called to initialize button resources. After that,
* up_buttons() may be called to collect the state of all buttons. up_buttons()
* returns an 8-bit bit set with each bit associated with a button. See the
* BUTTON_* definitions above for the meaning of each bit.
*
************************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
EXTERN void up_buttoninit(void);
EXTERN uint8_t up_buttons(void);
#endif
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/ea3131/src/up_leds.c * configs/ea3131/src/up_leds.c
* *
* Copyright (C) 2009-2010 Gregory Nutt. All rights reserved. * Copyright (C) 2009-2010, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -41,7 +41,9 @@
#include <stdint.h> #include <stdint.h>
#include <nuttx/arch.h>
#include <arch/board/board.h> #include <arch/board/board.h>
#include "ea3131_internal.h" #include "ea3131_internal.h"
#ifdef CONFIG_ARCH_BUTTONS #ifdef CONFIG_ARCH_BUTTONS
@ -63,10 +65,10 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
} }

View File

@ -140,23 +140,7 @@ extern "C" {
* *
************************************************************************************/ ************************************************************************************/
EXTERN void lpc31_boardinitialize(void); void lpc31_boardinitialize(void);
/************************************************************************************
* Button support.
*
* Description:
* up_buttoninit() must be called to initialize button resources. After that,
* up_buttons() may be called to collect the state of all buttons. up_buttons()
* returns an 8-bit bit set with each bit associated with a button. See the
* BUTTON_* definitions above for the meaning of each bit.
*
************************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
EXTERN void up_buttoninit(void);
EXTERN uint8_t up_buttons(void);
#endif
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/ea3152/src/up_leds.c * configs/ea3152/src/up_leds.c
* *
* Copyright (C) 2011 Gregory Nutt. All rights reserved. * Copyright (C) 2011, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -41,7 +41,9 @@
#include <stdint.h> #include <stdint.h>
#include <nuttx/arch.h>
#include <arch/board/board.h> #include <arch/board/board.h>
#include "ea3152_internal.h" #include "ea3152_internal.h"
#ifdef CONFIG_ARCH_BUTTONS #ifdef CONFIG_ARCH_BUTTONS
@ -63,10 +65,10 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
} }

View File

@ -80,11 +80,6 @@ extern "C" {
#define EXTERN extern #define EXTERN extern
#endif #endif
#ifdef CONFIG_ARCH_BUTTONS
EXTERN void up_buttoninit(void);
EXTERN uint8_t up_buttons(void);
#endif
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)
} }

View File

@ -113,11 +113,11 @@ void up_pb2interrupt(void)
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS #ifdef CONFIG_ARCH_BUTTONS
void up_buttoninit(void) void board_button_initialize(void)
{ {
uint8_t regval; uint8_t regval;

View File

@ -383,38 +383,7 @@ extern "C" {
* *
************************************************************************************/ ************************************************************************************/
EXTERN void stm32_boardinitialize(void); void stm32_boardinitialize(void);
/************************************************************************************
* Button support.
*
* Description:
* up_buttoninit() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt
* handlers.
*
* After up_buttoninit() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT
* definitions in board.h for the meaning of each bit.
*
* up_irqbutton() may be called to register an interrupt handler that will
* be called when a button is depressed or released. The ID value is a
* button enumeration value that uniquely identifies a button resource. See the
* BUTTON_* and JOYSTICK_* definitions in board.h for the meaning of enumeration
* value. The previous interrupt handler address is returned (so that it may
* restored, if so desired).
*
************************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
EXTERN void up_buttoninit(void);
EXTERN uint8_t up_buttons(void);
#ifdef CONFIG_ARCH_IRQBUTTONS
EXTERN xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
#endif
#endif
/************************************************************************************ /************************************************************************************
* Name: stm32_ledinit, stm32_setled, and stm32_setleds * Name: stm32_ledinit, stm32_setled, and stm32_setleds
@ -427,9 +396,9 @@ EXTERN xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
************************************************************************************/ ************************************************************************************/
#ifndef CONFIG_ARCH_LEDS #ifndef CONFIG_ARCH_LEDS
EXTERN void stm32_ledinit(void); void stm32_ledinit(void);
EXTERN void stm32_setled(int led, bool ledon); void stm32_setled(int led, bool ledon);
EXTERN void stm32_setleds(uint8_t ledset); void stm32_setleds(uint8_t ledset);
#endif #endif
/************************************************************************************ /************************************************************************************
@ -444,7 +413,7 @@ EXTERN void stm32_setleds(uint8_t ledset);
************************************************************************************/ ************************************************************************************/
#ifdef CONFIG_STM32_FSMC #ifdef CONFIG_STM32_FSMC
EXTERN void fire_lcdclear(uint16_t color); void fire_lcdclear(uint16_t color);
#endif #endif
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/fire-stm32v2/src/up_buttons.c * configs/fire-stm32v2/src/up_buttons.c
* *
* Copyright (C) 2012 Gregory Nutt. All rights reserved. * Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -41,7 +41,9 @@
#include <stdint.h> #include <stdint.h>
#include <nuttx/arch.h>
#include <arch/board/board.h> #include <arch/board/board.h>
#include "fire-internal.h" #include "fire-internal.h"
#ifdef CONFIG_ARCH_BUTTONS #ifdef CONFIG_ARCH_BUTTONS
@ -63,17 +65,17 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources.
* that, up_buttons() may be called to collect the current state of all * After that, up_buttons() may be called to collect the current state of
* buttons or up_irqbutton() may be called to register button interrupt * all buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
/* Configure the GPIO pins as inputs. NOTE that EXTI interrupts are /* Configure the GPIO pins as inputs. NOTE that EXTI interrupts are
* configured for some pins but NOT used in this file * configured for some pins but NOT used in this file
@ -106,28 +108,29 @@ uint8_t up_buttons(void)
return ret; return ret;
} }
/************************************************************************************ /*****************************************************************************
* Button support. * Button support.
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources.
* that, up_buttons() may be called to collect the current state of all * After that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
* After up_buttoninit() has been called, up_buttons() may be called to * After board_button_initialize() has been called, up_buttons() may be
* collect the state of all buttons. up_buttons() returns an 8-bit bit set * called to collect the state of all buttons. up_buttons() returns an
* with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT * 8-bit bit set with each bit associated with a button. See the
* definitions in board.h for the meaning of each bit. * BUTTON_*_BIT and JOYSTICK_*_BIT definitions in board.h for the meaning
* of each bit.
* *
* up_irqbutton() may be called to register an interrupt handler that will * up_irqbutton() may be called to register an interrupt handler that will
* be called when a button is depressed or released. The ID value is a * be called when a button is depressed or released. The ID value is a
* button enumeration value that uniquely identifies a button resource. See the * button enumeration value that uniquely identifies a button resource. See
* BUTTON_* and JOYSTICK_* definitions in board.h for the meaning of enumeration * the BUTTON_* and JOYSTICK_* definitions in board.h for the meaning of
* value. The previous interrupt handler address is returned (so that it may * enumeration values. The previous interrupt handler address is returned
* restored, if so desired). * (so that it may restored, if so desired).
* *
************************************************************************************/ ****************************************************************************/
#ifdef CONFIG_ARCH_IRQBUTTONS #ifdef CONFIG_ARCH_IRQBUTTONS
xcpt_t up_irqbutton(int id, xcpt_t irqhandler) xcpt_t up_irqbutton(int id, xcpt_t irqhandler)

View File

@ -202,38 +202,7 @@ extern "C" {
* *
************************************************************************************/ ************************************************************************************/
EXTERN void stm32_boardinitialize(void); void stm32_boardinitialize(void);
/************************************************************************************
* Button support.
*
* Description:
* up_buttoninit() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt
* handlers.
*
* After up_buttoninit() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT
* definitions in board.h for the meaning of each bit.
*
* up_irqbutton() may be called to register an interrupt handler that will
* be called when a button is depressed or released. The ID value is a
* button enumeration value that uniquely identifies a button resource. See the
* BUTTON_* and JOYSTICK_* definitions in board.h for the meaning of enumeration
* value. The previous interrupt handler address is returned (so that it may
* restored, if so desired).
*
************************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
EXTERN void up_buttoninit(void);
EXTERN uint8_t up_buttons(void);
#ifdef CONFIG_ARCH_IRQBUTTONS
EXTERN xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
#endif
#endif
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/hymini-stm32v/src/up_buttons.c * configs/hymini-stm32v/src/up_buttons.c
* *
* Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved. * Copyright (C) 2009, 2011, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -41,7 +41,9 @@
#include <stdint.h> #include <stdint.h>
#include <nuttx/arch.h>
#include <arch/board/board.h> #include <arch/board/board.h>
#include "hymini_stm32v-internal.h" #include "hymini_stm32v-internal.h"
#ifdef CONFIG_ARCH_BUTTONS #ifdef CONFIG_ARCH_BUTTONS
@ -55,17 +57,17 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources.
* that, up_buttons() may be called to collect the current state of all * After that, up_buttons() may be called to collect the current state of
* buttons or up_irqbutton() may be called to register button interrupt * all buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
stm32_configgpio(GPIO_BTN_KEYA); stm32_configgpio(GPIO_BTN_KEYA);
stm32_configgpio(GPIO_BTN_KEYB); stm32_configgpio(GPIO_BTN_KEYB);
@ -100,28 +102,29 @@ uint8_t up_buttons(void)
return ret; return ret;
} }
/************************************************************************************ /****************************************************************************
* Button support. * Button support.
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources.
* that, up_buttons() may be called to collect the current state of all * After that, up_buttons() may be called to collect the current state of
* buttons or up_irqbutton() may be called to register button interrupt * all buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
* After up_buttoninit() has been called, up_buttons() may be called to * After board_button_initialize() has been called, up_buttons() may be
* collect the state of all buttons. up_buttons() returns an 8-bit bit set * called to collect the state of all buttons. up_buttons() returns an
* with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT * 8-bit bit set with each bit associated with a button. See the
* definitions in board.h for the meaning of each bit. * BUTTON_*_BIT and JOYSTICK_*_BIT definitions in board.h for the meaning
* of each bit.
* *
* up_irqbutton() may be called to register an interrupt handler that will * up_irqbutton() may be called to register an interrupt handler that will
* be called when a button is depressed or released. The ID value is a * be called when a button is depressed or released. The ID value is a
* button enumeration value that uniquely identifies a button resource. See the * button enumeration value that uniquely identifies a button resource. See
* BUTTON_* definitions in board.h for the meaning of enumeration * the BUTTON_* definitions in board.h for the meaning of enumeration
* value. The previous interrupt handler address is returned (so that it may * value. The previous interrupt handler address is returned (so that it
* restored, if so desired). * may be restored, if so desired).
* *
************************************************************************************/ ****************************************************************************/
#ifdef CONFIG_ARCH_IRQBUTTONS #ifdef CONFIG_ARCH_IRQBUTTONS
xcpt_t up_irqbutton(int id, xcpt_t irqhandler) xcpt_t up_irqbutton(int id, xcpt_t irqhandler)

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/kwikstik-k40/src/up_buttons.c * configs/kwikstik-k40/src/up_buttons.c
* *
* Copyright (C) 2011 Gregory Nutt. All rights reserved. * Copyright (C) 2011, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -41,7 +41,9 @@
#include <stdint.h> #include <stdint.h>
#include <nuttx/arch.h>
#include <arch/board/board.h> #include <arch/board/board.h>
#include "kwikstik-internal.h" #include "kwikstik-internal.h"
#ifdef CONFIG_ARCH_BUTTONS #ifdef CONFIG_ARCH_BUTTONS
@ -63,17 +65,17 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources.
* that, up_buttons() may be called to collect the current state of all * After that, up_buttons() may be called to collect the current state of
* buttons or up_irqbutton() may be called to register button interrupt * all buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
/* The KwikStik-K40 board has no standard GPIO contact buttons */ /* The KwikStik-K40 board has no standard GPIO contact buttons */
} }
@ -89,28 +91,29 @@ uint8_t up_buttons(void)
return 0; return 0;
} }
/************************************************************************************ /****************************************************************************
* Button support. * Button support.
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources.
* that, up_buttons() may be called to collect the current state of all * After that, up_buttons() may be called to collect the current state of
* buttons or up_irqbutton() may be called to register button interrupt * all buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
* After up_buttoninit() has been called, up_buttons() may be called to * After board_button_initialize() has been called, up_buttons() may be
* collect the state of all buttons. up_buttons() returns an 8-bit bit set * called to collect the state of all buttons. up_buttons() returns an
* with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT * 8-bit bit set with each bit associated with a button. See the
* definitions in board.h for the meaning of each bit. * BUTTON_*_BIT and JOYSTICK_*_BIT definitions in board.h for the meaning
* of each bit.
* *
* up_irqbutton() may be called to register an interrupt handler that will * up_irqbutton() may be called to register an interrupt handler that will
* be called when a button is depressed or released. The ID value is a * be called when a button is depressed or released. The ID value is a
* button enumeration value that uniquely identifies a button resource. See the * button enumeration value that uniquely identifies a button resource.
* BUTTON_* and JOYSTICK_* definitions in board.h for the meaning of enumeration * See the BUTTON_* and JOYSTICK_* definitions in board.h for the meaning
* value. The previous interrupt handler address is returned (so that it may * of enumeration value. The previous interrupt handler address is
* restored, if so desired). * returned (so that it may be restored, if so desired).
* *
************************************************************************************/ ****************************************************************************/
#ifdef CONFIG_ARCH_IRQBUTTONS #ifdef CONFIG_ARCH_IRQBUTTONS
xcpt_t up_irqbutton(int id, xcpt_t irqhandler) xcpt_t up_irqbutton(int id, xcpt_t irqhandler)

View File

@ -94,17 +94,17 @@ static uint8_t g_buttonirq[BOARD_NUM_BUTTONS] =
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
int i; int i;
@ -120,7 +120,7 @@ void up_buttoninit(void)
* Name: up_buttons * Name: up_buttons
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons. * buttons.
* *
@ -160,7 +160,7 @@ uint8_t up_buttons(void)
* Button support. * Button support.
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_irqbutton() may be called to register button interrupt handlers. * that, up_irqbutton() may be called to register button interrupt handlers.
* *
* up_irqbutton() may be called to register an interrupt handler that will * up_irqbutton() may be called to register an interrupt handler that will

View File

@ -1,8 +1,7 @@
/************************************************************************************ /************************************************************************************
* configs/lm4f120-launchpad/include/board.h * configs/lm4f120-launchpad/include/board.h
* include/arch/board/board.h
* *
* Copyright (C) 2010 Gregory Nutt. All rights reserved. * Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -34,8 +33,8 @@
* *
************************************************************************************/ ************************************************************************************/
#ifndef __ARCH_BOARD_BOARD_H #ifndef __CONFIGS_LM4F120_LAUNCHPAD_INCLUDE_BOARD_H
#define __ARCH_BOARD_BOARD_H #define __CONFIGS_LM4F120_LAUNCHPAD_INCLUDE_BOARD_H
/************************************************************************************ /************************************************************************************
* Included Files * Included Files
@ -219,60 +218,5 @@ void lm4f_setled(int led, bool ledon);
void lm4f_setleds(uint8_t ledset); void lm4f_setleds(uint8_t ledset);
#endif #endif
/************************************************************************************
* Name: up_buttoninit
*
* Description:
* up_buttoninit() must be called to initialize button resources. After that,
* up_buttons() may be called to collect the current state of all buttons or
* up_irqbutton() may be called to register button interrupt handlers.
*
************************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
void up_buttoninit(void);
/************************************************************************************
* Name: up_buttons
*
* Description:
* up_buttoninit() must be called to initialize button resources. After that,
* up_buttons() may be called to collect the current state of all buttons.
*
* After up_buttoninit() has been called, up_buttons() may be called to collect
* the state of all buttons. up_buttons() returns an 8-bit bit set with each bit
* associated with a button. See the BOARD_BUTTON_*_BIT and BOARD_JOYSTICK_*_BIT
* definitions above for the meaning of each bit.
*
************************************************************************************/
uint8_t up_buttons(void);
/************************************************************************************
* Button support.
*
* Description:
* up_buttoninit() must be called to initialize button resources. After that,
* up_irqbutton() may be called to register button interrupt handlers.
*
* up_irqbutton() may be called to register an interrupt handler that will be called
* when a button is depressed or released. The ID value is a button enumeration
* value that uniquely identifies a button resource. See the BOARD_BUTTON_* and
* BOARD_JOYSTICK_* definitions in above for the meaning of enumeration values
* The previous interrupt handler address is returned (so that it may restored, if
* so desired).
*
* Note that up_irqbutton() also enables button interrupts. Button interrupts
* will remain enabled after the interrupt handler is attached. Interrupts may
* be disabled (and detached) by calling up_irqbutton with irqhandler equal to
* NULL.
*
************************************************************************************/
#if defined(CONFIG_ARCH_IRQBUTTONS) && defined(CONFIG_GPIO_IRQ)
xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
#endif
#endif /* CONFIG_ARCH_BUTTONS */
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#endif /* __ARCH_BOARD_BOARD_H */ #endif /* __CONFIGS_LM4F120_LAUNCHPAD_INCLUDE_BOARD_H */

View File

@ -93,17 +93,17 @@ static uint8_t g_buttonirq[BOARD_NUM_BUTTONS] =
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
int i; int i;
@ -119,7 +119,7 @@ void up_buttoninit(void)
* Name: up_buttons * Name: up_buttons
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons. * buttons.
* *
@ -159,7 +159,7 @@ uint8_t up_buttons(void)
* Button support. * Button support.
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_irqbutton() may be called to register button interrupt handlers. * that, up_irqbutton() may be called to register button interrupt handlers.
* *
* up_irqbutton() may be called to register an interrupt handler that will * up_irqbutton() may be called to register an interrupt handler that will

View File

@ -297,37 +297,6 @@ void stm32_setled(int led, bool ledon);
void stm32_setleds(uint8_t ledset); void stm32_setleds(uint8_t ledset);
#endif #endif
/************************************************************************************
* Button support.
*
* Description:
* up_buttoninit() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt
* handlers.
*
* After up_buttoninit() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT
* definitions in board.h for the meaning of each bit.
*
* up_irqbutton() may be called to register an interrupt handler that will
* be called when a button is depressed or released. The ID value is a
* button enumeration value that uniquely identifies a button resource. See the
* BUTTON_* definitions in board.h for the meaning of enumeration
* value. The previous interrupt handler address is returned (so that it may
* restored, if so desired).
*
************************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
void up_buttoninit(void);
uint8_t up_buttons(void);
#ifdef CONFIG_ARCH_IRQBUTTONS
xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
#endif
#endif
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)
} }

View File

@ -125,22 +125,7 @@ extern "C" {
* *
************************************************************************************/ ************************************************************************************/
EXTERN void hcs12_boardinitialize(void); void hcs12_boardinitialize(void);
/************************************************************************************
* Button support.
*
* Description:
* up_buttoninit() must be called to initialize button resources. After that,
* up_buttons() may be called to collect the state of all buttons. up_buttons()
* returns an bit set with bits corresponding to the state of each button.
*
************************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
EXTERN void up_buttoninit(void);
EXTERN uint8_t up_buttons(void);
#endif
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/ne64badge/src/up_buttons.c * configs/ne64badge/src/up_buttons.c
* *
* Copyright (C) 2011 Gregory Nutt. All rights reserved. * Copyright (C) 2011, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -41,7 +41,9 @@
#include <stdint.h> #include <stdint.h>
#include <nuttx/arch.h>
#include <arch/board/board.h> #include <arch/board/board.h>
#include "ne64badge_internal.h" #include "ne64badge_internal.h"
#ifdef CONFIG_ARCH_BUTTONS #ifdef CONFIG_ARCH_BUTTONS
@ -91,19 +93,19 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
/* Configure all button GPIO lines */ /* Configure all button GPIO lines */
btn_dumpgpio("up_buttoninit() Entry)"); btn_dumpgpio("board_button_initialize() Entry)");
hcs12_configgpio(NE64BADGE_BUTTON1); hcs12_configgpio(NE64BADGE_BUTTON1);
hcs12_configgpio(NE64BADGE_BUTTON2); hcs12_configgpio(NE64BADGE_BUTTON2);
btn_dumpgpio("up_buttoninit() Exit"); btn_dumpgpio("board_button_initialize() Exit");
} }
/**************************************************************************** /****************************************************************************

View File

@ -398,61 +398,6 @@ EXTERN void lpc17_setled(int led, bool ledon);
EXTERN void lpc17_setleds(uint8_t ledset); EXTERN void lpc17_setleds(uint8_t ledset);
#endif #endif
/************************************************************************************
* Name: up_buttoninit
*
* Description:
* up_buttoninit() must be called to initialize button resources. After that,
* up_buttons() may be called to collect the current state of all buttons or
* up_irqbutton() may be called to register button interrupt handlers.
*
************************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
EXTERN void up_buttoninit(void);
/************************************************************************************
* Name: up_buttons
*
* Description:
* up_buttoninit() must be called to initialize button resources. After that,
* up_buttons() may be called to collect the current state of all buttons.
*
* After up_buttoninit() has been called, up_buttons() may be called to collect
* the state of all buttons. up_buttons() returns an 8-bit bit set with each bit
* associated with a button. See the BOARD_BUTTON_*_BIT and BOARD_JOYSTICK_*_BIT
* definitions above for the meaning of each bit.
*
************************************************************************************/
EXTERN uint8_t up_buttons(void);
/************************************************************************************
* Button support.
*
* Description:
* up_buttoninit() must be called to initialize button resources. After that,
* up_irqbutton() may be called to register button interrupt handlers.
*
* up_irqbutton() may be called to register an interrupt handler that will be called
* when a button is depressed or released. The ID value is a button enumeration
* value that uniquely identifies a button resource. See the BOARD_BUTTON_* and
* BOARD_JOYSTICK_* definitions in above for the meaning of enumeration values
* The previous interrupt handler address is returned (so that it may restored, if
* so desired).
*
* Note that up_irqbutton() also enables button interrupts. Button interrupts
* will remain enabled after the interrupt handler is attached. Interrupts may
* be disabled (and detached) by calling up_irqbutton with irqhandler equal to
* NULL.
*
************************************************************************************/
#if defined(CONFIG_ARCH_IRQBUTTONS) && defined(CONFIG_GPIO_IRQ)
EXTERN xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
#endif
#endif /* CONFIG_ARCH_BUTTONS */
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)
} }

View File

@ -97,17 +97,17 @@ static uint8_t g_buttonirq[BOARD_NUM_BUTTONS] =
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
int i; int i;
@ -123,7 +123,7 @@ void up_buttoninit(void)
* Name: up_buttons * Name: up_buttons
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons. * buttons.
* *
@ -163,7 +163,7 @@ uint8_t up_buttons(void)
* Button support. * Button support.
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_irqbutton() may be called to register button interrupt handlers. * that, up_irqbutton() may be called to register button interrupt handlers.
* *
* up_irqbutton() may be called to register an interrupt handler that will * up_irqbutton() may be called to register an interrupt handler that will

View File

@ -90,7 +90,7 @@ void stm32_boardinitialize(void)
/* Configure on-board BUTTONs if BUTTON support has been selected. */ /* Configure on-board BUTTONs if BUTTON support has been selected. */
#ifdef CONFIG_ARCH_BUTTONS #ifdef CONFIG_ARCH_BUTTONS
up_buttoninit(); board_button_initialize();
#endif #endif
} }

View File

@ -40,7 +40,10 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdint.h> #include <stdint.h>
#include <nuttx/arch.h>
#include <arch/board/board.h> #include <arch/board/board.h>
#include "olimex-stm32-p207.h" #include "olimex-stm32-p207.h"
#ifdef CONFIG_ARCH_BUTTONS #ifdef CONFIG_ARCH_BUTTONS
@ -77,17 +80,17 @@ static const uint16_t g_buttons[NUM_BUTTONS] =
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
int i; int i;
@ -153,12 +156,12 @@ uint8_t up_buttons(void)
* Button support. * Button support.
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
* After up_buttoninit() has been called, up_buttons() may be called to * After board_button_initialize() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set * collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT * with each bit associated with a button. See the BUTTON_*_BIT
* definitions in board.h for the meaning of each bit. * definitions in board.h for the meaning of each bit.

View File

@ -171,11 +171,6 @@ extern "C" {
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
EXTERN void up_buttoninit(void);
EXTERN uint8_t up_buttons(void);
#endif
#undef EXTERN #undef EXTERN
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -72,11 +72,11 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS #ifdef CONFIG_ARCH_BUTTONS
void up_buttoninit(void) void board_button_initialize(void)
{ {
uint16_t reg16; uint16_t reg16;

View File

@ -483,61 +483,6 @@ EXTERN void lpc17_setled(int led, bool ledon);
EXTERN void lpc17_setleds(uint8_t ledset); EXTERN void lpc17_setleds(uint8_t ledset);
#endif #endif
/************************************************************************************
* Name: up_buttoninit
*
* Description:
* up_buttoninit() must be called to initialize button resources. After that,
* up_buttons() may be called to collect the current state of all buttons or
* up_irqbutton() may be called to register button interrupt handlers.
*
************************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
EXTERN void up_buttoninit(void);
/************************************************************************************
* Name: up_buttons
*
* Description:
* up_buttoninit() must be called to initialize button resources. After that,
* up_buttons() may be called to collect the current state of all buttons.
*
* After up_buttoninit() has been called, up_buttons() may be called to collect
* the state of all buttons. up_buttons() returns an 8-bit bit set with each bit
* associated with a button. See the BOARD_BUTTON_*_BIT and BOARD_JOYSTICK_*_BIT
* definitions above for the meaning of each bit.
*
************************************************************************************/
EXTERN uint8_t up_buttons(void);
/************************************************************************************
* Button support.
*
* Description:
* up_buttoninit() must be called to initialize button resources. After that,
* up_irqbutton() may be called to register button interrupt handlers.
*
* up_irqbutton() may be called to register an interrupt handler that will be called
* when a button is depressed or released. The ID value is a button enumeration
* value that uniquely identifies a button resource. See the BOARD_BUTTON_* and
* BOARD_JOYSTICK_* definitions in above for the meaning of enumeration values
* The previous interrupt handler address is returned (so that it may restored, if
* so desired).
*
* Note that up_irqbutton() also enables button interrupts. Button interrupts
* will remain enabled after the interrupt handler is attached. Interrupts may
* be disabled (and detached) by calling up_irqbutton with irqhandler equal to
* NULL.
*
************************************************************************************/
#if defined(CONFIG_ARCH_IRQBUTTONS) && defined(CONFIG_GPIO_IRQ)
EXTERN xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
#endif
#endif /* CONFIG_ARCH_BUTTONS */
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)
} }

View File

@ -115,17 +115,17 @@ static uint8_t g_buttonirq[BOARD_NUM_BUTTONS] =
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
int i; int i;
@ -141,7 +141,7 @@ void up_buttoninit(void)
* Name: up_buttons * Name: up_buttons
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons. * buttons.
* *
@ -181,7 +181,7 @@ uint8_t up_buttons(void)
* Button support. * Button support.
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_irqbutton() may be called to register button interrupt handlers. * that, up_irqbutton() may be called to register button interrupt handlers.
* *
* up_irqbutton() may be called to register an interrupt handler that will * up_irqbutton() may be called to register an interrupt handler that will

View File

@ -201,48 +201,6 @@ void a1x_setled(int led, bool ledon);
void a1x_setleds(uint8_t ledset); void a1x_setleds(uint8_t ledset);
#endif #endif
/************************************************************************************
* Name: up_buttoninit
*
* Description:
* up_buttoninit() must be called to initialize button resources. After that,
* up_buttons() may be called to collect the current state of all buttons or
* up_irqbutton() may be called to register button interrupt handlers.
*
************************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
void up_buttoninit(void);
/************************************************************************************
* Name: up_buttons
*
* Description:
* After up_buttoninit() has been called, up_buttons() may be called to collect
* the state of all buttons. up_buttons() returns an 8-bit bit set with each bit
* associated with a button. See the BUTTON* definitions above for the meaning of
* each bit in the returned value.
*
************************************************************************************/
uint8_t up_buttons(void);
/************************************************************************************
* Name: up_irqbutton
*
* Description:
* This function may be called to register an interrupt handler that will be
* called when a button is depressed or released. The ID value is one of the
* BUTTON* definitions provided above. The previous interrupt handler address is
* returned (so that it may restored, if so desired).
*
************************************************************************************/
#ifdef CONFIG_A1X_PIO_IRQ
xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
#endif
#endif /* CONFIG_ARCH_BUTTONS */
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)
} }

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/pcduino-a10/src/a1x_buttons.c * configs/pcduino-a10/src/a1x_buttons.c
* *
* Copyright (C) 2013 Gregory Nutt. All rights reserved. * Copyright (C) 2013-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -41,6 +41,7 @@
#include <stdint.h> #include <stdint.h>
#include <nuttx/arch.h>
#include <nuttx/irq.h> #include <nuttx/irq.h>
#include <arch/irq.h> #include <arch/irq.h>
@ -71,17 +72,17 @@ static xcpt_t g_irqbutton[BOARD_NBUTTONS];
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
# warning Missing logic # warning Missing logic
} }
@ -90,7 +91,7 @@ void up_buttoninit(void)
* Name: up_buttons * Name: up_buttons
* *
* Description: * Description:
* After up_buttoninit() has been called, up_buttons() may be called to * After board_button_initialize() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set * collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON* definitions * with each bit associated with a button. See the BUTTON* definitions
* above for the meaning of each bit in the returned value. * above for the meaning of each bit in the returned value.

View File

@ -185,48 +185,6 @@ extern "C" {
void sam_boardinitialize(void); void sam_boardinitialize(void);
/************************************************************************************
* Name: up_buttoninit
*
* Description:
* up_buttoninit() must be called to initialize button resources. After that,
* up_buttons() may be called to collect the current state of all buttons or
* up_irqbutton() may be called to register button interrupt handlers.
*
************************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
void up_buttoninit(void);
/************************************************************************************
* Name: up_buttons
*
* Description:
* After up_buttoninit() has been called, up_buttons() may be called to collect
* the state of all buttons. up_buttons() returns an 8-bit bit set with each bit
* associated with a button. See the BUTTON* definitions above for the meaning of
* each bit in the returned value.
*
************************************************************************************/
uint8_t up_buttons(void);
/************************************************************************************
* Name: up_irqbutton
*
* Description:
* This function may be called to register an interrupt handler that will be
* called when a button is depressed or released. The ID value is one of the
* BUTTON* definitions provided above. The previous interrupt handler address is
* returned (so that it may restored, if so desired).
*
************************************************************************************/
#ifdef CONFIG_GPIOA_IRQ
xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
#endif
#endif /* CONFIG_ARCH_BUTTONS */
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)
} }

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/sam3u-ek/src/up_leds.c * configs/sam3u-ek/src/up_leds.c
* *
* Copyright (C) 2010 Gregory Nutt. All rights reserved. * Copyright (C) 2010, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -41,6 +41,7 @@
#include <stdint.h> #include <stdint.h>
#include <nuttx/arch.h>
#include <nuttx/irq.h> #include <nuttx/irq.h>
#include <arch/irq.h> #include <arch/irq.h>
@ -111,17 +112,17 @@ static xcpt_t up_irqbuttonx(int irq, xcpt_t irqhandler, xcpt_t *store)
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
(void)sam_configgpio(GPIO_BUTTON1); (void)sam_configgpio(GPIO_BUTTON1);
(void)sam_configgpio(GPIO_BUTTON2); (void)sam_configgpio(GPIO_BUTTON2);
@ -131,7 +132,7 @@ void up_buttoninit(void)
* Name: up_buttons * Name: up_buttons
* *
* Description: * Description:
* After up_buttoninit() has been called, up_buttons() may be called to collect * After board_button_initialize() has been called, up_buttons() may be called to collect
* the state of all buttons. up_buttons() returns an 8-bit bit set with each bit * the state of all buttons. up_buttons() returns an 8-bit bit set with each bit
* associated with a button. See the BUTTON* definitions above for the meaning of * associated with a button. See the BUTTON* definitions above for the meaning of
* each bit in the returned value. * each bit in the returned value.

View File

@ -332,48 +332,6 @@ void sam_setled(int led, bool ledon);
void sam_setleds(uint8_t ledset); void sam_setleds(uint8_t ledset);
#endif #endif
/************************************************************************************
* Name: up_buttoninit
*
* Description:
* up_buttoninit() must be called to initialize button resources. After that,
* up_buttons() may be called to collect the current state of all buttons or
* up_irqbutton() may be called to register button interrupt handlers.
*
************************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
void up_buttoninit(void);
/************************************************************************************
* Name: up_buttons
*
* Description:
* After up_buttoninit() has been called, up_buttons() may be called to collect
* the state of all buttons. up_buttons() returns an 8-bit bit set with each bit
* associated with a button. See the BUTTON* definitions above for the meaning of
* each bit in the returned value.
*
************************************************************************************/
uint8_t up_buttons(void);
/************************************************************************************
* Name: up_irqbutton
*
* Description:
* This function may be called to register an interrupt handler that will be
* called when a button is depressed or released. The ID value is one of the
* BUTTON* definitions provided above. The previous interrupt handler address is
* returned (so that it may restored, if so desired).
*
************************************************************************************/
#ifdef CONFIG_GPIOA_IRQ
xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
#endif
#endif /* CONFIG_ARCH_BUTTONS */
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)
} }

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/sam4l-xplained/src/sam_buttons.c * configs/sam4l-xplained/src/sam_buttons.c
* *
* Copyright (C) 2013 Gregory Nutt. All rights reserved. * Copyright (C) 2013-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -41,6 +41,7 @@
#include <stdint.h> #include <stdint.h>
#include <nuttx/arch.h>
#include <nuttx/irq.h> #include <nuttx/irq.h>
#include <arch/irq.h> #include <arch/irq.h>
@ -72,17 +73,17 @@ static xcpt_t g_irqsw0;
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
(void)sam_configgpio(GPIO_SW0); (void)sam_configgpio(GPIO_SW0);
} }
@ -91,7 +92,7 @@ void up_buttoninit(void)
* Name: up_buttons * Name: up_buttons
* *
* Description: * Description:
* After up_buttoninit() has been called, up_buttons() may be called to collect * After board_button_initialize() has been called, up_buttons() may be called to collect
* the state of all buttons. up_buttons() returns an 8-bit bit set with each bit * the state of all buttons. up_buttons() returns an 8-bit bit set with each bit
* associated with a button. See the BUTTON* definitions above for the meaning of * associated with a button. See the BUTTON* definitions above for the meaning of
* each bit in the returned value. * each bit in the returned value.

View File

@ -272,48 +272,6 @@ void sam_setled(int led, bool ledon);
void sam_setleds(uint8_t ledset); void sam_setleds(uint8_t ledset);
#endif #endif
/************************************************************************************
* Name: up_buttoninit
*
* Description:
* up_buttoninit() must be called to initialize button resources. After that,
* up_buttons() may be called to collect the current state of all buttons or
* up_irqbutton() may be called to register button interrupt handlers.
*
************************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
void up_buttoninit(void);
/************************************************************************************
* Name: up_buttons
*
* Description:
* After up_buttoninit() has been called, up_buttons() may be called to collect
* the state of all buttons. up_buttons() returns an 8-bit bit set with each bit
* associated with a button. See the BUTTON* definitions above for the meaning of
* each bit in the returned value.
*
************************************************************************************/
uint8_t up_buttons(void);
/************************************************************************************
* Name: up_irqbutton
*
* Description:
* This function may be called to register an interrupt handler that will be
* called when a button is depressed or released. The ID value is one of the
* BUTTON* definitions provided above. The previous interrupt handler address is
* returned (so that it may restored, if so desired).
*
************************************************************************************/
#ifdef CONFIG_GPIOA_IRQ
xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
#endif
#endif /* CONFIG_ARCH_BUTTONS */
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)
} }

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/sam4s-xplained/src/sam_buttons.c * configs/sam4s-xplained/src/sam_buttons.c
* *
* Copyright (C) 2013 Gregory Nutt. All rights reserved. * Copyright (C) 2013-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -41,6 +41,7 @@
#include <stdint.h> #include <stdint.h>
#include <nuttx/arch.h>
#include <nuttx/irq.h> #include <nuttx/irq.h>
#include <arch/irq.h> #include <arch/irq.h>
@ -70,17 +71,17 @@ static xcpt_t g_irqbp2;
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
(void)sam_configgpio(GPIO_BP2); (void)sam_configgpio(GPIO_BP2);
} }
@ -89,7 +90,7 @@ void up_buttoninit(void)
* Name: up_buttons * Name: up_buttons
* *
* Description: * Description:
* After up_buttoninit() has been called, up_buttons() may be called to collect * After board_button_initialize() has been called, up_buttons() may be called to collect
* the state of all buttons. up_buttons() returns an 8-bit bit set with each bit * the state of all buttons. up_buttons() returns an 8-bit bit set with each bit
* associated with a button. See the BUTTON* definitions above for the meaning of * associated with a button. See the BUTTON* definitions above for the meaning of
* each bit in the returned value. * each bit in the returned value.

View File

@ -364,48 +364,6 @@ void sam_setled(int led, bool ledon);
void sam_setleds(uint8_t ledset); void sam_setleds(uint8_t ledset);
#endif #endif
/************************************************************************************
* Name: up_buttoninit
*
* Description:
* up_buttoninit() must be called to initialize button resources. After that,
* up_buttons() may be called to collect the current state of all buttons or
* up_irqbutton() may be called to register button interrupt handlers.
*
************************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
void up_buttoninit(void);
/************************************************************************************
* Name: up_buttons
*
* Description:
* After up_buttoninit() has been called, up_buttons() may be called to collect
* the state of all buttons. up_buttons() returns an 8-bit bit set with each bit
* associated with a button. See the BUTTON* definitions above for the meaning of
* each bit in the returned value.
*
************************************************************************************/
uint8_t up_buttons(void);
/************************************************************************************
* Name: up_irqbutton
*
* Description:
* This function may be called to register an interrupt handler that will be
* called when a button is depressed or released. The ID value is one of the
* BUTTON* definitions provided above. The previous interrupt handler address is
* returned (so that it may restored, if so desired).
*
************************************************************************************/
#ifdef CONFIG_SAMA5_PIOE_IRQ
xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
#endif
#endif /* CONFIG_ARCH_BUTTONS */
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)
} }

View File

@ -56,6 +56,7 @@
#include <stdint.h> #include <stdint.h>
#include <nuttx/arch.h>
#include <nuttx/irq.h> #include <nuttx/irq.h>
#include <arch/irq.h> #include <arch/irq.h>
@ -87,17 +88,17 @@ static xcpt_t g_irquser1;
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
(void)sam_configpio(PIO_USER1); (void)sam_configpio(PIO_USER1);
} }
@ -106,7 +107,7 @@ void up_buttoninit(void)
* Name: up_buttons * Name: up_buttons
* *
* Description: * Description:
* After up_buttoninit() has been called, up_buttons() may be called to * After board_button_initialize() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set * collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON* definitions * with each bit associated with a button. See the BUTTON* definitions
* above for the meaning of each bit in the returned value. * above for the meaning of each bit in the returned value.

View File

@ -368,37 +368,6 @@ extern "C" {
void stm32_boardinitialize(void); void stm32_boardinitialize(void);
/************************************************************************************
* Button support.
*
* Description:
* up_buttoninit() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt
* handlers.
*
* After up_buttoninit() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT
* definitions in board.h for the meaning of each bit.
*
* up_irqbutton() may be called to register an interrupt handler that will
* be called when a button is depressed or released. The ID value is a
* button enumeration value that uniquely identifies a button resource. See the
* BUTTON_* and JOYSTICK_* definitions in board.h for the meaning of enumeration
* value. The previous interrupt handler address is returned (so that it may
* restored, if so desired).
*
************************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
EXTERN void up_buttoninit(void);
EXTERN uint8_t up_buttons(void);
#ifdef CONFIG_ARCH_IRQBUTTONS
EXTERN xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
#endif
#endif
/************************************************************************************ /************************************************************************************
* Name: stm32_ledinit, stm32_setled, and stm32_setleds * Name: stm32_ledinit, stm32_setled, and stm32_setleds
* *
@ -410,9 +379,9 @@ EXTERN xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
************************************************************************************/ ************************************************************************************/
#ifndef CONFIG_ARCH_LEDS #ifndef CONFIG_ARCH_LEDS
EXTERN void stm32_ledinit(void); void stm32_ledinit(void);
EXTERN void stm32_setled(int led, bool ledon); void stm32_setled(int led, bool ledon);
EXTERN void stm32_setleds(uint8_t ledset); void stm32_setleds(uint8_t ledset);
#endif #endif
/************************************************************************************ /************************************************************************************
@ -426,7 +395,7 @@ EXTERN void stm32_setleds(uint8_t ledset);
* *
************************************************************************************/ ************************************************************************************/
EXTERN void stm32_lcdclear(uint16_t color); void stm32_lcdclear(uint16_t color);
/************************************************************************************ /************************************************************************************
* Relay control functions * Relay control functions
@ -439,17 +408,17 @@ EXTERN void stm32_lcdclear(uint16_t color);
************************************************************************************/ ************************************************************************************/
#ifdef CONFIG_ARCH_RELAYS #ifdef CONFIG_ARCH_RELAYS
EXTERN void up_relaysinit(void); void up_relaysinit(void);
EXTERN void relays_setstat(int relays, bool stat); void relays_setstat(int relays, bool stat);
EXTERN bool relays_getstat(int relays); bool relays_getstat(int relays);
EXTERN void relays_setstats(uint32_t relays_stat); void relays_setstats(uint32_t relays_stat);
EXTERN uint32_t relays_getstats(void); uint32_t relays_getstats(void);
EXTERN void relays_onoff(int relays, uint32_t mdelay); void relays_onoff(int relays, uint32_t mdelay);
EXTERN void relays_onoffs(uint32_t relays_stat, uint32_t mdelay); void relays_onoffs(uint32_t relays_stat, uint32_t mdelay);
EXTERN void relays_resetmode(int relays); void relays_resetmode(int relays);
EXTERN void relays_powermode(int relays); void relays_powermode(int relays);
EXTERN void relays_resetmodes(uint32_t relays_stat); void relays_resetmodes(uint32_t relays_stat);
EXTERN void relays_powermodes(uint32_t relays_stat); void relays_powermodes(uint32_t relays_stat);
#endif #endif
/************************************************************************************ /************************************************************************************
@ -460,8 +429,8 @@ EXTERN void relays_powermodes(uint32_t relays_stat);
* *
************************************************************************************/ ************************************************************************************/
EXTERN const char *stm32_getchipid(void); const char *stm32_getchipid(void);
EXTERN const char *stm32_getchipid_string(void); const char *stm32_getchipid_string(void);
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/shenzhou/src/up_buttons.c * configs/shenzhou/src/up_buttons.c
* *
* Copyright (C) 2012 Gregory Nutt. All rights reserved. * Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -41,7 +41,9 @@
#include <stdint.h> #include <stdint.h>
#include <nuttx/arch.h>
#include <arch/board/board.h> #include <arch/board/board.h>
#include "shenzhou-internal.h" #include "shenzhou-internal.h"
#ifdef CONFIG_ARCH_BUTTONS #ifdef CONFIG_ARCH_BUTTONS
@ -71,17 +73,17 @@ static const uint16_t g_buttons[NUM_BUTTONS] =
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
int i; int i;
@ -133,12 +135,12 @@ uint8_t up_buttons(void)
* Button support. * Button support.
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
* After up_buttoninit() has been called, up_buttons() may be called to * After board_button_initialize() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set * collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT * with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT
* definitions in board.h for the meaning of each bit. * definitions in board.h for the meaning of each bit.

View File

@ -69,11 +69,11 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS #ifdef CONFIG_ARCH_BUTTONS
void up_buttoninit(void) void board_button_initialize(void)
{ {
uint8_t regval; uint8_t regval;

View File

@ -221,36 +221,6 @@ extern "C"
/************************************************************************************ /************************************************************************************
* Public Function Prototypes * Public Function Prototypes
************************************************************************************/ ************************************************************************************/
/************************************************************************************
* Button support.
*
* Description:
* up_buttoninit() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt
* handlers.
*
* After up_buttoninit() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT
* definitions in board.h for the meaning of each bit.
*
* up_irqbutton() may be called to register an interrupt handler that will
* be called when a button is depressed or released. The ID value is a
* button enumeration value that uniquely identifies a button resource. See the
* BUTTON_* and JOYSTICK_* definitions in board.h for the meaning of enumeration
* value. The previous interrupt handler address is returned (so that it may
* restored, if so desired).
*
************************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
void up_buttoninit(void);
uint8_t up_buttons(void);
#ifdef CONFIG_ARCH_IRQBUTTONS
xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
#endif
#endif
/************************************************************************************ /************************************************************************************
* Name: up_ledinit, up_setled, and up_setleds * Name: up_ledinit, up_setled, and up_setleds

View File

@ -78,7 +78,7 @@ void stm32_boardinitialize(void)
#endif #endif
#ifdef CONFIG_ARCH_HAVE_BUTTONS #ifdef CONFIG_ARCH_HAVE_BUTTONS
up_buttoninit(); board_button_initialize();
#endif #endif
/* Configure SPI chip selects if 1) SP2 is not disabled, and 2) the weak function /* Configure SPI chip selects if 1) SP2 is not disabled, and 2) the weak function

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/spark/src/up_buttons.c * configs/spark/src/up_buttons.c
* *
* Copyright (C) 2011-2013 Gregory Nutt. All rights reserved. * Copyright (C) 2011-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -41,7 +41,9 @@
#include <stdint.h> #include <stdint.h>
#include <nuttx/arch.h>
#include <arch/board/board.h> #include <arch/board/board.h>
#include "spark.h" #include "spark.h"
#ifdef CONFIG_ARCH_BUTTONS #ifdef CONFIG_ARCH_BUTTONS
@ -63,17 +65,17 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
/* Configure the GPIO pins as inputs. NOTE that EXTI interrupts are /* Configure the GPIO pins as inputs. NOTE that EXTI interrupts are
* configured for all pins. * configured for all pins.
@ -97,12 +99,12 @@ uint8_t up_buttons(void)
* Button support. * Button support.
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
* After up_buttoninit() has been called, up_buttons() may be called to * After board_button_initialize() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set * collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT * with each bit associated with a button. See the BUTTON_*_BIT
* definitions in board.h for the meaning of each bit. * definitions in board.h for the meaning of each bit.

View File

@ -232,37 +232,6 @@ extern "C" {
EXTERN void stm32_boardinitialize(void); EXTERN void stm32_boardinitialize(void);
/************************************************************************************
* Button support.
*
* Description:
* up_buttoninit() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt
* handlers.
*
* After up_buttoninit() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT
* definitions in board.h for the meaning of each bit.
*
* up_irqbutton() may be called to register an interrupt handler that will
* be called when a button is depressed or released. The ID value is a
* button enumeration value that uniquely identifies a button resource. See the
* BUTTON_* and JOYSTICK_* definitions in board.h for the meaning of enumeration
* value. The previous interrupt handler address is returned (so that it may
* restored, if so desired).
*
************************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
EXTERN void up_buttoninit(void);
EXTERN uint8_t up_buttons(void);
#ifdef CONFIG_ARCH_IRQBUTTONS
EXTERN xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
#endif
#endif
/************************************************************************************ /************************************************************************************
* Name: stm3210e_lcdclear * Name: stm3210e_lcdclear
* *

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/stm3210e-eval/src/up_buttons.c * configs/stm3210e-eval/src/up_buttons.c
* *
* Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved. * Copyright (C) 2009, 2011, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -41,7 +41,9 @@
#include <stdint.h> #include <stdint.h>
#include <nuttx/arch.h>
#include <arch/board/board.h> #include <arch/board/board.h>
#include "stm3210e-internal.h" #include "stm3210e-internal.h"
#ifdef CONFIG_ARCH_BUTTONS #ifdef CONFIG_ARCH_BUTTONS
@ -72,17 +74,17 @@ static const uint16_t g_buttons[NUM_BUTTONS] =
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
int i; int i;
@ -134,12 +136,12 @@ uint8_t up_buttons(void)
* Button support. * Button support.
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
* After up_buttoninit() has been called, up_buttons() may be called to * After board_button_initialize() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set * collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT * with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT
* definitions in board.h for the meaning of each bit. * definitions in board.h for the meaning of each bit.

View File

@ -298,7 +298,7 @@ void up_pmbuttons(void)
{ {
/* Initialize the button GPIOs */ /* Initialize the button GPIOs */
up_buttoninit(); board_button_initialize();
#ifdef CONFIG_ARCH_IRQBUTTONS #ifdef CONFIG_ARCH_IRQBUTTONS
int i; int i;

View File

@ -481,37 +481,6 @@ EXTERN void stm32_setled(int led, bool ledon);
EXTERN void stm32_setleds(uint8_t ledset); EXTERN void stm32_setleds(uint8_t ledset);
#endif #endif
/************************************************************************************
* Button support.
*
* Description:
* up_buttoninit() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt
* handlers.
*
* After up_buttoninit() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT
* definitions in board.h for the meaning of each bit.
*
* up_irqbutton() may be called to register an interrupt handler that will
* be called when a button is depressed or released. The ID value is a
* button enumeration value that uniquely identifies a button resource. See the
* BUTTON_* definitions in board.h for the meaning of enumeration
* value. The previous interrupt handler address is returned (so that it may
* restored, if so desired).
*
************************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
EXTERN void up_buttoninit(void);
EXTERN uint8_t up_buttons(void);
#ifdef CONFIG_ARCH_IRQBUTTONS
EXTERN xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
#endif
#endif
/************************************************************************************ /************************************************************************************
* Name: stm3220g_lcdclear * Name: stm3220g_lcdclear
* *

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/stm3220g-eval/src/up_buttons.c * configs/stm3220g-eval/src/up_buttons.c
* *
* Copyright (C) 2012 Gregory Nutt. All rights reserved. * Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -41,7 +41,9 @@
#include <stdint.h> #include <stdint.h>
#include <nuttx/arch.h>
#include <arch/board/board.h> #include <arch/board/board.h>
#include "stm3220g-internal.h" #include "stm3220g-internal.h"
#ifdef CONFIG_ARCH_BUTTONS #ifdef CONFIG_ARCH_BUTTONS
@ -72,17 +74,17 @@ static const uint16_t g_buttons[NUM_BUTTONS] =
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
int i; int i;
@ -134,12 +136,12 @@ uint8_t up_buttons(void)
* Button support. * Button support.
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
* After up_buttoninit() has been called, up_buttons() may be called to * After board_button_initialize() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set * collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT * with each bit associated with a button. See the BUTTON_*_BIT
* definitions in board.h for the meaning of each bit. * definitions in board.h for the meaning of each bit.

View File

@ -480,7 +480,7 @@ extern "C" {
* *
************************************************************************************/ ************************************************************************************/
EXTERN void stm32_boardinitialize(void); void stm32_boardinitialize(void);
/************************************************************************************ /************************************************************************************
* Name: stm32_ledinit, stm32_setled, and stm32_setleds * Name: stm32_ledinit, stm32_setled, and stm32_setleds
@ -493,40 +493,9 @@ EXTERN void stm32_boardinitialize(void);
************************************************************************************/ ************************************************************************************/
#ifndef CONFIG_ARCH_LEDS #ifndef CONFIG_ARCH_LEDS
EXTERN void stm32_ledinit(void); void stm32_ledinit(void);
EXTERN void stm32_setled(int led, bool ledon); void stm32_setled(int led, bool ledon);
EXTERN void stm32_setleds(uint8_t ledset); void stm32_setleds(uint8_t ledset);
#endif
/************************************************************************************
* Button support.
*
* Description:
* up_buttoninit() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt
* handlers.
*
* After up_buttoninit() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT
* definitions in board.h for the meaning of each bit.
*
* up_irqbutton() may be called to register an interrupt handler that will
* be called when a button is depressed or released. The ID value is a
* button enumeration value that uniquely identifies a button resource. See the
* BUTTON_* definitions in board.h for the meaning of enumeration
* value. The previous interrupt handler address is returned (so that it may
* restored, if so desired).
*
************************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
EXTERN void up_buttoninit(void);
EXTERN uint8_t up_buttons(void);
#ifdef CONFIG_ARCH_IRQBUTTONS
EXTERN xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
#endif
#endif #endif
/************************************************************************************ /************************************************************************************
@ -541,7 +510,7 @@ EXTERN xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
************************************************************************************/ ************************************************************************************/
#ifdef CONFIG_STM32_FSMC #ifdef CONFIG_STM32_FSMC
EXTERN void stm3240g_lcdclear(uint16_t color); void stm3240g_lcdclear(uint16_t color);
#endif #endif
#undef EXTERN #undef EXTERN

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/stm3240g-eval/src/up_buttons.c * configs/stm3240g-eval/src/up_buttons.c
* *
* Copyright (C) 2011 Gregory Nutt. All rights reserved. * Copyright (C) 2011, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -41,7 +41,9 @@
#include <stdint.h> #include <stdint.h>
#include <nuttx/arch.h>
#include <arch/board/board.h> #include <arch/board/board.h>
#include "stm3240g-internal.h" #include "stm3240g-internal.h"
#ifdef CONFIG_ARCH_BUTTONS #ifdef CONFIG_ARCH_BUTTONS
@ -72,17 +74,17 @@ static const uint16_t g_buttons[NUM_BUTTONS] =
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
int i; int i;
@ -134,12 +136,12 @@ uint8_t up_buttons(void)
* Button support. * Button support.
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
* After up_buttoninit() has been called, up_buttons() may be called to * After board_button_initialize() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set * collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT * with each bit associated with a button. See the BUTTON_*_BIT
* definitions in board.h for the meaning of each bit. * definitions in board.h for the meaning of each bit.

View File

@ -183,37 +183,6 @@ EXTERN void stm32_setled(int led, bool ledon);
EXTERN void stm32_setleds(uint8_t ledset); EXTERN void stm32_setleds(uint8_t ledset);
#endif #endif
/************************************************************************************
* Button support.
*
* Description:
* up_buttoninit() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt
* handlers.
*
* After up_buttoninit() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT
* definitions in board.h for the meaning of each bit.
*
* up_irqbutton() may be called to register an interrupt handler that will
* be called when a button is depressed or released. The ID value is a
* button enumeration value that uniquely identifies a button resource. See the
* BUTTON_* and JOYSTICK_* definitions in board.h for the meaning of enumeration
* value. The previous interrupt handler address is returned (so that it may
* restored, if so desired).
*
************************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
EXTERN void up_buttoninit(void);
EXTERN uint8_t up_buttons(void);
#ifdef CONFIG_ARCH_IRQBUTTONS
EXTERN xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
#endif
#endif
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)
} }

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/stm32f100rc_generic/src/up_buttons.c * configs/stm32f100rc_generic/src/up_buttons.c
* *
* Copyright (C) 2012 Gregory Nutt. All rights reserved. * Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* Freddie Chopin <freddie_chopin@op.pl> * Freddie Chopin <freddie_chopin@op.pl>
* *
@ -42,7 +42,9 @@
#include <stdint.h> #include <stdint.h>
#include <nuttx/arch.h>
#include <arch/board/board.h> #include <arch/board/board.h>
#include "stm32f100rc_internal.h" #include "stm32f100rc_internal.h"
#ifdef CONFIG_ARCH_BUTTONS #ifdef CONFIG_ARCH_BUTTONS
@ -52,17 +54,17 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
stm32_configgpio(GPIO_BTN_0); /* Configure the GPIO pins as inputs. */ stm32_configgpio(GPIO_BTN_0); /* Configure the GPIO pins as inputs. */
} }
@ -84,12 +86,12 @@ uint8_t up_buttons(void)
* Button support. * Button support.
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
* After up_buttoninit() has been called, up_buttons() may be called to * After board_button_initialize() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set * collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT * with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT
* definitions in board.h for the meaning of each bit. * definitions in board.h for the meaning of each bit.

View File

@ -302,37 +302,6 @@ EXTERN void stm32_setled(int led, bool ledon);
EXTERN void stm32_setleds(uint8_t ledset); EXTERN void stm32_setleds(uint8_t ledset);
#endif #endif
/************************************************************************************
* Button support.
*
* Description:
* up_buttoninit() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt
* handlers.
*
* After up_buttoninit() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT
* definitions in board.h for the meaning of each bit.
*
* up_irqbutton() may be called to register an interrupt handler that will
* be called when a button is depressed or released. The ID value is a
* button enumeration value that uniquely identifies a button resource. See the
* BUTTON_* definitions in board.h for the meaning of enumeration
* value. The previous interrupt handler address is returned (so that it may
* restored, if so desired).
*
************************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
EXTERN void up_buttoninit(void);
EXTERN uint8_t up_buttons(void);
#ifdef CONFIG_ARCH_IRQBUTTONS
EXTERN xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
#endif
#endif
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)
} }

View File

@ -41,7 +41,9 @@
#include <stdint.h> #include <stdint.h>
#include <nuttx/arch.h>
#include <arch/board/board.h> #include <arch/board/board.h>
#include "stm32f3discovery-internal.h" #include "stm32f3discovery-internal.h"
#ifdef CONFIG_ARCH_BUTTONS #ifdef CONFIG_ARCH_BUTTONS
@ -72,17 +74,17 @@ static const uint16_t g_buttons[NUM_BUTTONS] =
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
int i; int i;
@ -129,12 +131,12 @@ uint8_t up_buttons(void)
* Button support. * Button support.
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
* After up_buttoninit() has been called, up_buttons() may be called to * After board_button_initialize() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set * collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT * with each bit associated with a button. See the BUTTON_*_BIT
* definitions in board.h for the meaning of each bit. * definitions in board.h for the meaning of each bit.

View File

@ -293,37 +293,6 @@ void stm32_setled(int led, bool ledon);
void stm32_setleds(uint8_t ledset); void stm32_setleds(uint8_t ledset);
#endif #endif
/************************************************************************************
* Button support.
*
* Description:
* up_buttoninit() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt
* handlers.
*
* After up_buttoninit() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT
* definitions in board.h for the meaning of each bit.
*
* up_irqbutton() may be called to register an interrupt handler that will
* be called when a button is depressed or released. The ID value is a
* button enumeration value that uniquely identifies a button resource. See the
* BUTTON_* definitions in board.h for the meaning of enumeration
* value. The previous interrupt handler address is returned (so that it may
* restored, if so desired).
*
************************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
void up_buttoninit(void);
uint8_t up_buttons(void);
#ifdef CONFIG_ARCH_IRQBUTTONS
xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
#endif
#endif
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)
} }

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/stm32f429i-disco/src/up_buttons.c * configs/stm32f429i-disco/src/up_buttons.c
* *
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. * Copyright (C) 2011-2012, 2-14 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -41,7 +41,9 @@
#include <stdint.h> #include <stdint.h>
#include <nuttx/arch.h>
#include <arch/board/board.h> #include <arch/board/board.h>
#include "stm32f429i-disco-internal.h" #include "stm32f429i-disco-internal.h"
#ifdef CONFIG_ARCH_BUTTONS #ifdef CONFIG_ARCH_BUTTONS
@ -72,17 +74,17 @@ static const uint16_t g_buttons[NUM_BUTTONS] =
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
int i; int i;
@ -129,12 +131,12 @@ uint8_t up_buttons(void)
* Button support. * Button support.
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
* After up_buttoninit() has been called, up_buttons() may be called to * After board_button_initialize() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set * collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT * with each bit associated with a button. See the BUTTON_*_BIT
* definitions in board.h for the meaning of each bit. * definitions in board.h for the meaning of each bit.

View File

@ -283,37 +283,6 @@ void stm32_setled(int led, bool ledon);
void stm32_setleds(uint8_t ledset); void stm32_setleds(uint8_t ledset);
#endif #endif
/************************************************************************************
* Button support.
*
* Description:
* up_buttoninit() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt
* handlers.
*
* After up_buttoninit() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT
* definitions in board.h for the meaning of each bit.
*
* up_irqbutton() may be called to register an interrupt handler that will
* be called when a button is depressed or released. The ID value is a
* button enumeration value that uniquely identifies a button resource. See the
* BUTTON_* definitions in board.h for the meaning of enumeration
* value. The previous interrupt handler address is returned (so that it may
* restored, if so desired).
*
************************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
void up_buttoninit(void);
uint8_t up_buttons(void);
#ifdef CONFIG_ARCH_IRQBUTTONS
xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
#endif
#endif
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)
} }

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/stm32f4discovery/src/up_buttons.c * configs/stm32f4discovery/src/up_buttons.c
* *
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. * Copyright (C) 2011-2012, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -41,7 +41,9 @@
#include <stdint.h> #include <stdint.h>
#include <nuttx/arch.h>
#include <arch/board/board.h> #include <arch/board/board.h>
#include "stm32f4discovery-internal.h" #include "stm32f4discovery-internal.h"
#ifdef CONFIG_ARCH_BUTTONS #ifdef CONFIG_ARCH_BUTTONS
@ -72,17 +74,17 @@ static const uint16_t g_buttons[NUM_BUTTONS] =
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
int i; int i;
@ -129,12 +131,12 @@ uint8_t up_buttons(void)
* Button support. * Button support.
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
* After up_buttoninit() has been called, up_buttons() may be called to * After board_button_initialize() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set * collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT * with each bit associated with a button. See the BUTTON_*_BIT
* definitions in board.h for the meaning of each bit. * definitions in board.h for the meaning of each bit.

View File

@ -132,7 +132,7 @@ void up_pmbuttons(void)
{ {
/* Initialize the button GPIOs */ /* Initialize the button GPIOs */
up_buttoninit(); board_button_initialize();
#ifdef CONFIG_ARCH_IRQBUTTONS #ifdef CONFIG_ARCH_IRQBUTTONS
xcpt_t oldhandler = up_irqbutton(0, button_handler); xcpt_t oldhandler = up_irqbutton(0, button_handler);

View File

@ -320,37 +320,6 @@ void stm32_setled(int led, bool ledon);
void stm32_setleds(uint8_t ledset); void stm32_setleds(uint8_t ledset);
#endif #endif
/************************************************************************************
* Button support.
*
* Description:
* up_buttoninit() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt
* handlers.
*
* After up_buttoninit() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT
* definitions in board.h for the meaning of each bit.
*
* up_irqbutton() may be called to register an interrupt handler that will
* be called when a button is depressed or released. The ID value is a
* button enumeration value that uniquely identifies a button resource. See the
* BUTTON_* definitions in board.h for the meaning of enumeration
* value. The previous interrupt handler address is returned (so that it may
* restored, if so desired).
*
************************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
void up_buttoninit(void);
uint8_t up_buttons(void);
#ifdef CONFIG_ARCH_IRQBUTTONS
xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
#endif
#endif
/**************************************************************************** /****************************************************************************
* Name: stm32_slcd_initialize * Name: stm32_slcd_initialize
* *

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/stm32ldiscovery/src/up_buttons.c * configs/stm32ldiscovery/src/up_buttons.c
* *
* Copyright (C) 2013 Gregory Nutt. All rights reserved. * Copyright (C) 2013-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -41,7 +41,9 @@
#include <stdint.h> #include <stdint.h>
#include <nuttx/arch.h>
#include <arch/board/board.h> #include <arch/board/board.h>
#include "stm32ldiscovery.h" #include "stm32ldiscovery.h"
#ifdef CONFIG_ARCH_BUTTONS #ifdef CONFIG_ARCH_BUTTONS
@ -72,17 +74,17 @@ static const uint16_t g_buttons[NUM_BUTTONS] =
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
int i; int i;
@ -129,12 +131,12 @@ uint8_t up_buttons(void)
* Button support. * Button support.
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
* After up_buttoninit() has been called, up_buttons() may be called to * After board_button_initialize() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set * collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT * with each bit associated with a button. See the BUTTON_*_BIT
* definitions in board.h for the meaning of each bit. * definitions in board.h for the meaning of each bit.

View File

@ -184,37 +184,6 @@ void stm32_setled(int led, bool ledon);
void stm32_setleds(uint8_t ledset); void stm32_setleds(uint8_t ledset);
#endif #endif
/************************************************************************************
* Button support.
*
* Description:
* up_buttoninit() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt
* handlers.
*
* After up_buttoninit() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT
* definitions in board.h for the meaning of each bit.
*
* up_irqbutton() may be called to register an interrupt handler that will
* be called when a button is depressed or released. The ID value is a
* button enumeration value that uniquely identifies a button resource. See the
* BUTTON_* and JOYSTICK_* definitions in board.h for the meaning of enumeration
* value. The previous interrupt handler address is returned (so that it may
* restored, if so desired).
*
************************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
void up_buttoninit(void);
uint8_t up_buttons(void);
#ifdef CONFIG_ARCH_IRQBUTTONS
xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
#endif
#endif
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)
} }

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/stm32vldiscovery/src/stm32_buttons.c * configs/stm32vldiscovery/src/stm32_buttons.c
* *
* Copyright (C) 2012 Gregory Nutt. All rights reserved. * Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* Freddie Chopin <freddie_chopin@op.pl> * Freddie Chopin <freddie_chopin@op.pl>
* *
@ -42,7 +42,9 @@
#include <stdint.h> #include <stdint.h>
#include <nuttx/arch.h>
#include <arch/board/board.h> #include <arch/board/board.h>
#include "stm32vldiscovery.h" #include "stm32vldiscovery.h"
#ifdef CONFIG_ARCH_BUTTONS #ifdef CONFIG_ARCH_BUTTONS
@ -52,17 +54,17 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
stm32_configgpio(GPIO_BTN_0); /* Configure the GPIO pins as inputs. */ stm32_configgpio(GPIO_BTN_0); /* Configure the GPIO pins as inputs. */
} }
@ -84,12 +86,12 @@ uint8_t up_buttons(void)
* Button support. * Button support.
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
* After up_buttoninit() has been called, up_buttons() may be called to * After board_button_initialize() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set * collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT * with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT
* definitions in board.h for the meaning of each bit. * definitions in board.h for the meaning of each bit.

View File

@ -169,42 +169,6 @@ extern "C" {
#define EXTERN extern #define EXTERN extern
#endif #endif
/****************************************************************************
* Button support.
*
* Description:
* up_buttoninit() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt
* handlers.
*
* After up_buttoninit() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT
* definitions in board.h for the meaning of each bit.
*
* up_irqbutton() may be called to register an interrupt handler that will
* be called when a button is depressed or released. The ID value is a
* button enumeration value that uniquely identifies a button resource.
* See the BUTTON_* definitions in board.h for the meaning of enumeration
* value. The previous interrupt handler address is returned (so that it
* may restored, if so desired).
*
* When an interrupt occurs, it is due to a change on the GPIO input pin
* associated with the button. In that case, all attached change
* notification handlers will be called. Each handler must maintain state
* and determine if the unlying GPIO button input value changed.
*
****************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
EXTERN void up_buttoninit(void);
EXTERN uint8_t up_buttons(void);
#ifdef CONFIG_ARCH_IRQBUTTONS
EXTERN xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
#endif
#endif
#undef EXTERN #undef EXTERN
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -125,17 +125,17 @@ static const uint8_t g_buttoncn[NUM_BUTTONS] =
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
int i; int i;
@ -177,12 +177,12 @@ uint8_t up_buttons(void)
* Button support. * Button support.
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
* After up_buttoninit() has been called, up_buttons() may be called to * After board_button_initialize() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set * collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT * with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT
* definitions in board.h for the meaning of each bit. * definitions in board.h for the meaning of each bit.

View File

@ -398,37 +398,6 @@ extern "C" {
EXTERN void kinetis_boardinitialize(void); EXTERN void kinetis_boardinitialize(void);
/************************************************************************************
* Button support.
*
* Description:
* up_buttoninit() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt
* handlers.
*
* After up_buttoninit() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT
* definitions in board.h for the meaning of each bit.
*
* up_irqbutton() may be called to register an interrupt handler that will
* be called when a button is depressed or released. The ID value is a
* button enumeration value that uniquely identifies a button resource. See the
* BUTTON_* and JOYSTICK_* definitions in board.h for the meaning of enumeration
* value. The previous interrupt handler address is returned (so that it may
* restored, if so desired).
*
************************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
EXTERN void up_buttoninit(void);
EXTERN uint8_t up_buttons(void);
#ifdef CONFIG_ARCH_IRQBUTTONS
EXTERN xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
#endif
#endif
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)
} }

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/twr-k60n512/src/up_buttons.c * configs/twr-k60n512/src/up_buttons.c
* *
* Copyright (C) 2011 Gregory Nutt. All rights reserved. * Copyright (C) 2011, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -41,7 +41,9 @@
#include <stdint.h> #include <stdint.h>
#include <nuttx/arch.h>
#include <arch/board/board.h> #include <arch/board/board.h>
#include "twrk60-internal.h" #include "twrk60-internal.h"
#ifdef CONFIG_ARCH_BUTTONS #ifdef CONFIG_ARCH_BUTTONS
@ -68,17 +70,17 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
/* Configure the two buttons as inputs */ /* Configure the two buttons as inputs */
@ -111,12 +113,12 @@ uint8_t up_buttons(void)
* Button support. * Button support.
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
* After up_buttoninit() has been called, up_buttons() may be called to * After board_button_initialize() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set * collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT * with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT
* definitions in board.h for the meaning of each bit. * definitions in board.h for the meaning of each bit.
@ -152,7 +154,7 @@ xcpt_t up_irqbutton(int id, xcpt_t irqhandler)
} }
/* The button has already been configured as an interrupting input (by /* The button has already been configured as an interrupting input (by
* up_buttoninit() above). * board_button_initialize() above).
* *
* Attach the new button handler. * Attach the new button handler.
*/ */

View File

@ -199,42 +199,6 @@ EXTERN void pic32mx_setled(int led, bool ledon);
EXTERN void pic32mx_setleds(uint8_t ledset); EXTERN void pic32mx_setleds(uint8_t ledset);
#endif #endif
/****************************************************************************
* Button support.
*
* Description:
* up_buttoninit() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt
* handlers.
*
* After up_buttoninit() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT
* definitions in board.h for the meaning of each bit.
*
* up_irqbutton() may be called to register an interrupt handler that will
* be called when a button is depressed or released. The ID value is a
* button enumeration value that uniquely identifies a button resource.
* See the BUTTON_* definitions in board.h for the meaning of enumeration
* value. The previous interrupt handler address is returned (so that it
* may restored, if so desired).
*
* When an interrupt occurs, it is due to a change on the GPIO input pin
* associated with the button. In that case, all attached change
* notification handlers will be called. Each handler must maintain state
* and determine if the unlying GPIO button input value changed.
*
****************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
EXTERN void up_buttoninit(void);
EXTERN uint8_t up_buttons(void);
#ifdef CONFIG_ARCH_IRQBUTTONS
EXTERN xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
#endif
#endif
#undef EXTERN #undef EXTERN
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -104,17 +104,17 @@ static const uint8_t g_buttoncn[NUM_BUTTONS] =
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
int i; int i;
@ -152,12 +152,12 @@ uint8_t up_buttons(void)
* Button support. * Button support.
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
* After up_buttoninit() has been called, up_buttons() may be called to * After board_button_initialize() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set * collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT definitions in * with each bit associated with a button. See the BUTTON_*_BIT definitions in
* board.h for the meaning of each bit. * board.h for the meaning of each bit.

View File

@ -86,11 +86,6 @@ extern "C" {
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
EXTERN void up_buttoninit(void);
EXTERN uint8_t up_buttons(void);
#endif
#undef EXTERN #undef EXTERN
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -174,48 +174,6 @@ void up_setled(int led, bool ledon);
void up_setleds(uint8_t ledset); void up_setleds(uint8_t ledset);
#endif #endif
/************************************************************************************
* Name: up_buttoninit
*
* Description:
* up_buttoninit() must be called to initialize button resources. After that,
* up_buttons() may be called to collect the current state of all buttons or
* up_irqbutton() may be called to register button interrupt handlers.
*
************************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
void up_buttoninit(void);
/************************************************************************************
* Name: up_buttons
*
* Description:
* After up_buttoninit() has been called, up_buttons() may be called to collect
* the state of all buttons. up_buttons() returns an 8-bit bit set with each bit
* associated with a button. See the BUTTON* definitions above for the meaning of
* each bit in the returned value.
*
************************************************************************************/
uint8_t up_buttons(void);
/************************************************************************************
* Name: up_irqbutton
*
* Description:
* This function may be called to register an interrupt handler that will be
* called when a button is depressed or released. The ID value is one of the
* BUTTON* definitions provided above. The previous interrupt handler address is
* returned (so that it may restored, if so desired).
*
************************************************************************************/
#ifdef CONFIG_ARCH_IRQBUTTONS
xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
#endif /* CONFIG_ARCH_IRQBUTTONS */
#endif /* CONFIG_ARCH_BUTTONS */
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)
} }

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/viewtool-stm32f107/src/stm32_buttons.c * configs/viewtool-stm32f107/src/stm32_buttons.c
* *
* Copyright (C) 2013 Gregory Nutt. All rights reserved. * Copyright (C) 2013, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -41,6 +41,7 @@
#include <stdint.h> #include <stdint.h>
#include <nuttx/arch.h>
#include <arch/board/board.h> #include <arch/board/board.h>
#include "viewtool_stm32f107.h" #include "viewtool_stm32f107.h"
@ -72,17 +73,17 @@ static const uint16_t g_buttons[NUM_BUTTONS] =
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
int i; int i;
@ -130,12 +131,12 @@ uint8_t up_buttons(void)
* Button support. * Button support.
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
* After up_buttoninit() has been called, up_buttons() may be called to * After board_button_initialize() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set * collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT * with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT
* definitions in board.h for the meaning of each bit. * definitions in board.h for the meaning of each bit.

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/viewtool-stm32f107/src/stm32_highpri.c * configs/viewtool-stm32f107/src/stm32_highpri.c
* *
* Copyright (C) 2013 Gregory Nutt. All rights reserved. * Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -157,10 +157,7 @@ void tim6_handler(void)
* Name: highpri_main * Name: highpri_main
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * Main entry point in into the high priority interrupt test.
* that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt
* handlers.
* *
****************************************************************************/ ****************************************************************************/

View File

@ -225,15 +225,6 @@ EXTERN void stm32_boardinitialize(void);
EXTERN void stm32_board_clockconfig(void); EXTERN void stm32_board_clockconfig(void);
#endif #endif
/************************************************************************************
* Button support. (TODO: button is not yet supported)
************************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
EXTERN void up_buttoninit(void);
EXTERN uint8_t up_buttons(void);
#endif
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)
} }

View File

@ -34,20 +34,23 @@
* *
****************************************************************************/ ****************************************************************************/
/** \file /****************************************************************************
* \author Uros Platise * Included Files
* \brief VSN Button ****************************************************************************/
*/
#include <nuttx/config.h>
#include <stdint.h>
#include <nuttx/arch.h>
#include <arch/board/board.h>
#include "vsn.h"
#ifdef CONFIG_ARCH_BUTTONS #ifdef CONFIG_ARCH_BUTTONS
#include <nuttx/config.h>
#include <stdint.h>
#include <arch/board/board.h>
#include "vsn.h"
/**************************************************************************** /****************************************************************************
* Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
@ -73,7 +76,7 @@ void buttons_callback(void)
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
stm32_configgpio(GPIO_PUSHBUTTON); stm32_configgpio(GPIO_PUSHBUTTON);
} }

View File

@ -83,17 +83,17 @@ static xcpt_t g_oldhandler;
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
****************************************************************************/ ****************************************************************************/
void up_buttoninit(void) void board_button_initialize(void)
{ {
int i; int i;
@ -138,12 +138,12 @@ uint8_t up_buttons(void)
* Button support. * Button support.
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources. After
* that, up_buttons() may be called to collect the current state of all * that, up_buttons() may be called to collect the current state of all
* buttons or up_irqbutton() may be called to register button interrupt * buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
* After up_buttoninit() has been called, up_buttons() may be called to * After board_button_initialize() has been called, up_buttons() may be called to
* collect the state of all buttons. up_buttons() returns an 8-bit bit set * collect the state of all buttons. up_buttons() returns an 8-bit bit set
* with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT * with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT
* definitions in board.h for the meaning of each bit. * definitions in board.h for the meaning of each bit.

View File

@ -1015,12 +1015,12 @@ ssize_t up_check_stack_remain(void);
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_buttoninit * Name: board_button_initialize
* *
* Description: * Description:
* up_buttoninit() must be called to initialize button resources. After * board_button_initialize() must be called to initialize button resources.
* that, up_buttons() may be called to collect the current state of all * After that, up_buttons() may be called to collect the current state of
* buttons or up_irqbutton() may be called to register button interrupt * all buttons or up_irqbutton() may be called to register button interrupt
* handlers. * handlers.
* *
* NOTE: This interface may or may not be supported by board-specific * NOTE: This interface may or may not be supported by board-specific
@ -1030,23 +1030,23 @@ ssize_t up_check_stack_remain(void);
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS #ifdef CONFIG_ARCH_BUTTONS
void up_buttoninit(void); void board_button_initialize(void);
#endif #endif
/**************************************************************************** /****************************************************************************
* Name: up_buttons * Name: up_buttons
* *
* Description: * Description:
* After up_buttoninit() has been called, up_buttons() may be called to * After board_button_initialize() has been called, up_buttons() may be
* collect the state of all buttons. up_buttons() returns an 8-bit bit set * called to collect the state of all buttons. up_buttons() returns an
* with each bit associated with a button. A bit set to "1" means that the * 8-bit bit set with each bit associated with a button. A bit set to
* button is depressed; a bit set to "0" means that the button is released. * "1" means that the button is depressed; a bit set to "0" means that
* The correspondence of the each button bit and physical buttons is board- * the button is released. The correspondence of the each button bit
* specific. * and physical buttons is board-specific.
* *
* NOTE: This interface may or may not be supported by board-specific * NOTE: This interface may or may not be supported by board-specific
* logic. If the board supports button interfaces, then CONFIG_ARCH_BUTTONS * logic. If the board supports button interfaces, then
* will be defined * CONFIG_ARCH_BUTTONS will be defined
* *
****************************************************************************/ ****************************************************************************/