aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb2422.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb2422.h')
-rw-r--r--drivers/usb2422.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/drivers/usb2422.h b/drivers/usb2422.h
new file mode 100644
index 000000000..2e435b02b
--- /dev/null
+++ b/drivers/usb2422.h
@@ -0,0 +1,59 @@
1/* Copyright 2021 QMK
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#pragma once
17
18#include <stdbool.h>
19
20#ifndef USB2422_ADDRESS
21# define USB2422_ADDRESS 0x58
22#endif
23
24#ifndef USB2422_VENDOR_ID
25# define USB2422_VENDOR_ID 0xFEED
26#endif
27#ifndef USB2422_PRODUCT_ID
28# define USB2422_PRODUCT_ID 0x0001
29#endif
30#ifndef USB2422_DEVICE_VER
31# define USB2422_DEVICE_VER 0x0001
32#endif
33
34#ifndef USB2422_MANUFACTURER
35# define USB2422_MANUFACTURER "QMK"
36#endif
37#ifndef USB2422_PRODUCT
38# define USB2422_PRODUCT "QMK Hub"
39#endif
40
41/** \brief Initialises the dependent subsystems */
42void USB2422_init(void);
43
44/** \brief Push configuration to the USB2422 device */
45void USB2422_configure(void);
46
47/** \brief Reset the chip (RESET_N)
48 *
49 * NOTE:
50 * Depends on a valid USB2422_RESET_PIN configuration
51 */
52void USB2422_reset(void);
53
54/** \brief Indicates the USB state of the hub (SUSP_IND)
55 *
56 * NOTE:
57 * Depends on a valid USB2422_ACTIVE_PIN configuration
58 */
59bool USB2422_active(void);