33 #ifndef _ps5trigger_h_
34 #define _ps5trigger_h_
41 typedef enum _EffectType : uint8_t {
43 ContinuousResitance = 0x01,
44 SectionResitance = 0x02,
50 typedef struct _EffectData {
52 EffectType effectType;
61 uint8_t startPosition;
64 } __attribute__((packed)) Continuous;
68 uint8_t startPosition;
71 } __attribute__((packed)) Section;
75 uint8_t startPosition;
81 } __attribute__((packed)) EffectEx;
82 } __attribute__((packed));
83 } __attribute__((packed)) EffectData;
101 data.effectType = EffectType::NoResitance;
110 data.effectType = EffectType::NoResitance;
122 data.effectType = EffectType::NoResitance;
124 data.effectType = EffectType::ContinuousResitance;
125 data.Continuous.startPosition = start;
126 data.Continuous.force = force;
138 data.effectType = EffectType::SectionResitance;
139 data.Section.startPosition = start;
140 data.Section.endPosition = end;
154 void setTriggerForceEffect(uint8_t start,
bool keep, uint8_t begin_force, uint8_t mid_force, uint8_t end_force, uint8_t frequency) {
155 data.effectType = EffectType::EffectEx;
156 data.EffectEx.startPosition = start;
157 data.EffectEx.keepEffect = keep;
158 data.EffectEx.beginForce = begin_force;
159 data.EffectEx.middleForce = mid_force;
160 data.EffectEx.endForce = end_force;
161 data.EffectEx.frequency = frequency;
void setTriggerForce(uint8_t start, uint8_t force)
void processTrigger(uint8_t *buffer)
Apply the trigger data to a PS5 update buffer.
void setTriggerForceSection(uint8_t start, uint8_t end)
void setTriggerForceEffect(uint8_t start, bool keep, uint8_t begin_force, uint8_t mid_force, uint8_t end_force, uint8_t frequency)