Brick Groove Machine
0.9.3
Firmware embarqué pour contrôleur/synthé Brick
Chargement...
Recherche...
Aucune correspondance
drv_buttons.h
Aller à la documentation de ce fichier.
1
17
#ifndef DRV_BUTTONS_H
18
#define DRV_BUTTONS_H
19
20
#include "
ch.h
"
21
#include "
brick_config.h
"
22
#include "hal.h"
23
24
/* ====================================================================== */
25
/* TYPES ET STRUCTURES */
26
/* ====================================================================== */
27
32
typedef
enum
{
33
BUTTON_EVENT_PRESS
= 0,
34
BUTTON_EVENT_RELEASE
35
}
button_event_type_t
;
36
41
typedef
struct
{
42
int
id
;
43
button_event_type_t
type
;
44
}
button_event_t
;
45
46
/* ====================================================================== */
47
/* API PUBLIQUE */
48
/* ====================================================================== */
49
56
void
drv_buttons_start
(
void
);
57
63
bool
drv_button_is_pressed
(
int
id
);
64
72
bool
drv_buttons_poll
(
button_event_t
*evt,
systime_t
timeout);
73
74
#endif
/* DRV_BUTTONS_H */
brick_config.h
Configuration matérielle et paramètres globaux du firmware Brick.
ch.h
systime_t
uint32_t systime_t
Definition
ch.h:12
drv_buttons_poll
bool drv_buttons_poll(button_event_t *evt, systime_t timeout)
Lit un événement de bouton dans la mailbox.
Definition
drv_buttons.c:156
drv_button_is_pressed
bool drv_button_is_pressed(int id)
Vérifie l’état courant d’un bouton.
Definition
drv_buttons.c:144
drv_buttons_start
void drv_buttons_start(void)
Initialise le driver des boutons et démarre le thread de lecture.
Definition
drv_buttons.c:121
button_event_type_t
button_event_type_t
Type d’événement de bouton détecté.
Definition
drv_buttons.h:32
BUTTON_EVENT_PRESS
@ BUTTON_EVENT_PRESS
Definition
drv_buttons.h:33
BUTTON_EVENT_RELEASE
@ BUTTON_EVENT_RELEASE
Definition
drv_buttons.h:34
button_event_t
Structure décrivant un événement de bouton.
Definition
drv_buttons.h:41
button_event_t::type
button_event_type_t type
Definition
drv_buttons.h:43
button_event_t::id
int id
Definition
drv_buttons.h:42
drivers
drv_buttons.h
Généré par
1.9.8