57 const int8_t index = getButtonIndexPS4(b);
if (index < 0)
return 0;
65 const int8_t index = getButtonIndexPS4(b);
if (index < 0)
return 0;
73 const int8_t index = getButtonIndexPS4(b);
if (index < 0)
return 0;
97 else if (
buf[0] == 0x11) {
100 Notify(
PSTR(
"\r\nReport is too short: "), 0x80);
108 Notify(
PSTR(
"\r\nUnknown report id: "), 0x80);
114 if (ps4Data.
btn.
val != oldButtonState.
val) {
115 buttonClickState.
val = ps4Data.
btn.
val & ~oldButtonState.val;
122 if (checkDpad(
RIGHT))
144 oldButtonState.
val = 0;
147 for (
i = 0;
i <
sizeof(ps4Data.
xy)/
sizeof(ps4Data.
xy[0]);
i++) {
154 buttonClickState.
dpad = 0;
158 ps4Output.
r = ps4Output.
g = ps4Output.
b = 0;
const uint8_t PS4_BUTTONS[]
void Parse(uint8_t len, uint8_t *buf)
uint8_t getAnalogButton(ButtonEnum b)
virtual void sendOutputReport(PS4Output *output)=0
bool getButtonClick(ButtonEnum b)
uint8_t getAnalogHat(AnalogHatEnum a)
bool getButtonPress(ButtonEnum b)
constexpr int8_t ButtonIndex(ButtonEnum key)
struct touchpadXY::@28 finger[2]
#define pgm_read_byte(addr)