Project 6
Monochrome Liquid-Crystal Display
|
Neff Site |
Header file for the Nokia 5110 LCD. More...
Go to the source code of this file.
Macros | |
#define | NOKIA5110_PORT PORTF |
#define | NOKIA5110_LED_bp PIN1_bp |
#define | NOKIA5110_SCLK_bp SPI_SCK_bp |
#define | NOKIA5110_DN_bp SPI_MOSI_bp |
#define | NOKIA5110_DC_bp PIN2_bp |
#define | NOKIA5110_RST_bp PIN3_bp |
#define | NOKIA5110_SCE_bp SPI_SS_bp |
#define | NOKIA5110_LED_bm PIN1_bm |
#define | NOKIA5110_SCLK_bm SPI_SCK_bm |
#define | NOKIA5110_DN_bm SPI_MOSI_bm |
#define | NOKIA5110_DC_bm PIN2_bm |
#define | NOKIA5110_RST_bm PIN3_bm |
#define | NOKIA5110_SCE_bm SPI_SS_bm |
#define | NOKIA5110_FONT_WIDTH 6 |
#define | NOKIA5110_FONT_HEIGHT 8 |
#define | NOKIA5110_LCD_WIDTH 84 |
#define | NOKIA5110_LCD_HEIGHT 48 |
#define | NOKIA5110_COLS (NOKIA5110_LCD_WIDTH/NOKIA5110_FONT_WIDTH) |
#define | NOKIA5110_ROWS (NOKIA5110_LCD_HEIGHT/NOKIA5110_FONT_HEIGHT) |
Functions | |
void | nokia5110_sendData (uint8_t byte) |
Send a data byte. More... | |
void | nokia5110_sendCommand (uint8_t cmd) |
Send a command. More... | |
void | nokia5110_resetController (void) |
Reset the display. More... | |
void | nokia5110_init (void) |
Initialize the display. More... | |
void | nokia5110_displayOn (void) |
Turn the display on. More... | |
void | nokia5110_displayOff (void) |
Turn the display off. More... | |
void | nokia5110_clearDisplay (void) |
Clear the display. More... | |
void | nokia5110_setCursor (uint8_t x, uint8_t y) |
Set display position. More... | |
void | nokia5110_putchar (char c) |
Display a character. More... | |
void | nokia5110_puts (const char *s) |
Display a character string. More... | |
void | nokia5110_putbmp (uint8_t x, uint8_t y, const uint8_t *bmp, uint8_t w, uint8_t h) |
Display a bitmap. More... | |
Header file for the Nokia 5110 LCD.
This is a library for the Nokia 5110 monochrome liquid-crystal display.
#define NOKIA5110_COLS (NOKIA5110_LCD_WIDTH/NOKIA5110_FONT_WIDTH) |
#define NOKIA5110_DC_bm PIN2_bm |
#define NOKIA5110_DC_bp PIN2_bp |
#define NOKIA5110_DN_bm SPI_MOSI_bm |
#define NOKIA5110_DN_bp SPI_MOSI_bp |
#define NOKIA5110_FONT_HEIGHT 8 |
#define NOKIA5110_FONT_WIDTH 6 |
#define NOKIA5110_LCD_HEIGHT 48 |
#define NOKIA5110_LCD_WIDTH 84 |
#define NOKIA5110_LED_bm PIN1_bm |
#define NOKIA5110_LED_bp PIN1_bp |
#define NOKIA5110_PORT PORTF |
#define NOKIA5110_ROWS (NOKIA5110_LCD_HEIGHT/NOKIA5110_FONT_HEIGHT) |
#define NOKIA5110_RST_bm PIN3_bm |
#define NOKIA5110_RST_bp PIN3_bp |
#define NOKIA5110_SCE_bm SPI_SS_bm |
#define NOKIA5110_SCE_bp SPI_SS_bp |
#define NOKIA5110_SCLK_bm SPI_SCK_bm |
#define NOKIA5110_SCLK_bp SPI_SCK_bp |
void nokia5110_clearDisplay | ( | void | ) |
Clear the display.
Clears the display by filling it with the background color.
void nokia5110_displayOff | ( | void | ) |
Turn the display off.
Turns the display and the background lighting off.
void nokia5110_displayOn | ( | void | ) |
Turn the display on.
Turns the display and the background lighting on.
void nokia5110_init | ( | void | ) |
Initialize the display.
In the course of the initialization the following tasks are done:
void nokia5110_putbmp | ( | uint8_t | x, |
uint8_t | y, | ||
const uint8_t * | bmp, | ||
uint8_t | w, | ||
uint8_t | h | ||
) |
Display a bitmap.
Displays a bitmap at the specified position.
x | The x position. |
y | The y position. |
bmp | The bitmap to be displayed. |
w | The width of the bitmap. |
h | The height of the bitmap. |
void nokia5110_putchar | ( | char | c | ) |
Display a character.
Displays a character at the current cursor position. The controller has no build-in character map.
c | The character to be displayed. |
void nokia5110_puts | ( | const char * | s | ) |
Display a character string.
Displays a character string.
s | The string to be displayed. |
void nokia5110_resetController | ( | void | ) |
Reset the display.
Resets the display by pulling down the reset line.
void nokia5110_sendCommand | ( | uint8_t | cmd | ) |
Send a command.
Sends a command to the display controller by selecting the slave and transmitting the data byte.
cmd | The command to be sent. |
void nokia5110_sendData | ( | uint8_t | byte | ) |
Send a data byte.
Sends a data byte to the display controller by selecting the slave and transmitting the data byte.
byte | The data byte to be sent. |
void nokia5110_setCursor | ( | uint8_t | x, |
uint8_t | y | ||
) |
Set display position.
Sets the position where the next data is written into the display RAM. For details please consult chapter 7.7 of the data sheet at page 9. The cursor is virtual and is not displayed.
x | The horizontal position. |
y | The vertical position. |
Contact | Generated by 1.8.13 |