diff --git a/switch_legacy_protocol.cpp b/switch_legacy_protocol.cpp new file mode 100644 index 0000000..9f21073 --- /dev/null +++ b/switch_legacy_protocol.cpp @@ -0,0 +1,23 @@ +#include "switch_protocol.h" + +#include "switch_pro_driver.h" + +void switch_protocol_init() { + switch_pro_init(); +} + +void switch_protocol_set_input(const SwitchInputState& state) { + switch_pro_set_input(state); +} + +void switch_protocol_task() { + switch_pro_task(); +} + +bool switch_protocol_is_ready() { + return switch_pro_is_ready(); +} + +void switch_protocol_set_rumble_callback(SwitchRumbleCallback callback) { + switch_pro_set_rumble_callback(callback); +} diff --git a/switch_protocol.h b/switch_protocol.h new file mode 100644 index 0000000..28b4c8a --- /dev/null +++ b/switch_protocol.h @@ -0,0 +1,13 @@ +#pragma once + +#include + +#include "switch_input.h" + +using SwitchRumbleCallback = void (*)(const uint8_t rumble_data[8]); + +void switch_protocol_init(); +void switch_protocol_set_input(const SwitchInputState& state); +void switch_protocol_task(); +bool switch_protocol_is_ready(); +void switch_protocol_set_rumble_callback(SwitchRumbleCallback callback);