drivers/button: Let board_button_initialize return the button number

so the lower half driver don't need include the specific board.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I2ff5c30049a5c5e8ee90baea56e9f4cb1a8a4f87
This commit is contained in:
Xiang Xiao 2020-06-05 17:13:48 +08:00 committed by Abdelatif Guettouche
parent 73fc43770a
commit 1b47aa1cb2
122 changed files with 293 additions and 138 deletions

View file

@ -68,7 +68,7 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
# warning Missing logic
}

View file

@ -68,7 +68,7 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
# warning Missing logic
}

View file

@ -71,8 +71,9 @@
* Name: board_button_initialize
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
return 0;
}
/****************************************************************************

View file

@ -102,7 +102,7 @@ static const gpio_pinset_t g_button_boards[NUM_BUTTONS] =
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int i;
@ -112,6 +112,8 @@ void board_button_initialize(void)
{
efm32_configgpio(g_button_boards[i]);
}
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -80,11 +80,12 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
/* Configure the buttons as input */
imxrt_config_gpio(GPIO_SWWAKE);
return 1;
}
/****************************************************************************

View file

@ -79,11 +79,12 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
/* Configure the button as input */
imxrt_config_gpio(GPIO_SW8);
return 1;
}
/****************************************************************************

View file

@ -80,11 +80,12 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
/* Configure the button as input */
imxrt_config_gpio(GPIO_SW8);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -81,12 +81,13 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
/* Configure the two buttons as inputs */
kinetis_pinconfig(GPIO_SW2);
kinetis_pinconfig(GPIO_SW3);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -85,12 +85,13 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
/* Configure the two buttons as inputs */
kinetis_pinconfig(GPIO_SW2);
kinetis_pinconfig(GPIO_SW3);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -65,9 +65,11 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
/* The KwikStik-K40 board has no standard GPIO contact buttons */
return 0;
}
/****************************************************************************

View file

@ -82,12 +82,13 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
/* Configure the two buttons as inputs */
kinetis_pinconfig(GPIO_SW1);
kinetis_pinconfig(GPIO_SW2);
return 2;
}
/****************************************************************************

View file

@ -99,7 +99,7 @@ static uint8_t g_buttonirq[NUM_BUTTONS] =
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int i;
@ -109,6 +109,8 @@ void board_button_initialize(void)
{
lpc17_40_configgpio(g_buttoncfg[i]);
}
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -113,7 +113,7 @@ static const uint8_t g_buttonirq[NUM_BUTTONS] =
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int i;
@ -123,6 +123,8 @@ void board_button_initialize(void)
{
lpc17_40_configgpio(g_buttoncfg[i]);
}
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -102,7 +102,7 @@ static const uint8_t g_buttonirq[NUM_BUTTONS] =
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int i;
@ -112,6 +112,8 @@ void board_button_initialize(void)
{
lpc17_40_configgpio(g_buttoncfg[i]);
}
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -102,7 +102,7 @@ static uint8_t g_buttonirq[NUM_BUTTONS] =
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int i;
@ -112,6 +112,8 @@ void board_button_initialize(void)
{
lpc17_40_configgpio(g_buttoncfg[i]);
}
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -114,7 +114,7 @@ static const uint8_t g_buttonirq[NUM_BUTTONS] =
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int i;
@ -124,6 +124,8 @@ void board_button_initialize(void)
{
lpc17_40_configgpio(g_buttoncfg[i]);
}
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -91,7 +91,7 @@ static const uint16_t g_buttons[NUM_BUTTONS] =
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int i;
@ -103,6 +103,8 @@ void board_button_initialize(void)
{
lpc17_40_configgpio(g_buttons[i]);
}
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -57,8 +57,9 @@
* Name: board_button_initialize
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
return 0;
}
/****************************************************************************

View file

@ -57,8 +57,9 @@
* Name: board_button_initialize
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
return 0;
}
/****************************************************************************

View file

@ -92,7 +92,7 @@ static uint8_t g_buttonirq[NUM_BUTTONS] =
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int i;
@ -102,6 +102,8 @@ void board_button_initialize(void)
{
lpc43_configgpio(g_buttoncfg[i]);
}
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -99,7 +99,7 @@ static uint8_t g_buttonirq[NUM_BUTTONS] =
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int i;
@ -109,6 +109,8 @@ void board_button_initialize(void)
{
lpc43_configgpio(g_buttoncfg[i]);
}
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -99,7 +99,7 @@ static uint8_t g_buttonirq[NUM_BUTTONS] =
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
#if 0 /* Not yet implemented */
int i;
@ -110,6 +110,8 @@ void board_button_initialize(void)
{
lpc43_configgpio(g_buttoncfg[i]);
}
#else
return 0;
#endif
}

