RGB LED cube 5x5x5
1.0
Martin Stejskal, Schmidt Dominik
|
Framebuffer for RGB LED cube 5x5x5. More...
#include <avr/io.h>
#include <avr/interrupt.h>
#include <inttypes.h>
#include "settings.h"
#include <util/delay.h>
#include "bit_operations.h"
Go to the source code of this file.
Macros | |
#define | framebuffer_wall0_void |
Turn off all LED in WALL0. More... | |
#define | framebuffer_wall1_void |
Turn off all LED in WALL1. More... | |
#define | framebuffer_wall2_void |
Turn off all LED in WALL2. More... | |
#define | framebuffer_wall3_void |
Turn off all LED in WALL3. More... | |
#define | framebuffer_wall4_void |
Turn off all LED in WALL4. More... | |
#define | framebuffer_wall0_ones |
Turn on all LED in WALL0. More... | |
#define | framebuffer_wall1_ones |
Turn on all LED in WALL1. More... | |
#define | framebuffer_wall2_ones |
Turn on all LED in WALL2. More... | |
#define | framebuffer_wall3_ones |
Turn on all LED in WALL3. More... | |
#define | framebuffer_wall4_ones |
Turn on all LED in WALL4. More... | |
#define | framebuffer_copy_wall0_to_wall1 |
Copy data from WALL0 to WALL1. More... | |
#define | framebuffer_copy_wall1_to_wall2 |
Copy data from WALL1 to WALL2. More... | |
#define | framebuffer_copy_wall2_to_wall3 |
Copy data from WALL2 to WALL3. More... | |
#define | framebuffer_copy_wall3_to_wall4 |
Copy data from WALL3 to WALL4. More... | |
Functions | |
void | framebuffer (volatile uint16_t(*p_fb_data)[5][5]) |
Frame buffer use pointer to array with data, witch represents one 3D image. More... | |
void | init_framebuffer (void) |
Set I/O for framebuffer to defaults. More... | |
void | set_active_wall (uint8_t i_wall_number) |
According parameter set active "wall". More... | |
void | set_active_column (uint8_t i_column_number) |
According parameter set active "column". More... | |
void | load_DATA_RED_on_bus (uint8_t i_data_r) |
Load bits stored in i_data_r to bus with red LEDs. More... | |
void | load_DATA_GREEN_on_bus (uint8_t i_data_g) |
Load bits stored in i_data_g to bus with green LEDs. More... | |
void | load_DATA_BLUE_on_bus (uint8_t i_data_b) |
Load bits stored in i_data_b to bus with blue LEDs. More... | |
Framebuffer for RGB LED cube 5x5x5.
Framebuffer display once image on LED cube. As parameter of framebuffer is
pointer to image in SRAM memory. Framebuffer disable global interrupt
however enable it when is needed some delay, so in this "time spaces" MCU
can to other stuff.
Definition in file framebuffer.h.
#define framebuffer_copy_wall0_to_wall1 |
#define framebuffer_copy_wall1_to_wall2 |
#define framebuffer_copy_wall2_to_wall3 |
#define framebuffer_copy_wall3_to_wall4 |
#define framebuffer_wall0_ones |
#define framebuffer_wall0_void |
#define framebuffer_wall1_ones |
#define framebuffer_wall1_void |
#define framebuffer_wall2_ones |
#define framebuffer_wall2_void |
#define framebuffer_wall3_ones |
#define framebuffer_wall3_void |
#define framebuffer_wall4_ones |
#define framebuffer_wall4_void |
void framebuffer | ( | volatile uint16_t(*) | p_fb_data[5][5]) |
Frame buffer use pointer to array with data, witch represents one 3D image.
This function display data pointed to array p_fb_data[][] to LED cube. Whole function must run in infinite loop, else just once image will be showed (for very short time). And because of multiplex, LEDs have to been "refreshed"
p_fb_data | Pointer to frame buffer. First index is for "wall", second is for "column". Size of every "column" is 16 bits. MSB bit (highest LED in "column") is always "first". LSB bit (lowest one) is "last". |MSB| |LSB|MSB| |LSB|MSB| |LSB| +—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+ | X | R | R | R | R | R | G | G | G | G | G | B | B | B | B | B | +—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+ |
Definition at line 18 of file framebuffer.c.
void init_framebuffer | ( | void | ) |
Set I/O for framebuffer to defaults.
Set only pins, that framebuffer controls
Definition at line 73 of file framebuffer.c.
|
inline |
Load bits stored in i_data_b to bus with blue LEDs.
LSB is represent lowest blue diode in column
i_data_b | Binary data for blue color |
Definition at line 359 of file framebuffer.c.
|
inline |
Load bits stored in i_data_g to bus with green LEDs.
LSB is represent lowest green diode in column
i_data_g | Binary data for green color |
Definition at line 302 of file framebuffer.c.
|
inline |
Load bits stored in i_data_r to bus with red LEDs.
LSB is represent lowest red diode in column
i_data_r | Binary data for red color |
Definition at line 245 of file framebuffer.c.
|
inline |
According parameter set active "column".
If input parameter is out of HW limit, then none "column" is activated
i_column_number | Column number 0~5 |
Definition at line 193 of file framebuffer.c.
|
inline |
According parameter set active "wall".
If input parameter is out of HW limit, then none "wall" is activated
i_wall_number | Wall number - 0~5 |
Definition at line 141 of file framebuffer.c.