18 #ifndef _switch_pro_parser_h_
19 #define _switch_pro_parser_h_
93 } __attribute__((packed));
95 } __attribute__((packed));
100 } __attribute__((packed));
106 } __attribute__((packed));
123 } __attribute__((packed));
138 } __attribute__((packed));
186 return (atan2f(-switchProData.
imu[0].
accY, -switchProData.
imu[0].
accZ) + PI) * RAD_TO_DEG;
188 return (atan2f(switchProData.
imu[0].
accX, -switchProData.
imu[0].
accZ) + PI) * RAD_TO_DEG;
205 return switchProData.
imu[0].
accX;
207 return switchProData.
imu[0].
accY;
209 return switchProData.
imu[0].
accZ;
323 return message_counter;
349 void Parse(uint8_t len, uint8_t *buf);
374 static int8_t getButtonIndexSwitchPro(
ButtonEnum b);
376 void sendOutputCmd();
377 void sendRumbleOutputReport();
381 uint16_t message_counter = 0;
382 uint8_t output_sequence_counter : 4;
383 uint32_t rumble_on_timer = 0;
const uint8_t SWITCH_PRO_BUTTONS[]
const uint8_t SWITCH_PRO_LEDS[]
virtual void sendOutputReport(uint8_t *data, uint8_t len)=0
int16_t getAnalogHat(AnalogHatEnum a)
uint8_t getBatteryLevel()
bool getButtonClick(ButtonEnum b)
void setRumble(bool leftRumbleOn, bool rightRumbleOn)
float getAngle(AngleEnum a)
bool getButtonPress(ButtonEnum b)
void setLedOff(LEDEnum a)
void enableImu(bool enable)
int16_t getSensor(SensorEnum s)
void setLedRaw(uint8_t mask)
virtual void disableTimeout()
void setLedToggle(LEDEnum a)
void setRumbleRight(bool on)
uint16_t getMessageCounter()
virtual void sendHandshake()
void Parse(uint8_t len, uint8_t *buf)
SwitchProOutput switchProOutput
void setRumbleLeft(bool on)
bool enableFullReportMode
bool ledHomeReportChanged
#define pgm_read_byte(addr)