Keyboard firmwares for Atmel AVR and Cortex-M
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

usb_mouse.h 699B

12345678910111213141516171819202122232425262728293031
  1. #ifndef USB_MOUSE_H
  2. #define USB_MOUSE_H 1
  3. #include <stdint.h>
  4. #include <stdbool.h>
  5. #include "usb.h"
  6. #define MOUSE_INTERFACE 1
  7. #define MOUSE_ENDPOINT 2
  8. #define MOUSE_SIZE 8
  9. #define MOUSE_BUFFER EP_DOUBLE_BUFFER
  10. #define BIT_BTN1 (1<<0)
  11. #define BIT_BTN2 (1<<1)
  12. #define BIT_BTN3 (1<<2)
  13. #define BIT_BTN4 (1<<3)
  14. #define BIT_BTN5 (1<<4)
  15. extern uint8_t mouse_buttons;
  16. extern uint8_t mouse_protocol;
  17. int8_t usb_mouse_buttons(uint8_t left, uint8_t middle, uint8_t right);
  18. int8_t usb_mouse_move(int8_t x, int8_t y, int8_t wheel, int8_t hwheel);
  19. void usb_mouse_clear(void);
  20. bool usb_mouse_is_sent(void);
  21. void usb_mouse_print(int8_t mouse_x, int8_t mouse_y, int8_t wheel_v, int8_t wheel_h);
  22. #endif