Added 16-bit welcome screen bitmap functionality.

This commit is contained in:
id101010
2016-01-29 15:23:52 +01:00
parent 913eba8f6f
commit 87a9235bc9
3 changed files with 7200 additions and 0 deletions

7161
src/bitmap.c Normal file

File diff suppressed because it is too large Load Diff

22
src/draw.c Normal file
View File

@@ -0,0 +1,22 @@
#include<stdlib.c>
#include<stdint.c>
#define BYTES_PER_PIXEL 2
uint16_t bitmap_draw( unsigned int width, unsigned int height,
unsigned int bytes_per_pixel,
unsigned char *pixel_data){
if(bytes_per_pixel != BYTES_PER_PIXEL){
return -1
}
SSD1963_SetArea(0, 0, width - 1, height - 1);
SSD1963_WriteCommand(CMD_WR_MEMSTART);
for(int i = 0; i < width * height; i++){
SSD193_WriteData(((uint16_t*)pixel_data)[i]);
}
return 0;
}

17
src/draw.h Normal file
View File

@@ -0,0 +1,17 @@
#ifndef DRAW_H
#define DRAW_H
/**
* @brief Draw bitmap
*
* @param width Bitmap width
* @param height Bitmap height
* @param bytes_per_pixel Bytes per pixel
* @param color 16-Bit color bitmap
* @param *pixel_data uint16_t Bitmap data array
* @return -1 if error 0 else
*
*/
uint16_t bitmap_draw( unsigned int width, unsigned int height, unsigned int bytes_per_pixel, unsigned char *pixel_data);
#endif /* DRAW_H */