FreeRTOS Tetris
input.h
Go to the documentation of this file.
1 
24 #ifndef INPUT_H
25 #define INPUT_H
26 
27 #include "tetrisConfig.h"
28 
32 typedef struct debounce_button
33 {
34  int counter;
35  bool lastState;
37 
41 typedef struct buttons_buffer
42 {
43  uint8_t buttons[SDL_NUM_SCANCODES];
44  SemaphoreHandle_t lock;
46 
48 
53 void vGetButtonInput();
54 
66 bool bGameDebounceButton(char currentState, bool* previousState);
67 
77 bool bGUIPushButton(const coord_t lowBound, const coord_t highBound);
78 
83 int iInputInit();
84 
86 #endif // INPUT_H
bGameDebounceButton
bool bGameDebounceButton(char currentState, bool *previousState)
Simple function for debouncing input buttons.
Definition: input.c:5
debounce_button::lastState
bool lastState
Stores the last state of the button.
Definition: input.h:35
bGUIPushButton
bool bGUIPushButton(const coord_t lowBound, const coord_t highBound)
Create a push-button between 2 boundaries.
Definition: input.c:28
vGetButtonInput
void vGetButtonInput()
Read the current button input from buttonInputQueue & write it into buttons.
Definition: input.c:19
debounce_button::counter
int counter
Counts the amount of times the key has been pressed.
Definition: input.h:34
tetrisConfig.h
File containing some game configurations.
debounce_button
Structure for debouncing buttons.
Definition: input.h:32
buttons_buffer_t
struct buttons_buffer buttons_buffer_t
Structure for keyboard inputs.
iInputInit
int iInputInit()
Initialize the input module.
Definition: input.c:37
buttons_buffer::buttons
uint8_t buttons[SDL_NUM_SCANCODES]
Keyboard buttons using the SDL library.
Definition: input.h:43
buttons_buffer
Structure for keyboard inputs.
Definition: input.h:41
buttons_buffer::lock
SemaphoreHandle_t lock
Buttons lock.
Definition: input.h:44
buttons
buttons_buffer_t buttons
Object representing the keyboard buttons.
Definition: input.c:3
coord
Holds a pixel co-ordinate.
Definition: TUM_Draw.h:121
debounce_button_t
struct debounce_button debounce_button_t
Structure for debouncing buttons.