usb mouse with lpc1769 as host

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

usb mouse with lpc1769 as host

1,224 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nikita on Mon Oct 28 04:44:14 MST 2013
Hi,
I am in need of usb mouse source code for lpc1769 LPCXpresso board ,

The sample codes have keyboard with LPC board as host but not for mouse.In the code given for

mouse, board acts as HID device not as a host.

What changes do I need to use keyboard_host program from NXPUSBLib  for mouse ?

I also want to use usb hub with LPCXpresso board, Any other suggestions..

Waiting for reply.
0 项奖励
回复
3 回复数

1,040 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nikita on Thu Nov 07 00:49:25 MST 2013
Any more suggestions for code USB hub with pc1769 LPCxpresso board ?


0 项奖励
回复

1,040 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nikita on Thu Oct 31 21:35:40 MST 2013
Thank you Tsuneo...!!
0 项奖励
回复

1,040 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tsuneo on Tue Oct 29 11:04:55 MST 2013
The lpcusblib_KeyboardHost example in LPCOpen(v1.03) detects boot keyboard by looking in bInterfaceProtocol field on the target device. (lazy implementation.)
Modify it to boot mouse.

lpcopen_v1.03\applications\LPCUSBlib\lpcusblib_KeyboardHost\KeyboardHost.c

static USB_ClassInfo_HID_Host_t Keyboard_HID_Interface = {
    .Config = {
        .DataINPipeNumber       = 1,
        .DataINPipeDoubleBank   = false,

        .DataOUTPipeNumber      = 2,
        .DataOUTPipeDoubleBank  = false,

        .HIDInterfaceProtocol   = HID_CSCP_KeyboardBootProtocol,  // <-- HID_CSCP_MouseBootProtocol
        .PortNumber = 0,
    },
};

With this change, your boot mouse should be enumerated by this host.

Now that the modification of input report parser.
KeyboardHost.c

static void KeyboardHost_Task(void)
{
    ...
    // USB_KeyboardReport_Data_t KeyboardReport;
    // HID_Host_ReceiveReport(&Keyboard_HID_Interface, &KeyboardReport);

    USB_MouseReport_Data_t MouseReport;
    HID_Host_ReceiveReport(&Keyboard_HID_Interface, &MouseReport);

    // following lines in this routine are rewritten to refer MouseReport
    // to process MouseReport.Button, .X, .Y
    ...


That's all.


Quote:
I also want to use usb hub with LPCXpresso board


mbed team has good implementation for hub over LPC1768 (also fine for LPC1769)
http://mbed.org/handbook/USBHost
http://mbed.org/handbook/USBHostHub

Tsuneo
0 项奖励
回复