RGB LED cube 5x5x5
1.0
Martin Stejskal, Schmidt Dominik
|
Complex settings AVR for project. More...
Go to the source code of this file.
Macros | |
#define | F_CPU 16000000UL |
MCU speed. More... | |
#define | column_delay 500 |
Time space (in us) between "two columns". More... | |
#define | animation_delay_timer 156 |
Value for animation timer to get approximately 10ms delay. More... | |
#define | pwm_support enabled |
Enable/Disable PWM support. More... | |
#define | enabled 1 |
#define | disabled 0 |
#define | anim_run 7 |
#define | anim_change 6 |
#define | anim_random 5 |
#define | anim_cnt1 3 |
#define | anim_cnt0 2 |
#define | anim_SRAM_valid 1 |
#define | anim_read_FLASH 0 |
#define | anim_random_max_address_flash 2700 |
Maximum read address when reading from memory. | |
#define | version debug |
Define witch version will be compiled. More... | |
#define | debug 0 |
#define | release 1 |
#define | D_R0_PORT G |
#define | D_R0_pin 4 |
#define | D_R1_PORT G |
#define | D_R1_pin 3 |
#define | D_R2_PORT B |
#define | D_R2_pin 7 |
#define | D_R3_PORT B |
#define | D_R3_pin 6 |
#define | D_R4_PORT B |
#define | D_R4_pin 5 |
#define | D_G0_PORT B |
#define | D_G0_pin 4 |
#define | D_G1_PORT B |
#define | D_G1_pin 3 |
#define | D_G2_PORT B |
#define | D_G2_pin 2 |
#define | D_G3_PORT B |
#define | D_G3_pin 1 |
#define | D_G4_PORT B |
#define | D_G4_pin 0 |
#define | D_B0_PORT E |
#define | D_B0_pin 7 |
#define | D_B1_PORT E |
#define | D_B1_pin 6 |
#define | D_B2_PORT A |
#define | D_B2_pin 5 |
#define | D_B3_PORT A |
#define | D_B3_pin 4 |
#define | D_B4_PORT A |
#define | D_B4_pin 3 |
#define | WALL0_PORT A |
#define | WALL0_pin 6 |
#define | WALL1_PORT A |
#define | WALL1_pin 7 |
#define | WALL2_PORT C |
#define | WALL2_pin 7 |
#define | WALL3_PORT C |
#define | WALL3_pin 5 |
#define | WALL4_PORT C |
#define | WALL4_pin 3 |
#define | COLUMN0_PORT D |
#define | COLUMN0_pin 5 |
#define | COLUMN1_PORT D |
#define | COLUMN1_pin 7 |
#define | COLUMN2_PORT G |
#define | COLUMN2_pin 0 |
#define | COLUMN3_PORT G |
#define | COLUMN3_pin 1 |
#define | COLUMN4_PORT C |
#define | COLUMN4_pin 1 |
#define | PWM_R_PORT E |
#define | PWM_R_pin 3 |
#define | PWM_G_PORT E |
#define | PWM_G_pin 4 |
#define | PWM_B_PORT E |
#define | PWM_B_pin 5 |
#define | KBRD_RD0_PORT F |
#define | KBRD_RD0_pin 5 |
#define | KBRD_RD1_PORT F |
#define | KBRD_RD1_pin 4 |
#define | KBRD_RD2_PORT F |
#define | KBRD_RD2_pin 3 |
#define | KBRD_RD3_PORT F |
#define | KBRD_RD3_pin 2 |
#define | KBRD_RD4_PORT F |
#define | KBRD_RD4_pin 1 |
#define | KBRD_RD5_PORT F |
#define | KBRD_RD5_pin 0 |
#define | KBRD_PWR0_PORT A |
#define | KBRD_PWR0_pin 2 |
#define | KBRD_PWR1_PORT A |
#define | KBRD_PWR1_pin 1 |
#define | KBRD_PWR2_PORT A |
#define | KBRD_PWR2_pin 0 |
#define | KBRD_PWR3_PORT F |
#define | KBRD_PWR3_pin 7 |
#define | KBRD_PWR4_PORT F |
#define | KBRD_PWR4_pin 6 |
#define | RX_PC_PORT D |
#define | RX_PC_pin 3 |
#define | TX_PC_PORT D |
#define | TX_PC_pin 2 |
Complex settings AVR for project.
In this file is defined speed of CPU, names for pins and PORTs and so on
Definition in file settings.h.
#define animation_delay_timer 156 |
Value for animation timer to get approximately 10ms delay.
Delay is calculated for prescaller in function init_animation_counter.
For 16 MHz crystal and prescaller 1024 is this value 156.
16 MHz -> 62.5 ns -> 62.5 ns * 1024 -> 64 us /1 timer cycle ->
-> 10 ms / 64us = 156.25 -> 156
Definition at line 39 of file settings.h.
#define column_delay 500 |
Time space (in us) between "two columns".
--— time --—>
< COLUMN0 active > < time delay > < COLUMN1 active > < time delay > < COLUMN2 active > ....
Definition at line 29 of file settings.h.
#define F_CPU 16000000UL |
#define pwm_support enabled |
Enable/Disable PWM support.
If project will be ported on different AVR, there can be problem that
three PWM channel will not be on same counter. If PWM is disabled, then
outputs PWM_R*, PWM_G* and PWM_B* will be set to 1. Anyway it is good idea
to change PCB (when is changed AVR), so it is easier connect "R_GND",
"G_GND" and "B_GND" direct to GND. Then any code with PWM can be removed. Options: enabled, disabled
Definition at line 51 of file settings.h.
#define version debug |
Define witch version will be compiled.
Now it is easy to switch from debug to release code and vice versa :) Debug code can not affect release version.
Options: debug, release
Definition at line 63 of file settings.h.