User manual
LPCXpresso Experiment Kit - User’s Guide
Page 124
Copyright 2013 © Embedded Artists AB
Figure 68 illustrates how the display is connected to the LPCXpresso Experiment board via a 14-pos
cable.
Figure 68 – 1.5 inch RGB OLED Connected via Serial Expansion Connector
In the preparation a number of defines (SEC14_PIN*) were defined. Each module that is connected via
the serial expansion connector can setup its own list of pins depending on needs. For the OLED
module it will be:
#define OLED_SSEL_PORT SEC14_PIN6_PORT
#define OLED_SSEL_PIN SEC14_PIN6_PIN
#define OLED_RESET_PORT SEC14_PIN12_PORT
#define OLED_RESET_PIN SEC14_PIN12_PIN
#define OLED_DC_PORT SEC14_PIN11_PORT
#define OLED_DC_PIN SEC14_PIN11_PIN
#define OLED_SD_PORT SEC14_PIN14_PORT
#define OLED_SD_PIN SEC14_PIN14_PIN
The advantage of this approach is that if the LPCXpresso LPC111x board is replaced with a different
one then the pin/port information only has to be changed for the SEC14_* defines – the connected
modules will remain unchanged.
The SSD1315 controller chip is complex and creating a driver from scratch is out-of-scope for this
exercise. Instead a number of ready drivers are give, see list below. These files must be
copied/imported into the project.
draw.c/h – basic graphical drawing primitives
oled.c/h – OLED initialization function
ssd1315.c/h – OLED controller driver
Below a code segment is given that serves as base for the program in this experiment.
static void rainbow(draw_lcd_t *lcd)
{
// White => 0~15
draw_fillRectangle(lcd, 0, 0, 15, 127, 0xffff);
// Yellow => 16~31
...