HRI board firmware v2.1 Microcontroller firmware of the board used during the HRI labs.

Macros | Functions | Variables
button.c File Reference
`#include "button.h"`
`#include "../communication.h"`

## Macros
#define | BOARD_BUTTON_PORT GPIOE
#define | BOARD_BUTTON_PIN GPIO_Pin_2
#define | USER_BUTTON_IRQ_CHANNEL EXTI2_IRQn
#define | USER_BUTTON_IRQ_LINE EXTI_Line2
#define | USER_BUTTON_IRQ_PINSOURCE EXTI_PinSource2
#define | USER_BUTTON_IRQ_SOURCE EXTI_PortSourceGPIOE

## Functions
void | but_Init (void(*stateChangedCallback)(bool))
| Initializes the button module. More...
bool | but_GetState (void)
| Gets the current state of the user button. More...
void | EXTI2_IRQHandler (void)
| Calls the user button callback function. More...

## Variables
void(* | userButtonStateChangedCallback )(bool)
| Function called when the button state changes. The bool parameter is true if the button was released. More...

## Macro Definition Documentation

## ◆ BOARD_BUTTON_PIN

#define BOARD_BUTTON_PIN GPIO_Pin_2

## ◆ BOARD_BUTTON_PORT

#define BOARD_BUTTON_PORT GPIOE

## ◆ USER_BUTTON_IRQ_CHANNEL

#define USER_BUTTON_IRQ_CHANNEL EXTI2_IRQn

## ◆ USER_BUTTON_IRQ_LINE

#define USER_BUTTON_IRQ_LINE EXTI_Line2

## ◆ USER_BUTTON_IRQ_PINSOURCE

#define USER_BUTTON_IRQ_PINSOURCE EXTI_PinSource2

## ◆ USER_BUTTON_IRQ_SOURCE

#define USER_BUTTON_IRQ_SOURCE EXTI_PortSourceGPIOE

## Function Documentation

## ◆ EXTI2_IRQHandler()

void EXTI2_IRQHandler | ( | void |  | ) |

Calls the user button callback function.

Remarks
  : this function is called automatically by the pin change interrupt of the user button.

## Variable Documentation

## ◆ userButtonStateChangedCallback

void(* userButtonStateChangedCallback) (bool)

Function called when the button state changes. The bool parameter is true if the button was released.