SSD1331 Oled driver library for 96x64 colour Oled display. Demo included in .h file
Dependents: Oled-SSD1331 PJ12_device
Diff: ssd1331.h
- Revision:
- 3:a4caac512e13
- Parent:
- 2:1204274fad8f
- Child:
- 4:062b4708eb35
diff -r 1204274fad8f -r a4caac512e13 ssd1331.h
--- a/ssd1331.h Fri May 06 21:40:50 2016 +0000
+++ b/ssd1331.h Thu May 12 21:36:11 2016 +0000
@@ -87,8 +87,8 @@
oled.circle (20, 60, 40 ,oled.toRGB(255,0,0) , 0); //circle
oled.line( 0, 0, width, height, oled.toRGB(0,255,255)); //line
oled.line( width, 0, 0, height, oled.toRGB(255,0,255)); //line
- oled.rectangle(10,10,90,60,oled.toRGB(255,255,0)); //rectangle
- oled.fillrectangle(20,20,40,40,oled.toRGB(255,255,255),oled.toRGB(0,255,0)); //fillrectangle
+ oled.rect(10,10,90,60,oled.toRGB(255,255,0)); //rectangle
+ oled.fillrect(20,20,40,40,oled.toRGB(255,255,255),oled.toRGB(0,255,0)); //fillrectangle
for(int y = 9; y >= 0; y--) {
oled.contrast(y); // set contrast level
@@ -158,8 +158,8 @@
// constructor
ssd1331(PinName cs_pin, PinName rst_pin, PinName a0_pin, PinName mosi_pin, PinName miso_pin, PinName sclk_pin);
- void pixel(int x,int y,unsigned int color);
- void rect(int x1,int y1,int x2,int y2,unsigned int colorline);
+ void pixel(int16_t x,int16_t y,unsigned int color);
+ void rect(int16_t x1,int16_t y1,int16_t x2,int16_t y2,unsigned int colorline);
void fillrect(int x1,int y1,int x2,int y2,unsigned int colorline,unsigned int colorfill);
void line( int x1,int y1,int x2,int y2,unsigned int color);
void circle (int radius, int x, int y,unsigned int color,int fill);
@@ -172,21 +172,21 @@
void cls(); // clear screen to black
void dim(); // flip dim/normal
void contrast(char value); //0~9 low~high
- void locate(int column, int row); // text start position
- int toRGB(int R,int G,int B); // get color from RGB values 00~FF(0~255)
+ void locate(int16_t column, int16_t row); // text start position
+ int toRGB(int16_t R,int16_t G,int16_t B); // get color from RGB values 00~FF(0~255)
int row();
int column();
void ScrollSet(int horizontal, int startline, int linecount, int vertical , int frame_interval);
void Scrollstart();
void Scrollstop();
void Copy(int src_x1,int src_y1,int src_x2,int src_y2, int dst_x,int dst_y);
- void character(int x, int y, int c);
- void set_font(unsigned char* f);
- void Bitmap(const uint8_t *bitmap, int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);
- void Bitmap16(unsigned int x, unsigned int y, unsigned int w, unsigned int h,unsigned char *bitmap);
- int Bitmap16SD( unsigned int x, unsigned int y, unsigned char *Name_BMP); // 12.288k
-
-
+ void character(int x, int y, int c); // Print single character, x & y pixel co-ords.
+ void set_font(unsigned char* f); // set external font. Use oled.set_font(NULL) to restore default font
+ void Bitmap(const uint8_t *bitmap, int16_t x, int16_t y, int16_t w, int16_t h, unsigned char color); // load mono bitmap from flash
+ void Bitmap16(int16_t x, int16_t y, int16_t w, int16_t h,unsigned char *bitmap); // load bitmap from flash
+ int Bitmap16SD( int16_t x, int16_t y, unsigned char *Name_BMP); // uses up to 12.288k RAM, Fast
+ int Bitmap16SD2(int16_t x, int16_t y, unsigned char *Name_BMP); // uses 96b RAM, slower
+
protected:
// Stream implementation functions
virtual int _putc(int c);
@@ -204,7 +204,7 @@
unsigned char* font;
unsigned int Char_Color; // text color
unsigned int BGround_Color; // background color
- void window(int x, int y, int w, int h);
+ void window(int16_t x, int16_t y, int16_t w, int16_t h);
void Maxwindow(); // reset display window to full size
// pixel location
short _x;
Display Module .95" 96x64 Oled with SPI interface