X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=tmk_core%2Fprotocol%2Fchibios%2Fusb_main.h;h=30d8fcaef72a7786f0b23a0af6d0236759d130ba;hb=fc40073bbce2b30762cc8c622910fdeec889d049;hp=b7696643a6cae398481df06cddf0612f3f3eef7d;hpb=27dec2db7bb33cc45b04b89b6855bac6b98de2e5;p=max%2Ftmk_keyboard.git diff --git a/tmk_core/protocol/chibios/usb_main.h b/tmk_core/protocol/chibios/usb_main.h index b7696643..30d8fcae 100644 --- a/tmk_core/protocol/chibios/usb_main.h +++ b/tmk_core/protocol/chibios/usb_main.h @@ -19,6 +19,9 @@ #ifndef _USB_MAIN_H_ #define _USB_MAIN_H_ +// TESTING +// extern uint8_t blinkLed; + #include "ch.h" #include "hal.h" @@ -31,7 +34,10 @@ #define USB_DRIVER USBD1 /* Initialize the USB driver and bus */ -void init_usb_driver(void); +void init_usb_driver(USBDriver *usbp); + +/* Send remote wakeup packet */ +void send_remote_wakeup(USBDriver *usbp); /* --------------- * Keyboard header @@ -41,20 +47,17 @@ void init_usb_driver(void); /* main keyboard (6kro) */ #define KBD_INTERFACE 0 #define KBD_ENDPOINT 1 -#define KBD_SIZE 8 -#define KBD_REPORT_KEYS (KBD_SIZE - 2) +#define KBD_EPSIZE 8 +#define KBD_REPORT_KEYS (KBD_EPSIZE - 2) /* secondary keyboard */ #ifdef NKRO_ENABLE #define NKRO_INTERFACE 4 #define NKRO_ENDPOINT 5 -#define NKRO_SIZE 16 -#define NKRO_REPORT_KEYS (NKRO_SIZE - 1) +#define NKRO_EPSIZE 16 +#define NKRO_REPORT_KEYS (NKRO_EPSIZE - 1) #endif -/* this defines report_keyboard_t and computes REPORT_SIZE defines */ -#include "report.h" - /* extern report_keyboard_t keyboard_report_sent; */ /* keyboard IN request callback handler */ @@ -77,7 +80,7 @@ void nkro_in_cb(USBDriver *usbp, usbep_t ep); #define MOUSE_INTERFACE 1 #define MOUSE_ENDPOINT 2 -#define MOUSE_SIZE 8 +#define MOUSE_EPSIZE 8 /* mouse IN request callback handler */ void mouse_in_cb(USBDriver *usbp, usbep_t ep); @@ -92,7 +95,7 @@ void mouse_in_cb(USBDriver *usbp, usbep_t ep); #define EXTRA_INTERFACE 3 #define EXTRA_ENDPOINT 4 -#define EXTRA_SIZE 8 +#define EXTRA_EPSIZE 8 /* extrakey IN request callback handler */ void extra_in_cb(USBDriver *usbp, usbep_t ep); @@ -113,18 +116,16 @@ typedef struct { #define CONSOLE_INTERFACE 2 #define CONSOLE_ENDPOINT 3 -#define CONSOLE_SIZE 16 +#define CONSOLE_EPSIZE 16 /* Number of IN reports that can be stored inside the output queue */ -#define CONSOLE_QUEUE_CAPACITY 2 -#define CONSOLE_QUEUE_BUFFER_SIZE (CONSOLE_QUEUE_CAPACITY * CONSOLE_SIZE) +#define CONSOLE_QUEUE_CAPACITY 4 /* Console flush time */ #define CONSOLE_FLUSH_MS 50 /* Putchar over the USB console */ int8_t sendchar(uint8_t c); -/* wrapper for printf lib */ /* Flush output (send everything immediately) */ void console_flush_output(void); @@ -135,15 +136,4 @@ void console_in_cb(USBDriver *usbp, usbep_t ep); void sendchar_pf(void *p, char c); -/* --------------------------- - * Host driver functions (TMK) - * --------------------------- - */ - -uint8_t keyboard_leds(void); -void send_keyboard(report_keyboard_t *report); -void send_mouse(report_mouse_t *report); -void send_system(uint16_t data); -void send_consumer(uint16_t data); - #endif /* _USB_MAIN_H_ */