Special HID configuration file?

Titan Two general support. Questions, firmware update, feature request.

Special HID configuration file?

Postby BN_JailBreak » Fri Jul 26, 2019 3:02 am

I have read on the forms a "special HID configuration file" can be made to support devices without a firmware update and just out of curiosity is there any way to make a "special HID configuration file" your self using captured descriptors(or external tools) and a little programing?

Is this information accurate?

If possible any examples or reference guides?

Where are "special HID configuration file" stored on the SD card in the root directory or a sub directory?

Do "special HID configuration file" support Bluetooth devices or only USB?


Thanks for the Time!
User avatar
BN_JailBreak
Sergeant
Sergeant
 
Posts: 7
Joined: Sun Jul 29, 2018 3:16 am

Re: Special HID configuration file?

Postby J2Kbr » Mon Jul 29, 2019 11:44 am

BN_JailBreak wrote:I have read on the forms a "special HID configuration file" can be made to support devices without a firmware update and just out of curiosity is there any way to make a "special HID configuration file" your self using captured descriptors(or external tools) and a little programing? Is this information accurate? If possible any examples or reference guides?

The HID configuration file is in binary format. The format is not considered proprietary, however we don't have yet any documentation of it available. The basic structure of a HID configuration is the mapping of the standard HID inputs to a GPC designator, here is a example of that:
Code: Select all
#include "hiddrv.h"

const char filename[] = "2DFA0001.hid";

const uint8_t configuration[] = {
// SECTION                              IFACE   SIZE
HID_USAGE_MAPPING,                      0xFF,   U16BE(3+(16*4)+3+(7*4)+1),
    // USAGE PAGE                       REPID   ELEMENTS
    HIDPAGE_BUTTON,                     0xFF,   16,
        // USAGE                        TYPE    PREF            PRIM    ELEMENT
        1,                              1,      BUTTON_17,      1,   // 0
        2,                              1,      BUTTON_16,      1,   // 1
        3,                              1,      BUTTON_15,      1,   // 2
        4,                              1,      BUTTON_14,      1,   // 3
        5,                              1,      BUTTON_7,       1,   // 4
        6,                              1,      BUTTON_4,       1,   // 5
        7,                              1,      BUTTON_18,      1,   // 6
        8,                              1,      BUTTON_19,      1,   // 7
        9,                              1,      BUTTON_2,       1,   // 8
        10,                             1,      BUTTON_3,       1,   // 9
        11,                             1,      BUTTON_9,       1,   // 10
        12,                             1,      BUTTON_6,       1,   // 11
        13,                             1,      BUTTON_1,       1,   // 12
        14,                             1,      BUTTON_20,      1,   // 13
        15,                             1,      BUTTON_21,      1,   // 14
        16,                             1,      GYRO_1_Z,       1,   // 15
    // USAGE PAGE                       REPID   ELEMENTS
    HIDPAGE_GENERICDESKTOP,             0xFF,   7,
        // USAGE                        TYPE    PREF            PRIM    ELEMENT
        HIDUSAGE_GD_X,                  0,      STICK_2_X,       1,  // 0
        HIDUSAGE_GD_Y,                  0,      STICK_2_Y,       1,  // 1
        HIDUSAGE_GD_Z,                  0,      STICK_1_X,       1,  // 2
        HIDUSAGE_GD_RX,                 0,      BUTTON_8,        1,  // 3
        HIDUSAGE_GD_RY,                 0,      BUTTON_5,        1,  // 4
        HIDUSAGE_GD_RZ,                 0,      STICK_1_Y,       1,  // 5
        HIDUSAGE_GD_SLIDER,             0,      POINT_1_X,       1,  // 6
    HIDPAGE_UNDEFINED, // END-OF-MAPPING
HID_CONFIG_END
};

BN_JailBreak wrote:Where are "special HID configuration file" stored on the SD card in the root directory or a sub directory?

In the /TITAN TWO/ directory. These files have ".hid" extension, where the name is the VID:PID of the device.

BN_JailBreak wrote:Do "special HID configuration file" support Bluetooth devices or only USB?

Currently only USB (generic HID devices are not yet supported over Bluetooth).
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: Special HID configuration file?

Postby BN_JailBreak » Tue Jul 30, 2019 2:16 am

Thank you very much for this is information going to play around with this right away!
User avatar
BN_JailBreak
Sergeant
Sergeant
 
