Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

P18f4550, USB HID Protocol Problem

Status
Not open for further replies.

hassanzia

Junior Member level 3
Junior Member level 3
Joined
Nov 24, 2011
Messages
30
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Visit site
Activity points
1,506
Hi all,

I'm trying to emulate a mouse by using a P18F4550 and an ADNS optical sensor. According to my best understanding (I may be wrong here) the host receives movement data of the mouse via the following code, which is taken directly from the HID Demo provided by Microchip :

Code:
// the parameter hid_report_in holds the data to be sent and 0x03 is the size of this data (in bytes).
// I am unable to figure what the first parameter is for.
lastTransmission = HIDTxPacket(HID_EP, (BYTE*)hid_report_in, 0x03);

I have been able to successfully simulate the movement of a mouse using the above code. However, now I'm uncertain as to how to send the information regarding the buttons of the mouse (ie whether one button is pressed or not) by modifying the above code. Any help with my problem or with the general structure of the HID class would be appreciated.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top