Test for STM32F4
Fork of RGB_OLED_SSD1331 by
Diff: include/SSD1331.h
- Revision:
- 5:9de43186f5ea
- Parent:
- 4:1707ca53e7d5
- Child:
- 6:06c211302c93
--- a/include/SSD1331.h Thu Nov 12 23:53:58 2015 +0000 +++ b/include/SSD1331.h Fri Nov 13 23:29:59 2015 +0000 @@ -60,21 +60,17 @@ #ifndef _SSD1331_H_ #define _SSD1331_H_ + #include "DigitalOut.h" #include "PinNames.h" #include "SGL.h" #include "Stream.h" -namespace mbed -{ - class DigitalOut; - class SPI; -} - -#define __USE_GAC__ // use SSD1331/1332 Graphi Accelaration Command #define RGB_OLED_WIDTH 96 #define RGB_OLED_HEIGHT 64 +#define RGB_OLED_XMAX RGB_OLED_WIDTH-1 +#define RGB_OLED_YMAX RGB_OLED_HEIGHT-1 #define CMD_DRAW_LINE 0x21 #define CMD_DRAW_RECTANGLE 0x22 @@ -187,13 +183,13 @@ { public: SSD1331(PinName cs, PinName rst, PinName dc, PinName mosi, PinName miso, PinName sclk); - void init(void); + virtual void drawPixel(uint8_t x, uint8_t y, uint16_t color); virtual void drawLine(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint16_t color); - void drawFrame(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t outColor, uint16_t fillColor); - void copyWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1,uint16_t x2, uint16_t y2); - void dimWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1); - void clearWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1); + void drawFrame(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint16_t outColor, uint16_t fillColor); + void copyArea(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2); + void dimArea(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1); + void clearArea(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1); void setScolling(ScollingDirection direction, uint8_t rowAddr, uint8_t rowNum, uint8_t timeInterval); void enableScolling(bool enable); void setDisplayMode(DisplayMode mode); @@ -205,6 +201,7 @@ virtual int _getc(); private: + void init(void); void sendCmd(uint8_t cmd); void sendCmd(uint8_t cmd, uint8_t arg1); void sendCmd(uint8_t cmd, uint8_t arg1, uint8_t arg2);