Core2 for AWS IoT EduKit BSP 1.5.1
Functions | Variables
button.c File Reference
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/semphr.h"
#include "freertos/queue.h"
#include "ft6336u.h"
#include "button.h"

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_WasLongPress (Button_t *button, uint32_t long_press_time)
 See if the specified button press was a long press. 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...
 
void Button_Update (Button_t *button, uint8_t press, uint16_t x, uint16_t y)
 

Variables

Button_t * button_ahead = NULL
 

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_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.

◆ 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_Update()

void Button_Update ( Button_t *  button,
uint8_t  press,
uint16_t  x,
uint16_t  y 
)

Variable Documentation

◆ button_ahead

Button_t* button_ahead = NULL