USBHost library. NOTE: This library is only officially supported on the LPC1768 platform. For more information, please see the handbook page.

Dependencies:   FATFileSystem mbed-rtos

Dependents:   BTstack WallbotWii SD to Flash Data Transfer USBHost-MSD_HelloWorld ... more

Embed: (wiki syntax)

« Back to documentation index

USBHostMouse Class Reference

USBHostMouse Class Reference

A class to communicate a USB mouse. More...

#include <USBHostMouse.h>

Inherits IUSBEnumerator.

Public Member Functions

 USBHostMouse ()
 Constructor.
bool connect ()
 Try to connect a mouse device.
bool connected ()
 Check if a mouse is connected.
void attachEvent (void(*ptr)(uint8_t buttons, int8_t x, int8_t y, int8_t z))
 Attach a callback called when a mouse event is received.
void attachButtonEvent (void(*ptr)(uint8_t buttons))
 Attach a callback called when the button state changes.
void attachXEvent (void(*ptr)(int8_t x))
 Attach a callback called when the X axis value changes.
void attachYEvent (void(*ptr)(int8_t y))
 Attach a callback called when the Y axis value changes.
void attachZEvent (void(*ptr)(int8_t z))
 Attach a callback called when the Z axis value changes (scrolling)

Detailed Description

A class to communicate a USB mouse.

Definition at line 29 of file USBHostMouse.h.


Constructor & Destructor Documentation

USBHostMouse (  )

Constructor.

Definition at line 21 of file USBHostMouse.cpp.


Member Function Documentation

void attachButtonEvent ( void(*)(uint8_t buttons)  ptr )

Attach a callback called when the button state changes.

Parameters:
ptrfunction pointer

Definition at line 69 of file USBHostMouse.h.

void attachEvent ( void(*)(uint8_t buttons, int8_t x, int8_t y, int8_t z)  ptr )

Attach a callback called when a mouse event is received.

Parameters:
ptrfunction pointer

Definition at line 57 of file USBHostMouse.h.

void attachXEvent ( void(*)(int8_t x)  ptr )

Attach a callback called when the X axis value changes.

Parameters:
ptrfunction pointer

Definition at line 81 of file USBHostMouse.h.

void attachYEvent ( void(*)(int8_t y)  ptr )

Attach a callback called when the Y axis value changes.

Parameters:
ptrfunction pointer

Definition at line 93 of file USBHostMouse.h.

void attachZEvent ( void(*)(int8_t z)  ptr )

Attach a callback called when the Z axis value changes (scrolling)

Parameters:
ptrfunction pointer

Definition at line 105 of file USBHostMouse.h.

bool connect (  )

Try to connect a mouse device.

Returns:
true if connection was successful

Definition at line 52 of file USBHostMouse.cpp.

bool connected (  )

Check if a mouse is connected.

Returns:
true if a mouse is connected

Definition at line 47 of file USBHostMouse.cpp.