pitrix/include/prototypes.h

108 lines
1.8 KiB
C
Raw Normal View History

#pragma once
#include <Arduino.h>
extern uint8_t baseHue;
extern char hostname[30];
typedef struct {
uint8_t width;
uint8_t height;
const uint8_t *data;
bool (*isCharAllowed)(const char);
uint16_t (*getCharPosition)(const char);
} Font;
typedef struct Vector {
2019-06-07 04:24:16 +00:00
double x1;
double x2;
} Vector;
typedef struct Matrix {
2019-06-07 04:24:16 +00:00
double a11;
double a12;
double a21;
double a22;
} Matrix;
2019-05-31 03:45:07 +00:00
typedef struct {
uint16_t x;
uint16_t y;
} Coords;
enum SettingType {
TYPE_UINT8,
TYPE_UINT16,
TYPE_BOOL
};
typedef struct {
const char* name;
uint16_t* value;
SettingType type;
} Setting;
struct /* settings */{
uint16_t fps = 50;
struct /* effects */ {
struct /* cycle */ {
uint16_t time = 300;
uint16_t random = 1;
} cycle ;
struct /* matrix */ {
uint16_t length_min = 4;
uint16_t length_max = 20;
uint16_t speed_min = 1;
uint16_t speed_max = 10;
} matrix;
struct /* confetti */ {
uint16_t pixels_per_loop = 2;
} confetti;
struct /* dvd */ {
uint16_t width = 3;
uint16_t height = 2;
} dvd;
struct /* dynamic */ {
uint16_t single_loop_time = 40;
uint16_t multi_loop_time = 1400;
uint16_t big_loop_time = 50;
uint16_t big_size = 3;
} dynamic;
struct /* fire */ {
uint16_t cooldown = 192;
uint16_t spark_chance = 5;
} fire;
struct /* firework */ {
uint16_t drag = 255;
uint16_t bounce = 200;
uint16_t gravity = 10;
uint16_t sparks = 12;
} firework;
struct /* gol */ {
uint16_t start_percentage = 90;
uint16_t blend_speed = 10;
uint16_t restart_after_steps = 100;
} gol;
struct /* sines */ {
uint16_t count = 5;
} sines;
struct /* snake */ {
uint16_t direction_change = 5;
uint16_t slowdown = 2;
} snake;
} effects;
} settings;
extern Setting all_settings[];
extern const uint8_t all_settings_size;