STM32L4xx_Nucleo_144 BSP User Manual: BUTTON Functions

STM32L4xx_Nucleo_144 BSP

STM32L4xx_Nucleo_144 BSP User Manual
BUTTON Functions

Functions

void BSP_PB_Init (Button_TypeDef Button, ButtonMode_TypeDef ButtonMode)
 Configure Button GPIO and EXTI Line.
void BSP_PB_DeInit (Button_TypeDef Button)
 DeInitialize Push Button.
uint32_t BSP_PB_GetState (Button_TypeDef Button)
 Return the selected Button state.
uint8_t BSP_JOY_Init (void)
 Configure joystick available on adafruit 1.8" TFT shield managed through ADC to detect motion.
void BSP_JOY_DeInit (void)
 DeInitialize joystick GPIOs.
JOYState_TypeDef BSP_JOY_GetState (void)
 Return the Joystick key pressed.

Function Documentation

void BSP_JOY_DeInit ( void  )

DeInitialize joystick GPIOs.

Return values:
None.

Definition at line 372 of file stm32l4xx_nucleo_144.c.

References ADCx_DeInit().

Return the Joystick key pressed.

Note:
To know which Joystick key is pressed we need to detect the voltage level on each key output
  • None : 3.3 V / 4095
  • SEL : 1.055 V / 1308
  • DOWN : 0.71 V / 88
  • LEFT : 3.0 V / 3720
  • RIGHT : 0.595 V / 737
  • UP : 1.65 V / 2046
Return values:
JOYState_TypeDef,:Code of the Joystick key pressed.

Definition at line 389 of file stm32l4xx_nucleo_144.c.

References hnucleo_Adc, JOY_DOWN, JOY_LEFT, JOY_NONE, JOY_RIGHT, JOY_SEL, and JOY_UP.

uint8_t BSP_JOY_Init ( void  )

Configure joystick available on adafruit 1.8" TFT shield managed through ADC to detect motion.

Return values:
Joystickstatus(0=> success, 1=> fail)

Definition at line 352 of file stm32l4xx_nucleo_144.c.

References ADCx_Init(), hnucleo_Adc, NUCLEO_ADCx_CHANNEL, NUCLEO_ADCx_SAMPLETIME, and sConfig.

void BSP_PB_DeInit ( Button_TypeDef  Button)

DeInitialize Push Button.

Parameters:
Button,:Button to be configured This parameter should be: BUTTON_USER
Note:
BSP_PB_DeInit() does not disable the GPIO clock
Return values:
None

Definition at line 326 of file stm32l4xx_nucleo_144.c.

References BUTTON_IRQn, BUTTON_PIN, and BUTTON_PORT.

uint32_t BSP_PB_GetState ( Button_TypeDef  Button)

Return the selected Button state.

Parameters:
Button,:Specifies the Button to be checked. This parameter should be: BUTTON_USER
Return values:
TheButton GPIO pin value.

Definition at line 341 of file stm32l4xx_nucleo_144.c.

References BUTTON_PIN, and BUTTON_PORT.

void BSP_PB_Init ( Button_TypeDef  Button,
ButtonMode_TypeDef  ButtonMode 
)

Configure Button GPIO and EXTI Line.

Parameters:
Button,:Specifies the Button to be configured. This parameter should be: BUTTON_USER
ButtonMode,:Specifies Button mode. This parameter can be one of following parameters:
  • BUTTON_MODE_GPIO: Button will be used as simple IO
  • BUTTON_MODE_EXTI: Button will be connected to EXTI line with interrupt generation capability
Return values:
None

Definition at line 289 of file stm32l4xx_nucleo_144.c.

References BUTTON_IRQn, BUTTON_MODE_EXTI, BUTTON_MODE_GPIO, BUTTON_PIN, BUTTON_PORT, and BUTTONx_GPIO_CLK_ENABLE.

Generated on Mon Oct 9 2017 01:35:13 for STM32L4xx_Nucleo_144 BSP User Manual by   doxygen 1.7.6.1