lcd_text.h
Go to the documentation of this file.00001
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067 #ifndef DRV_LCD_H
00068 #define DRV_LCD_H
00069
00070 #include "lcd_hd44.h"
00071
00072 #include <cfg/macros.h>
00073 #include <cfg/compiler.h>
00074 #include <mware/list.h>
00075
00076 #include <stdarg.h>
00077
00078
00079
00080 #define LCD_NORMAL 0
00081 #define LCD_FILL BV(0)
00082 #define LCD_CENTER BV(1)
00083 #define LCD_NOCURSOR BV(2)
00084
00086 #define LAYER_HIDDEN -128
00087
00088
00089 #define LCD_POS(x,y) ((lcdpos_t)((uint8_t)(x) + (uint8_t)(y) * (uint8_t)LCD_COLS))
00090 #define LCD_ROW0 (LCD_COLS * 0)
00091 #define LCD_ROW1 (LCD_COLS * 1)
00092 #define LCD_ROW2 (LCD_COLS * 2)
00093 #define LCD_ROW3 (LCD_COLS * 3)
00094
00098 typedef struct _Layer
00099 {
00104 DECLARE_NODE_ANON(struct _Layer)
00105
00106
00107 lcdpos_t addr;
00108
00110 char pri;
00111
00119 char buf[LCD_COLS * LCD_ROWS];
00120 } Layer;
00121
00122
00123
00124 extern Layer *lcd_DefLayer;
00125
00126
00127 extern void lcd_init(void);
00128 extern void lcd_test(void);
00129
00130 extern void lcd_moveCursor(lcdpos_t addr);
00131 extern char lcd_setCursor(char state);
00132
00133 extern void lcd_setAddr(Layer *layer, lcdpos_t addr);
00134 extern void lcd_putChar(char c, Layer *layer);
00135 extern int lcd_vprintf(Layer *layer, lcdpos_t addr, uint8_t mode, const char *format, va_list ap) FORMAT(printf, 4, 0);
00136 extern int lcd_printf(Layer *layer, lcdpos_t addr, uint8_t mode, const char *format, ...) FORMAT(printf, 4, 5);
00137 extern void lcd_clear(Layer *layer);
00138 extern void lcd_layerSet(Layer *layer, char c);
00139 extern void lcd_clearLine(Layer *layer, int y);
00140
00141 extern void lcd_setLayerDepth(Layer *layer, char pri);
00142 extern Layer *lcd_newLayer(char pri);
00143 extern void lcd_deleteLayer(Layer *layer);
00144 extern void lcd_lock(void);
00145 extern void lcd_unlock(void);
00146
00147 #endif