View file

@ -110,7 +110,7 @@ static int board_button_interrupt(int irq, FAR void *context, FAR void *arg)
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int ret;
@ -128,6 +128,8 @@ void board_button_initialize(void)
irq_attach(g_button_irq, board_button_interrupt, NULL);
#endif
}
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -70,9 +70,10 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
max326_gpio_config(GPIO_BUTTON);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -83,7 +83,7 @@ static const uint32_t g_buttons[NUM_BUTTONS] =
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int i;
@ -93,6 +93,8 @@ void board_button_initialize(void)
{
nrf52_gpio_config(g_buttons[i]);
}
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -83,7 +83,7 @@ static const uint32_t g_buttons[NUM_BUTTONS] =
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int i;
@ -93,6 +93,8 @@ void board_button_initialize(void)
{
nrf52_gpio_config(g_buttons[i]);
}
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -73,12 +73,13 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
/* Configure the GPIO pins as interrupting inputs. */
s32k1xx_pinconfig(GPIO_SW2);
s32k1xx_pinconfig(GPIO_SW3);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -73,12 +73,13 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
/* Configure the GPIO pins as interrupting inputs. */
s32k1xx_pinconfig(GPIO_SW2);
s32k1xx_pinconfig(GPIO_SW3);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -73,12 +73,13 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
/* Configure the GPIO pins as interrupting inputs. */
s32k1xx_pinconfig(GPIO_SW2);
s32k1xx_pinconfig(GPIO_SW3);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -73,12 +73,13 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
/* Configure the GPIO pins as interrupting inputs. */
s32k1xx_pinconfig(GPIO_SW2);
s32k1xx_pinconfig(GPIO_SW3);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -73,12 +73,13 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
/* Configure the GPIO pins as interrupting inputs. */
s32k1xx_pinconfig(GPIO_SW2);
s32k1xx_pinconfig(GPIO_SW3);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -73,12 +73,13 @@
*
****************************************************************************/
void board_button_initialize(void)
uin32_t board_button_initialize(void)
{
/* Configure the GPIO pins as interrupting inputs. */
s32k1xx_pinconfig(GPIO_SW3);
s32k1xx_pinconfig(GPIO_SW4);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -116,10 +116,11 @@ static int board_button_irqx(gpio_pinset_t pinset, int irq, xcpt_t irqhandler,
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
sam_configgpio(GPIO_BUTTON1);
sam_configgpio(GPIO_BUTTON2);
return 2;
}
/****************************************************************************

View file

@ -116,12 +116,13 @@ static int board_button_irqx(gpio_pinset_t pinset, int irq, xcpt_t irqhandler,
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
sam_configgpio(GPIO_SCROLLUP);
sam_configgpio(GPIO_SCROLLDWN);
sam_configgpio(GPIO_WAKU);
sam_configgpio(GPIO_TAMP);
return 4;
}
/****************************************************************************

View file

@ -68,9 +68,10 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
sam_configgpio(GPIO_SW0);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -70,9 +70,10 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
sam_configgpio(GPIO_SW0);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -69,9 +69,10 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
sam_configgpio(GPIO_BP2);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -66,9 +66,10 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
sam_configpio(PIO_BTN_USER);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -85,9 +85,10 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
sam_configpio(PIO_USER);
return 1;
}
/****************************************************************************

View file

@ -84,9 +84,10 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
sam_configpio(PIO_USER1);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -80,9 +80,10 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
sam_configpio(PIO_BTN_USER);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -69,9 +69,10 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
sam_configport(PORT_SW0);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -69,9 +69,10 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
sam_configport(PORT_SW0);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -69,9 +69,10 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
sam_configport(PORT_SW0);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -129,11 +129,12 @@ static int board_button_irqx(gpio_pinset_t pinset, int irq,
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
/* Configure button PIOs */
sam_configgpio(GPIO_SW0);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -133,7 +133,7 @@ static int board_button_irqx(gpio_pinset_t pinset, int irq, xcpt_t irqhandler,
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
uint32_t regval;
@ -150,6 +150,7 @@ void board_button_initialize(void)
sam_configgpio(GPIO_SW0);
sam_configgpio(GPIO_SW1);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -79,7 +79,7 @@ static const uint32_t g_buttons[NUM_BUTTONS] =
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int i;
@ -91,6 +91,8 @@ void board_button_initialize(void)
{
stm32_configgpio(g_buttons[i]);
}
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -68,12 +68,13 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
/* Configure BUTTONS T2-T3 GPIOs for input */
stm32_configgpio(GPIO_BTN_T2);
stm32_configgpio(GPIO_BTN_T3);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -86,7 +86,7 @@ static const uint32_t g_buttons[NUM_BUTTONS] =
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int i;
@ -98,6 +98,8 @@ void board_button_initialize(void)
{
stm32_configgpio(g_buttons[i]);
}
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -77,7 +77,7 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
/* Configure the GPIO pins as inputs. NOTE that EXTI interrupts are
* configured for some pins but NOT used in this file
@ -85,6 +85,7 @@ void board_button_initialize(void)
stm32_configgpio(GPIO_BTN_KEY1);
stm32_configgpio(GPIO_BTN_KEY2);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -67,10 +67,11 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
stm32_configgpio(GPIO_BTN_KEYA);
stm32_configgpio(GPIO_BTN_KEYB);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -66,13 +66,14 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
/* Configure the single button as an input. NOTE that EXTI interrupts are
* also configured for the pin.
*/
stm32_configgpio(GPIO_BTN_USER);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -66,9 +66,10 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
stm32_configgpio(GPIO_BTN_USER);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -66,13 +66,14 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
/* Configure the single button as an input. NOTE that EXTI interrupts are
* also configured for the pin.
*/
stm32_configgpio(GPIO_BTN_USER);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -68,13 +68,14 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
/* Configure the single button as an input. NOTE that EXTI interrupts are
* also configured for the pin.
*/
stm32_configgpio(GPIO_BTN_USER);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -66,9 +66,10 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
stm32_configgpio(GPIO_BTN_USER);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -65,13 +65,14 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
/* Configure the single button as an input. NOTE that EXTI interrupts are
* also configured for the pin.
*/
stm32_configgpio(GPIO_BTN_USER);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -52,9 +52,10 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
stm32_configgpio(GPIO_BTN_USER);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -65,13 +65,14 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
/* Configure the single button as an input. NOTE that EXTI interrupts are
* also configured for the pin.
*/
stm32_configgpio(GPIO_BTN_USER);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -67,13 +67,14 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
/* Configure the single button as an input. NOTE that EXTI interrupts are
* also configured for the pin.
*/
stm32_configgpio(GPIO_BTN_USER);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -66,13 +66,14 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
/* Configure the single button as an input. NOTE that EXTI interrupts are
* also configured for the pin.
*/
stm32_configgpio(GPIO_BTN_USER);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -78,7 +78,7 @@ static const uint32_t g_buttons[NUM_BUTTONS] =
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int i;
@ -90,6 +90,8 @@ void board_button_initialize(void)
{
stm32_configgpio(g_buttons[i]);
}
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -78,7 +78,7 @@ static const uint32_t g_buttons[NUM_BUTTONS] =
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int i;
@ -90,6 +90,8 @@ void board_button_initialize(void)
{
stm32_configgpio(g_buttons[i]);
}
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -78,7 +78,7 @@ static const uint32_t g_buttons[NUM_BUTTONS] =
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int i;
@ -90,6 +90,8 @@ void board_button_initialize(void)
{
stm32_configgpio(g_buttons[i]);
}
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -84,7 +84,7 @@ static const uint32_t g_buttons[NUM_BUTTONS] =
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int i;
@ -96,6 +96,8 @@ void board_button_initialize(void)
{
stm32_configgpio(g_buttons[i]);
}
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -86,7 +86,7 @@ static const uint32_t g_buttons[NUM_BUTTONS] =
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int i;
@ -98,6 +98,8 @@ void board_button_initialize(void)
{
stm32_configgpio(g_buttons[i]);
}
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -85,9 +85,10 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
stm32_configgpio(BUTTON_BOOT0n);
return 1;
}
/****************************************************************************

View file

@ -55,11 +55,12 @@
* Name: board_button_initialize
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
/* Configure Photon button gpio as input */
stm32_configgpio(GPIO_BUTTON1);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -78,7 +78,7 @@ static const uint32_t g_buttons[NUM_BUTTONS] =
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int i;
@ -90,6 +90,8 @@ void board_button_initialize(void)
{
stm32_configgpio(g_buttons[i]);
}
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -91,7 +91,7 @@ static const uint32_t g_buttons[NUM_BUTTONS] =
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int i;
@ -103,6 +103,8 @@ void board_button_initialize(void)
{
stm32_configgpio(g_buttons[i]);
}
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -78,7 +78,7 @@ static const uint32_t g_buttons[NUM_BUTTONS] =
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int i;
@ -90,6 +90,8 @@ void board_button_initialize(void)
{
stm32_configgpio(g_buttons[i]);
}
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -86,7 +86,7 @@ static const uint32_t g_buttons[NUM_BUTTONS] =
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int i;
@ -98,6 +98,8 @@ void board_button_initialize(void)
{
stm32_configgpio(g_buttons[i]);
}
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -75,7 +75,7 @@ static const uint32_t buttons[NUM_BUTTONS] =
* Initializes gpio pins for joystick buttons
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int i;
@ -83,6 +83,8 @@ void board_button_initialize(void)
{
stm32_configgpio(buttons[i]);
}
return NUM_BUTTONS;
}
/*****************************************************************************

View file

@ -87,7 +87,7 @@ static const uint32_t g_buttons[NUM_BUTTONS] =
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int i;
@ -99,6 +99,8 @@ void board_button_initialize(void)
{
stm32_configgpio(g_buttons[i]);
}
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -78,7 +78,7 @@ static const uint32_t g_buttons[NUM_BUTTONS] =
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int i;
@ -90,6 +90,8 @@ void board_button_initialize(void)
{
stm32_configgpio(g_buttons[i]);
}
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -78,7 +78,7 @@ static const uint32_t g_buttons[NUM_BUTTONS] =
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int i;
@ -90,6 +90,8 @@ void board_button_initialize(void)
{
stm32_configgpio(g_buttons[i]);
}
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -79,7 +79,7 @@ static const uint32_t g_buttons[NUM_BUTTONS] =
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int i;
@ -91,6 +91,8 @@ void board_button_initialize(void)
{
stm32_configgpio(g_buttons[i]);
}
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -79,7 +79,7 @@ static const uint32_t g_buttons[NUM_BUTTONS] =
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int i;
@ -91,6 +91,8 @@ void board_button_initialize(void)
{
stm32_configgpio(g_buttons[i]);
}
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -66,9 +66,10 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
stm32_configgpio(GPIO_BTN_0); /* Configure the GPIO pins as inputs. */
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -78,7 +78,7 @@ static const uint32_t g_buttons[NUM_BUTTONS] =
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int i;
@ -90,6 +90,8 @@ void board_button_initialize(void)
{
stm32_configgpio(g_buttons[i]);
}
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -67,13 +67,14 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
/* Configure the single button as an input. NOTE that EXTI interrupts are
* also configured for the pin.
*/
stm32_configgpio(GPIO_BTN_USER);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -67,13 +67,14 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
/* Configure the single button as an input. NOTE that EXTI interrupts are
* also configured for the pin.
*/
stm32_configgpio(GPIO_BTN_USER);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -71,13 +71,14 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
/* Configure the single button as an input. NOTE that EXTI interrupts are
* also configured for the pin.
*/
stm32_configgpio(GPIO_BTN_USER);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -68,13 +68,14 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
/* Configure the single button as an input. NOTE that EXTI interrupts are
* also configured for the pin.
*/
stm32_configgpio(GPIO_BTN_USER);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -68,13 +68,14 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
/* Configure the single button as an input. NOTE that EXTI interrupts are
* also configured for the pin.
*/
stm32_configgpio(GPIO_BTN_USER);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -79,7 +79,7 @@ static const uint32_t g_buttons[NUM_BUTTONS] =
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int i;
@ -91,6 +91,8 @@ void board_button_initialize(void)
{
stm32_configgpio(g_buttons[i]);
}
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -79,7 +79,7 @@ static const uint32_t g_buttons[NUM_BUTTONS] =
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int i;
@ -91,6 +91,8 @@ void board_button_initialize(void)
{
stm32_configgpio(g_buttons[i]);
}
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -68,9 +68,10 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
stm32_configgpio(GPIO_BTN_USER);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -66,9 +66,10 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
stm32_configgpio(GPIO_BTN_USER);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -64,9 +64,10 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
stm32_configgpio(GPIO_BTN_USER);
return 1;
}
/****************************************************************************

View file

@ -66,9 +66,10 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
stm32_configgpio(GPIO_BTN_USER);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -66,9 +66,10 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
stm32_configgpio(GPIO_BTN_USER);
return 1;
}
/****************************************************************************

View file

@ -65,13 +65,14 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
/* Configure the single button as an input. NOTE that EXTI interrupts are
* also configured for the pin.
*/
stm32_configgpio(GPIO_BTN_USER);
return 1;
}
/****************************************************************************

View file

@ -68,13 +68,14 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
/* Configure the single button as an input. NOTE that EXTI interrupts are
* also configured for the pin.
*/
stm32l4_configgpio(GPIO_BTN_USER);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -65,13 +65,14 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
/* Configure the single button as an input. NOTE that EXTI interrupts are
* also configured for the pin.
*/
stm32l4_configgpio(GPIO_BTN_USER);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -68,9 +68,10 @@
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
stm32l4_configgpio(GPIO_BTN_USER);
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -79,7 +79,7 @@ static const uint32_t g_buttons[NUM_BUTTONS] =
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int i;
@ -91,6 +91,8 @@ void board_button_initialize(void)
{
stm32l4_configgpio(g_buttons[i]);
}
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -230,7 +230,7 @@ static int button_pm_prepare(struct pm_callback_s *cb, int domain,
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int i;
@ -252,6 +252,8 @@ void board_button_initialize(void)
#endif
#endif
}
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -229,7 +229,7 @@ static int button_pm_prepare(struct pm_callback_s *cb, int domain,
*
****************************************************************************/
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
int i;
@ -251,6 +251,8 @@ void board_button_initialize(void)
#endif
#endif
}
return NUM_BUTTONS;
}
/****************************************************************************

View file

@ -77,7 +77,7 @@
****************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
void board_button_initialize(void)
uint32_t board_button_initialize(void)
{
uint16_t reg16;
@ -106,6 +106,8 @@ void board_button_initialize(void)
reg16 = getreg16(STR71X_GPIO1_PC2);
reg16 &= ~STR71X_BUTBUTTON_GPIO1;
putreg16(reg16, STR71X_GPIO1_PC2);
return 2;
}
/****************************************************************************

Some files were not shown because too many files have changed in this diff Show more