Posts: 7
Joined: Sun Jul 29, 2018 3:16 am

Re: Special HID configuration file?

Postby BN_JailBreak » Tue Jul 30, 2019 11:45 pm

Some follow up questions what do you use to compile to 32bit RISC binary and is "hiddrv.h" propitiatory or where can i get the code?
User avatar
BN_JailBreak
Sergeant
Sergeant
 
Posts: 7
Joined: Sun Jul 29, 2018 3:16 am

Re: Special HID configuration file?

Postby J2Kbr » Wed Jul 31, 2019 8:17 am

BN_JailBreak wrote:Some follow up questions what do you use to compile to 32bit RISC binary and is "hiddrv.h" propitiatory or where can i get the code?

Attached is the header file "hiddrv.h", and following is the main code "hiddrv.c" that generates the HID configuration based on the above posted ("3drudder_joystick.h") header file:
Code: Select all
/**
 * Compile with:
 * gcc hiddrv.c -o hiddrv
 */
#include <stdint.h>
#include <stdio.h>

#include "3drudder_joystick.h"

int main(int argc, char *argv[]) {
    FILE *fp = fopen(filename, "w");
    fwrite(configuration, 1, sizeof(configuration), fp);
    fclose(fp);
    printf("%s created.\n", filename);
    return(0);
}
Attachments
hiddrv.h
(161.53 KiB) Downloaded 103 times
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: Special HID configuration file?

Postby BN_JailBreak » Thu Aug 01, 2019 1:23 am

I greatly appreciate the amount of help and support you dedicate to the forms! This should come in quite handy i collect a lot of odd/obscure controllers and have recently started designing controllers as a hobby cant thank you enough!
User avatar
BN_JailBreak
Sergeant
Sergeant
 
Posts: 7
Joined: Sun Jul 29, 2018 3:16 am

Re: Special HID configuration file?

Postby J2Kbr » Thu Aug 01, 2019 10:20 am

You are welcome. Few more information you may need:

Is possible to set the HID configuration to be apllied to specific USB interface (IFACE) and/or report ID (REPID). The value 0xFF means to apply on all Interface/Report ID found.

Related with the field TYPE: 1 means the value is unsigned (from 0 to 100), 0 means the value is signed (from -100 to 100).

The PRIM field should always be set to 1. (this filed is only used to solve mapping conflicts with the default HID parser, to avoid more than one HID input be mapped to the same GPC designator).
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: Special HID configuration file?

Postby trancaruas » Mon Sep 14, 2020 2:37 am

Hi J2Kbr,

First, many thanks for your continuous development and support!

I have a request – could you please share a hiddrv.h updated with PADDLE_* designators?

I tried just to add them to hiddrv.h and use them in custom .hid for Virpil MongoosT-50CM2 as below, but it did not work, still button 22 recognized in device monitor as point_1_x after compilation and putting said .hid to sd card:
Code: Select all
 
hiddrv.h snip
// GPC DESIGNATORS
enum {
    BUTTON_1 = 0,               // PS, XBOX
[...]
    GYRO_1_Z,                   // GYROZ
 
    PADDLE_1,
    PADDLE_2,
    PADDLE_3,
    PADDLE_4,
};
 
virpil_mongoost_grip_CM2-5.h snip:
const uint8_t configuration[] = {
// SECTION                              IFACE   SIZE
HID_USAGE_MAPPING,                      0xFF,   U16BE(3+(28*4)+3+(4*4)+1),
    // USAGE PAGE                       REPID   ELEMENTS
    HIDPAGE_BUTTON,                     0xFF,   28,
        // USAGE                        TYPE    PREF            PRIM    ELEMENT
        1,                              1,      BUTTON_1,        1,   // 0  fire pre-trigger     
[...]
//        22,                             1,      POINT_1_X,       1,   // 21 thumb hat up         
        22,                             1,      PADDLE_1,        1,   // 21 thumb hat up
 
User avatar
trancaruas
Private First Class
Private First Class
 
Posts: 3
Joined: Fri Sep 20, 2019 7:23 pm

Re: Special HID configuration file?

Postby J2Kbr » Mon Sep 14, 2020 9:58 pm

trancaruas wrote:I have a request – could you please share a hiddrv.h updated with PADDLE_* designators?

Definitively:
hiddrv.h
(157.76 KiB) Downloaded 71 times
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm


Return to Titan Two Device

Who is online

Users browsing this forum: No registered users and 52 guests