Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
OLEDSeps525f.h
00001 /* mbed Library - OLEDSeps525f 00002 * Copyright (c) 2010, sblandford 00003 * Based on MobileLCD library 00004 * Copyright (c) 2007/8, sford 00005 * released under MIT license http://mbed.org/licence/mit 00006 */ 00007 00008 #ifndef MBED_OLEDSEPS525F_H 00009 #define MBED_OLEDSEPS525F_H 00010 00011 #include "mbed.h" 00012 00013 namespace mbed { 00014 00015 /* Class: OLEDSeps525f 00016 * An abstraction of an 160x128 OLED driven by the SEPS525F 00017 * such as the Densitron DD-160128FC-1A 00018 * 00019 * Example: 00020 * > // Print messages when the AnalogIn is greater than 50% 00021 * > 00022 * > #include "mbed.h" 00023 * > #include "OLEDSeps525f.h" 00024 * > 00025 * > OLEDSeps525f lcd(p5,p6,p7,p8,p9,p10); 00026 * > 00027 * > int main() { 00028 * > lcd.printf("Hello World!"); 00029 * > } 00030 */ 00031 00032 class OLEDSeps525f : public Stream { 00033 00034 public: 00035 /* Constructor: OLEDSeps525f 00036 * Create and object for the Seps525f OLED, using SPI and three DigitalOuts 00037 * 00038 * Variables: 00039 * mosi - SPI data out 00040 * miso - SPI data in, not used 00041 * clk - SPI clock 00042 * cs - Chip Select 00043 * rst - reset 00044 * rs - command/data select 00045 */ 00046 00047 OLEDSeps525f(PinName mosi, PinName miso, PinName clk, PinName cs, PinName rst, PinName rs); 00048 00049 virtual void reset(); 00050 virtual void _window(int x, int y, int width, int height); 00051 virtual void _putp(int colour); 00052 00053 void command(int value); 00054 void data(int value); 00055 void rgbdot(int r, int g, int b); 00056 void pixel(int value); 00057 /* Functions foreground and background 00058 * v - A three-byte RGB code to set the foreground 00059 * or background colour 00060 */ 00061 void foreground(int v); 00062 void background(int v); 00063 /* Funtion: orientation 00064 * set the display orientation in 00065 * 90 degree steps. 00066 * o - An integer from 0-3 setting the orientation 00067 */ 00068 void orientation(int o); 00069 /* Function: tablength 00070 * Set the tab length 00071 * l - An integer representing the number of columns 00072 */ 00073 void tablength(int l); 00074 /* Function: locate 00075 * Set the text cursor to location x,y 00076 * 00077 * Variables: 00078 * x - An integer setting the column position 00079 * y - An integer setting the row position 00080 */ 00081 void locate(int column, int row); 00082 /* Function: newline 00083 * Set the text cursor to the start of the next line 00084 */ 00085 void newline(); 00086 virtual int _putc(int c); 00087 virtual int _getc() { return 0; } 00088 SPI _spi; 00089 DigitalOut _rst; 00090 DigitalOut _cs; 00091 DigitalOut _rs; 00092 void bitblit(int x, int y, int width, int height, const char* bitstream); 00093 void fill(int x, int y, int width, int height, int colour); 00094 void blit(int x, int y, int width, int height, const int* colour); 00095 /* Function: cls 00096 * Clear the screen 00097 */ 00098 void cls(); 00099 /* Functions returning the current max width, max height, max columns, max rows, orientation 00100 * and tablength as an integer 00101 */ 00102 int width(); 00103 int height(); 00104 int columns(); 00105 int rows(); 00106 int orientation(); 00107 int tablength(); 00108 /* Functions returning the current foreground or background colour as a three-byte RGB code */ 00109 int foreground(); 00110 int background(); 00111 void putp(int v); 00112 void window(int x, int y, int width, int height); 00113 void pixel(int x, int y, int colour); 00114 enum {_physical_width=160}; 00115 enum {_physical_height=128}; 00116 int _row, _column, _rows, _columns, _tablength, _foreground, _background, _width, _height, _rotation, _writing_pixels; 00117 }; 00118 00119 } 00120 00121 #endif
Generated on Fri Jul 15 2022 13:46:49 by
1.7.2