Added 16-bit welcome screen bitmap functionality.
This commit is contained in:
7161
src/bitmap.c
Normal file
7161
src/bitmap.c
Normal file
File diff suppressed because it is too large
Load Diff
22
src/draw.c
Normal file
22
src/draw.c
Normal 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
17
src/draw.h
Normal 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 */
|
||||||
Reference in New Issue
Block a user