switch-pico/switch_pro_driver.h
Joey Yakimowich-Payne 05e04b2632 Wire protocol modes
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-08-11 12:23:07 +09:00

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);