- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi.
This sample uses CY8CKIT-059.
This sample code is based on “https://www.cypress.com/documentation/application-notes/an57473-usb-hid-basics-psoc-3-and-psoc-5lp”.
This "AN57473" has 5 buttons, but add 1 button to make 6 buttons.
I hope this sample will help you evaluate USB HID.
schematics
Pin list
USBFS component
AN57473 This sample
Usage Maximum (5) ⇒ Usage Maximum (6)
Report Count (5) ⇒ Report Count (6)
Report Size (3) ⇒ Report Size (2)
main.c
===========================================
void ReadButtons (void)
{
if(Thumb_Button_Read() != 0) /* Detect if button was pressed */
Buttons |= 0x01; /* If pressed, mask bit to indicate button press */
else
Buttons &= ~0x01; /* If released, clear bit */
if(Button_A_Read() != 0)
Buttons |= 0x02;
else
Buttons &= ~0x02;
if(Button_B_Read() != 0)
Buttons |= 0x04;
else
Buttons &= ~0x04;
if(Button_C_Read() != 0)
Buttons |= 0x08;
else
Buttons &= ~0x08;
if(Button_D_Read() != 0)
Buttons |= 0x10;
else
Buttons &= ~0x10;
if(Button_E_Read() != 0)
Buttons |= 0x20;
else
Buttons &= ~0x20;
}
===========================================
Breadboard wiring diagram
Game controller property
Thanks,
Asanuma
- Labels:
-
PSoC 345 LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Asanuma,
Thank you for providing the example project.
Best Regards
Ekta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Asanuma,
Is Joystick Demo a custom application? Where to find this program?
/odissey1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
odissey1-san
This is an application with 6 buttons.
The project is attached.
Best Regards,
Asanuma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Asanuma,
I mean what is this application,
Is this a part of Windows or a custom App?
/odissey1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
odissey1-san
This application is part of Windows.
For more info, refer section 5.1 5.2 5.3.
AN57473
https://www.cypress.com/documentation/application-notes/an57473-usb-hid-basics-psoc-3-and-psoc-5lp
Best Regards,
Asanuma