mirror of
https://gitea.tendokyu.moe/Dniel97/segatools.git
synced 2025-01-19 06:27:23 +01:00
22 lines
804 B
C
22 lines
804 B
C
#pragma once
|
|
|
|
#include <windows.h>
|
|
#include <stdint.h>
|
|
|
|
#define LED_PACKET_FRAMING 0xE0
|
|
#define LED_PACKET_ESCAPE 0xD0
|
|
#define LED_NUM_MAX 66
|
|
#define LED_BOARDS_TOTAL 3
|
|
#define LED_OUTPUT_HEADER_SIZE 2
|
|
#define LED_OUTPUT_DATA_SIZE_MAX LED_NUM_MAX * 3 * 2 // max if every byte's escaped
|
|
#define LED_OUTPUT_TOTAL_SIZE_MAX LED_OUTPUT_HEADER_SIZE + LED_OUTPUT_DATA_SIZE_MAX
|
|
|
|
// This struct is used to send data related to the slider and billboard LEDs
|
|
struct _chuni_led_data_buf_t {
|
|
uint8_t framing; // Sync byte
|
|
uint8_t board; // LED output the data is for (0-1: billboard, 2: slider)
|
|
uint8_t data[LED_OUTPUT_DATA_SIZE_MAX]; // Buffer for LEDs
|
|
uint8_t data_len; // How many bytes to output from the buffer
|
|
};
|
|
|
|
static uint8_t chuni_led_board_data_lens[LED_BOARDS_TOTAL] = {53*3, 63*3, 31*3}; |