📄 glcd.h
字号:
/*
Port&Copyright: Mark de Jong, mail to mark at mdejong.de
Port&Copyright: Christian Kranz, mail to cnkz at yahoo.com
Original Copyright: Hagen Reddmann mailto HaReddmann at T-Online dot de
Author: Hagen Reddmann
Remarks: this Copyright must be included
known Problems: none
Version: 0.1. 2005
Description: Graphic Library for Siemens S65, M65, CX65 and RX65 Display
*/
#ifdef AVR
#include <avr/io.h>
#include <avr/pgmspace.h>
#endif
#ifdef __C166__
#include "inttypes.h"
#ifdef TARGET_C164CI
#include <C164CXSX.H>
#endif
#ifdef TARGET_MM167
#include <C167CS.H>
#endif
#endif
#ifndef GLCD_H
#define GLCD_H
#include "glcd.inc"
typedef uint16_t glcdColor_t; // 65535 colors
typedef uint16_t glcdCoord2_t; // intern zur Koordinatenberechnung
typedef uint8_t glcdCoord_t; // coordinates, ONLY byte coords supported without rewriting of lib
typedef uint8_t glcdFontData_t; // pointer to font datas
typedef uint8_t (*glcdFontFunc_t)(glcdFontData_t *index); // custom font data read callback, thus we can support ae. I2C EEPROM
typedef uint8_t (*glcdCharFunc_t)(char c);
typedef struct
{
glcdCoord_t X;
glcdCoord_t Y;
} glcdPoint_t;
typedef struct
{
glcdCoord_t X1;
glcdCoord_t Y1;
glcdCoord_t X2;
glcdCoord_t Y2;
} glcdRect_t;
typedef union {
uint8_t All;
struct
{
uint8_t AutoLineFeed:1; // font routines should use implizit linefeed and wrap around glcd_Window
uint8_t FixedFont:1; // == 0 fonts painted proportional, == 1 fonts painted in fixed pitch
uint8_t Clipping:1; // activate clipping
}bits;
} glcdFlags_t;
extern glcdColor_t glcd_Colors[1 << COLOR_TABLE_BITS]; // Farbtabelle, Colors[0] = Hintergrund = F黮lfarbe, Color[1] = Vordergrund = Linienfarbe
extern uint8_t glcd_MemCtrl;
extern glcdFlags_t glcd_Flags;
extern glcdRect_t glcd_Clip; // Clipping Koordinaten, alles was ausserhalb ist wird nicht dargestellt
#ifdef USE_FONTS
extern glcdPoint_t glcd_Cursor; // aktuelle Position f黵 Schriften
extern glcdRect_t glcd_Window; // aktuelles Fenster f黵 Textausgaben
extern uint8_t glcd_FontFirstChar; // erstes Zeichen im Font
extern uint8_t glcd_FontLastChar; // letztes Zeichen im Font
extern uint8_t glcd_FontWidth; // fixed Zeichenbreite des Fonts
extern uint8_t glcd_FontHeight; // Zeichenh鰄e
extern uint8_t glcd_FontBitsPixel; // Farbtiefe des Fonts
extern uint16_t glcd_FontSize; // Font size
extern glcdFontFunc_t glcd_FontRead; // User definierte Readcallback f黵 die Fontdaten
extern glcdFontData_t *glcd_FontData; // die eigentlichen Fontdaten beginnen hier, abh鋘gig von der Readcallback
#endif
extern void glcdDisplayByte(uint8_t cmd); // send a byte to display
extern void glcdDisplayWord(uint16_t cmd); // send a word to display
extern void glcdDisplayCommand(uint16_t cmd); // send a command to display
extern void glcdDisplayData(uint16_t data); // send data to display
extern void glcdDisplayBufferByte( uint8_t *buffer, uint8_t buffersize, uint8_t flashstored); // send a buffer of bytes to the display
extern void glcdDisplayBufferWord( uint16_t *buffer, uint8_t buffersize, uint8_t flashstored); // send a buffer of words to the display
extern void glcdDisplayBufferCommand( uint16_t *buffer, uint8_t buffersize, uint8_t flashstored); // send a buffer of bytes as command to the display
extern void glcdDisplayBufferData( uint16_t *buffer, uint8_t buffersize, uint8_t flashstored); // send a buffer of bytes as data to the display
extern void glcdDisplayInit(void); // initialize the display, MUST be normaly NEVER called, it's automaticaly called by the initialization code
extern void glcdDisplayOn(void); // switch display on, booster on, sleep out
extern void glcdDisplayOff(void); // switch display off, booster off, sleep in
extern void glcdPowerOn(void); // switch power on
extern void glcdPowerOff(void); // switch power off
extern void glcdBackLightOn(void); // switch backlight on
extern void glcdBackLightOff(void); // switch backlight off
extern void glcdWait(uint16_t ms); // wait some milliseconds, XTAL must be correct defined
extern void glcdFillScreen(uint16_t color);
extern void glcdSetOrientation(uint8_t orientation); // degree 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -