libctr9
Nintendo 3DS ARM9 library
ctr_hid.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright (C) 2016 Gabriel Marcano
3  *
4  * Refer to the COPYING.txt file at the top of the project directory. If that is
5  * missing, this file is licensed under the GPL version 2.0 or later.
6  *
7  ******************************************************************************/
8 
11 #ifndef CTR_HID_H_
12 #define CTR_HID_H_
13 
14 #include <stdint.h>
15 #include <stdbool.h>
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 //Button type
22 typedef uint32_t ctr_hid_button_type;
23 
24 //HID Register
25 #define CTR_HID_REG ((volatile ctr_hid_button_type*)0x10146000)
26 
27 //Button definitions
28 #define CTR_HID_NON 0x000u
29 #define CTR_HID_A 0x001u
30 #define CTR_HID_B 0x002u
31 #define CTR_HID_SELECT 0x004u
32 #define CTR_HID_START 0x008u
33 #define CTR_HID_RIGHT 0x010u
34 #define CTR_HID_LEFT 0x020u
35 #define CTR_HID_UP 0x040u
36 #define CTR_HID_DOWN 0x080u
37 #define CTR_HID_RT 0x100u
38 #define CTR_HID_LT 0x200u
39 #define CTR_HID_X 0x400u
40 #define CTR_HID_Y 0x800u
41 
48 bool ctr_hid_button_status(ctr_hid_button_type buttons);
49 
55 ctr_hid_button_type ctr_hid_get_buttons(void);
56 
57 #ifdef __cplusplus
58 }
59 #endif
60 
61 #endif//CTR_HID_H_
62 
ctr_hid_button_type ctr_hid_get_buttons(void)
Returns all of the buttons pressed at the instant this is called.
bool ctr_hid_button_status(ctr_hid_button_type buttons)
Returns whether the given button combination is pressed or not.