-
Notifications
You must be signed in to change notification settings - Fork 174
/
hid.h
2207 lines (1925 loc) · 90.6 KB
/
hid.h
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* @file hid.h
* @brief Human input device (hid) service IPC wrapper.
* @author shinyquagsire23
* @author yellows8
* @copyright libnx Authors
*/
#pragma once
#include "../types.h"
#include "../kernel/event.h"
#include "../services/btdrv_types.h"
#include "../sf/service.h"
// Begin enums and output structs
/// HidDebugPadButton
typedef enum {
HidDebugPadButton_A = BIT(0), ///< A button
HidDebugPadButton_B = BIT(1), ///< B button
HidDebugPadButton_X = BIT(2), ///< X button
HidDebugPadButton_Y = BIT(3), ///< Y button
HidDebugPadButton_L = BIT(4), ///< L button
HidDebugPadButton_R = BIT(5), ///< R button
HidDebugPadButton_ZL = BIT(6), ///< ZL button
HidDebugPadButton_ZR = BIT(7), ///< ZR button
HidDebugPadButton_Start = BIT(8), ///< Start button
HidDebugPadButton_Select = BIT(9), ///< Select button
HidDebugPadButton_Left = BIT(10), ///< D-Pad Left button
HidDebugPadButton_Up = BIT(11), ///< D-Pad Up button
HidDebugPadButton_Right = BIT(12), ///< D-Pad Right button
HidDebugPadButton_Down = BIT(13), ///< D-Pad Down button
} HidDebugPadButton;
/// HidTouchScreenModeForNx
typedef enum {
HidTouchScreenModeForNx_UseSystemSetting = 0, ///< UseSystemSetting
HidTouchScreenModeForNx_Finger = 1, ///< Finger
HidTouchScreenModeForNx_Heat2 = 2, ///< Heat2
} HidTouchScreenModeForNx;
/// HidMouseButton
typedef enum {
HidMouseButton_Left = BIT(0),
HidMouseButton_Right = BIT(1),
HidMouseButton_Middle = BIT(2),
HidMouseButton_Forward = BIT(3),
HidMouseButton_Back = BIT(4),
} HidMouseButton;
/// HidKeyboardKey
typedef enum {
HidKeyboardKey_A = 4,
HidKeyboardKey_B = 5,
HidKeyboardKey_C = 6,
HidKeyboardKey_D = 7,
HidKeyboardKey_E = 8,
HidKeyboardKey_F = 9,
HidKeyboardKey_G = 10,
HidKeyboardKey_H = 11,
HidKeyboardKey_I = 12,
HidKeyboardKey_J = 13,
HidKeyboardKey_K = 14,
HidKeyboardKey_L = 15,
HidKeyboardKey_M = 16,
HidKeyboardKey_N = 17,
HidKeyboardKey_O = 18,
HidKeyboardKey_P = 19,
HidKeyboardKey_Q = 20,
HidKeyboardKey_R = 21,
HidKeyboardKey_S = 22,
HidKeyboardKey_T = 23,
HidKeyboardKey_U = 24,
HidKeyboardKey_V = 25,
HidKeyboardKey_W = 26,
HidKeyboardKey_X = 27,
HidKeyboardKey_Y = 28,
HidKeyboardKey_Z = 29,
HidKeyboardKey_D1 = 30,
HidKeyboardKey_D2 = 31,
HidKeyboardKey_D3 = 32,
HidKeyboardKey_D4 = 33,
HidKeyboardKey_D5 = 34,
HidKeyboardKey_D6 = 35,
HidKeyboardKey_D7 = 36,
HidKeyboardKey_D8 = 37,
HidKeyboardKey_D9 = 38,
HidKeyboardKey_D0 = 39,
HidKeyboardKey_Return = 40,
HidKeyboardKey_Escape = 41,
HidKeyboardKey_Backspace = 42,
HidKeyboardKey_Tab = 43,
HidKeyboardKey_Space = 44,
HidKeyboardKey_Minus = 45,
HidKeyboardKey_Plus = 46,
HidKeyboardKey_OpenBracket = 47,
HidKeyboardKey_CloseBracket = 48,
HidKeyboardKey_Pipe = 49,
HidKeyboardKey_Tilde = 50,
HidKeyboardKey_Semicolon = 51,
HidKeyboardKey_Quote = 52,
HidKeyboardKey_Backquote = 53,
HidKeyboardKey_Comma = 54,
HidKeyboardKey_Period = 55,
HidKeyboardKey_Slash = 56,
HidKeyboardKey_CapsLock = 57,
HidKeyboardKey_F1 = 58,
HidKeyboardKey_F2 = 59,
HidKeyboardKey_F3 = 60,
HidKeyboardKey_F4 = 61,
HidKeyboardKey_F5 = 62,
HidKeyboardKey_F6 = 63,
HidKeyboardKey_F7 = 64,
HidKeyboardKey_F8 = 65,
HidKeyboardKey_F9 = 66,
HidKeyboardKey_F10 = 67,
HidKeyboardKey_F11 = 68,
HidKeyboardKey_F12 = 69,
HidKeyboardKey_PrintScreen = 70,
HidKeyboardKey_ScrollLock = 71,
HidKeyboardKey_Pause = 72,
HidKeyboardKey_Insert = 73,
HidKeyboardKey_Home = 74,
HidKeyboardKey_PageUp = 75,
HidKeyboardKey_Delete = 76,
HidKeyboardKey_End = 77,
HidKeyboardKey_PageDown = 78,
HidKeyboardKey_RightArrow = 79,
HidKeyboardKey_LeftArrow = 80,
HidKeyboardKey_DownArrow = 81,
HidKeyboardKey_UpArrow = 82,
HidKeyboardKey_NumLock = 83,
HidKeyboardKey_NumPadDivide = 84,
HidKeyboardKey_NumPadMultiply = 85,
HidKeyboardKey_NumPadSubtract = 86,
HidKeyboardKey_NumPadAdd = 87,
HidKeyboardKey_NumPadEnter = 88,
HidKeyboardKey_NumPad1 = 89,
HidKeyboardKey_NumPad2 = 90,
HidKeyboardKey_NumPad3 = 91,
HidKeyboardKey_NumPad4 = 92,
HidKeyboardKey_NumPad5 = 93,
HidKeyboardKey_NumPad6 = 94,
HidKeyboardKey_NumPad7 = 95,
HidKeyboardKey_NumPad8 = 96,
HidKeyboardKey_NumPad9 = 97,
HidKeyboardKey_NumPad0 = 98,
HidKeyboardKey_NumPadDot = 99,
HidKeyboardKey_Backslash = 100,
HidKeyboardKey_Application = 101,
HidKeyboardKey_Power = 102,
HidKeyboardKey_NumPadEquals = 103,
HidKeyboardKey_F13 = 104,
HidKeyboardKey_F14 = 105,
HidKeyboardKey_F15 = 106,
HidKeyboardKey_F16 = 107,
HidKeyboardKey_F17 = 108,
HidKeyboardKey_F18 = 109,
HidKeyboardKey_F19 = 110,
HidKeyboardKey_F20 = 111,
HidKeyboardKey_F21 = 112,
HidKeyboardKey_F22 = 113,
HidKeyboardKey_F23 = 114,
HidKeyboardKey_F24 = 115,
HidKeyboardKey_NumPadComma = 133,
HidKeyboardKey_Ro = 135,
HidKeyboardKey_KatakanaHiragana = 136,
HidKeyboardKey_Yen = 137,
HidKeyboardKey_Henkan = 138,
HidKeyboardKey_Muhenkan = 139,
HidKeyboardKey_NumPadCommaPc98 = 140,
HidKeyboardKey_HangulEnglish = 144,
HidKeyboardKey_Hanja = 145,
HidKeyboardKey_Katakana = 146,
HidKeyboardKey_Hiragana = 147,
HidKeyboardKey_ZenkakuHankaku = 148,
HidKeyboardKey_LeftControl = 224,
HidKeyboardKey_LeftShift = 225,
HidKeyboardKey_LeftAlt = 226,
HidKeyboardKey_LeftGui = 227,
HidKeyboardKey_RightControl = 228,
HidKeyboardKey_RightShift = 229,
HidKeyboardKey_RightAlt = 230,
HidKeyboardKey_RightGui = 231,
} HidKeyboardKey;
/// HidKeyboardModifier
typedef enum {
HidKeyboardModifier_Control = BIT(0),
HidKeyboardModifier_Shift = BIT(1),
HidKeyboardModifier_LeftAlt = BIT(2),
HidKeyboardModifier_RightAlt = BIT(3),
HidKeyboardModifier_Gui = BIT(4),
HidKeyboardModifier_CapsLock = BIT(8),
HidKeyboardModifier_ScrollLock = BIT(9),
HidKeyboardModifier_NumLock = BIT(10),
HidKeyboardModifier_Katakana = BIT(11),
HidKeyboardModifier_Hiragana = BIT(12),
} HidKeyboardModifier;
/// KeyboardLockKeyEvent
typedef enum {
HidKeyboardLockKeyEvent_NumLockOn = BIT(0), ///< NumLockOn
HidKeyboardLockKeyEvent_NumLockOff = BIT(1), ///< NumLockOff
HidKeyboardLockKeyEvent_NumLockToggle = BIT(2), ///< NumLockToggle
HidKeyboardLockKeyEvent_CapsLockOn = BIT(3), ///< CapsLockOn
HidKeyboardLockKeyEvent_CapsLockOff = BIT(4), ///< CapsLockOff
HidKeyboardLockKeyEvent_CapsLockToggle = BIT(5), ///< CapsLockToggle
HidKeyboardLockKeyEvent_ScrollLockOn = BIT(6), ///< ScrollLockOn
HidKeyboardLockKeyEvent_ScrollLockOff = BIT(7), ///< ScrollLockOff
HidKeyboardLockKeyEvent_ScrollLockToggle = BIT(8), ///< ScrollLockToggle
} HidKeyboardLockKeyEvent;
/// HID controller IDs
typedef enum {
HidNpadIdType_No1 = 0, ///< Player 1 controller
HidNpadIdType_No2 = 1, ///< Player 2 controller
HidNpadIdType_No3 = 2, ///< Player 3 controller
HidNpadIdType_No4 = 3, ///< Player 4 controller
HidNpadIdType_No5 = 4, ///< Player 5 controller
HidNpadIdType_No6 = 5, ///< Player 6 controller
HidNpadIdType_No7 = 6, ///< Player 7 controller
HidNpadIdType_No8 = 7, ///< Player 8 controller
HidNpadIdType_Other = 0x10, ///< Other controller
HidNpadIdType_Handheld = 0x20, ///< Handheld mode controls
} HidNpadIdType;
/// HID controller styles
typedef enum {
HidNpadStyleTag_NpadFullKey = BIT(0), ///< Pro Controller
HidNpadStyleTag_NpadHandheld = BIT(1), ///< Joy-Con controller in handheld mode
HidNpadStyleTag_NpadJoyDual = BIT(2), ///< Joy-Con controller in dual mode
HidNpadStyleTag_NpadJoyLeft = BIT(3), ///< Joy-Con left controller in single mode
HidNpadStyleTag_NpadJoyRight = BIT(4), ///< Joy-Con right controller in single mode
HidNpadStyleTag_NpadGc = BIT(5), ///< GameCube controller
HidNpadStyleTag_NpadPalma = BIT(6), ///< Poké Ball Plus controller
HidNpadStyleTag_NpadLark = BIT(7), ///< NES/Famicom controller
HidNpadStyleTag_NpadHandheldLark = BIT(8), ///< NES/Famicom controller in handheld mode
HidNpadStyleTag_NpadLucia = BIT(9), ///< SNES controller
HidNpadStyleTag_NpadLagon = BIT(10), ///< N64 controller
HidNpadStyleTag_NpadLager = BIT(11), ///< Sega Genesis controller
HidNpadStyleTag_NpadSystemExt = BIT(29), ///< Generic external controller
HidNpadStyleTag_NpadSystem = BIT(30), ///< Generic controller
HidNpadStyleSet_NpadFullCtrl = HidNpadStyleTag_NpadFullKey | HidNpadStyleTag_NpadHandheld | HidNpadStyleTag_NpadJoyDual, ///< Style set comprising Npad styles containing the full set of controls {FullKey, Handheld, JoyDual}
HidNpadStyleSet_NpadStandard = HidNpadStyleSet_NpadFullCtrl | HidNpadStyleTag_NpadJoyLeft | HidNpadStyleTag_NpadJoyRight, ///< Style set comprising all standard Npad styles {FullKey, Handheld, JoyDual, JoyLeft, JoyRight}
} HidNpadStyleTag;
/// HidColorAttribute
typedef enum {
HidColorAttribute_Ok = 0, ///< Ok
HidColorAttribute_ReadError = 1, ///< ReadError
HidColorAttribute_NoController = 2, ///< NoController
} HidColorAttribute;
/// HidNpadButton
typedef enum {
HidNpadButton_A = BITL(0), ///< A button / Right face button
HidNpadButton_B = BITL(1), ///< B button / Down face button
HidNpadButton_X = BITL(2), ///< X button / Up face button
HidNpadButton_Y = BITL(3), ///< Y button / Left face button
HidNpadButton_StickL = BITL(4), ///< Left Stick button
HidNpadButton_StickR = BITL(5), ///< Right Stick button
HidNpadButton_L = BITL(6), ///< L button
HidNpadButton_R = BITL(7), ///< R button
HidNpadButton_ZL = BITL(8), ///< ZL button
HidNpadButton_ZR = BITL(9), ///< ZR button
HidNpadButton_Plus = BITL(10), ///< Plus button
HidNpadButton_Minus = BITL(11), ///< Minus button
HidNpadButton_Left = BITL(12), ///< D-Pad Left button
HidNpadButton_Up = BITL(13), ///< D-Pad Up button
HidNpadButton_Right = BITL(14), ///< D-Pad Right button
HidNpadButton_Down = BITL(15), ///< D-Pad Down button
HidNpadButton_StickLLeft = BITL(16), ///< Left Stick pseudo-button when moved Left
HidNpadButton_StickLUp = BITL(17), ///< Left Stick pseudo-button when moved Up
HidNpadButton_StickLRight = BITL(18), ///< Left Stick pseudo-button when moved Right
HidNpadButton_StickLDown = BITL(19), ///< Left Stick pseudo-button when moved Down
HidNpadButton_StickRLeft = BITL(20), ///< Right Stick pseudo-button when moved Left
HidNpadButton_StickRUp = BITL(21), ///< Right Stick pseudo-button when moved Up
HidNpadButton_StickRRight = BITL(22), ///< Right Stick pseudo-button when moved Right
HidNpadButton_StickRDown = BITL(23), ///< Right Stick pseudo-button when moved Left
HidNpadButton_LeftSL = BITL(24), ///< SL button on Left Joy-Con
HidNpadButton_LeftSR = BITL(25), ///< SR button on Left Joy-Con
HidNpadButton_RightSL = BITL(26), ///< SL button on Right Joy-Con
HidNpadButton_RightSR = BITL(27), ///< SR button on Right Joy-Con
HidNpadButton_Palma = BITL(28), ///< Top button on Poké Ball Plus (Palma) controller
HidNpadButton_Verification = BITL(29), ///< Verification
HidNpadButton_HandheldLeftB = BITL(30), ///< B button on Left NES/HVC controller in Handheld mode
HidNpadButton_LagonCLeft = BITL(31), ///< Left C button in N64 controller
HidNpadButton_LagonCUp = BITL(32), ///< Up C button in N64 controller
HidNpadButton_LagonCRight = BITL(33), ///< Right C button in N64 controller
HidNpadButton_LagonCDown = BITL(34), ///< Down C button in N64 controller
HidNpadButton_AnyLeft = HidNpadButton_Left | HidNpadButton_StickLLeft | HidNpadButton_StickRLeft, ///< Bitmask containing all buttons that are considered Left (D-Pad, Sticks)
HidNpadButton_AnyUp = HidNpadButton_Up | HidNpadButton_StickLUp | HidNpadButton_StickRUp, ///< Bitmask containing all buttons that are considered Up (D-Pad, Sticks)
HidNpadButton_AnyRight = HidNpadButton_Right | HidNpadButton_StickLRight | HidNpadButton_StickRRight, ///< Bitmask containing all buttons that are considered Right (D-Pad, Sticks)
HidNpadButton_AnyDown = HidNpadButton_Down | HidNpadButton_StickLDown | HidNpadButton_StickRDown, ///< Bitmask containing all buttons that are considered Down (D-Pad, Sticks)
HidNpadButton_AnySL = HidNpadButton_LeftSL | HidNpadButton_RightSL, ///< Bitmask containing SL buttons on both Joy-Cons (Left/Right)
HidNpadButton_AnySR = HidNpadButton_LeftSR | HidNpadButton_RightSR, ///< Bitmask containing SR buttons on both Joy-Cons (Left/Right)
} HidNpadButton;
/// HidDebugPadAttribute
typedef enum {
HidDebugPadAttribute_IsConnected = BIT(0), ///< IsConnected
} HidDebugPadAttribute;
/// HidTouchAttribute
typedef enum {
HidTouchAttribute_Start = BIT(0), ///< Start
HidTouchAttribute_End = BIT(1), ///< End
} HidTouchAttribute;
/// HidMouseAttribute
typedef enum {
HidMouseAttribute_Transferable = BIT(0), ///< Transferable
HidMouseAttribute_IsConnected = BIT(1), ///< IsConnected
} HidMouseAttribute;
/// HidNpadAttribute
typedef enum {
HidNpadAttribute_IsConnected = BIT(0), ///< IsConnected
HidNpadAttribute_IsWired = BIT(1), ///< IsWired
HidNpadAttribute_IsLeftConnected = BIT(2), ///< IsLeftConnected
HidNpadAttribute_IsLeftWired = BIT(3), ///< IsLeftWired
HidNpadAttribute_IsRightConnected = BIT(4), ///< IsRightConnected
HidNpadAttribute_IsRightWired = BIT(5), ///< IsRightWired
} HidNpadAttribute;
/// HidSixAxisSensorAttribute
typedef enum {
HidSixAxisSensorAttribute_IsConnected = BIT(0), ///< IsConnected
HidSixAxisSensorAttribute_IsInterpolated = BIT(1), ///< IsInterpolated
} HidSixAxisSensorAttribute;
/// HidGestureAttribute
typedef enum {
HidGestureAttribute_IsNewTouch = BIT(4), ///< IsNewTouch
HidGestureAttribute_IsDoubleTap = BIT(8), ///< IsDoubleTap
} HidGestureAttribute;
/// HidGestureDirection
typedef enum {
HidGestureDirection_None = 0, ///< None
HidGestureDirection_Left = 1, ///< Left
HidGestureDirection_Up = 2, ///< Up
HidGestureDirection_Right = 3, ///< Right
HidGestureDirection_Down = 4, ///< Down
} HidGestureDirection;
/// HidGestureType
typedef enum {
HidGestureType_Idle = 0, ///< Idle
HidGestureType_Complete = 1, ///< Complete
HidGestureType_Cancel = 2, ///< Cancel
HidGestureType_Touch = 3, ///< Touch
HidGestureType_Press = 4, ///< Press
HidGestureType_Tap = 5, ///< Tap
HidGestureType_Pan = 6, ///< Pan
HidGestureType_Swipe = 7, ///< Swipe
HidGestureType_Pinch = 8, ///< Pinch
HidGestureType_Rotate = 9, ///< Rotate
} HidGestureType;
/// GyroscopeZeroDriftMode
typedef enum {
HidGyroscopeZeroDriftMode_Loose = 0, ///< Loose
HidGyroscopeZeroDriftMode_Standard = 1, ///< Standard
HidGyroscopeZeroDriftMode_Tight = 2, ///< Tight
} HidGyroscopeZeroDriftMode;
/// NpadJoyHoldType
typedef enum {
HidNpadJoyHoldType_Vertical = 0, ///< Default / Joy-Con held vertically.
HidNpadJoyHoldType_Horizontal = 1, ///< Joy-Con held horizontally.
} HidNpadJoyHoldType;
/// NpadJoyDeviceType
typedef enum {
HidNpadJoyDeviceType_Left = 0, ///< Left
HidNpadJoyDeviceType_Right = 1, ///< Right
} HidNpadJoyDeviceType;
/// This controls how many Joy-Cons must be attached for handheld-mode to be activated.
typedef enum {
HidNpadHandheldActivationMode_Dual = 0, ///< Dual (2 Joy-Cons)
HidNpadHandheldActivationMode_Single = 1, ///< Single (1 Joy-Con)
HidNpadHandheldActivationMode_None = 2, ///< None (0 Joy-Cons)
} HidNpadHandheldActivationMode;
/// NpadJoyAssignmentMode
typedef enum {
HidNpadJoyAssignmentMode_Dual = 0, ///< Dual (Set by \ref hidSetNpadJoyAssignmentModeDual)
HidNpadJoyAssignmentMode_Single = 1, ///< Single (Set by hidSetNpadJoyAssignmentModeSingle*())
} HidNpadJoyAssignmentMode;
/// NpadCommunicationMode
typedef enum {
HidNpadCommunicationMode_5ms = 0, ///< 5ms
HidNpadCommunicationMode_10ms = 1, ///< 10ms
HidNpadCommunicationMode_15ms = 2, ///< 15ms
HidNpadCommunicationMode_Default = 3, ///< Default
} HidNpadCommunicationMode;
/// DeviceType (system)
typedef enum {
HidDeviceTypeBits_FullKey = BIT(0), ///< Pro Controller and Gc controller.
HidDeviceTypeBits_DebugPad = BIT(1), ///< DebugPad
HidDeviceTypeBits_HandheldLeft = BIT(2), ///< Joy-Con/Famicom/NES left controller in handheld mode.
HidDeviceTypeBits_HandheldRight = BIT(3), ///< Joy-Con/Famicom/NES right controller in handheld mode.
HidDeviceTypeBits_JoyLeft = BIT(4), ///< Joy-Con left controller.
HidDeviceTypeBits_JoyRight = BIT(5), ///< Joy-Con right controller.
HidDeviceTypeBits_Palma = BIT(6), ///< Poké Ball Plus controller.
HidDeviceTypeBits_LarkHvcLeft = BIT(7), ///< Famicom left controller.
HidDeviceTypeBits_LarkHvcRight = BIT(8), ///< Famicom right controller (with microphone).
HidDeviceTypeBits_LarkNesLeft = BIT(9), ///< NES left controller.
HidDeviceTypeBits_LarkNesRight = BIT(10), ///< NES right controller.
HidDeviceTypeBits_HandheldLarkHvcLeft = BIT(11), ///< Famicom left controller in handheld mode.
HidDeviceTypeBits_HandheldLarkHvcRight = BIT(12), ///< Famicom right controller (with microphone) in handheld mode.
HidDeviceTypeBits_HandheldLarkNesLeft = BIT(13), ///< NES left controller in handheld mode.
HidDeviceTypeBits_HandheldLarkNesRight = BIT(14), ///< NES right controller in handheld mode.
HidDeviceTypeBits_Lucia = BIT(15), ///< SNES controller
HidDeviceTypeBits_Lagon = BIT(16), ///< N64 controller
HidDeviceTypeBits_Lager = BIT(17), ///< Sega Genesis controller
HidDeviceTypeBits_System = BIT(31), ///< Generic controller.
} HidDeviceTypeBits;
/// Internal DeviceType for [9.0.0+]. Converted to/from the pre-9.0.0 version of this by the hiddbg funcs.
typedef enum {
HidDeviceType_JoyRight1 = 1, ///< ::HidDeviceTypeBits_JoyRight
HidDeviceType_JoyLeft2 = 2, ///< ::HidDeviceTypeBits_JoyLeft
HidDeviceType_FullKey3 = 3, ///< ::HidDeviceTypeBits_FullKey
HidDeviceType_JoyLeft4 = 4, ///< ::HidDeviceTypeBits_JoyLeft
HidDeviceType_JoyRight5 = 5, ///< ::HidDeviceTypeBits_JoyRight
HidDeviceType_FullKey6 = 6, ///< ::HidDeviceTypeBits_FullKey
HidDeviceType_LarkHvcLeft = 7, ///< ::HidDeviceTypeBits_LarkHvcLeft, ::HidDeviceTypeBits_HandheldLarkHvcLeft
HidDeviceType_LarkHvcRight = 8, ///< ::HidDeviceTypeBits_LarkHvcRight, ::HidDeviceTypeBits_HandheldLarkHvcRight
HidDeviceType_LarkNesLeft = 9, ///< ::HidDeviceTypeBits_LarkNesLeft, ::HidDeviceTypeBits_HandheldLarkNesLeft
HidDeviceType_LarkNesRight = 10, ///< ::HidDeviceTypeBits_LarkNesRight, ::HidDeviceTypeBits_HandheldLarkNesRight
HidDeviceType_Lucia = 11, ///< ::HidDeviceTypeBits_Lucia
HidDeviceType_Palma = 12, ///< [9.0.0+] ::HidDeviceTypeBits_Palma
HidDeviceType_FullKey13 = 13, ///< ::HidDeviceTypeBits_FullKey
HidDeviceType_FullKey15 = 15, ///< ::HidDeviceTypeBits_FullKey
HidDeviceType_DebugPad = 17, ///< ::HidDeviceTypeBits_DebugPad
HidDeviceType_System19 = 19, ///< ::HidDeviceTypeBits_System with \ref HidNpadStyleTag |= ::HidNpadStyleTag_NpadFullKey.
HidDeviceType_System20 = 20, ///< ::HidDeviceTypeBits_System with \ref HidNpadStyleTag |= ::HidNpadStyleTag_NpadJoyDual.
HidDeviceType_System21 = 21, ///< ::HidDeviceTypeBits_System with \ref HidNpadStyleTag |= ::HidNpadStyleTag_NpadJoyDual.
HidDeviceType_Lagon = 22, ///< ::HidDeviceTypeBits_Lagon
HidDeviceType_Lager = 28, ///< ::HidDeviceTypeBits_Lager
} HidDeviceType;
/// AppletFooterUiType (system)
typedef enum {
HidAppletFooterUiType_None = 0, ///< None
HidAppletFooterUiType_HandheldNone = 1, ///< HandheldNone
HidAppletFooterUiType_HandheldJoyConLeftOnly = 2, ///< HandheldJoyConLeftOnly
HidAppletFooterUiType_HandheldJoyConRightOnly = 3, ///< HandheldJoyConRightOnly
HidAppletFooterUiType_HandheldJoyConLeftJoyConRight = 4, ///< HandheldJoyConLeftJoyConRight
HidAppletFooterUiType_JoyDual = 5, ///< JoyDual
HidAppletFooterUiType_JoyDualLeftOnly = 6, ///< JoyDualLeftOnly
HidAppletFooterUiType_JoyDualRightOnly = 7, ///< JoyDualRightOnly
HidAppletFooterUiType_JoyLeftHorizontal = 8, ///< JoyLeftHorizontal
HidAppletFooterUiType_JoyLeftVertical = 9, ///< JoyLeftVertical
HidAppletFooterUiType_JoyRightHorizontal = 10, ///< JoyRightHorizontal
HidAppletFooterUiType_JoyRightVertical = 11, ///< JoyRightVertical
HidAppletFooterUiType_SwitchProController = 12, ///< SwitchProController
HidAppletFooterUiType_CompatibleProController = 13, ///< CompatibleProController
HidAppletFooterUiType_CompatibleJoyCon = 14, ///< CompatibleJoyCon
HidAppletFooterUiType_LarkHvc1 = 15, ///< LarkHvc1
HidAppletFooterUiType_LarkHvc2 = 16, ///< LarkHvc2
HidAppletFooterUiType_LarkNesLeft = 17, ///< LarkNesLeft
HidAppletFooterUiType_LarkNesRight = 18, ///< LarkNesRight
HidAppletFooterUiType_Lucia = 19, ///< Lucia
HidAppletFooterUiType_Verification = 20, ///< Verification
HidAppletFooterUiType_Lagon = 21, ///< [13.0.0+] Lagon
} HidAppletFooterUiType;
/// NpadInterfaceType (system)
typedef enum {
HidNpadInterfaceType_Bluetooth = 1, ///< Bluetooth.
HidNpadInterfaceType_Rail = 2, ///< Rail.
HidNpadInterfaceType_USB = 3, ///< USB.
HidNpadInterfaceType_Unknown4 = 4, ///< Unknown.
} HidNpadInterfaceType;
/// XcdInterfaceType
typedef enum {
XcdInterfaceType_Bluetooth = BIT(0),
XcdInterfaceType_Uart = BIT(1),
XcdInterfaceType_Usb = BIT(2),
XcdInterfaceType_FieldSet = BIT(7),
} XcdInterfaceType;
/// NpadLarkType
typedef enum {
HidNpadLarkType_Invalid = 0, ///< Invalid
HidNpadLarkType_H1 = 1, ///< H1
HidNpadLarkType_H2 = 2, ///< H2
HidNpadLarkType_NL = 3, ///< NL
HidNpadLarkType_NR = 4, ///< NR
} HidNpadLarkType;
/// NpadLuciaType
typedef enum {
HidNpadLuciaType_Invalid = 0, ///< Invalid
HidNpadLuciaType_J = 1, ///< J
HidNpadLuciaType_E = 2, ///< E
HidNpadLuciaType_U = 3, ///< U
} HidNpadLuciaType;
/// NpadLagerType
typedef enum {
HidNpadLagerType_Invalid = 0, ///< Invalid
HidNpadLagerType_J = 1, ///< J
HidNpadLagerType_E = 2, ///< E
HidNpadLagerType_U = 3, ///< U
} HidNpadLagerType;
/// Type values for HidVibrationDeviceInfo::type.
typedef enum {
HidVibrationDeviceType_Unknown = 0, ///< Unknown
HidVibrationDeviceType_LinearResonantActuator = 1, ///< LinearResonantActuator
HidVibrationDeviceType_GcErm = 2, ///< GcErm (::HidNpadStyleTag_NpadGc)
} HidVibrationDeviceType;
/// VibrationDevicePosition
typedef enum {
HidVibrationDevicePosition_None = 0, ///< None
HidVibrationDevicePosition_Left = 1, ///< Left
HidVibrationDevicePosition_Right = 2, ///< Right
} HidVibrationDevicePosition;
/// VibrationGcErmCommand
typedef enum {
HidVibrationGcErmCommand_Stop = 0, ///< Stops the vibration with a decay phase.
HidVibrationGcErmCommand_Start = 1, ///< Starts the vibration.
HidVibrationGcErmCommand_StopHard = 2, ///< Stops the vibration immediately, with no decay phase.
} HidVibrationGcErmCommand;
/// PalmaOperationType
typedef enum {
HidPalmaOperationType_PlayActivity = 0, ///< PlayActivity
HidPalmaOperationType_SetFrModeType = 1, ///< SetFrModeType
HidPalmaOperationType_ReadStep = 2, ///< ReadStep
HidPalmaOperationType_EnableStep = 3, ///< EnableStep
HidPalmaOperationType_ResetStep = 4, ///< ResetStep
HidPalmaOperationType_ReadApplicationSection = 5, ///< ReadApplicationSection
HidPalmaOperationType_WriteApplicationSection = 6, ///< WriteApplicationSection
HidPalmaOperationType_ReadUniqueCode = 7, ///< ReadUniqueCode
HidPalmaOperationType_SetUniqueCodeInvalid = 8, ///< SetUniqueCodeInvalid
HidPalmaOperationType_WriteActivityEntry = 9, ///< WriteActivityEntry
HidPalmaOperationType_WriteRgbLedPatternEntry = 10, ///< WriteRgbLedPatternEntry
HidPalmaOperationType_WriteWaveEntry = 11, ///< WriteWaveEntry
HidPalmaOperationType_ReadDataBaseIdentificationVersion = 12, ///< ReadDataBaseIdentificationVersion
HidPalmaOperationType_WriteDataBaseIdentificationVersion = 13, ///< WriteDataBaseIdentificationVersion
HidPalmaOperationType_SuspendFeature = 14, ///< SuspendFeature
HidPalmaOperationType_ReadPlayLog = 15, ///< [5.1.0+] ReadPlayLog
HidPalmaOperationType_ResetPlayLog = 16, ///< [5.1.0+] ResetPlayLog
} HidPalmaOperationType;
/// PalmaFrModeType
typedef enum {
HidPalmaFrModeType_Off = 0, ///< Off
HidPalmaFrModeType_B01 = 1, ///< B01
HidPalmaFrModeType_B02 = 2, ///< B02
HidPalmaFrModeType_B03 = 3, ///< B03
HidPalmaFrModeType_Downloaded = 4, ///< Downloaded
} HidPalmaFrModeType;
/// PalmaWaveSet
typedef enum {
HidPalmaWaveSet_Small = 0, ///< Small
HidPalmaWaveSet_Medium = 1, ///< Medium
HidPalmaWaveSet_Large = 2, ///< Large
} HidPalmaWaveSet;
/// PalmaFeature
typedef enum {
HidPalmaFeature_FrMode = BIT(0), ///< FrMode
HidPalmaFeature_RumbleFeedback = BIT(1), ///< RumbleFeedback
HidPalmaFeature_Step = BIT(2), ///< Step
HidPalmaFeature_MuteSwitch = BIT(3), ///< MuteSwitch
} HidPalmaFeature;
/// HidAnalogStickState
typedef struct HidAnalogStickState {
s32 x; ///< X
s32 y; ///< Y
} HidAnalogStickState;
/// HidVector
typedef struct HidVector {
float x;
float y;
float z;
} HidVector;
/// HidDirectionState
typedef struct HidDirectionState {
float direction[3][3]; ///< 3x3 matrix
} HidDirectionState;
#define JOYSTICK_MAX (0x7FFF)
#define JOYSTICK_MIN (-0x7FFF)
// End enums and output structs
/// HidCommonLifoHeader
typedef struct HidCommonLifoHeader {
u64 unused; ///< Unused
u64 buffer_count; ///< BufferCount
u64 tail; ///< Tail
u64 count; ///< Count
} HidCommonLifoHeader;
// Begin HidDebugPad
/// HidDebugPadState
typedef struct HidDebugPadState {
u64 sampling_number; ///< SamplingNumber
u32 attributes; ///< Bitfield of \ref HidDebugPadAttribute.
u32 buttons; ///< Bitfield of \ref HidDebugPadButton.
HidAnalogStickState analog_stick_r; ///< AnalogStickR
HidAnalogStickState analog_stick_l; ///< AnalogStickL
} HidDebugPadState;
/// HidDebugPadStateAtomicStorage
typedef struct HidDebugPadStateAtomicStorage {
u64 sampling_number; ///< SamplingNumber
HidDebugPadState state; ///< \ref HidDebugPadState
} HidDebugPadStateAtomicStorage;
/// HidDebugPadLifo
typedef struct HidDebugPadLifo {
HidCommonLifoHeader header; ///< \ref HidCommonLifoHeader
HidDebugPadStateAtomicStorage storage[17]; ///< \ref HidDebugPadStateAtomicStorage
} HidDebugPadLifo;
/// HidDebugPadSharedMemoryFormat
typedef struct HidDebugPadSharedMemoryFormat {
HidDebugPadLifo lifo;
u8 padding[0x138];
} HidDebugPadSharedMemoryFormat;
// End HidDebugPad
// Begin HidTouchScreen
/// HidTouchState
typedef struct HidTouchState {
u64 delta_time; ///< DeltaTime
u32 attributes; ///< Bitfield of \ref HidTouchAttribute.
u32 finger_id; ///< FingerId
u32 x; ///< X
u32 y; ///< Y
u32 diameter_x; ///< DiameterX
u32 diameter_y; ///< DiameterY
u32 rotation_angle; ///< RotationAngle
u32 reserved; ///< Reserved
} HidTouchState;
/// HidTouchScreenState
typedef struct HidTouchScreenState {
u64 sampling_number; ///< SamplingNumber
s32 count; ///< Number of entries in the touches array.
u32 reserved; ///< Reserved
HidTouchState touches[16]; ///< Array of \ref HidTouchState, with the above count.
} HidTouchScreenState;
/// HidTouchScreenStateAtomicStorage
typedef struct HidTouchScreenStateAtomicStorage {
u64 sampling_number; ///< SamplingNumber
HidTouchScreenState state; ///< \ref HidTouchScreenState
} HidTouchScreenStateAtomicStorage;
/// HidTouchScreenLifo
typedef struct HidTouchScreenLifo {
HidCommonLifoHeader header; ///< \ref HidCommonLifoHeader
HidTouchScreenStateAtomicStorage storage[17]; ///< \ref HidTouchScreenStateAtomicStorage
} HidTouchScreenLifo;
/// HidTouchScreenSharedMemoryFormat
typedef struct HidTouchScreenSharedMemoryFormat {
HidTouchScreenLifo lifo;
u8 padding[0x3c8];
} HidTouchScreenSharedMemoryFormat;
/// HidTouchScreenConfigurationForNx
typedef struct {
u8 mode; ///< \ref HidTouchScreenModeForNx
u8 reserved[0xF]; ///< Reserved
} HidTouchScreenConfigurationForNx;
// End HidTouchScreen
// Begin HidMouse
/// HidMouseState
typedef struct HidMouseState {
u64 sampling_number; ///< SamplingNumber
s32 x; ///< X
s32 y; ///< Y
s32 delta_x; ///< DeltaX
s32 delta_y; ///< DeltaY
s32 wheel_delta_x; ///< WheelDeltaX
s32 wheel_delta_y; ///< WheelDeltaY
u32 buttons; ///< Bitfield of \ref HidMouseButton.
u32 attributes; ///< Bitfield of \ref HidMouseAttribute.
} HidMouseState;
/// HidMouseStateAtomicStorage
typedef struct HidMouseStateAtomicStorage {
u64 sampling_number; ///< SamplingNumber
HidMouseState state;
} HidMouseStateAtomicStorage;
/// HidMouseLifo
typedef struct HidMouseLifo {
HidCommonLifoHeader header;
HidMouseStateAtomicStorage storage[17];
} HidMouseLifo;
/// HidMouseSharedMemoryFormat
typedef struct HidMouseSharedMemoryFormat {
HidMouseLifo lifo;
u8 padding[0xB0];
} HidMouseSharedMemoryFormat;
// End HidMouse
// Begin HidKeyboard
/// HidKeyboardState
typedef struct HidKeyboardState {
u64 sampling_number; ///< SamplingNumber
u64 modifiers; ///< Bitfield of \ref HidKeyboardModifier.
u64 keys[4];
} HidKeyboardState;
/// HidKeyboardStateAtomicStorage
typedef struct HidKeyboardStateAtomicStorage {
u64 sampling_number; ///< SamplingNumber
HidKeyboardState state;
} HidKeyboardStateAtomicStorage;
/// HidKeyboardLifo
typedef struct HidKeyboardLifo {
HidCommonLifoHeader header;
HidKeyboardStateAtomicStorage storage[17];
} HidKeyboardLifo;
/// HidKeyboardSharedMemoryFormat
typedef struct HidKeyboardSharedMemoryFormat {
HidKeyboardLifo lifo;
u8 padding[0x28];
} HidKeyboardSharedMemoryFormat;
// End HidKeyboard
// Begin HidNpad
/// Npad colors.
/// Color fields are zero when not set.
typedef struct HidNpadControllerColor {
u32 main; ///< RGBA Body Color
u32 sub; ///< RGBA Buttons Color
} HidNpadControllerColor;
/// HidNpadFullKeyColorState
typedef struct HidNpadFullKeyColorState {
u32 attribute; ///< \ref HidColorAttribute
HidNpadControllerColor full_key; ///< \ref HidNpadControllerColor FullKey
} HidNpadFullKeyColorState;
/// HidNpadJoyColorState
typedef struct HidNpadJoyColorState {
u32 attribute; ///< \ref HidColorAttribute
HidNpadControllerColor left; ///< \ref HidNpadControllerColor Left
HidNpadControllerColor right; ///< \ref HidNpadControllerColor Right
} HidNpadJoyColorState;
/// HidNpadCommonState
typedef struct HidNpadCommonState {
u64 sampling_number; ///< SamplingNumber
u64 buttons; ///< Bitfield of \ref HidNpadButton.
HidAnalogStickState analog_stick_l; ///< AnalogStickL
HidAnalogStickState analog_stick_r; ///< AnalogStickR
u32 attributes; ///< Bitfield of \ref HidNpadAttribute.
u32 reserved; ///< Reserved
} HidNpadCommonState;
typedef HidNpadCommonState HidNpadFullKeyState; ///< State for ::HidNpadStyleTag_NpadFullKey.
typedef HidNpadCommonState HidNpadHandheldState; ///< State for ::HidNpadStyleTag_NpadHandheld.
typedef HidNpadCommonState HidNpadJoyDualState; ///< State for ::HidNpadStyleTag_NpadJoyDual.
typedef HidNpadCommonState HidNpadJoyLeftState; ///< State for ::HidNpadStyleTag_NpadJoyLeft.
typedef HidNpadCommonState HidNpadJoyRightState; ///< State for ::HidNpadStyleTag_NpadJoyRight.
/// State for ::HidNpadStyleTag_NpadGc. Loaded from the same lifo as \ref HidNpadFullKeyState, with the additional trigger_l/trigger_r loaded from elsewhere.
typedef struct HidNpadGcState {
u64 sampling_number; ///< SamplingNumber
u64 buttons; ///< Bitfield of \ref HidNpadButton.
HidAnalogStickState analog_stick_l; ///< AnalogStickL
HidAnalogStickState analog_stick_r; ///< AnalogStickR
u32 attributes; ///< Bitfield of \ref HidNpadAttribute.
u32 trigger_l; ///< L analog trigger. Valid range: 0x0-0x7FFF.
u32 trigger_r; ///< R analog trigger. Valid range: 0x0-0x7FFF.
u32 pad;
} HidNpadGcState;
typedef HidNpadCommonState HidNpadPalmaState; ///< State for ::HidNpadStyleTag_NpadPalma.
/// State for ::HidNpadStyleTag_NpadLark. The base state is loaded from the same lifo as \ref HidNpadFullKeyState.
typedef struct HidNpadLarkState {
u64 sampling_number; ///< SamplingNumber
u64 buttons; ///< Bitfield of \ref HidNpadButton.
HidAnalogStickState analog_stick_l; ///< This is always zero.
HidAnalogStickState analog_stick_r; ///< This is always zero.
u32 attributes; ///< Bitfield of \ref HidNpadAttribute.
HidNpadLarkType lark_type_l_and_main; ///< \ref HidNpadLarkType LarkTypeLAndMain
} HidNpadLarkState;
/// State for ::HidNpadStyleTag_NpadHandheldLark. The base state is loaded from the same lifo as \ref HidNpadHandheldState.
typedef struct HidNpadHandheldLarkState {
u64 sampling_number; ///< SamplingNumber
u64 buttons; ///< Bitfield of \ref HidNpadButton.
HidAnalogStickState analog_stick_l; ///< AnalogStickL
HidAnalogStickState analog_stick_r; ///< AnalogStickR
u32 attributes; ///< Bitfield of \ref HidNpadAttribute.
HidNpadLarkType lark_type_l_and_main; ///< \ref HidNpadLarkType LarkTypeLAndMain
HidNpadLarkType lark_type_r; ///< \ref HidNpadLarkType LarkTypeR
u32 pad;
} HidNpadHandheldLarkState;
/// State for ::HidNpadStyleTag_NpadLucia. The base state is loaded from the same lifo as \ref HidNpadFullKeyState.
typedef struct HidNpadLuciaState {
u64 sampling_number; ///< SamplingNumber
u64 buttons; ///< Bitfield of \ref HidNpadButton.
HidAnalogStickState analog_stick_l; ///< This is always zero.
HidAnalogStickState analog_stick_r; ///< This is always zero.
u32 attributes; ///< Bitfield of \ref HidNpadAttribute.
HidNpadLuciaType lucia_type; ///< \ref HidNpadLuciaType
} HidNpadLuciaState;
typedef HidNpadCommonState HidNpadLagerState; ///< State for ::HidNpadStyleTag_NpadLager. Analog-sticks state are always zero.
typedef HidNpadCommonState HidNpadSystemExtState; ///< State for ::HidNpadStyleTag_NpadSystemExt.
typedef HidNpadCommonState HidNpadSystemState; ///< State for ::HidNpadStyleTag_NpadSystem. Analog-sticks state are always zero. Only the following button bits are available: HidNpadButton_A, HidNpadButton_B, HidNpadButton_X, HidNpadButton_Y, HidNpadButton_Left, HidNpadButton_Up, HidNpadButton_Right, HidNpadButton_Down, HidNpadButton_L, HidNpadButton_R.
/// HidNpadCommonStateAtomicStorage
typedef struct HidNpadCommonStateAtomicStorage {
u64 sampling_number; ///< SamplingNumber
HidNpadCommonState state;
} HidNpadCommonStateAtomicStorage;
/// HidNpadCommonLifo
typedef struct HidNpadCommonLifo {
HidCommonLifoHeader header;
HidNpadCommonStateAtomicStorage storage[17];
} HidNpadCommonLifo;
/// HidNpadGcTriggerState
typedef struct HidNpadGcTriggerState {
u64 sampling_number; ///< SamplingNumber
u32 trigger_l;
u32 trigger_r;
} HidNpadGcTriggerState;
/// HidNpadGcTriggerStateAtomicStorage
typedef struct HidNpadGcTriggerStateAtomicStorage {
u64 sampling_number; ///< SamplingNumber
HidNpadGcTriggerState state;
} HidNpadGcTriggerStateAtomicStorage;
/// HidNpadGcTriggerLifo
typedef struct HidNpadGcTriggerLifo {
HidCommonLifoHeader header;
HidNpadGcTriggerStateAtomicStorage storage[17];
} HidNpadGcTriggerLifo;
/// HidSixAxisSensorState
typedef struct HidSixAxisSensorState {
u64 delta_time; ///< DeltaTime
u64 sampling_number; ///< SamplingNumber
HidVector acceleration; ///< Acceleration
HidVector angular_velocity; ///< AngularVelocity
HidVector angle; ///< Angle
HidDirectionState direction; ///< Direction
u32 attributes; ///< Bitfield of \ref HidSixAxisSensorAttribute.
u32 reserved; ///< Reserved
} HidSixAxisSensorState;
/// HidSixAxisSensorStateAtomicStorage
typedef struct HidSixAxisSensorStateAtomicStorage {
u64 sampling_number; ///< SamplingNumber
HidSixAxisSensorState state;
} HidSixAxisSensorStateAtomicStorage;
/// HidNpadSixAxisSensorLifo
typedef struct HidNpadSixAxisSensorLifo {
HidCommonLifoHeader header;
HidSixAxisSensorStateAtomicStorage storage[17];
} HidNpadSixAxisSensorLifo;
/// NpadSystemProperties
typedef struct {
u64 is_charging : 3; ///< Use \ref hidGetNpadPowerInfoSingle / \ref hidGetNpadPowerInfoSplit instead of accessing this directly.
u64 is_powered : 3; ///< Use \ref hidGetNpadPowerInfoSingle / \ref hidGetNpadPowerInfoSplit instead of accessing this directly.
u64 bit6 : 1; ///< Unused
u64 bit7 : 1; ///< Unused
u64 bit8 : 1; ///< Unused
u64 is_unsupported_button_pressed_on_npad_system : 1; ///< IsUnsupportedButtonPressedOnNpadSystem
u64 is_unsupported_button_pressed_on_npad_system_ext : 1; ///< IsUnsupportedButtonPressedOnNpadSystemExt
u64 is_abxy_button_oriented : 1; ///< IsAbxyButtonOriented
u64 is_sl_sr_button_oriented : 1; ///< IsSlSrButtonOriented
u64 is_plus_available : 1; ///< [4.0.0+] IsPlusAvailable
u64 is_minus_available : 1; ///< [4.0.0+] IsMinusAvailable
u64 is_directional_buttons_available : 1; ///< [8.0.0+] IsDirectionalButtonsAvailable
u64 unused : 48; ///< Unused
} HidNpadSystemProperties;
/// NpadSystemButtonProperties
typedef struct {
u32 is_unintended_home_button_input_protection_enabled : 1; ///< IsUnintendedHomeButtonInputProtectionEnabled
} HidNpadSystemButtonProperties;
/// HidPowerInfo (system)
typedef struct {
bool is_powered; ///< IsPowered
bool is_charging; ///< IsCharging
u8 reserved[6]; ///< Reserved
u32 battery_level; ///< BatteryLevel, always 0-4.
} HidPowerInfo;
/// XcdDeviceHandle
typedef struct XcdDeviceHandle {
u64 handle;
} XcdDeviceHandle;
/// HidNfcXcdDeviceHandleStateImpl
typedef struct HidNfcXcdDeviceHandleStateImpl {
XcdDeviceHandle handle;
u8 is_available;
u8 is_activated;
u8 reserved[6];
u64 sampling_number; ///< SamplingNumber
} HidNfcXcdDeviceHandleStateImpl;
/// HidNfcXcdDeviceHandleStateImplAtomicStorage
typedef struct HidNfcXcdDeviceHandleStateImplAtomicStorage {
u64 sampling_number; ///< SamplingNumber
HidNfcXcdDeviceHandleStateImpl state; ///< \ref HidNfcXcdDeviceHandleStateImpl
} HidNfcXcdDeviceHandleStateImplAtomicStorage;
/// HidNfcXcdDeviceHandleState
typedef struct HidNfcXcdDeviceHandleState {
HidCommonLifoHeader header;
HidNfcXcdDeviceHandleStateImplAtomicStorage storage[2];
} HidNfcXcdDeviceHandleState;
/// HidNpadInternalState
typedef struct HidNpadInternalState {
u32 style_set; ///< Bitfield of \ref HidNpadStyleTag.
u32 joy_assignment_mode; ///< \ref HidNpadJoyAssignmentMode
HidNpadFullKeyColorState full_key_color; ///< \ref HidNpadFullKeyColorState
HidNpadJoyColorState joy_color; ///< \ref HidNpadJoyColorState
HidNpadCommonLifo full_key_lifo; ///< FullKeyLifo
HidNpadCommonLifo handheld_lifo; ///< HandheldLifo
HidNpadCommonLifo joy_dual_lifo; ///< JoyDualLifo
HidNpadCommonLifo joy_left_lifo; ///< JoyLeftLifo
HidNpadCommonLifo joy_right_lifo; ///< JoyRightLifo
HidNpadCommonLifo palma_lifo; ///< PalmaLifo
HidNpadCommonLifo system_ext_lifo; ///< SystemExtLifo
HidNpadSixAxisSensorLifo full_key_six_axis_sensor_lifo; ///< FullKeySixAxisSensorLifo
HidNpadSixAxisSensorLifo handheld_six_axis_sensor_lifo; ///< HandheldSixAxisSensorLifo
HidNpadSixAxisSensorLifo joy_dual_left_six_axis_sensor_lifo; ///< JoyDualLeftSixAxisSensorLifo
HidNpadSixAxisSensorLifo joy_dual_right_six_axis_sensor_lifo; ///< JoyDualRightSixAxisSensorLifo
HidNpadSixAxisSensorLifo joy_left_six_axis_sensor_lifo; ///< JoyLeftSixAxisSensorLifo
HidNpadSixAxisSensorLifo joy_right_six_axis_sensor_lifo; ///< JoyRightSixAxisSensorLifo
u32 device_type; ///< Bitfield of \ref HidDeviceTypeBits.
u32 reserved; ///< Reserved
HidNpadSystemProperties system_properties;
HidNpadSystemButtonProperties system_button_properties;
u32 battery_level[3];
union {
struct { // [1.0.0-3.0.2]
HidNfcXcdDeviceHandleState nfc_xcd_device_handle;
};
struct {
u32 applet_footer_ui_attribute; ///< Bitfield of AppletFooterUiAttribute.
u8 applet_footer_ui_type; ///< \ref HidAppletFooterUiType
u8 reserved_x41AD[0x5B];
};
};
u8 reserved_x4208[0x20]; ///< Mutex on pre-10.0.0.
HidNpadGcTriggerLifo gc_trigger_lifo;