Subversion Repositories Code-Repo

Rev

Rev 205 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 205 Rev 206
Line 7... Line 7...
7
#define CUBE_ROTATIONS 7
7
#define CUBE_ROTATIONS 7
8
 
8
 
9
#define GCS_REG_SIZE 36
9
#define GCS_REG_SIZE 36
10
#define GCS_LAYER_SIZE (GCS_REG_SIZE*CUBE_ROW_COUNT)
10
#define GCS_LAYER_SIZE (GCS_REG_SIZE*CUBE_ROW_COUNT)
11
 
11
 
-
 
12
#define CUBE_STRING_MAX_LENGTH 32
-
 
13
 
12
#define RED    0x0FF,0x000,0x000
14
#define RED    0x0FF,0x000,0x000
13
#define ORANGE 0x0FF,0x020,0x000
15
#define ORANGE 0x0FF,0x020,0x000
14
#define YELLOW 0x0FF,0x0FF,0x000
16
#define YELLOW 0x0FF,0x0FF,0x000
15
#define GREEN  0x000,0x0FF,0x000
17
#define GREEN  0x000,0x0FF,0x000
16
#define TEAL   0x000,0x0FF,0x0FF
18
#define TEAL   0x000,0x0FF,0x0FF
Line 33... Line 35...
33
#define GSLAT PORTDbits.RD9
35
#define GSLAT PORTDbits.RD9
34
#define XBLNK PORTDbits.RD2
36
#define XBLNK PORTDbits.RD2
35
 
37
 
36
typedef struct {
38
typedef struct {
37
    unsigned char GCS[CUBE_LAYER_COUNT][GCS_LAYER_SIZE];
39
    unsigned char GCS[CUBE_LAYER_COUNT][GCS_LAYER_SIZE];
-
 
40
    unsigned char GCS_OVERLAY[CUBE_LAYER_COUNT][GCS_LAYER_SIZE];
-
 
41
    unsigned char GCS_WRITE[CUBE_LAYER_COUNT][GCS_LAYER_SIZE];
38
    unsigned char current_layer;
42
    unsigned char current_layer;
39
    unsigned char rotation_counter;
43
    unsigned char rotation_counter;
-
 
44
 
-
 
45
    unsigned char string[CUBE_STRING_MAX_LENGTH];
-
 
46
    unsigned char string_length;
-
 
47
    unsigned char string_index;
-
 
48
    unsigned char string_line;
-
 
49
    int string_R, string_G, string_B;
40
} CUBE_DATA;
50
} CUBE_DATA;
41
 
51
 
42
void Cube_Init(CUBE_DATA *data, char BC);
52
void Cube_Init(CUBE_DATA *data, char BC);
43
void Cube_Timer_Interrupt(void);
53
void Cube_Timer_Interrupt(void);
44
 
54
 
Line 51... Line 61...
51
void Cube_Clear(void);
61
void Cube_Clear(void);
52
void Cube_Set_All(int R, int G, int B);
62
void Cube_Set_All(int R, int G, int B);
53
void Cube_Set_Layer(int layer, int R, int G, int B);
63
void Cube_Set_Layer(int layer, int R, int G, int B);
54
void Cube_Set_Pixel(int layer, int row, int column, int R, int G, int B);
64
void Cube_Set_Pixel(int layer, int row, int column, int R, int G, int B);
55
void Cube_Get_Pixel(int layer, int row, int column, int* R, int* G, int* B);
65
void Cube_Get_Pixel(int layer, int row, int column, int* R, int* G, int* B);
56
 
-
 
57
void Cube_Move_Pixel(int layer1, int row1, int column1, int layer2, int row2, int column2);
66
void Cube_Move_Pixel(int layer1, int row1, int column1, int layer2, int row2, int column2);
-
 
67
void Cube_Rotate_Shell(char shell, char direction);
-
 
68
void Cube_Rotate(char direction);
-
 
69
 
-
 
70
void Cube_Overlay_Clear(void);
-
 
71
void Cube_Overlay_Set_Pixel(int layer, int row, int column, int R, int G, int B);
-
 
72
void Cube_Overlay_Get_Pixel(int layer, int row, int column, int* R, int* G, int* B);
-
 
73
void Cube_Overlay_Move_Pixel(int layer1, int row1, int column1, int layer2, int row2, int column2);
-
 
74
void Cube_Overlay_Rotate_Shell(char shell, char direction);
58
 
75
 
59
void Cube_Rotate_Shell(char shell);
76
void Cube_Text_Init(char *string, char length, int R, int G, int B);
60
void Cube_Rotate(void);
77
void Cube_Text_Interrupt(void);
61
 
78
 
62
#endif	/* CUBE_H */
79
#endif	/* CUBE_H */
63
 
80