Subversion Repositories Code-Repo

Rev

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

Rev 216 Rev 231
Line 62... Line 62...
62
    READ_CHECKSUM
62
    READ_CHECKSUM
63
} PROCESS_STATE;
63
} PROCESS_STATE;
64
 
64
 
65
typedef struct {
65
typedef struct {
66
    // Variables for base cube
66
    // Variables for base cube
67
    unsigned char GCS[CUBE_LAYER_COUNT][GCS_LAYER_SIZE];
67
    uint8_t GCS[CUBE_LAYER_COUNT][GCS_LAYER_SIZE];
68
    unsigned char GCS_OVERLAY[CUBE_LAYER_COUNT][GCS_LAYER_SIZE];
68
    uint8_t GCS_OVERLAY[CUBE_LAYER_COUNT][GCS_LAYER_SIZE];
69
    unsigned char GCS_WRITE[CUBE_LAYER_COUNT][GCS_LAYER_SIZE];
69
    uint8_t GCS_WRITE[CUBE_LAYER_COUNT][GCS_LAYER_SIZE];
70
    unsigned char current_layer;
70
    uint8_t current_layer;
71
    unsigned char rotation_counter;
71
    uint8_t rotation_counter;
72
 
72
 
73
    // Variables for the scrolling text
73
    // Variables for the scrolling text
74
    unsigned char string[CUBE_STRING_MAX_LENGTH];
74
    uint8_t string[CUBE_STRING_MAX_LENGTH];
75
    unsigned char string_length;
75
    uint8_t string_length;
76
    unsigned char string_index;
76
    uint8_t string_index;
77
    unsigned char string_line;
77
    uint8_t string_line;
78
    int string_R, string_G, string_B;
78
    uint16_t string_R, string_G, string_B;
79
 
79
 
80
    // Variables for input frame data
80
    // Variables for input frame data
81
    PROCESS_STATE frame_state;
81
    PROCESS_STATE frame_state;
82
    unsigned char frame_buffer[CUBE_FRAME_BUFFER_SIZE];
82
    uint8_t frame_buffer[CUBE_FRAME_BUFFER_SIZE];
83
    char frame_checksum;
83
    uint8_t frame_checksum;
84
    int frame_length;
84
    uint32_t frame_length;
85
    int frame_index;
85
    uint32_t frame_index;
86
    int frame_command;
86
    uint32_t frame_command;
87
    int frame_escape;
87
    uint32_t frame_escape;
88
} CUBE_DATA;
88
} CUBE_DATA;
89
 
89
 
90
void Cube_Init(CUBE_DATA *data, char BC);
90
void Cube_Init(CUBE_DATA *data, uint8_t BC);
91
void Cube_Timer_Interrupt(void);
91
void Cube_Timer_Interrupt(void);
92
 
92
 
93
// Callbacks on completion of DCS/GCS writes
93
// Callbacks on completion of DCS/GCS writes
94
void Cube_DCS_Write_Callback(void);
94
void Cube_DCS_Write_Callback(void);
95
void Cube_GCS_Write_Callback(void);
95
void Cube_GCS_Write_Callback(void);
96
 
96
 
97
// Cube control functions
97
// Cube control functions
98
void Cube_Write_DCS(char BC);
98
void Cube_Write_DCS(uint8_t BC);
99
void Cube_Clear(void);
99
void Cube_Clear(void);
100
void Cube_Set_All(int R, int G, int B);
100
void Cube_Set_All(uint16_t R, uint16_t G, uint16_t B);
101
void Cube_Set_Layer(int layer, int R, int G, int B);
101
void Cube_Set_Layer(uint8_t layer, uint16_t R, uint16_t G, uint16_t B);
102
void Cube_Set_Pixel(int layer, int row, int column, int R, int G, int B);
102
void Cube_Set_Pixel(uint8_t layer, uint8_t row, uint8_t column, uint16_t R, uint16_t G, uint16_t B);
103
void Cube_Get_Pixel(int layer, int row, int column, int* R, int* G, int* B);
103
void Cube_Get_Pixel(uint8_t layer, uint8_t row, uint8_t column, uint16_t* R, uint16_t* G, uint16_t* B);
104
void Cube_Move_Pixel(int layer1, int row1, int column1, int layer2, int row2, int column2);
104
void Cube_Move_Pixel(uint8_t layer1, uint8_t row1, uint8_t column1, uint8_t layer2, uint8_t row2, uint8_t column2);
105
void Cube_Rotate_Shell(char shell, char direction);
105
void Cube_Rotate_Shell(uint8_t shell, uint8_t direction);
106
void Cube_Rotate(char direction);
106
void Cube_Rotate(uint8_t direction);
107
 
107
 
108
// Overlay control functions
108
// Overlay control functions
109
void Cube_Overlay_Clear(void);
109
void Cube_Overlay_Clear(void);
110
void Cube_Overlay_Set_Pixel(int layer, int row, int column, int R, int G, int B);
110
void Cube_Overlay_Set_Pixel(uint8_t layer, uint8_t row, uint8_t column, uint16_t R, uint16_t G, uint16_t B);
111
void Cube_Overlay_Get_Pixel(int layer, int row, int column, int* R, int* G, int* B);
111
void Cube_Overlay_Get_Pixel(uint8_t layer, uint8_t row, uint8_t column, uint16_t* R, uint16_t* G, uint16_t* B);
112
void Cube_Overlay_Move_Pixel(int layer1, int row1, int column1, int layer2, int row2, int column2);
112
void Cube_Overlay_Move_Pixel(uint8_t layer1, uint8_t row1, uint8_t column1, uint8_t layer2, uint8_t row2, uint8_t column2);
113
void Cube_Overlay_Rotate_Shell(char shell, char direction);
113
void Cube_Overlay_Rotate_Shell(uint8_t shell, uint8_t direction);
114
 
114
 
115
// Text control functions
115
// Text control functions
116
void Cube_Text_Init(char *string, char length, int R, int G, int B);
116
void Cube_Text_Init(uint8_t *string, uint8_t length, uint16_t R, uint16_t G, uint16_t B);
117
void Cube_Text_Interrupt(void);
117
void Cube_Text_Interrupt(void);
118
 
118
 
119
// Data stream in control functions
119
// Data stream in control functions
120
void Cube_Data_In(char c);
120
void Cube_Data_In(uint8_t c);
121
void Cube_Data_In_Process_Frame(void);
121
void Cube_Data_In_Process_Frame(void);
122
void Cube_Data_Direct_Write_All(char *buffer);
122
void Cube_Data_Direct_Write_All(uint8_t *buffer);
123
 
123
 
124
#endif	/* CUBE_H */
124
#endif	/* CUBE_H */
125
 
125