113 #if defined(NZ_LCD2S_ENABLED)
117 #ifndef LCD2S_I2C_ADR
118 #define LCD2S_I2C_ADR 80ul //LCD2S I2C Address
122 #ifndef LCD2S_MAX_NUMBER
123 #define LCD2S_MAX_NUMBER 1
127 #ifndef KPAD_BUF_SIZE
128 #define KPAD_BUF_SIZE 8ul
132 #ifndef LCD2S_USE_I2C_BUS
133 #define LCD2S_USE_I2C_BUS 1
139 #define LCD2S_CMD_CURSOR_MOVES_BACKWARDS 0x01
142 #define LCD2S_CMD_CURSOR_MOVES_FORWARD 0x09
145 #define LCD2S_CMD_BLINK_BLOCK_CURSOR_OFF 0x10
148 #define LCD2S_CMD_UNDERLINE_CURSOR_ON 0x19
151 #define LCD2S_CMD_DISPLAY_ON 0x1A
154 #define LCD2S_CMD_DISPLAY_OFF 0x12
157 #define LCD2S_CMD_INTERRUPT_PIN_PUSH_PULL 0x22
160 #define LCD2S_CMD_BACKLIGHT_ON 0x28
163 #define LCD2S_CMD_BACKLIGHT_OFF 0x20
166 #define LCD2S_CMD_OUT1_OFF 0x30
169 #define LCD2S_CMD_OUT2_OFF 0x31
172 #define LCD2S_CMD_OUT1_ON 0x38
175 #define LCD2S_CMD_OUT2_ON 0x39
178 #define LCD2S_CMD_GPIO1_OFF 0x40
181 #define LCD2S_CMD_GPIO2_OFF 0x41
184 #define LCD2S_CMD_GPIO1_ON 0x48
187 #define LCD2S_CMD_GPIO2_ON 0x49
190 #define LCD2S_CMD_WRITE_STRING 0x80
193 #define LCD2S_CMD_SET_BACKLIGHT 0x81
196 #define LCD2S_CMD_SET_CONTRAST 0x82
199 #define LCD2S_CMD_MOVE_CURSOR_RIGHT 0x83
202 #define LCD2S_CMD_MOVE_CURSOR_LEFT 0x84
205 #define LCD2S_CMD_SHIFT_DISPLAY_RIGHT 0x85
208 #define LCD2S_CMD_SHIFT_DISPLAY_LEFT 0x86
211 #define LCD2S_CMD_SHIFT_DISPLAY_UP 0x85
214 #define LCD2S_CMD_SHIFT_DISPLAY_DOWN 0x86
217 #define LCD2S_CMD_SET_CURSOR_ADDRESS 0x89
220 #define LCD2S_CMD_SET_CURSOR_POSITION 0x8A
223 #define LCD2S_CMD_CLEAR_DISPLAY 0x8C
226 #define LCD2S_CMD_REMEMBER 0x8D
229 #define LCD2S_CMD_LOAD_CUSTOM_CHAR_SET 0x8E
232 #define LCD2S_CMD_WRITE_LARGE_NUM_STING 0x8F
235 #define LCD2S_CMD_SET_STARTUP_SCREEN 0x90
238 #define LCD2S_CMD_SET_I2C_BASE_ADR 0x91
241 #define LCD2S_CMD_DEFINE_CUSTOM_CHAR 0x92
244 #define LCD2S_CMD_DRAW_VERT_BAR_GRAPH 0x93
247 #define LCD2S_CMD_DRAW_TALL_VERT_BAR_GRAPH 0x94
250 #define LCD2S_CMD_CONFIG_DEVICE 0x95
253 #define LCD2S_CMD_SET_KEYPAD_REPEAT_DELAY 0xA0
256 #define LCD2S_CMD_SET_KEYPAD_REPEAT_RATE 0xA1
259 #define LCD2S_CMD_SET_KEYPAD_BUZZER_PERIOD 0xA2
262 #define LCD2S_CMD_MAX_BACKLIGHT 0xA3
265 #define LCD2S_CMD_GET_STATUS 0xD0
268 #define LCD2S_CMD_GET_KEY 0xD1
271 #define LCD2S_CMD_GET_GPIO1_TO_GPIO3 0xD3
274 #define LCD2S_CMD_CONFIG_KEYPAD_AND_IO 0xE0
277 #define LCD2S_CMD_SET_KEYPAD_DEBOUNCE_TIME 0xE1
280 #define LCD2S_CMD_SET_OUT1_AND_OUT2 0xE2
283 #define LCD2S_CMD_CONFIG_GPIO1 0xE3
286 #define LCD2S_CMD_CONFIG_GPIO2 0xE4
292 extern BYTE kpadBufGet[LCD2S_MAX_NUMBER];
293 extern BYTE kpadBufPut[LCD2S_MAX_NUMBER];
309 void lcd2sTask(
void);
316 #define kpadHasKeys(kpadNum) (kpadBufPut[kpadNum] != kpadBufGet[kpadNum])
329 BYTE kpadGetKey(BYTE kpadNum);
343 INT8 lcdPutCmd(BYTE lcdNum, BYTE cmd);
359 INT8 lcdPutCmd1Param(BYTE lcdNum, BYTE cmd, BYTE param1);
377 INT8 lcdPutCmd2Param(BYTE lcdNum, BYTE cmd, BYTE param1, BYTE param2);
390 INT8 lcdPutArray(BYTE lcdNum, BYTE* buf, BYTE len);
403 INT8 lcdDisplayChar(BYTE lcdNum,
char c);
417 INT8 lcdDisplayCharHex(BYTE lcdNum, BYTE c);
442 INT8 lcdDisplayString(BYTE lcdNum,
char* s);
471 INT8 lcdSetStartupScreen(BYTE lcdNum, BYTE row,
char*
string);
497 INT8 lcdDrawVertBargraph(BYTE lcdNum, BYTE row, BYTE col, BYTE height);
512 #define lcdSetCursorPosition(lcdNum, row, col) lcdPutCmd2Param(lcdNum, LCD2S_CMD_SET_CURSOR_POSITION, row, col)
524 #define lcdSetBacklight(lcdNum, value) lcdPutCmd1Param(lcdNum, LCD2S_CMD_SET_BACKLIGHT, value)
536 #define lcdSetContrast(lcdNum, value) lcdPutCmd1Param(lcdNum, LCD2S_CMD_SET_CONTRAST, value)
562 #define lcdLoadCustomCharSet(lcdNum, value) lcdPutCmd1Param(lcdNum, LCD2S_CMD_LOAD_CUSTOM_CHAR_SET, value)
602 #define lcdDefineCustomChar(lcdNum, buf) lcdPutArray(lcdNum, buf, 10)
604 #endif //#if defined(NZ_LCD2S_ENABLED)