report45.h 805 B

123456789101112131415
  1. // report45.h -- encode g_in into the controller's HID input report 0x45.
  2. //
  3. // The exact inverse of the field offsets in triton.h (s16off/u16off/trigU8/btnsOf/imuFrom45). The
  4. // puck's rf_link.cpp decodes this same byte layout, so the round-trip Deck -> g_in -> 0x45 -> puck ->
  5. // Steam is symmetric. Output is REPORT45_LEN bytes: [0x45][seq][buttons u32][...sticks/pads/IMU].
  6. #pragma once
  7. #include <stdint.h>
  8. // 46 bytes: id + 45 payload bytes (matches the puck descriptor's report-0x45 count 0x2D and the
  9. // IMU tail at rep[34..46] that rf_link decodes when tlen >= 46).
  10. #define REPORT45_LEN 46
  11. // Build a fresh report 0x45 from g_in into out[REPORT45_LEN]. seq is the rolling frame counter
  12. // (rep[1]); the puck treats a changed seq as a fresh report.
  13. void buildReport45(uint8_t *out, uint8_t seq);