Project 6  Monochrome Liquid-Crystal Display
Neff Site
nokia5110.h
Go to the documentation of this file.
1 
17 #ifndef NOKIA5110_H_
18 #define NOKIA5110_H_
19 
20 #include "spi.h"
21 #include "pcd8544.h"
22 
23 #define NOKIA5110_PORT PORTF
24 
25 #define NOKIA5110_LED_bp PIN1_bp
26 #define NOKIA5110_SCLK_bp SPI_SCK_bp
27 #define NOKIA5110_DN_bp SPI_MOSI_bp
28 #define NOKIA5110_DC_bp PIN2_bp
29 #define NOKIA5110_RST_bp PIN3_bp
30 #define NOKIA5110_SCE_bp SPI_SS_bp
31 
32 #define NOKIA5110_LED_bm PIN1_bm
33 #define NOKIA5110_SCLK_bm SPI_SCK_bm
34 #define NOKIA5110_DN_bm SPI_MOSI_bm
35 #define NOKIA5110_DC_bm PIN2_bm
36 #define NOKIA5110_RST_bm PIN3_bm
37 #define NOKIA5110_SCE_bm SPI_SS_bm
38 
39 #define NOKIA5110_FONT_WIDTH 6
40 #define NOKIA5110_FONT_HEIGHT 8
41 
42 #define NOKIA5110_LCD_WIDTH 84
43 #define NOKIA5110_LCD_HEIGHT 48
44 
45 #define NOKIA5110_COLS (NOKIA5110_LCD_WIDTH/NOKIA5110_FONT_WIDTH)
46 #define NOKIA5110_ROWS (NOKIA5110_LCD_HEIGHT/NOKIA5110_FONT_HEIGHT)
47 
48 #ifdef __cplusplus
49 extern "C"
50 {
51 #endif
52 
53 /***** Low level functions *****/
54 
61 void nokia5110_sendData(uint8_t byte);
62 
69 void nokia5110_sendCommand(uint8_t cmd);
70 
75 void nokia5110_resetController(void);
76 
77 /***** High level functions *****/
78 
88 void nokia5110_init(void);
89 
94 void nokia5110_displayOn(void);
95 
100 void nokia5110_displayOff(void);
101 
106 void nokia5110_clearDisplay(void);
107 
117 void nokia5110_setCursor(uint8_t x, uint8_t y);
118 
125 void nokia5110_putchar(char c);
126 
132 void nokia5110_puts(const char* s);
133 
143 void nokia5110_putbmp(uint8_t x, uint8_t y, const uint8_t* bmp, uint8_t w, uint8_t h);
144 
145 #ifdef __cplusplus
146 }
147 #endif
148 
149 #endif /* NOKIA5110_H_ */
void nokia5110_setCursor(uint8_t x, uint8_t y)
Set display position.
void nokia5110_displayOff(void)
Turn the display off.
void nokia5110_init(void)
Initialize the display.
void nokia5110_putchar(char c)
Display a character.
void nokia5110_sendCommand(uint8_t cmd)
Send a command.
Header file for the SPI interface.
void nokia5110_sendData(uint8_t byte)
Send a data byte.
void nokia5110_puts(const char *s)
Display a character string.
void nokia5110_clearDisplay(void)
Clear the display.
Header file for the PCD8544 controller.
void nokia5110_resetController(void)
Reset the display.
void nokia5110_displayOn(void)
Turn the display on.
void nokia5110_putbmp(uint8_t x, uint8_t y, const uint8_t *bmp, uint8_t w, uint8_t h)
Display a bitmap.
Contact