//-------------------------------------------------------------------------- // Titre : Header Librairie de gestion LCD graphique // de myAVR Board MK3 et mySmartControl MK3 //-------------------------------------------------------------------------- // Fonction : Fonctions de gestion du LCD graphique //-------------------------------------------------------------------------- // Processeur : atmega640/atmega2560 // Langage : C // Date : 16/05/2010 // Version : 1.0 // Auteur : Devtronic SARL - Laser&Co //-------------------------------------------------------------------------- //en: defines for a better abridgement which port what do #define PortLcdData PORTC #define PortLcdDataPIN PINC #define PortLcdDataDDR DDRC #define PortLcdCtrl PORTA #define PortLcdCtrlDDR DDRA #define PortLed PORTL #define PortLedDDR DDRL #define true 1 #define ASCIItableWIDTH 6 #include #include //---------------------------------------------------------------------- // LCD-Funktionen - Implementation //---------------------------------------------------------------------- //en: counts a value from 0 to x //en: PE: x = highest index void MYAVRGRAPHIC_wait(uint16_t x); //en: send data to the LCD, ist used by lcdSendData() //en: PE: data = data to send void MYAVRGRAPHIC_lcdSend(uint8_t data); //en: to initialise the LCD void MYAVRGRAPHIC_lcdInit(void); //en: send a control command to the LCD //en: PE: data = control command void MYAVRGRAPHIC_lcdSendCmd(uint8_t data); //en: writes a byte on the actual position at the LCD (actual position is increase by one) //en: PE: data = the byte void MYAVRGRAPHIC_lcdSendData(uint8_t data); //en: reads a byte from the actual postion at the LCD (actual position is not changed) //en: PA: the byte uint8_t MYAVRGRAPHIC_lcdReadData(void); //en: Set the position for the next output, for text e. g. //en: the y-value is round down to a 8like value (0,8,16,24...56) //en: PE: x = x-coordinate 0...127; y = y-coordinate 0...63 void MYAVRGRAPHIC_lcdSetPos(uint8_t x, uint8_t y); //en: move to the inputline to the actual line on the LCD (srcolleffect) //en: PE: Line = number of the line to goto void MYAVRGRAPHIC_lcdGotoLine(uint8_t line); //en: clears all data on the LCD void MYAVRGRAPHIC_lcdClear(void); //en: inverse display (dark at bright backround/ bright at dark backround) //en: PE: on = off/on 0/1; 0 = normal (dark at blight backround); 1 = inverse (blight at dark backround) void MYAVRGRAPHIC_lcdSendCmdReverse(uint8_t jn); //en: turn the display on/off //en: PE: on = on/off 0/1; 0 = display on; 1 = display off (complete dark) void MYAVRGRAPHIC_lcdSendCmdOn(uint8_t on); //en: set a Pixel on position x,y at the LCD //en: PE: x = x-coordinate 0...127; y = y-coordinate 0...63 void MYAVRGRAPHIC_lcdSetPixel(uint8_t x, uint8_t y); //fr: liste des fonctions évolué permettant l'affichage de lettres et formes de base void MYAVRGRAPHIC_printChar(char xchar); void MYAVRGRAPHIC_printChain(char *chain, int nb_char); void MYAVRGRAPHIC_PrintCircle(uint8_t x1,uint8_t y1,uint8_t r); void MYAVRGRAPHIC_PrintLine(uint8_t x1,uint8_t y1,uint8_t x2,uint8_t y2); void MYAVRGRAPHIC_PrintFullSquare(uint8_t x1,uint8_t y1,uint8_t w); void MYAVRGRAPHIC_PrintRectangle(uint8_t x1,uint8_t y1,uint8_t x2,uint8_t y2); void MYAVRGRAPHIC_afficherEntier(int entier); void MYAVRGRAPHIC_afficherDouble(double vdouble, int nb_decimales);