Skip to content

File syn_usb_hid_mouse.h

FileList > drivers > syn_usb_hid_mouse.h

Go to the source code of this file

Zero-Heap USB HID Boot Mouse Device Helper Module.

  • #include "syntropic/common/syn_defs.h"
  • #include "syntropic/drivers/syn_usb_hid.h"
  • #include <stdbool.h>
  • #include <stddef.h>
  • #include <stdint.h>

Classes

Type Name
struct SYN_USB_HID_MouseReport

Public Attributes

Type Name
const uint8_t SYN_USB_HID_MOUSE_REPORT_DESC

Public Functions

Type Name
SYN_Status syn_usb_hid_mouse_click (SYN_USB_HID * hid, uint8_t buttons)
Send a USB HID Mouse click (press button + release).
SYN_Status syn_usb_hid_mouse_move (SYN_USB_HID * hid, int8_t x, int8_t y)
Move the USB HID Mouse pointer relatively.
SYN_Status syn_usb_hid_mouse_send (SYN_USB_HID * hid, uint8_t buttons, int8_t x, int8_t y, int8_t wheel)
Send a USB HID Mouse report with relative movement and buttons.

Macros

Type Name
define SYN_USB_HID_MOUSE_BTN_LEFT (1U &lt;&lt; 0)
Left mouse button bitmask.
define SYN_USB_HID_MOUSE_BTN_MIDDLE (1U &lt;&lt; 2)
Middle mouse button bitmask.
define SYN_USB_HID_MOUSE_BTN_RIGHT (1U &lt;&lt; 1)
Right mouse button bitmask.

Public Attributes Documentation

variable SYN_USB_HID_MOUSE_REPORT_DESC

const uint8_t SYN_USB_HID_MOUSE_REPORT_DESC[54];

Standard USB HID Mouse Report Descriptor (54 Bytes)


Public Functions Documentation

function syn_usb_hid_mouse_click

Send a USB HID Mouse click (press button + release).

SYN_Status syn_usb_hid_mouse_click (
    SYN_USB_HID * hid,
    uint8_t buttons
) 

Parameters:

  • hid Pointer to USB HID instance.
  • buttons Button bitmask (e.g. SYN_USB_HID_MOUSE_BTN_LEFT).

Returns:

SYN_OK on success.


function syn_usb_hid_mouse_move

Move the USB HID Mouse pointer relatively.

SYN_Status syn_usb_hid_mouse_move (
    SYN_USB_HID * hid,
    int8_t x,
    int8_t y
) 

Parameters:

  • hid Pointer to USB HID instance.
  • x Relative X axis displacement.
  • y Relative Y axis displacement.

Returns:

SYN_OK on success.


function syn_usb_hid_mouse_send

Send a USB HID Mouse report with relative movement and buttons.

SYN_Status syn_usb_hid_mouse_send (
    SYN_USB_HID * hid,
    uint8_t buttons,
    int8_t x,
    int8_t y,
    int8_t wheel
) 

Parameters:

  • hid Pointer to USB HID instance.
  • buttons Button bitmask (Left=0x01, Right=0x02, Middle=0x04).
  • x Relative X axis displacement.
  • y Relative Y axis displacement.
  • wheel Relative vertical scroll wheel displacement.

Returns:

SYN_OK on success.


Macro Definition Documentation

define SYN_USB_HID_MOUSE_BTN_LEFT

Left mouse button bitmask.

#define SYN_USB_HID_MOUSE_BTN_LEFT `(1U << 0)`

USB HID Mouse Button Bitmasks


define SYN_USB_HID_MOUSE_BTN_MIDDLE

Middle mouse button bitmask.

#define SYN_USB_HID_MOUSE_BTN_MIDDLE `(1U << 2)`


define SYN_USB_HID_MOUSE_BTN_RIGHT

Right mouse button bitmask.

#define SYN_USB_HID_MOUSE_BTN_RIGHT `(1U << 1)`



The documentation for this class was generated from the following file src/syntropic/drivers/syn_usb_hid_mouse.h