/* * 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 * * opentx 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 "opentx.h" #define delay_1us() _delay_us(1) #define delay_2us() _delay_us(2) void delay_1_5us(uint16_t ms) { for (uint16_t i=0; iSEG1) 0xA6, //REV = 0: non-reverse display 0xA4, //EON = 0: normal display. non-entire #ifdef LCD_ERC12864FSF 0xA3, // Select LCD bias 0xC0, //SHL = 0: normal direction (COM1->COM64) 0x2F, //Control power circuit operation VC=VR=VF=1 0x27, //Select int resistance ratio R2 R1 R0 0x81, //Set reference voltage Mode 0x2D, // 24 SV5 SV4 SV3 SV2 SV1 SV0 #else 0xA2, // Select LCD bias=0 0xC0, //SHL = 0: normal direction (COM1->COM64) 0x2F, //Control power circuit operation VC=VR=VF=1 0x25, //Select int resistance ratio R2 R1 R0 =5 0x81, //Set reference voltage Mode 0x22, // 24 SV5 SV4 SV3 SV2 SV1 SV0 = 0x18 #endif 0xAF //DON = 1: display ON }; inline void lcdInit() { // /home/thus/txt/datasheets/lcd/KS0713.pdf // ~/txt/flieger/ST7565RV17.pdf from http://www.glyn.de/content.asp?wdid=132&sid= LCD_LOCK(); PORTC_LCD_CTRL &= ~(1<0; --x) { PORTA_LCD_DAT = *p++; PORTC_LCD_CTRL |= (1<