Update lcd.h
adds graphic procedures
Dieser Commit ist enthalten in:
Ursprung
77ee1b280c
Commit
606183b0da
41
lcd.h
41
lcd.h
@ -37,6 +37,8 @@
|
||||
* first dev-version only for I2C-Connection
|
||||
* at ATMega328P like Arduino Uno
|
||||
*
|
||||
* at GRAPHICMODE lib needs SRAM for display
|
||||
* DISPLAY-WIDTH * DISPLAY-HEIGHT + 2 bytes
|
||||
*/
|
||||
|
||||
#ifndef LCD_H
|
||||
@ -56,10 +58,16 @@
|
||||
#include <inttypes.h>
|
||||
#include <avr/io.h>
|
||||
#include <avr/pgmspace.h>
|
||||
#include "i2c.h"
|
||||
#include "i2c.h" // library for I2C-communication
|
||||
// if you want to use other lib for I2C
|
||||
// edit i2c_xxx commands in this library
|
||||
// i2c_start(), i2c_byte(), i2c_stop()
|
||||
|
||||
/* TODO: define displaycontroller */
|
||||
#define SH1106 // or SSD1306, check datasheet of your display
|
||||
#define SH1106 // or SSD1306, check datasheet of your display
|
||||
|
||||
#define GRAPHICMODE // TEXTMODE for only text to display,
|
||||
// GRAPHICMODE for text and graphic
|
||||
|
||||
#define LCD_I2C_ADDR 0x7A
|
||||
|
||||
@ -73,16 +81,29 @@
|
||||
#define DISPLAY_HEIGHT 64
|
||||
#define DISPLAYSIZE DISPLAY_WIDTH*DISPLAY_HEIGHT/8
|
||||
|
||||
void lcd_init(uint8_t dispAttr);
|
||||
void lcd_home(void);
|
||||
|
||||
void lcd_command(uint8_t cmd[], uint8_t size); // transmit command to display
|
||||
void lcd_data(uint8_t data[], uint16_t size); // transmit data to display
|
||||
void lcd_gotoxy(uint8_t x, uint8_t y); // set curser at pos x, y. x means character, y means line (page, refer lcd manual)
|
||||
void lcd_clrscr(void); // clear screen
|
||||
void lcd_putc(char c); // print character on screen
|
||||
void lcd_puts(const char* s); // print string, \n-terminated, from ram on screen
|
||||
void lcd_puts_p(const char* progmem_s); // print string from flash on screen
|
||||
void lcd_init(uint8_t dispAttr);
|
||||
void lcd_home(void); // set cursor to 0,0
|
||||
void lcd_invert(uint8_t invert); // invert display
|
||||
void lcd_set_contrast(uint8_t contrast); // set contrast for display
|
||||
void lcd_puts(const char* s); // print string, \n-terminated, from ram on screen (TEXTMODE)
|
||||
// or buffer (GRAPHICMODE)
|
||||
void lcd_puts_p(const char* progmem_s); // print string from flash on screen (TEXTMODE)
|
||||
// or buffer (GRAPHICMODE)
|
||||
|
||||
void lcd_clrscr(void); // clear screen (and buffer at GRFAICMODE)
|
||||
void lcd_gotoxy(uint8_t x, uint8_t y); // set curser at pos x, y. x means character,
|
||||
// y means line (page, refer lcd manual)
|
||||
void lcd_putc(char c); // print character on screen at TEXTMODE
|
||||
// at GRAPHICMODE print character to buffer
|
||||
#if defined GRAPHICMODE
|
||||
void lcd_drawPixel(uint8_t x, uint8_t y, uint8_t color);
|
||||
void lcd_drawLine(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, uint8_t color);
|
||||
void lcd_drawRect(uint8_t px1, uint8_t py1, uint8_t px2, uint8_t py2, uint8_t color);
|
||||
void lcd_fillRect(uint8_t px1, uint8_t py1, uint8_t px2, uint8_t py2, uint8_t color);
|
||||
void lcd_drawCircle(uint8_t center_x, uint8_t center_y, uint8_t radius, uint8_t color);
|
||||
void lcd_fillCircle(uint8_t center_x, uint8_t center_y, uint8_t radius, uint8_t color);
|
||||
void lcd_display(void); // copy buffer to display RAM
|
||||
#endif
|
||||
#endif /* LCD_H */
|
||||
|
Laden…
x
In neuem Issue referenzieren
Einen Benutzer sperren