14#define FFB_ID_OFFSET 0x00
18#define HID_USAGE_X 0x30
19#define HID_USAGE_Y 0x31
20#define HID_USAGE_Z 0x32
21#define HID_USAGE_RX 0x33
22#define HID_USAGE_RY 0x34
23#define HID_USAGE_RZ 0x35
24#define HID_USAGE_SL0 0x36
25#define HID_USAGE_SL1 0x37
26#define HID_USAGE_WHL 0x38
27#define HID_USAGE_POV 0x39
30#define HID_USAGE_CONST 0x26
31#define HID_USAGE_RAMP 0x27
32#define HID_USAGE_SQUR 0x30
33#define HID_USAGE_SINE 0x31
34#define HID_USAGE_TRNG 0x32
35#define HID_USAGE_STUP 0x33
36#define HID_USAGE_STDN 0x34
37#define HID_USAGE_SPRNG 0x40
38#define HID_USAGE_DMPR 0x41
39#define HID_USAGE_INRT 0x42
40#define HID_USAGE_FRIC 0x43
44#define HID_ID_STATE 0x02
46#define HID_ID_EFFREP 0x01
47#define HID_ID_ENVREP 0x02
48#define HID_ID_CONDREP 0x03
49#define HID_ID_PRIDREP 0x04
50#define HID_ID_CONSTREP 0x05
51#define HID_ID_RAMPREP 0x06
52#define HID_ID_CSTMREP 0x07
53#define HID_ID_SMPLREP 0x08
54#define HID_ID_EFOPREP 0x0A
55#define HID_ID_BLKFRREP 0x0B
56#define HID_ID_CTRLREP 0x0C
57#define HID_ID_GAINREP 0x0D
58#define HID_ID_SETCREP 0x0E
60#define HID_ID_NEWEFREP 0x11
61#define HID_ID_BLKLDREP 0x12
62#define HID_ID_POOLREP 0x13
65#define HID_ID_CUSTOMCMD 0xAF
66#define HID_ID_HIDCMD 0xA1
67#define HID_ID_STRCMD 0xAC
72#define FFB_EFFECT_NONE 0x00
73#define FFB_EFFECT_CONSTANT 0x01
74#define FFB_EFFECT_RAMP 0x02
75#define FFB_EFFECT_SQUARE 0x03
76#define FFB_EFFECT_SINE 0x04
77#define FFB_EFFECT_TRIANGLE 0x05
78#define FFB_EFFECT_SAWTOOTHUP 0x06
79#define FFB_EFFECT_SAWTOOTHDOWN 0x07
80#define FFB_EFFECT_SPRING 0x08
81#define FFB_EFFECT_DAMPER 0x09
82#define FFB_EFFECT_INERTIA 0x0A
83#define FFB_EFFECT_FRICTION 0x0B
84#define FFB_EFFECT_CUSTOM 0x0C
86#define HID_ACTUATOR_POWER 0x08
87#define HID_SAFETY_SWITCH 0x04
88#define HID_ENABLE_ACTUATORS 0x02
89#define HID_EFFECT_PAUSE 0x01
90#define HID_ENABLE_ACTUATORS_MASK 0xFD
91#define HID_EFFECT_PLAYING 0x10
93#define HID_DIRECTION_ENABLE 0x04
94#define FFB_EFFECT_DURATION_INFINITE 0xffff
104 uint64_t buttons = 0;
142 report->Slider = val;
151 const uint8_t
reportId = HID_ID_STATE+FFB_ID_OFFSET;
153 uint8_t
status = (HID_ACTUATOR_POWER) | (HID_ENABLE_ACTUATORS);
184 uint8_t effectBlockIndex;
206 uint8_t effectBlockIndex;
223 uint8_t effectBlockIndex;
233 uint8_t effectBlockIndex;
243 uint8_t effectBlockIndex;
265 uint8_t effectBlockIndex;
274 uint8_t
type = FFB_EFFECT_NONE;
289 std::unique_ptr<Biquad>
filter[MAX_AXIS] = {
nullptr };
303 uint8_t effectBlockIndex;
void setHidReportAxis(reportHID_t *report, uint8_t idx, int16_t val)
struct __attribute__((__packed__)) reportHID_t
int16_t positiveCoefficient
uint8_t parameterBlockOffset
uint16_t negativeSaturation
uint16_t ramPoolAvailable
uint8_t maxSimultaneousEffects
uint16_t triggerRepeatInterval
int16_t negativeCoefficient
uint16_t positiveSaturation
uint16_t negativeSaturation
int16_t negativeCoefficient
int16_t positiveCoefficient
uint16_t positiveSaturation
std::unique_ptr< Biquad > filter[MAX_AXIS]
float axisMagnitudes[MAX_AXIS]
FFB_Effect_Condition conditions[MAX_AXIS]