website logo
⌘K
Hand Held Legend Wiki
Modding Tips
Restore Your Original Gameboy Bumper Buttons To Factory
IPS Comparison Info
Headphones Working But Speaker Is Not
Power Switch Cleaning Guide
IPS LCD Dry Test
GBA SP | IPS LCD Dry Test
Soldering Iron Guide
HHL Products
GC Pocket Adapter
Open Controller DevKit
Retro-C Cable Information
RetroGlow
ProGCC Mod Kit
T6 Torx Screws
Console Guides
Game Gear
Electrolytic Re-Cap Guide
Nintendo Switch
GameCube
Game Boy (DMG)
Game Boy Pocket
Game Boy Color
Game Boy Advance (AGB)
Game Boy Advance SP
Mod Install Guides
Nintendo Switch
Game Gear
GameCube
Game Boy (DMG)
Game Boy Pocket/Light
Game Boy Color
Game Boy Advance (AGB)
Game Boy Advance SP
Atari Lynx
WonderSwan
Product Usage Guides
Writing A Rom To A Flash Cart
🧃 CleanJuice Modules
Game Boy Color
Troubleshooting
🔉Audio
IPS Troubleshooting Guide
⚡EZ-Flash Omega Troubleshoot
🔋 Power Switch Is Too Small
Developer Center
OpenJoyPad HID USB Specification
USB Product IDs Used
Nintendo Switch
Affiliate Guidelines
Docs powered by archbee 
3min

0x01 - Input Report

INPUT Format

See the code block example for an implementation of the OpenJoyPad HID report as a C struct.

C++
|
// Structure for OpenJoyPad USB input report Data
// Has a length of 10 bytes
typedef struct
{
    uint8_t report_id;

    union
    {
        struct
        {
            uint8_t button_y    : 1;
            uint8_t button_b    : 1;
            uint8_t button_a    : 1;
            uint8_t button_x    : 1;
            uint8_t trigger_l   : 1;
            uint8_t trigger_r   : 1;
            uint8_t trigger_zl  : 1;
            uint8_t trigger_zr  : 1;
        };
        uint8_t buttons_1;
    };

    union
    {
        struct
        {
            uint8_t button_minus  : 1;
            uint8_t button_plus   : 1;
            uint8_t stick_left    : 1;
            uint8_t stick_right   : 1;
            uint8_t button_home   : 1;
            uint8_t button_capture: 1;
            uint8_t padding       : 2;
        }; 
        uint8_t buttons_2;
    };

  uint8_t dpad_hat;
  uint8_t stick_left_x;
  uint8_t stick_left_y;
  uint8_t stick_right_x;
  uint8_t stick_right_y;
  uint8_t analog_trigger_l;
  uint8_t analog_trigger_r;
} __attribute__ ((packed)) openjoypad_input_s;


D-Pad Hat Formatting

See the enumerator table below for definitions you can use to ensure your D-Pad output values are correct.

C++
|
typedef enum
{
  JP_HAT_TOP          = 0x00,
  JP_HAT_TOP_RIGHT    = 0x01,
  JP_HAT_RIGHT        = 0x02,
  JP_HAT_BOTTOM_RIGHT = 0x03,
  JP_HAT_BOTTOM       = 0x04,
  JP_HAT_BOTTOM_LEFT  = 0x05,
  JP_HAT_LEFT         = 0x06,
  JP_HAT_TOP_LEFT     = 0x07,
  JP_HAT_CENTER       = 0x08,
} jp_input_hat_dir_t;




Updated 03 Mar 2023
Did this page help you?
Yes
No
UP NEXT
0x02 - Configuration Report
Docs powered by archbee 
TABLE OF CONTENTS
INPUT Format
D-Pad Hat Formatting