34 namespace target = hwlib::target;
55 matrix(
int width,
int height,
bool double_buffer, target::pin_out _lat,
56 target::pin_out _oe, target::pin_out _clk,
57 target::pin_out _selA, target::pin_out _selB,
58 target::pin_out _selC, target::pin_out _selD,
59 target::pin_out _b1, target::pin_out _g1,
60 target::pin_out _r1, target::pin_out _b2,
61 target::pin_out _g2, target::pin_out _r2);
69 void drawPixel(
int x,
int y, uint8_t rc, uint8_t gc, uint8_t bc)
override;
77 void drawPixel(
int x,
int y, uint32_t color);
81 void fillScreen(uint8_t r, uint8_t g, uint8_t b)
override;
89 void clear()
override;
94 void start()
override;
118 bool is_using_default_pins(){
129 uint8_t front_buffer[ROW*COL] = {};
131 uint8_t back_buffer[ROW*COL] = {};
133 uint8_t * current_buffer;
135 uint8_t * next_buffer;
138 volatile int current_row, current_bit;
144 volatile bool double_buffer, swap_flag, swap_copy;
147 volatile int t_delay;
150 hwlib::target::pin_out _lat;
152 hwlib::target::pin_out _oe;
154 hwlib::target::pin_out _clk;
157 hwlib::target::pin_out _selA;
159 hwlib::target::pin_out _selB;
161 hwlib::target::pin_out _selC;
163 hwlib::target::pin_out _selD;
166 hwlib::target::pin_out _b1;
168 hwlib::target::pin_out _g1;
170 hwlib::target::pin_out _r1;
172 hwlib::target::pin_out _b2;
174 hwlib::target::pin_out _g2;
176 hwlib::target::pin_out _r2;
void start() override
Start the auto update of the screen.
Definition: matrix.cpp:205
Led matrix implementation for the abstract class Screen.
Definition: matrix.hpp:40
The interface for led matrix and eventual other led screens.
Definition: Screen.hpp:28
void swap_buffer(bool copy) override
Swap the front buffer with the back buffer.
Definition: matrix.cpp:216
void drawPixel(int x, int y, uint8_t rc, uint8_t gc, uint8_t bc) override
Draw a given pixel with a color R G B.
Definition: matrix.cpp:133
void fillScreen(uint8_t r, uint8_t g, uint8_t b) override
Fill the entire screen with r g b colors.
Definition: matrix.cpp:189
void update() override
Update the screen.
Definition: matrix.cpp:301
void stop() override
Stop the auto update of the screen.
Definition: matrix.cpp:211
int width
width and height of the screen.
Definition: Screen.hpp:77
matrix(int width, int height, bool double_buffer)
Matrix constructor with default wiring.
Definition: matrix.cpp:8
void clear() override
Clear the entire screen.
Definition: matrix.cpp:128