/* * Authors (alphabetical order) * - Andre Bernet * - Andreas Weitl * - Bertrand Songis * - Bryan J. Rentoul (Gruvin) * - Cameron Weeks * - Erez Raviv * - Gabriel Birkus * - Jean-Pierre Parisy * - Karl Szmutny * - Michael Blandford * - Michal Hlavinka * - Pat Mackenzie * - Philip Moss * - Rob Thomson * - Romolo Manfredini * - Thomas Husterer * * open9x is based on code named * gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/, * er9x by Erez Raviv: http://code.google.com/p/er9x/, * and the original (and ongoing) project by * Thomas Husterer, th9x: http://code.google.com/p/th9x/ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include "open9x.h" #define delay_1us() _delay_us(1) void delay_1_5us(int ms) { for(int i=0; iSEG1) lcdSendCtl(0xA6); //REV = 0: non-reverse display lcdSendCtl(0xA4); //EON = 0: normal display. non-entire lcdSendCtl(0xA2); // Select LCD bias=0 lcdSendCtl(0xC0); //SHL = 0: normal direction (COM1->COM64) lcdSendCtl(0x2F); //Control power circuit operation VC=VR=VF=1 lcdSendCtl(0x25); //Select int resistance ratio R2 R1 R0 =5 lcdSendCtl(0x81); //Set reference voltage Mode lcdSendCtl(0x22); // 24 SV5 SV4 SV3 SV2 SV1 SV0 = 0x18 lcdSendCtl(0xAF); //DON = 1: display ON g_eeGeneral.contrast = 0x22; LCD_UNLOCK(); } void lcdSetRefVolt(uint8_t val) { LCD_LOCK(); lcdSendCtl(0x81); lcdSendCtl(val); LCD_UNLOCK(); } void lcdRefresh() { LCD_LOCK(); uint8_t *p=displayBuf; for(uint8_t y=0; y < 8; y++) { lcdSendCtl(0x04); lcdSendCtl(0x10); //column addr 0 lcdSendCtl( y | 0xB0); //page addr y PORTC_LCD_CTRL &= ~(1<0; --x) { PORTA_LCD_DAT = *p++; PORTC_LCD_CTRL |= (1<