2018-11-21 02:27:05 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <windows.h>
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#include "hook/iobuf.h"
|
|
|
|
|
|
|
|
struct sg_led_ops {
|
|
|
|
HRESULT (*reset)(void *ctx);
|
2019-02-26 03:55:49 +01:00
|
|
|
void (*set_color)(void *ctx, uint8_t r, uint8_t g, uint8_t b);
|
2018-11-21 02:27:05 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
struct sg_led {
|
|
|
|
const struct sg_led_ops *ops;
|
|
|
|
void *ops_ctx;
|
|
|
|
uint8_t addr;
|
2023-12-03 18:45:42 +01:00
|
|
|
unsigned int gen;
|
2018-11-21 02:27:05 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
void sg_led_init(
|
|
|
|
struct sg_led *led,
|
|
|
|
uint8_t addr,
|
|
|
|
const struct sg_led_ops *ops,
|
2023-12-03 18:45:42 +01:00
|
|
|
unsigned int gen,
|
2018-11-21 02:27:05 +01:00
|
|
|
void *ctx);
|
|
|
|
|
|
|
|
void sg_led_transact(
|
|
|
|
struct sg_led *led,
|
2019-10-27 00:25:04 +02:00
|
|
|
struct iobuf *res_frame,
|
2018-11-21 02:27:05 +01:00
|
|
|
const void *req_bytes,
|
|
|
|
size_t req_nbytes);
|