Core2 for AWS IoT EduKit BSP 1.5.1
Data Structures | Enumerations | Functions
button.h File Reference

Functions for the virtual buttons using the FT633U touch controller. More...

#include "stdio.h"

Go to the source code of this file.

Data Structures

struct  Button_t
 The member defintions of the virtual button data. More...
 

Enumerations

enum  PressEvent { PRESS = (1 << 0) , RELEASE = (1 << 1) , LONGPRESS = (1 << 2) }
 List of possible virtual button press events. More...
 

Functions

void Button_Init ()
 Initializes the virtual buttons using the FT6336U touch controller. More...
 
Button_t * Button_Attach (uint16_t x, uint16_t y, uint16_t w, uint16_t h)
 Create a virtual button based on locations and size of the button area. The Core2 for AWS IoT EduKit has 3 buttons on the face of the device that these virtual buttons are mapped to. More...
 
uint8_t Button_WasPressed (Button_t *button)
 See if the specified button was pressed. More...
 
uint8_t Button_WasReleased (Button_t *button)
 See if the specified button press was released. More...
 
uint8_t Button_IsPress (Button_t *button)
 See if the specified button is currently being pressed. More...
 
uint8_t Button_IsRelease (Button_t *button)
 See if the specified button press is currently released. More...
 
uint8_t Button_WasLongPress (Button_t *button, uint32_t long_press_time)
 See if the specified button press was a long press. More...
 

Detailed Description

Functions for the virtual buttons using the FT633U touch controller.

Enumeration Type Documentation

◆ PressEvent

enum PressEvent

List of possible virtual button press events.

Enumerator
PRESS 

Virtual button was pressed.

RELEASE 

Virtual button was released.

LONGPRESS 

Virtual button was long pressed.

Function Documentation

◆ Button_Init()

void Button_Init ( )

Initializes the virtual buttons using the FT6336U touch controller.

Note
The Core2ForAWS_Init() calls this function when the hardware feature is enabled.

◆ Button_Attach()

Button_t * Button_Attach ( uint16_t  x,
uint16_t  y,
uint16_t  w,
uint16_t  h 
)

Create a virtual button based on locations and size of the button area. The Core2 for AWS IoT EduKit has 3 buttons on the face of the device that these virtual buttons are mapped to.

Parameters
[in]xVirtual button touch starting point in the X-coordinate plane.
[in]yVirtual button touch starting point in the Y-coordinate plane.
[in]wVirtual button touched width from the starting point in the X-coordinate plane.
[in]hVirtual button touched height from the starting point in the Y-coordinate plane.
Returns
An instance of the virtual button struct.

◆ Button_WasPressed()

uint8_t Button_WasPressed ( Button_t *  button)

See if the specified button was pressed.

Parameters
[out]buttonThe button to check if it was pressed. Updates the value of the state definition.
Returns
A boolean if the button specified was pressed. 0x00 for not pressed, 0xff for pressed.

◆ Button_WasReleased()

uint8_t Button_WasReleased ( Button_t *  button)

See if the specified button press was released.

Parameters
[out]buttonThe button to check if it was released. Updates the value of the state definition.
Returns
A boolean if the button specified was released. 0x00 for not released, 0xff for released.

◆ Button_IsPress()

uint8_t Button_IsPress ( Button_t *  button)

See if the specified button is currently being pressed.

Parameters
[out]buttonThe button to check if it is currently being pressed. Updates the value of the state definition.
Returns
A boolean if the button specified is currently being pressed. 0x00 for currently not being pressed, 0xff for is currently being pressed.

◆ Button_IsRelease()

uint8_t Button_IsRelease ( Button_t *  button)

See if the specified button press is currently released.

Parameters
[out]buttonThe button to check if it is currently released.
Returns
A boolean if the button specified is currently released. 0x00 for currently not released, 0xff for is currently released.

◆ Button_WasLongPress()

uint8_t Button_WasLongPress ( Button_t *  button,
uint32_t  long_press_time 
)

See if the specified button press was a long press.

Parameters
[out]buttonThe button to check if it was a long press button event. Updates the value of the state definition.
[in]long_press_timeThe time duration to consider a button press a long press.
Returns
A boolean if the button specified was long pressed. 0x00 for not a long button press, 0xff for was a long button press.