I'm looking at building a display for my RepRap Wilson using an Adafruit OLED display. These tiny displays are very readable due to their high contrast. They use an SSD1306 controller that is supported by the U8GLIB used in Repetier Firmware. It looks like the following changes will add this support:
UI.cpp ~ line 617
#if UI_DISPLAY_TYPE == DISPLAY_U8G
//u8glib support two different controllors, wired the same way.
#ifdef U8GLIB_ST7920 || defined(U8GLIB_SSD1306)
#define UI_SPI_SCK UI_DISPLAY_D4_PIN
#define UI_SPI_MOSI UI_DISPLAY_ENABLE_PIN
#define UI_SPI_CS UI_DISPLAY_RS_PIN
#endif
#include "u8glib_ex.h"
UI.cpp ~ line 709
void initializeLCD()
{
#ifdef U8GLIB_ST7920
//U8GLIB_ST7920_128X64_1X u8g(UI_DISPLAY_D4_PIN, UI_DISPLAY_ENABLE_PIN, UI_DISPLAY_RS_PIN);
u8g_InitSPI(&u8g,&u8g_dev_st7920_128x64_sw_spi, UI_DISPLAY_D4_PIN, UI_DISPLAY_ENABLE_PIN, UI_DISPLAY_RS_PIN, U8G_PIN_NONE, U8G_PIN_NONE);
#endif
#ifdef U8GLIB_SSD1306
u8g_InitSPI(&u8g,&u8g_dev_ssd1306_128x64_sw_spi, UI_DISPLAY_D4_PIN, UI_DISPLAY_ENABLE_PIN, UI_DISPLAY_RS_PIN, U8G_PIN_NONE, U8G_PIN_NONE);
#endif
Somewhere instead of defining U8GLIB_ST7920, the new item U8GLIB_SSD1306 must be defined instead.
I think this will be all that is necessary to use the OLED controller. It will be wired up the same way as the ST7920 one is.
I'd like to look into using the HW spi support of the library, but I don't know if the LCD and the SD card can share the SPI interface. Two different CS lines are used, so if the existing SD driver behaves correctly (Releasing the CS when not in use) and the LCD library does the same it SHOULD work.
UI.cpp ~ line 617
#if UI_DISPLAY_TYPE == DISPLAY_U8G
//u8glib support two different controllors, wired the same way.
#ifdef U8GLIB_ST7920 || defined(U8GLIB_SSD1306)
#define UI_SPI_SCK UI_DISPLAY_D4_PIN
#define UI_SPI_MOSI UI_DISPLAY_ENABLE_PIN
#define UI_SPI_CS UI_DISPLAY_RS_PIN
#endif
#include "u8glib_ex.h"
UI.cpp ~ line 709
void initializeLCD()
{
#ifdef U8GLIB_ST7920
//U8GLIB_ST7920_128X64_1X u8g(UI_DISPLAY_D4_PIN, UI_DISPLAY_ENABLE_PIN, UI_DISPLAY_RS_PIN);
u8g_InitSPI(&u8g,&u8g_dev_st7920_128x64_sw_spi, UI_DISPLAY_D4_PIN, UI_DISPLAY_ENABLE_PIN, UI_DISPLAY_RS_PIN, U8G_PIN_NONE, U8G_PIN_NONE);
#endif
#ifdef U8GLIB_SSD1306
u8g_InitSPI(&u8g,&u8g_dev_ssd1306_128x64_sw_spi, UI_DISPLAY_D4_PIN, UI_DISPLAY_ENABLE_PIN, UI_DISPLAY_RS_PIN, U8G_PIN_NONE, U8G_PIN_NONE);
#endif
Somewhere instead of defining U8GLIB_ST7920, the new item U8GLIB_SSD1306 must be defined instead.
I think this will be all that is necessary to use the OLED controller. It will be wired up the same way as the ST7920 one is.
I'd like to look into using the HW spi support of the library, but I don't know if the LCD and the SD card can share the SPI interface. Two different CS lines are used, so if the existing SD driver behaves correctly (Releasing the CS when not in use) and the LCD library does the same it SHOULD work.