// TITLE: Public header file for the USB HID Mouse device class
#pragma once
#include "usbdhid.h"
enum tMouseState{
eHIDMouseStateUnconfigured, // Unconfigured.
eHIDMouseStateIdle, // No keys to send and not waiting on data.
eHIDMouseStateWaitData, // Waiting on report data from the host.
eHIDMouseStateSend // Waiting on data to be sent out.
};
//*****************************************************************************
//
// PRIVATE
//
// This structure provides the private instance data structure for the USB
// HID Mouse device. This structure forms the RAM workspace used by each
// instance of the mouse.
//
//*****************************************************************************
struct tUSBDHIDMouseDevice:public tUSBDHIDDevice{
// The USB configuration number set by the host or 0 of the device is
// currently unconfigured.
bool Configured;
// The protocol requested by the host, USB_HID_PROTOCOL_BOOT or
// USB_HID_PROTOCOL_REPORT.
// uint8_t ui8Protocol;
// A buffer used to hold the last input report sent to the host.
uint8_t pui8Report[3];
// The current state of the mouse interrupt IN endpoint.
volatile tMouseState iMouseState;
// The idle timeout control structure for our input report. This is
// required by the lower level HID driver.
// tHIDReportIdle sReportIdle;
void*Init();
void Term();
uint32_t StateChange(int8_t i8DeltaX,int8_t i8DeltaY, uint8_t ui8Buttons);
uint32_t RxCallback(uint32_t ui32Event,uint32_t ui32MsgParam, void *pvMsgData) override;
};
//! return code from USBDHIDMouseStateChange
enum{
MOUSE_SUCCESS = 0,
MOUSE_ERR_TX_ERROR = 2,
MOUSE_ERR_NOT_CONFIGURED = 4,
};
//*****************************************************************************
// API Function Prototypes
//*****************************************************************************
Vorgefundene Kodierung: ASCII (7 bit) | 2
|