33 lines
694 B
C
33 lines
694 B
C
#pragma once
|
|
|
|
#include "led.h"
|
|
|
|
struct wang_header {
|
|
// First 16-byte chunk
|
|
uint8_t magic[6]; // "wang\0\0"
|
|
uint8_t flash_map;
|
|
uint8_t marquee_map;
|
|
uint8_t speed_and_mode[8];
|
|
|
|
// Second 16-byte chunk
|
|
uint16_t widths[8];
|
|
|
|
// Third 16-byte chunk
|
|
uint8_t padding[6];
|
|
uint8_t time[6];
|
|
uint8_t padding2[4];
|
|
|
|
// Fourth 16-byte chunk, empty
|
|
uint8_t blank[16];
|
|
};
|
|
|
|
// Receive some data in wang format
|
|
void wang_rx(const uint8_t *, int);
|
|
|
|
extern struct wang_header flash_header;
|
|
extern int flash_header_valid;
|
|
void wang_init(void);
|
|
void wang_render(int index, struct row_buf *output);
|
|
|
|
void wang_read(int index, int offset, int width, uint16_t *buf);
|