
Buttons Driver
3
Buttons Driver
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
API Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Programming Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.1
Introduction
The buttons driver provides functions to make it easy to use the push buttons on the EK-LM4F232
evaluation board. The driver provides a function to initialize all the hardware required for the buttons,
and features for debouncing and querying the button state.
This driver is located in
examples/boards/ek-lm4f232/drivers
, with
buttons.c
containing
the source code and
buttons.h
containing the API declarations for use by applications.
3.2
API Functions
Functions
void
ButtonsInit
(void)
uint8_t
ButtonsPoll
(uint8_t
∗
pui8Delta, uint8_t
∗
pui8RawState)
3.2.1
Function Documentation
3.2.1.1
ButtonsInit
Initializes the GPIO pins used by the board pushbuttons.
Prototype:
void
ButtonsInit(void)
Description:
This function must be called during application initialization to configure the GPIO pins to which
the pushbuttons are attached. It enables the port used by the buttons and configures each
button GPIO as an input with a weak pull-up.
Returns:
None.
3.2.1.2
ButtonsPoll
Polls the current state of the buttons and determines which have changed.
February 22, 2017
17