N5110 library
Fork of N5110 by
Diff: N5110.h
- Revision:
- 25:444e55e2e419
- Parent:
- 24:342bdb6679a1
- Child:
- 26:36be85c20ef4
--- a/N5110.h Tue Feb 07 10:21:43 2017 +0000 +++ b/N5110.h Tue Feb 07 11:22:45 2017 +0000 @@ -1,7 +1,42 @@ /** -@file N5110.h +*@file N5110.h +*/ + +#ifndef N5110_H +#define N5110_H + +#include "mbed.h" -@brief Header file containing member functions and variables +// Command Bytes - taken from Chris Yan's library +// More information can be found in the display datasheet +// H = 0 - Basic instructions +#define CMD_DC_CLEAR_DISPLAY 0x08 +#define CMD_DC_NORMAL_MODE 0x0C +#define CMD_DC_FILL_DISPLAY 0x09 +#define CMD_DC_INVERT_VIDEO 0x0D +#define CMD_FS_HORIZONTAL_MODE 0x00 +#define CMD_FS_VERTICAL_MODE 0x02 +#define CMD_FS_BASIC_MODE 0x00 +#define CMD_FS_EXTENDED_MODE 0x01 +#define CMD_FS_ACTIVE_MODE 0x00 +#define CMD_FS_POWER_DOWN_MODE 0x04 +// H = 1 - Extended instructions +#define CMD_TC_TEMP_0 0x04 +#define CMD_TC_TEMP_1 0x05 +#define CMD_TC_TEMP_2 0x06 +#define CMD_TC_TEMP_3 0x07 +#define CMD_BI_MUX_24 0x15 +#define CMD_BI_MUX_48 0x13 +#define CMD_BI_MUX_100 0x10 +#define CMD_VOP_6V06 0xB2 +#define CMD_VOP_7V38 0xC8 + +// number of pixels on display +#define WIDTH 84 +#define HEIGHT 48 +#define BANKS 6 + +/** N5110 Class @brief Library for interfacing with Nokia 5110 LCD display (https://www.sparkfun.com/products/10168) using the hardware SPI on the mbed. @brief The display is powered from a GPIO pin meaning it can be controlled via software. The LED backlight is also software-controllable (via PWM pin). @brief Can print characters and strings to the display using the included 5x7 font. @@ -139,43 +174,7 @@ } @endcode - */ - -#ifndef N5110_H -#define N5110_H - -// Command Bytes - taken from Chris Yan's library -// More information can be found in the display datasheet -// H = 0 - Basic instructions -#define CMD_DC_CLEAR_DISPLAY 0x08 -#define CMD_DC_NORMAL_MODE 0x0C -#define CMD_DC_FILL_DISPLAY 0x09 -#define CMD_DC_INVERT_VIDEO 0x0D -#define CMD_FS_HORIZONTAL_MODE 0x00 -#define CMD_FS_VERTICAL_MODE 0x02 -#define CMD_FS_BASIC_MODE 0x00 -#define CMD_FS_EXTENDED_MODE 0x01 -#define CMD_FS_ACTIVE_MODE 0x00 -#define CMD_FS_POWER_DOWN_MODE 0x04 -// H = 1 - Extended instructions -#define CMD_TC_TEMP_0 0x04 -#define CMD_TC_TEMP_1 0x05 -#define CMD_TC_TEMP_2 0x06 -#define CMD_TC_TEMP_3 0x07 -#define CMD_BI_MUX_24 0x15 -#define CMD_BI_MUX_48 0x13 -#define CMD_BI_MUX_100 0x10 -#define CMD_VOP_6V06 0xB2 -#define CMD_VOP_7V38 0xC8 - -// number of pixels on display -#define WIDTH 84 -#define HEIGHT 48 -#define BANKS 6 - -#include "mbed.h" - class N5110 {