devterm.h 944 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef DEVTERM_H
  2. #define DEVTERM_H
  3. #define KEY_LATENCY 1400
  4. #include "state.h"
  5. #include <USBComposite.h>
  6. typedef struct key_debouncing{
  7. bool deing;//debouncing
  8. uint16_t de_time;
  9. }KEY_DEB;
  10. typedef struct keyboard_state{
  11. uint8_t layer;
  12. uint8_t prev_layer;
  13. uint8_t fn_on;
  14. uint8_t shift;
  15. }KEYBOARD_STATE;
  16. class DEVTERM {
  17. public:
  18. HIDKeyboard *Keyboard;
  19. HIDMouse *Mouse;
  20. HIDJoystick *Joystick;
  21. HIDConsumer *Consumer;
  22. KEYBOARD_STATE Keyboard_state;
  23. USBCompositeSerial *_Serial;
  24. //if not to use USBCompositeSerial,then use default Serial
  25. //**Serial and USBCompositeSerial can not use together, otherwise the keyboard firmware uploading will be dead**
  26. //and you will need to find a way out to flash the stm32duino bootloader once again
  27. //USBSerial *_Serial;//_Serial = &Serial;
  28. State *state;
  29. uint32_t delta;
  30. };
  31. #define KEYBOARD_PULL 1 // 1 for PULLUP, 0 FOR PULLDOWN
  32. #endif