2019-08-31 00:49:11 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <windows.h>
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2024-05-12 22:02:53 +02:00
|
|
|
#define IO4_REPORT_OUT_PAYLOAD_LEN 62
|
|
|
|
|
2019-08-31 00:49:11 +02:00
|
|
|
enum {
|
|
|
|
/* System buttons in button[0] */
|
|
|
|
|
|
|
|
IO4_BUTTON_TEST = 1 << 9,
|
|
|
|
IO4_BUTTON_SERVICE = 1 << 6,
|
|
|
|
};
|
|
|
|
|
2020-10-07 19:26:12 +02:00
|
|
|
struct io4_config {
|
|
|
|
bool enable;
|
|
|
|
};
|
|
|
|
|
2019-08-31 00:49:11 +02:00
|
|
|
struct io4_state {
|
|
|
|
uint16_t adcs[8];
|
|
|
|
uint16_t spinners[4];
|
|
|
|
uint16_t chutes[2];
|
|
|
|
uint16_t buttons[2];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct io4_ops {
|
|
|
|
HRESULT (*poll)(void *ctx, struct io4_state *state);
|
2024-05-12 22:02:53 +02:00
|
|
|
HRESULT (*write_gpio)(uint8_t* payload, size_t len);
|
2019-08-31 00:49:11 +02:00
|
|
|
};
|
|
|
|
|
2020-10-07 19:26:12 +02:00
|
|
|
HRESULT io4_hook_init(
|
|
|
|
const struct io4_config *cfg,
|
|
|
|
const struct io4_ops *ops,
|
|
|
|
void *ctx);
|