Waratah is a HID descriptor composition tool designed to simplify the creation and optimization of Human Interface Device (HID) report descriptors. It abstracts complex details of the HID specification, enabling developers to focus on designing device input/output without manual error-prone tasks.
Key Features:
Human-readable Text: Uses a TOML-like syntax for easy composition and meaningful source control.
Built-in Usages and Units: Includes all public HID usages and units from the latest specifications.
C++ Struct Generation: Automatically generates C++ structs with context-aware naming.
Descriptor Optimization: Reduces byte size by removing redundancies and combining items.
Report Summary: Offers a detailed breakdown of report item types, sizes, and counts.
Context-aware Validation: Ensures all values comply with HID specifications.
Automatic ReportId Generation: Streamlines the process for developers.
8-bit Alignment: Adds padding where necessary to meet alignment requirements.
Collection Termination: Automatically closes collections to prevent errors.
Report Item Size Inference: Derives sizes from logical ranges or vice versa.
Overspanning Prevention: Ensures no item exceeds 4 bytes, inserting padding as needed.
Conditional Invalidations Check: Validates report flags based on usage types.
Inline Usage Transformation: Converts usages to their correct format during compilation.
Usage Range Validation: Ensures all usages fall within valid ranges.
Audience & Benefit:
Ideal for device firmware engineers and hardware developers, Waratah accelerates product development by reducing the complexity of HID descriptor creation. It minimizes errors, optimizes code efficiency, and integrates seamlessly into existing workflows. With Waratah, developers can focus on innovation while ensuring their devices meet HID specifications.
Waratah can be installed via winget, making it easy to incorporate into your development environment.
README
Project
This repo is the central location of Microsoft HID Tools. Currently, the only tool available is Waratah.
Install from Nuget
The underlying HidSpecification and HidEngine libraries are available via Nuget:
Waratah is a HID descriptor composition tool. It offers a high-level of abstraction, eliminates common errors (by design), and optimizes the descriptor to reduce byte size. It implements the HID 1.11 specification so developers don't have to.
It is expected to be used by device firmware authors during device bring-up.
Waratah uses a TOML-like hierarchical language of sections and keys to represent a HID Report Descriptor (Note: There is currently no support for HID Physical Descriptors). This can then be compiled to to either a simple plain-text format, or a C++ header file suitable for ingestion into device firmware.
> Waratah is NOT a direct dt.exe replacement. dt.exe permits the use of specialized items (e.g. Push/Pop) and non-optimal practices (e.g. ReportSize larger than LogicalMinimum/Maximum). There are also known bugs in dt.exe, that have not been replicated in Waratah. It is reasonable to think of Waratah as high-level compiler like C and dt.exe as an assembler. No further development of dt.exe is planned.
Features:
Human-readable text for easy composition and meaningful source-control management.
This project welcomes contributions and suggestions. Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
provided by the bot. You will only need to do this once across all repos using our CLA.
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft
trademarks or logos is subject to and must follow
Microsoft's Trademark & Brand Guidelines.
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
Any use of third-party trademarks or logos are subject to those third-party's policies.