summaryrefslogtreecommitdiff
path: root/tmk_core/protocol/arm_atsam/usb/main_usb.c
blob: 0f676ab639d95d3335e40da0e32d680210cd3816 (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
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
/*
Copyright 2018 Massdrop Inc.

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 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#include "samd51j18a.h"
#include "conf_usb.h"
#include "udd.h"

uint8_t keyboard_protocol = 1;

void main_suspend_action(void)
{
    ui_powerdown();
}

void main_resume_action(void)
{
    ui_wakeup();
}

void main_sof_action(void)
{
    ui_process(udd_get_frame_number());
}

void main_remotewakeup_enable(void)
{
    ui_wakeup_enable();
}

void main_remotewakeup_disable(void)
{
    ui_wakeup_disable();
}

#ifdef KBD
volatile bool main_b_kbd_enable = false;
bool main_kbd_enable(void)
{
    main_b_kbd_enable = true;
    return true;
}

void main_kbd_disable(void)
{
    main_b_kbd_enable = false;
}
#endif

#ifdef NKRO
volatile bool main_b_nkro_enable = false;
bool main_nkro_enable(void)
{
    main_b_nkro_enable = true;
    return true;
}

void main_nkro_disable(void)
{
    main_b_nkro_enable = false;
}
#endif

#ifdef EXK
volatile bool main_b_exk_enable = false;
bool main_exk_enable(void)
{
    main_b_exk_enable = true;
    return true;
}

void main_exk_disable(void)
{
    main_b_exk_enable = false;
}
#endif

#ifdef CON
volatile bool main_b_con_enable = false;
bool main_con_enable(void)
{
    main_b_con_enable = true;
    return true;
}

void main_con_disable(void)
{
    main_b_con_enable = false;
}
#endif

#ifdef MOU
volatile bool main_b_mou_enable = false;
bool main_mou_enable(void)
{
    main_b_mou_enable = true;
    return true;
}

void main_mou_disable(void)
{
    main_b_mou_enable = false;
}
#endif

#ifdef RAW
volatile bool main_b_raw_enable = false;
bool main_raw_enable(void)
{
    main_b_raw_enable = true;
    return true;
}

void main_raw_disable(void)
{
    main_b_raw_enable = false;
}
#endif