aboutsummaryrefslogtreecommitdiffstats
path: root/source/buttons.h
blob: ba7e02d87f2d1ce779e3e27307d9ed54869566f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
 * buttons.h - Provides ability to read button state.
 * Copyright (C) 2020  Clyne Sullivan
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * See the GNU General Public License for more details.
 */

#ifndef BUTTONS_H_
#define BUTTONS_H_

#define BUTTON_JOYUL (1 << 7)
#define BUTTON_JOYUR (1 << 6)
#define BUTTON_JOYDR (1 << 5)
#define BUTTON_JOYDL (1 << 4)
#define BUTTON_JOY   (1 << 3)
#define BUTTON_1     (1 << 2)
#define BUTTON_2     (1 << 1)
#define BUTTON_3     (1 << 0)

#define BUTTON_JOYUP    (BUTTON_JOYUL | BUTTON_JOYUR)
#define BUTTON_JOYDOWN  (BUTTON_JOYDL | BUTTON_JOYDR)
#define BUTTON_JOYLEFT  (BUTTON_JOYUL | BUTTON_JOYDL)
#define BUTTON_JOYRIGHT (BUTTON_JOYUR | BUTTON_JOYDR)

extern unsigned char button_state;

void buttons_init();

#endif // BUTTONS_H_