FreeRTOS Emulator with SDL2 Based Graphics and Input Library  1.0
A POSIX wrapper to run FreeRTOS on an x86 machine with some basic input and output libraries aimed at making teaching FreeRTOS simpler.
buttons.h
Go to the documentation of this file.
1 
25 #ifndef __BUTTONS_H__
26 #define __BUTTONS_H__
27 
28 #include <SDL2/SDL_scancode.h>
29 
30 #include "FreeRTOS.h"
31 #include "semphr.h"
32 
33 #define KEYCODE(CHAR) SDL_SCANCODE_##CHAR
34 
37 typedef struct buttons_buffer {
38  unsigned char buttons[SDL_NUM_SCANCODES];
39  SemaphoreHandle_t lock;
41 
43 
46 void vGetButtonInput(void);
47 
51 int xButtonsInit(void);
52 
55 void vButtonsExit(void);
56 
57 #endif //__BUTTONS_H__
buttons_buffer_t buttons
Definition: buttons.c:31
void vButtonsExit(void)
Deinitializes the buttons structure that holds the user's actual copy of the buttons lookup table.
Definition: buttons.c:52
int xButtonsInit(void)
Initializes the buttons structure that holds the user's actual copy of the buttons lookup table.
Definition: buttons.c:41
void vGetButtonInput(void)
Recieves a fresh copy of the buttons lookup table from the backend SDL events library.
Definition: buttons.c:33
struct buttons_buffer buttons_buffer_t
Structure containing a loopup table containing all the keyboards' buttons states and a lock for acces...
Structure containing a loopup table containing all the keyboards' buttons states and a lock for acces...
Definition: buttons.h:37
SemaphoreHandle_t lock
Definition: buttons.h:39
unsigned char buttons[SDL_NUM_SCANCODES]
Definition: buttons.h:38