⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fonts.h

📁 AVR单片机的EW12A03GLY液晶显示代码
💻 H
字号:
#ifndef _FONTS_H
#define _FONTS_H

#include <avr/pgmspace.h>

/* select desired fonts. (Simply comment out those not needed) */
// #define EN_FIVE_DOT
#define EN_SIX_DOT
#define EN_SEVEN_DOT
#define EN_NINE_DOT
// #define EN_TEN_DOT
#define EN_FIFTEEN_DOT
#define EN_EIGHTEEN_DOT

/* define number labels for the font selections */
typedef enum
 {
#ifdef EN_FIVE_DOT
   FONT_FIVE_DOT,
#endif

#ifdef EN_SIX_DOT
   FONT_SIX_DOT,
#endif

#ifdef EN_SEVEN_DOT
   FONT_SEVEN_DOT,
#endif

#ifdef EN_NINE_DOT
   FONT_NINE_DOT,
#endif

#ifdef EN_TEN_DOT
   FONT_TEN_DOT,
#endif

#ifdef EN_FIFTEEN_DOT
   FONT_FIFTEEN_DOT,
#endif

#ifdef EN_EIGHTEEN_DOT
   FONT_EIGHTEEN_DOT,
#endif

   FONT_COUNT
 } FONT_BASE;

struct FONT_DEF 
 { const unsigned char store_width;            /* glyph storage width in bytes */
   const unsigned char glyph_height;  	       /* glyph height for storage */
   const unsigned char *glyph_table;           /* font table start address in memory */
   const unsigned char fixed_width;            /* fixed width of glyphs. If zero */
                                                /* then use the width table. */
   const unsigned char *width_table; 	      /* variable width table start adress */
   const unsigned char glyph_beg;			 	 /* start ascii offset in table */
   const unsigned char glyph_end;				 /* end ascii offset in table */
   const unsigned char glyph_def;				 /* code for undefined glyph code */
};

/* font definition tables for the three fonts */
extern const struct FONT_DEF fonts[FONT_COUNT] PROGMEM;

/* glyph bitmap and width tables for the fonts */ 
#ifdef EN_FIVE_DOT
  extern const unsigned char five_dot_glyph_table[] PROGMEM;
  extern const unsigned char five_dot_width_table[] PROGMEM;
#endif

#ifdef EN_SIX_DOT
  extern const unsigned char six_dot_glyph_table[] PROGMEM;
  extern const unsigned char six_dot_width_table[] PROGMEM;
#endif

#ifdef EN_SEVEN_DOT
#define DEG_CHAR ('~'+1)
  extern const unsigned char seven_dot_glyph_table[] PROGMEM;
  extern const unsigned char seven_dot_width_table[] PROGMEM;
#endif

#ifdef EN_NINE_DOT
  extern const unsigned char nine_dot_glyph_table[] PROGMEM;
#endif

#ifdef EN_TEN_DOT
  extern const unsigned char ten_dot_glyph_table[] PROGMEM;
#endif

#ifdef EN_FIFTEEN_DOT
  extern const unsigned char fifteen_dot_glyph_table[] PROGMEM;
  extern const unsigned char fifteen_dot_width_table[] PROGMEM;
#endif

#ifdef EN_EIGHTEEN_DOT
  extern const unsigned char eighteen_dot_glyph_table[] PROGMEM;
  extern const unsigned char eighteen_dot_width_table[] PROGMEM;
#endif

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -