22#include "rtos/Mutex.h"
24#define REPORT_ID_MOUSE 2
39#define X_MAX_ABS (0x7fff)
40#define Y_MAX_ABS (0x7fff)
42#define X_MIN_REL (-127)
43#define Y_MIN_REL (-127)
44#define X_MAX_REL (127)
45#define Y_MAX_REL (127)
129 USBMouse(
bool connect_blocking =
true, MOUSE_TYPE mouse_type = REL_MOUSE, uint16_t vendor_id = 0x1234, uint16_t product_id = 0x0001, uint16_t product_release = 0x0001);
148 USBMouse(
USBPhy *phy, MOUSE_TYPE mouse_type = REL_MOUSE, uint16_t vendor_id = 0x1234, uint16_t product_id = 0x0001, uint16_t product_release = 0x0001);
167 bool update(int16_t x, int16_t y, uint8_t buttons, int8_t z);
176 bool move(int16_t x, int16_t y);
222 virtual const uint8_t *report_desc();
230 virtual const uint8_t *configuration_desc(uint8_t index);
233 MOUSE_TYPE _mouse_type;
235 uint8_t _configuration_descriptor[41];
238 bool mouse_send(int8_t x, int8_t y, uint8_t buttons, int8_t z);
USBMouse(bool connect_blocking=true, MOUSE_TYPE mouse_type=REL_MOUSE, uint16_t vendor_id=0x1234, uint16_t product_id=0x0001, uint16_t product_release=0x0001)
Basic constructor.
bool move(int16_t x, int16_t y)
Move the cursor to (x, y)
USBMouse(USBPhy *phy, MOUSE_TYPE mouse_type=REL_MOUSE, uint16_t vendor_id=0x1234, uint16_t product_id=0x0001, uint16_t product_release=0x0001)
Fully featured constructor.
bool release(uint8_t button)
Release one or several buttons.
virtual ~USBMouse()
Destroy this object.
bool scroll(int8_t z)
Scrolling.
bool press(uint8_t button)
Press one or several buttons.
bool click(uint8_t button)
Click.
bool update(int16_t x, int16_t y, uint8_t buttons, int8_t z)
Write a state of the mouse.
bool double_click()
Double click (MOUSE_LEFT)
Abstract interface to physical USB hardware.
The Mutex class is used to synchronize the execution of threads.