Test for STM32F4
Fork of RGB_OLED_SSD1331 by
Diff: include/SSD1331.h
- Revision:
- 3:af00512c9694
- Parent:
- 2:e033aab5daad
- Child:
- 4:1707ca53e7d5
--- a/include/SSD1331.h Thu Nov 12 22:31:58 2015 +0000 +++ b/include/SSD1331.h Thu Nov 12 23:23:33 2015 +0000 @@ -2,6 +2,7 @@ * SSD1331.h * A library for RGB OLED module * +* Copyright (c) 2015 Juergen Messerer * Copyright (c) 2014 seeed technology inc. * Copyright (c) 2012, Adafruit Industries. * @@ -182,39 +183,38 @@ }; -class SSD1331 : public mbed::Stream, public virtual SGL { -public: - SSD1331(PinName cs, PinName rst, PinName dc, PinName mosi, PinName miso, PinName sclk); - void init(void); - virtual void drawPixel(uint16_t x, uint16_t y, uint16_t color); - virtual void drawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_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 setScolling(ScollingDirection direction, uint8_t rowAddr, uint8_t rowNum, uint8_t timeInterval); - void enableScolling(bool enable); - void setDisplayMode(DisplayMode mode); - void setDisplayPower(DisplayPower power); - void Draw_Dot(uint8_t x, uint8_t y,unsigned int Color); - - void RegWriteM(unsigned char *Command, int count); -protected: - // Stream implementation functions - virtual int _putc( int c ); - virtual int _getc(); - -private: - void sendCmd(unsigned char cmd); - void sendCmd(unsigned char cmd, unsigned char arg1); - void sendCmd(unsigned char cmd, unsigned char arg1, unsigned char arg2); - void sendCmd(unsigned char *cmd, int count); - void sendData(uint16_t data); - -private: - mbed::DigitalOut _cs; - mbed::DigitalOut _dc; - mbed::SPI _spiPort; +class SSD1331 : public mbed::Stream, public virtual SGL +{ + 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(uint16_t x0, uint16_t y0, uint16_t x1, uint16_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 setScolling(ScollingDirection direction, uint8_t rowAddr, uint8_t rowNum, uint8_t timeInterval); + void enableScolling(bool enable); + void setDisplayMode(DisplayMode mode); + void setDisplayPower(DisplayPower power); + + protected: + // Stream implementation functions + virtual int _putc( int c ); + virtual int _getc(); + + private: + void sendCmd(uint8_t cmd); + void sendCmd(uint8_t cmd, uint8_t arg1); + void sendCmd(uint8_t cmd, uint8_t arg1, uint8_t arg2); + void sendCmd(uint8_t *cmd, uint8_t count); + void sendData(uint16_t data); + + private: + mbed::DigitalOut _cs; + mbed::DigitalOut _dc; + mbed::SPI _spiPort; }; #endif \ No newline at end of file