Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
27 lines
819 B
C
27 lines
819 B
C
/*
|
|
* Minimal Switch Pro controller emulation glue derived from the GP2040-CE
|
|
* SwitchProDriver. The driver keeps the same descriptors/handshake while
|
|
* exposing a simple API for feeding inputs.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
#include "switch_protocol.h"
|
|
|
|
// Initialize USB state and calibration before entering the main loop.
|
|
void switch_pro_init();
|
|
|
|
// Update the desired controller state for the next USB report.
|
|
void switch_pro_set_input(const SwitchInputState& state);
|
|
|
|
// Drive the Switch Pro USB state machine; call this frequently in the main loop.
|
|
void switch_pro_task();
|
|
|
|
// Driver state helpers
|
|
bool switch_pro_is_ready();
|
|
|
|
// Optional callback fired when the host sends a rumble payload (the raw 8 rumble bytes).
|
|
void switch_pro_set_rumble_callback(SwitchRumbleCallback cb);
|