77 } __attribute__((packed));
79 } __attribute__((packed));
88 } __attribute__((packed));
101 } __attribute__((packed));
103 } __attribute__((packed));
130 uint8_t rightTriggerFeedback;
131 uint8_t leftTriggerFeedback;
132 uint8_t reserved4[10];
137 } __attribute__((packed));
146 } __attribute__((packed));
194 uint16_t
getX(uint8_t finger = 0) {
203 uint16_t
getY(uint8_t finger = 0) {
232 return (atan2f(-ps5Data.
accY, -ps5Data.
accZ) + PI) * RAD_TO_DEG;
234 return (atan2f(ps5Data.
accX, -ps5Data.
accZ) + PI) * RAD_TO_DEG;
245 return ps5Data.
gyroX;
247 return ps5Data.
gyroY;
249 return ps5Data.
gyroZ;
266 uint8_t getBatteryLevel() {
267 return ps5Data.status.battery;
276 bool getUsbStatus() {
277 return ps5Data.status.usb;
284 bool getAudioStatus() {
285 return ps5Data.status.headphone;
292 bool getMicStatus() {
293 return ps5Data.status.mic;
314 setRumbleOn(0x00, 0xFF);
316 setRumbleOn(0xFF, 0x00);
325 ps5Output.bigRumble = bigRumble;
326 ps5Output.smallRumble = smallRumble;
327 ps5Output.reportChanged =
true;
339 void setLed(uint8_t r, uint8_t g, uint8_t b) {
343 ps5Output.reportChanged =
true;
351 setLed((uint8_t)(color >> 16), (uint8_t)(color >> 8), (uint8_t)(color));
364 ps5Output.playerLeds = mask;
365 ps5Output.reportChanged =
true;
378 ps5Output.microphoneLed = on ? 1 : 0;
379 ps5Output.reportChanged =
true;
384 return message_counter;
393 void Parse(uint8_t len, uint8_t *buf);
406 static int8_t getButtonIndexPS5(
ButtonEnum b);
413 uint16_t message_counter = 0;
const uint8_t PS5_BUTTONS[]
Based on Ludwig Füchsl's DualSense Windows driver https://github.com/Ohjurot/DualSense-Windows.
void setLed(uint8_t r, uint8_t g, uint8_t b)
uint16_t getY(uint8_t finger=0)
bool getButtonPress(ButtonEnum b)
bool getButtonClick(ButtonEnum b)
int16_t getSensor(SensorEnum s)
uint8_t getAnalogHat(AnalogHatEnum a)
void setPlayerLed(uint8_t mask)
uint16_t getMessageCounter()
void setLed(ColorsEnum color)
void setRumbleOn(RumbleEnum mode)
float getAngle(AngleEnum a)
bool isTouching(uint8_t finger=0)
virtual void sendOutputReport(PS5Output *output)=0
uint8_t getTouchCounter(uint8_t finger=0)
uint8_t getAnalogButton(ButtonEnum b)
void setRumbleOn(uint8_t bigRumble, uint8_t smallRumble)
uint16_t getX(uint8_t finger=0)
struct ps5TouchpadXY::@31 finger[2]