#ifndef MATRIX_H #define MATRIX_H #include #include #include #include "defaults.h" #include "snake.h" typedef enum GameMode_e { NORMAL, FANCY, GAME_MODE_LAST, } GameMode; typedef enum PixelType_e { NONE, SNAKE, APPLE, } PixelType; typedef struct Pixel_s { Color color; PixelType type; } Pixel; typedef struct LEDMatrix_s { Pixel pixels[MATRIX_HEIGHT][MATRIX_WIDTH]; } LEDMatrix; typedef struct { int pin; bool state_init; bool state_prev; bool state_curr; } Button; extern GameMode game_mode; extern LEDMatrix* matrix; extern Button* button_1; extern Button* button_2; extern Button* button_3; extern Button* button_4; int random_Int(int max); void matrix_Init(Color color); void matrix_SetPixelColor(int x, int y, Color c); void matrix_ToMdkBuffer(); void matrix_WriteLed(); void matrix_ClearAll(Color color); void matrix_Blink(int count, unsigned long delay_millis); void matrix_Print(); void matrix_Update(); #endif