Merge remote-tracking branch 'origin/master'
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
26
src/draw.c
Normal file
26
src/draw.c
Normal file
@@ -0,0 +1,26 @@
|
||||
#include<stdint.h>
|
||||
#include"ssd1963.h"
|
||||
#include"ssd1963_lld.h"
|
||||
#include"ssd1963_cmd.h"
|
||||
#include"lcd_conf.h"
|
||||
#include"draw.h"
|
||||
|
||||
#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++){
|
||||
SSD1963_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