Library for the OLED display, as used on the mbed LPCXpresso Baseboard
Dependents: EAOLED_HelloWorld EA_BigBen NetClock_aitendoOLED_from_EA_and_nucho
EAOLED.h@0:8fe8b0fe5134, 2010-06-06 (annotated)
- Committer:
- simon
- Date:
- Sun Jun 06 19:33:24 2010 +0000
- Revision:
- 0:8fe8b0fe5134
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
simon | 0:8fe8b0fe5134 | 1 | /* mbed Embedded Artists OLED library, as found on the LPCXpresso Baseboard |
simon | 0:8fe8b0fe5134 | 2 | * Copyright (c) 2010, sford |
simon | 0:8fe8b0fe5134 | 3 | * |
simon | 0:8fe8b0fe5134 | 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
simon | 0:8fe8b0fe5134 | 5 | * of this software and associated documentation files (the "Software"), to deal |
simon | 0:8fe8b0fe5134 | 6 | * in the Software without restriction, including without limitation the rights |
simon | 0:8fe8b0fe5134 | 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
simon | 0:8fe8b0fe5134 | 8 | * copies of the Software, and to permit persons to whom the Software is |
simon | 0:8fe8b0fe5134 | 9 | * furnished to do so, subject to the following conditions: |
simon | 0:8fe8b0fe5134 | 10 | * |
simon | 0:8fe8b0fe5134 | 11 | * The above copyright notice and this permission notice shall be included in |
simon | 0:8fe8b0fe5134 | 12 | * all copies or substantial portions of the Software. |
simon | 0:8fe8b0fe5134 | 13 | * |
simon | 0:8fe8b0fe5134 | 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
simon | 0:8fe8b0fe5134 | 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
simon | 0:8fe8b0fe5134 | 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
simon | 0:8fe8b0fe5134 | 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
simon | 0:8fe8b0fe5134 | 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
simon | 0:8fe8b0fe5134 | 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
simon | 0:8fe8b0fe5134 | 20 | * THE SOFTWARE. |
simon | 0:8fe8b0fe5134 | 21 | */ |
simon | 0:8fe8b0fe5134 | 22 | |
simon | 0:8fe8b0fe5134 | 23 | #ifndef MBED_EAOLED_H |
simon | 0:8fe8b0fe5134 | 24 | #define MBED_EAOLED_H |
simon | 0:8fe8b0fe5134 | 25 | |
simon | 0:8fe8b0fe5134 | 26 | #include "mbed.h" |
simon | 0:8fe8b0fe5134 | 27 | #include "GraphicsDisplay.h" |
simon | 0:8fe8b0fe5134 | 28 | |
simon | 0:8fe8b0fe5134 | 29 | class EAOLED : public GraphicsDisplay { |
simon | 0:8fe8b0fe5134 | 30 | public: |
simon | 0:8fe8b0fe5134 | 31 | EAOLED(PinName mosi, PinName dnc, PinName sclk, PinName cs, PinName power); |
simon | 0:8fe8b0fe5134 | 32 | virtual void pixel(int x, int y, int colour); |
simon | 0:8fe8b0fe5134 | 33 | // virtual void cls(); |
simon | 0:8fe8b0fe5134 | 34 | virtual int width() { return 96; } |
simon | 0:8fe8b0fe5134 | 35 | virtual int height() { return 64; } |
simon | 0:8fe8b0fe5134 | 36 | |
simon | 0:8fe8b0fe5134 | 37 | void reset(); |
simon | 0:8fe8b0fe5134 | 38 | void data(int value); |
simon | 0:8fe8b0fe5134 | 39 | void command(int value); |
simon | 0:8fe8b0fe5134 | 40 | |
simon | 0:8fe8b0fe5134 | 41 | SPI _spi; |
simon | 0:8fe8b0fe5134 | 42 | DigitalOut _data; |
simon | 0:8fe8b0fe5134 | 43 | DigitalOut _cs; |
simon | 0:8fe8b0fe5134 | 44 | DigitalOut _power; |
simon | 0:8fe8b0fe5134 | 45 | |
simon | 0:8fe8b0fe5134 | 46 | uint8_t framebuffer[(96 * 64) / 8]; |
simon | 0:8fe8b0fe5134 | 47 | }; |
simon | 0:8fe8b0fe5134 | 48 | |
simon | 0:8fe8b0fe5134 | 49 | #endif |