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
;
40
}
buttons_buffer_t
;
41
42
extern
buttons_buffer_t
buttons
;
43
46
void
vGetButtonInput
(
void
);
47
51
int
xButtonsInit
(
void
);
52
55
void
vButtonsExit
(
void
);
56
57
#endif
//__BUTTONS_H__
buttons
buttons_buffer_t buttons
Definition:
buttons.c:31
vButtonsExit
void vButtonsExit(void)
Deinitializes the buttons structure that holds the user's actual copy of the buttons lookup table.
Definition:
buttons.c:52
xButtonsInit
int xButtonsInit(void)
Initializes the buttons structure that holds the user's actual copy of the buttons lookup table.
Definition:
buttons.c:41
vGetButtonInput
void vGetButtonInput(void)
Recieves a fresh copy of the buttons lookup table from the backend SDL events library.
Definition:
buttons.c:33
buttons_buffer_t
struct buttons_buffer buttons_buffer_t
Structure containing a loopup table containing all the keyboards' buttons states and a lock for acces...
buttons_buffer
Structure containing a loopup table containing all the keyboards' buttons states and a lock for acces...
Definition:
buttons.h:37
buttons_buffer::lock
SemaphoreHandle_t lock
Definition:
buttons.h:39
buttons_buffer::buttons
unsigned char buttons[SDL_NUM_SCANCODES]
Definition:
buttons.h:38
include
buttons.h
Generated by
1.9.1