1
0
mirror of synced 2024-11-23 21:40:58 +01:00
bananatools/board/sg-led.h

33 lines
614 B
C
Raw Permalink Normal View History

2023-09-18 10:00:09 +02:00
#pragma once
#include <windows.h>
#include <stdint.h>
#include "hook/iobuf.h"
struct sg_led_ops {
HRESULT (*reset)(void *ctx);
void (*set_color)(void *ctx, uint8_t r, uint8_t g, uint8_t b);
};
struct sg_led {
const struct sg_led_ops *ops;
void *ops_ctx;
uint8_t addr;
2024-10-06 20:37:20 +02:00
unsigned int gen;
2023-09-18 10:00:09 +02:00
};
void sg_led_init(
struct sg_led *led,
uint8_t addr,
const struct sg_led_ops *ops,
2024-10-06 20:37:20 +02:00
unsigned int gen,
2023-09-18 10:00:09 +02:00
void *ctx);
void sg_led_transact(
struct sg_led *led,
struct iobuf *res_frame,
const void *req_bytes,
size_t req_nbytes);