- Dual-Core Architecture: Dedicated 1000Hz USB gaming pipeline on Core 1 and BLE/Wi-Fi/Web telemetry on Core 0. - Multi-Input BLE Host: Parsers for Xbox Wireless, Google Stadia, 8BitDo (Ultimate/Pro2/SN30), and Generic HOGP gamepads. - Multi-Console USB Emulation: Nintendo Switch, PC DirectInput, PS3, PS4, Xbox 360 (libxsm3 cryptographic challenge-response), Original Xbox, and Couch Mouse/Keyboard. - Onboard Web Portal & Captive Portal: Real-time SVG gamepad visualizer, stick deadzone calibration, button combo remapping, and Wi-Fi manager. - Low-Latency Radio Management: Interactive SoftAP toggle to drop to 0-latency gaming mode. - Dual OTA Firmware Flashing: Browser-based wireless firmware updater and automated Python OTA script. - Strict Build Quality: Clean build under -Wall -Wextra with zero warnings or errors. - Versioning & Licensing: Semantic Versioning v1.0.0 and GNU GPLv3 with Commercial Restrictions.
55 lines
1.8 KiB
C
55 lines
1.8 KiB
C
#pragma once
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
#include "controller_state.h"
|
|
#include "esp_err.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef struct {
|
|
uint8_t left_deadzone; /* Inner deadzone percentage: 0 to 40% (default: 5%) */
|
|
uint8_t right_deadzone; /* Inner deadzone percentage: 0 to 40% (default: 5%) */
|
|
uint8_t trigger_deadzone; /* Trigger minimum deadzone: 0 to 50 (default: 0) */
|
|
bool swap_ab; /* Swap South (A) and East (B) */
|
|
bool swap_xy; /* Swap West (X) and North (Y) */
|
|
bool swap_bumpers_triggers; /* Swap Bumpers (LB/RB) with Triggers (LT/RT) */
|
|
bool invert_lx; /* Invert Left Stick X */
|
|
bool invert_ly; /* Invert Left Stick Y */
|
|
bool invert_rx; /* Invert Right Stick X */
|
|
bool invert_ry; /* Invert Right Stick Y */
|
|
} input_calibration_cfg_t;
|
|
|
|
/**
|
|
* @brief Initialize input calibration module and load settings from NVS.
|
|
*/
|
|
esp_err_t input_calibration_init(void);
|
|
|
|
/**
|
|
* @brief Get the current input calibration configuration.
|
|
*/
|
|
void input_calibration_get_config(input_calibration_cfg_t *cfg);
|
|
|
|
/**
|
|
* @brief Save new input calibration configuration to NVS and apply immediately.
|
|
*/
|
|
esp_err_t input_calibration_set_config(const input_calibration_cfg_t *cfg);
|
|
|
|
/**
|
|
* @brief Reset input calibration configuration to default values.
|
|
*/
|
|
esp_err_t input_calibration_reset_defaults(void);
|
|
|
|
/**
|
|
* @brief Apply deadzones, axis inversions, and button remapping to raw state.
|
|
* @param in_raw Raw input controller state.
|
|
* @param out_calibrated Output calibrated and remapped controller state.
|
|
*/
|
|
void input_calibration_apply(const controller_state_t *in_raw, controller_state_t *out_calibrated);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|