nipo / hrdc

HID Report Descriptor Compiler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HID Report Descriptor Compiler

This project handles Human Interface Devices (HID) Report Descriptors.

This is a python library with associated tools to manipulate Report Descriptors.

Presentation

Usually, report descriptors are authored in a source form directly. Some tools exist, but they all concentrate on translating representation of a descriptor, keeping it at the abstraction level from Specification.

This project introduces a language for the semantic abstraction level described in the spec, i.e. using Collection, Values and Reports as first-class objects, not decomposed as Items.

Moreover, HID uses a lot of symbolic constants for Usage, Item types, Data types, etc. This should be transparent to the Report Descriptor author.

Abstraction levels

Two abstraction levels are handled by this library:

  • the usual abstraction level from the HID specification. Various encoding are handled:
    • Binary data,
    • Hex blob,
    • C code with pretty comments.
  • High-level descriptor: this is an abstract representation with Reports, Values, Collections, etc.

Compiler, converters

Conversion between all these abstractions and encodings is supported through:

  • A generic HID Report Descriptor encoding converter,
  • A Report Descriptor decompiler to get back to abstract representation,
  • A report descriptor optimizing compiler.

Goal

If you are still reading, you probably know how to interpret this:

The whole purpose of this project is to stop editing this kind of source code to concentrate on this:

... and let the computer take care of Global Items, Logical ranges, Physical ranges, Units, etc.

More information

See documentation for more information about Usage, Descriptor language and rationale.

See examples.

License

MIT

About

HID Report Descriptor Compiler

License:MIT License


Languages

Language:Python 100.0%