The codebase to run the *spark d-fuser controller www.sparkav.co.uk/dvimixer
Dependencies: SPK-TVOne DMX DmxArtNet NetServicesMin OSC PinDetect mRotaryEncoder iniparser mbed spk_oled_ssd1305 filter
Diff: spk_oled_ssd1305.h
- Revision:
- 0:87aab40d5806
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spk_oled_ssd1305.h Sat Mar 10 19:26:44 2012 +0000 @@ -0,0 +1,46 @@ +// *spark audio-visual +// OLED display using SSD1305 driver +// Copyright *spark audio-visual 2012 + +// TODO +// sendBufferIfNeeded() -- library caches whether buffer has been updated, and this method sends buffer if so + +#ifndef SPK_OLED_SSD1305_h +#define SPK_OLED_SSD1305_h + +#include "mbed.h" +#include <string> + +#define bufferCount 1056 +#define bufferWidth 132 +#define pixelWidth 128 +#define pixelHeight 64 +#define pixInPage 8 +#define pageCount 8 + +class SPKDisplay +{ + public: + SPKDisplay(PinName mosi, PinName clk, PinName cs, PinName dc, PinName res, Serial *debugSerial = NULL); + + void clearBuffer(); + void clearBufferRow(int row); + void imageToBuffer(); + void horizLineToBuffer(int y); + void textToBuffer(std::string message, int row); + + void sendBuffer(); + + private: + SPI *spi; + DigitalOut *cs; + DigitalOut *dc; + DigitalOut *res; + + Serial *debug; + uint8_t buffer[bufferCount]; + + void setup(); +}; + +#endif