RGB LED cube 5x5x5  1.0
Martin Stejskal, Schmidt Dominik
 All Files Functions Variables Macros Groups Pages
Functions
framebuffer.c File Reference

Framebuffer for RGB LED cube 5x5x5. More...

#include "framebuffer.h"

Go to the source code of this file.

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...
 

Detailed Description

Framebuffer for RGB LED cube 5x5x5.

Author
Martin Stejskal

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.c.

Function Documentation

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"

Parameters
p_fb_dataPointer 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 |
+—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+
Todo:
Timer instead loop

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.

void load_DATA_BLUE_on_bus ( uint8_t  i_data_b)
inline

Load bits stored in i_data_b to bus with blue LEDs.

LSB is represent lowest blue diode in column

Parameters
i_data_bBinary data for blue color

Definition at line 359 of file framebuffer.c.

void load_DATA_GREEN_on_bus ( uint8_t  i_data_g)
inline

Load bits stored in i_data_g to bus with green LEDs.

LSB is represent lowest green diode in column

Parameters
i_data_gBinary data for green color

Definition at line 302 of file framebuffer.c.

void load_DATA_RED_on_bus ( uint8_t  i_data_r)
inline

Load bits stored in i_data_r to bus with red LEDs.

LSB is represent lowest red diode in column

Parameters
i_data_rBinary data for red color

Definition at line 245 of file framebuffer.c.

void set_active_column ( uint8_t  i_column_number)
inline

According parameter set active "column".

If input parameter is out of HW limit, then none "column" is activated

Parameters
i_column_numberColumn number 0~5

Definition at line 193 of file framebuffer.c.

void set_active_wall ( uint8_t  i_wall_number)
inline

According parameter set active "wall".

If input parameter is out of HW limit, then none "wall" is activated

Parameters
i_wall_numberWall number - 0~5

Definition at line 141 of file framebuffer.c.