diff -r 5b1e0b384d31 -r 86f099bda525 lib/unigraphic/SSD1322.h --- a/lib/unigraphic/SSD1322.h Sun Aug 30 22:53:15 2020 +0200 +++ b/lib/unigraphic/SSD1322.h Thu Oct 15 01:11:03 2020 +0200 @@ -30,22 +30,22 @@ class SSD1322: public GraphicsDisplay { -public: +public: - + /** Create a monochrome SSD1322 SPI interface - * @param name The name used by the parent class to access the interface - */ - SSD1322(int Hz, PinName mosi, PinName miso, PinName sclk, PinName CS, PinName reset, PinName DC, - const char* name); - + * @param name The name used by the parent class to access the interface + */ + SSD1322(int Hz, PinName mosi, PinName miso, PinName sclk, PinName CS, PinName reset, PinName DC, + const char* name); + /** Destructor - * will free framebuffer - */ + * will free framebuffer + */ virtual ~SSD1322() {}; - + - + /////// functions that come for free, but can be overwritten/////////////////////////////////////////////////// /////// ----------------------------------------------------/////////////////////////////////////////////////// @@ -66,7 +66,7 @@ * @param h is the window height in pixels. */ virtual void window(int x, int y, int w, int h); - + /** Read pixel color at location * @param x is the horizontal offset to this pixel. * @param y is the vertical offset to this pixel. @@ -79,24 +79,24 @@ * @param color is the pixel color. */ virtual void window_pushpixel(unsigned short color); - + /** Push some pixels of the same color into the window and increment position. * You must first call window() then push pixels. * @param color is the pixel color. * @param count: how many */ virtual void window_pushpixel(unsigned short color, unsigned int count); - + /** Push array of pixel colors into the window and increment position. * You must first call window() then push pixels. * @param color is the pixel color. */ virtual void window_pushpixelbuf(unsigned short* color, unsigned int lenght); - + /** Framebuffer is used, it needs to be sent to SSD1322 from time to time */ virtual void copy_to_lcd(); - + /** set the contrast of the screen * * @param o contrast 0-63 @@ -120,9 +120,9 @@ * We override it to speedup */ virtual void cls(); - + /** Set the orientation of the screen - * x,y: 0,0 is always top left + * x,y: 0,0 is always top left * * @param o direction to use the screen (0-3) * 0 = -90° @@ -130,14 +130,14 @@ * 2 = +90° * 3 = +180° * - */ + */ void set_orientation(int o); - + /** Set ChipSelect high or low - * @param enable 0/1 + * @param enable 0/1 */ virtual void bus_enable(bool enable); - + /** get display X size in pixels (native, orientation independent) * @returns X size in pixels */ @@ -147,8 +147,8 @@ * @returns Y size in pixels */ int sizeY() {return screensize_Y;}; - -//////////////////////////////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////////////////////////// // not implemented yet ////////////////////////////////////////////////////////////////// // virtual unsigned short pixelread(int x, int y){return 0;}; @@ -163,47 +163,47 @@ void clrbuff(const unsigned char value=0x00); unsigned long buffaddr(unsigned int i); void fills(const unsigned char value=0xFF); - + void set_row_address(unsigned char start_row=0x00, unsigned char end_row=0x3F); void set_column_address(unsigned char start_col=0x00, unsigned char end_col=0x3F); virtual void copy_to_lcd(unsigned char from_col, unsigned char to_col, - unsigned char from_row, unsigned char to_row); - + unsigned char from_row, unsigned char to_row); + protected: /** Setup some stuff (malloc the buffer, etc) */ void init(); /** set mirror mode - * @note may be overridden by specific display init class in case of not standard cmds or inverted wiring - * @param mode NONE, X, Y, XY + * @note may be overridden by specific display init class in case of not standard cmds or inverted wiring + * @param mode NONE, X, Y, XY */ virtual void mirrorXY(mirror_t mode); ////// functions needed by parent class /////////////////////////////////////// ////// -------------------------------- /////////////////////////////////////// - /** Send 8bit command to display controller + /** Send 8bit command to display controller * - * @param cmd: byte to send + * @param cmd: byte to send * @note if protocol is SPI16, it will insert NOP cmd before, so if cmd is a 2byte cmd, the second cmd will be broken. Use wr_cmd16 for 2bytes cmds - */ + */ void wr_cmd8(unsigned char cmd); - - /** Send 8bit data to display controller + + /** Send 8bit data to display controller * - * @param data: byte to send + * @param data: byte to send * - */ + */ void wr_data8(unsigned char data); - - /** HW reset sequence (without display init commands) + + /** HW reset sequence (without display init commands) */ void hw_reset(); - + int contrast; - + protected: mbed::SPI _spi; @@ -212,7 +212,7 @@ DigitalOut _DC; volatile DISPLAY_BUFFER_TYPE _pixelBuffer[DISPLAY_BUFFER_ELEMENTS]; // one full frame buffer DISPLAY_BUFFER_TYPE _trBuffer[DISPLAY_BUFFER_ELEMENTS]; // for sending - + const int screensize_X; const int screensize_Y; const int _PAGES; @@ -235,7 +235,7 @@ #ifdef DEVICE_SPI_ASYNCH event_callback_t _spiEventCb; #endif - + }; #endif