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

📄 vfd_cus.h

📁 mtk1389L latest sourcecode enjoy
💻 H
字号:
/***************    MTK CONFIDENTIAL & COPYRIGHTED     ****************/
/***************                                       ****************/
/*************** Description : VFD Driver Customer     ****************/
/***************               HW Leve Header file     ****************/
/***************                                       ****************/
/***************     Company : MediaTek Inc.           ****************/
/***************  Programmer : Harrison Hsieh          ****************/
/**********************************************************************/

#ifndef _VFD_CUS_H_
#define _VFD_CUS_H_
#ifdef VFD_SUPPORT

#ifdef TEST_VFD
  #define  VFD_16311
#else
  #define  VFD_16312   // auto generate by tool
#endif
#define VFD_LED
//#define DIRECT_CROSS_TABLE

// how many segments on this VFD
#define MAX_SEG_SEQ_NUM        9    
#define VFD_CONTROL    0x8C        // set Display ON and Set Pulse width
// for vVfdRotate()
#define MAX_DISC_NUM           12
#define SEG_SIZE     8
#ifdef TEST_VFD
   xdata BYTE _bCon_Key_flag = 0; //_bRS232Con_flag
   xdata BYTE MODESET = 2;
#else
#define MODESET    2
#endif

#ifdef VFD_16311
   #define TEST_MAX_VFD_ADDR          48
#else
   #define TEST_MAX_VFD_ADDR          22
#endif

/*
    2004/09/04 Alfonso
    MAX_VFD_ADDR actually implied the count of VFD address.
*/
#define MAX_VFD_ADDR   0x0B        // the real Max VFD_ADDR




#ifndef _SHM_CHK_C_

// VFD mode constant code define here
code BYTE _pbVfdMode[] = {
0xff, 0xff, 0xff, 0xff, 0x02, 0x80, 0x08, 0x80, 0xff, 0xff, 0xff, 0xff,
0x08, 0x40, 0x0b, 0x80, 0x0b, 0x20, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x80,
0xff, 0xff, 0x08, 0x01, 0x08, 0x10, 0x08, 0x20, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x01, 0x01, 0x09, 0x01, 0xff, 0xff, 0xff, 0xff,
0x0a, 0x08, 0xff, 0xff, 0x08, 0x02, 0x0b, 0x10, 0x0b, 0x40, 0x03, 0x01,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff};

code BYTE _pbVfdDisc[] = {
0x0a, 0x80, 0x0a, 0x40, 0x0a, 0x20, 0x0a, 0x10, 0x0a, 0x08, 0x0a, 0x04,
0x0a, 0x02, 0x0a, 0x01, 0x0b, 0x08, 0x0b, 0x04, 0x0b, 0x02, 0x0b, 0x01
};

// VFD seven-segment related defined here, not only for digits, but also for words
code BYTE _pbVfdSeg[9][16] = {
{0x06, 0x40, 0x06, 0x20, 0x06, 0x04, 0x06, 0x01, 0x06, 0x02, 0x06, 0x10, 0x06, 0x08, 0x07, 0x01},
{0x07, 0x80, 0x07, 0x40, 0x07, 0x08, 0x07, 0x02, 0x07, 0x04, 0x07, 0x20, 0x07, 0x10, 0xff, 0xff},
{0x04, 0x40, 0x04, 0x20, 0x04, 0x04, 0x04, 0x01, 0x04, 0x02, 0x04, 0x10, 0x04, 0x08, 0x05, 0x01},
{0x05, 0x80, 0x05, 0x40, 0x05, 0x08, 0x05, 0x02, 0x05, 0x04, 0x05, 0x20, 0x05, 0x10, 0xff, 0xff},
{0x03, 0x80, 0x03, 0x40, 0x03, 0x08, 0x03, 0x02, 0x03, 0x04, 0x03, 0x20, 0x03, 0x10, 0xff, 0xff},
{0x00, 0x40, 0x00, 0x20, 0x00, 0x04, 0x00, 0x01, 0x00, 0x02, 0x00, 0x10, 0x00, 0x08, 0xff, 0xff},
{0x01, 0x80, 0x01, 0x40, 0x01, 0x08, 0x01, 0x02, 0x01, 0x04, 0x01, 0x20, 0x01, 0x10, 0xff, 0xff},
{0x09, 0x80, 0x09, 0x40, 0x09, 0x08, 0x09, 0x02, 0x09, 0x04, 0x09, 0x20, 0x09, 0x10, 0xff, 0xff},
{0x02, 0x40, 0x02, 0x20, 0x02, 0x04, 0x02, 0x01, 0x02, 0x02, 0x02, 0x10, 0x02, 0x08, 0xff, 0xff}
};


code BYTE _pbSegSequence[] = {
VFD_SEG_TITLE_HIGH, VFD_SEG_TITLE_LOW, VFD_SEG_CHAP_HIGH, VFD_SEG_CHAP_LOW,
VFD_SEG_HR,
VFD_SEG_MIN_HIGH, VFD_SEG_MIN_LOW, VFD_SEG_SEC_HIGH, VFD_SEG_SEC_LOW
};


code BYTE _pbVfdMsg[] = {
0x05, SEG_CHAR_H, SEG_CHAR_E, SEG_CHAR_L, SEG_CHAR_L, SEG_CHAR_O,   // hello 6: start 0
0x04, SEG_CHAR_S, SEG_CHAR_t, SEG_CHAR_O, SEG_CHAR_P,              // stop ,5: start 6
0x04, SEG_CHAR_r, SEG_CHAR_O, SEG_CHAR_O, SEG_CHAR_t,               // root, 5: start 11
0x05, SEG_CHAR_t, SEG_CHAR_I, SEG_CHAR_t, SEG_CHAR_L, SEG_CHAR_E,   // title, 6: start 16
0x06, SEG_CHAR_n, SEG_CHAR_O, SEG_CHAR_d, SEG_CHAR_I, SEG_CHAR_S, SEG_CHAR_C,  // nodisc, 7: start 22
0x06, SEG_CHAR_U, SEG_CHAR_n, SEG_CHAR_d, SEG_CHAR_I, SEG_CHAR_S, SEG_CHAR_C,  // undisc, 7: start 29
0x04, SEG_CHAR_O, SEG_CHAR_P, SEG_CHAR_E, SEG_CHAR_n,               // open, 5: start 36
0x05, SEG_CHAR_C, SEG_CHAR_L, SEG_CHAR_O, SEG_CHAR_S, SEG_CHAR_E,   // close, 6: start 41
0x07, SEG_CHAR_L, SEG_CHAR_O, SEG_CHAR_A, SEG_CHAR_d, SEG_CHAR_I, SEG_CHAR_n, SEG_CHAR_g,  // loading, 8: start 47
0x03, SEG_CHAR_O, SEG_CHAR_F, SEG_CHAR_F,                           // OFF, 4, start 55
0x44, SEG_CHAR_J, SEG_CHAR_P, SEG_CHAR_E, SEG_CHAR_G,               // jpeg, 5 :start 59
0x04, SEG_CHAR_P, SEG_CHAR__, SEG_CHAR_c, SEG_CHAR_d,               // p-cd, 5, :start 64
0x03, SEG_CHAR_E, SEG_CHAR_r, SEG_CHAR_r,                           // err, 4: start 69
0x03, SEG_CHAR_U, SEG_CHAR_P, SEG_CHAR_G,                           // upg, 4: start 73
0x06, SEG_CHAR_d, SEG_CHAR_I, SEG_CHAR_g, SEG_CHAR_E, SEG_CHAR_S, SEG_CHAR_t, // digest, : 7 : start 77
0x08, SEG_CHAR_P, SEG_CHAR_b, SEG_CHAR_C, SEG_CHAR__, SEG_CHAR_P, SEG_CHAR_L, SEG_CHAR_A, SEG_CHAR_y, // pbc-play, 9: start 84
MAX_SEG_SEQ_NUM, SEG_CLEAN, SEG_CLEAN, SEG_CLEAN, SEG_CLEAN, SEG_CLEAN, SEG_CLEAN, SEG_CLEAN, SEG_CLEAN, SEG_CLEAN // clean all, 10: start 93
};

code WORD _pwMsgTable[] = {
0, 6, 11, 16, 22, 29, 36, 41, 47, 55, 59, 64,
69, 73, 77, 84, 93
};

/*
#ifdef DIRECT_CROSS_TABLE
code BYTE _pbMsgDirectTable[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0x5, 0xff,  0,    0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff
};

// to save code space, only what in direct message, we declare here
code BYTE _pbVfdDirectMsg[] = {
0x2, 0x00, 0xad, 0x02, 0x80,        // OFF for 0x4909
0x2, 0x00, 0xE4, 0x02, 0xdd
};
#endif
*/

#define DOT_A      0x00
#define DOT_B      0x01
#define DOT_C      0x02
#define DOT_D      0x03
#define DOT_E      0x04
#define DOT_F      0x05
#define DOT_G      0x06
#define DOT_H      0x07

code BYTE _pbSegUnit[] = {
(1<<DOT_A)|(1<<DOT_B)|(1<<DOT_C)|(1<<DOT_D)|(1<<DOT_E)|(1<<DOT_F),    // 0
(1<<DOT_B)|(1<<DOT_C),                                               // 1
(1<<DOT_A)|(1<<DOT_B)|(1<<DOT_D)|(1<<DOT_E)|(1<<DOT_G),              // 2
(1<<DOT_A)|(1<<DOT_B)|(1<<DOT_C)|(1<<DOT_D)|(1<<DOT_G),              // 3
(1<<DOT_B)|(1<<DOT_C)|(1<<DOT_F)|(1<<DOT_G),                         // 4
(1<<DOT_A)|(1<<DOT_C)|(1<<DOT_D)|(1<<DOT_F)|(1<<DOT_G),              // 5
(1<<DOT_A)|(1<<DOT_C)|(1<<DOT_D)|(1<<DOT_E)|(1<<DOT_F)|(1<<DOT_G),   // 6
(1<<DOT_A)|(1<<DOT_B)|(1<<DOT_C),                                    // 7
(1<<DOT_A)|(1<<DOT_B)|(1<<DOT_C)|(1<<DOT_D)|(1<<DOT_E)|(1<<DOT_F)|(1<<DOT_G), // 8
(1<<DOT_A)|(1<<DOT_B)|(1<<DOT_C)|(1<<DOT_F)|(1<<DOT_G),              // 9
0,                                                                   // clear all
(1<<DOT_A)|(1<<DOT_B)|(1<<DOT_C)|(1<<DOT_E)|(1<<DOT_F)|(1<<DOT_G),   // A
(1<<DOT_A)|(1<<DOT_D)|(1<<DOT_E)|(1<<DOT_F)|(1<<DOT_G),              // E
(1<<DOT_A)|(1<<DOT_E)|(1<<DOT_F)|(1<<DOT_G),                         // F                 
(1<<DOT_A)|(1<<DOT_C)|(1<<DOT_D)|(1<<DOT_E)|(1<<DOT_F),              // G               
(1<<DOT_B)|(1<<DOT_C)|(1<<DOT_E)|(1<<DOT_F)|(1<<DOT_G),              // H
#if (SEG_SIZE == 14) 
(1<<DOT_A)|(1<<DOT_D),                                               // I                                   
#else
(1<<DOT_E)|(1<<DOT_F),                                               // I                                   
#endif
(1<<DOT_B)|(1<<DOT_C)|(1<<DOT_D)|(1<<DOT_E),                         // J                    
(1<<DOT_D)|(1<<DOT_E)|(1<<DOT_F),                                    // L                            
(1<<DOT_A)|(1<<DOT_D)|(1<<DOT_E)|(1<<DOT_F),                         // C                     
(1<<DOT_A)|(1<<DOT_B)|(1<<DOT_E)|(1<<DOT_F)|(1<<DOT_G),              // P               
(1<<DOT_A)|(1<<DOT_C)|(1<<DOT_D)|(1<<DOT_F)|(1<<DOT_G),              // S              
(1<<DOT_B)|(1<<DOT_C)|(1<<DOT_D)|(1<<DOT_E)|(1<<DOT_F),              // U               
(1<<DOT_C)|(1<<DOT_D)|(1<<DOT_E)|(1<<DOT_F)|(1<<DOT_G),              // b             
(1<<DOT_D)|(1<<DOT_E)|(1<<DOT_G),                                    // c                            
(1<<DOT_B)|(1<<DOT_C)|(1<<DOT_D)|(1<<DOT_E)|(1<<DOT_G),              // d               
(1<<DOT_A)|(1<<DOT_B)|(1<<DOT_C)|(1<<DOT_D)|(1<<DOT_F)|(1<<DOT_G),   // g  
(1<<DOT_A)|(1<<DOT_B)|(1<<DOT_C)|(1<<DOT_E)|(1<<DOT_F),              // n               
(1<<DOT_E)|(1<<DOT_G),                                               // r                                   
(1<<DOT_D)|(1<<DOT_E)|(1<<DOT_F)|(1<<DOT_G),                         // t 
#if (SEG_SIZE != 14) 
(1<<DOT_B)|(1<<DOT_C)|(1<<DOT_D)|(1<<DOT_F)|(1<<DOT_G),              // y             
#else
(1<<DOT_H),         // y
#endif
(1<<DOT_G), // -                                            
#if (SEG_SIZE == 7) 
(1<<DOT_A)|(1<<DOT_B)|(1<<DOT_C)|(1<<DOT_D)|(1<<DOT_E)|(1<<DOT_F)|(1<<DOT_G), // all
#else
(1<<DOT_A)|(1<<DOT_B)|(1<<DOT_C)|(1<<DOT_D)|(1<<DOT_E)|(1<<DOT_F)|(1<<DOT_G)|(1<<DOT_H), // all
#endif  // after this , we will define what only appear on segment > 7
#if (SEG_SIZE > 7)
(1<<DOT_B)|(1<<DOT_C)|(1<<DOT_E)|(1<<DOT_F)|(1<<DOT_H),              // N
(1<<DOT_B)|(1<<DOT_C)|(1<<DOT_H),                                    // V
#endif
// after this , we will define what only appear on Segment = 14
#if (SEG_SIZE == 14)
(1<<DOT_H),                                                        // X
(1<<DOT_H),                                          // Y
(1<<DOT_E)|(1<<DOT_F)|(1<<DOT_G),                    // K
(1<<DOT_A),                                          // T
(1<<DOT_G)|(1<<DOT_H),                               // *
(1<<DOT_A)|(1<<DOT_D),                               // Z
(1<<DOT_B)|(1<<DOT_C)|(1<<DOT_E)|(1<<DOT_F)|(1<<DOT_H)     // M
#else
0
#endif
};



#if (SEG_SIZE > 8) 
#define  DOT_M   0x00
#define  DOT_J   0x01
#define  DOT_P   0x02
#define  DOT_N   0x03
#define  DOT_K   0x04
#define  DOT_R   0x05



  // if segment size is 14, this should be included
code BYTE _pbSegUnitHi[] = {
0,
0,
(1<<DOT_M), 
(1<<DOT_M), 
(1<<DOT_M), 
(1<<DOT_M), 
(1<<DOT_M), 
0,
(1<<DOT_M),
(1<<DOT_M), 
0,
(1<<DOT_M),  // A
(1<<DOT_M),  // E
(1<<DOT_M),  // F
(1<<DOT_M),  // G
(1<<DOT_M),  // H
#if (SEG_SIZE == 14) 
(1<<DOT_J)|(1<<DOT_P),
#else
0,           // I
#endif
0,           // J
0,           // L
0,           // C
(1<<DOT_M),  // P
(1<<DOT_M),  // S
0,           // U
(1<<DOT_M),  // b
(1<<DOT_M),  // c
(1<<DOT_M),  // d
(1<<DOT_M),  // g
0,  // n
(1<<DOT_M),  // r
(1<<DOT_M),  // t
#if (SEG_SIZE == 14) 
(1<<DOT_M),  // y
#else
(1<<DOT_K)|(1<<DOT_R),
#endif
(1<<DOT_M),  // -
(1<<DOT_M)|(1<<DOT_J)|(1<<DOT_P)|(1<<DOT_N)|(1<<DOT_K)|(1<<DOT_R),   // all ON
(1<<DOT_N),  // N
(1<<DOT_N),  // V
(1<<DOT_K)|(1<<DOT_N)|(1<<DOT_R),   // X
(1<<DOT_K)|(1<<DOT_P),              // Y
(1<<DOT_N)|(1<<DOT_K),              // K
(1<<DOT_J)|(1<<DOT_P),              // T
(1<<DOT_M)|(1<<DOT_J)|(1<<DOT_P)|(1<<DOT_N)|(1<<DOT_K)|(1<<DOT_R),   // *
(1<<DOT_K)|(1<<DOT_R),              // Z
(1<<DOT_K)                         // M
};
#endif



// add the vfd key scan map here
code BYTE _pbVfdKeyScan[] = {
IR_NEXT, IR_PREV, IR_EJECT, IR_NONE, IR_NONE, IR_NONE, 
IR_FF,   IR_NONE, IR_FR,    IR_PLAY, IR_STOP, IR_PAUSE,
};

#endif  /* _SHM_CHK_C_ */

#endif
#endif

⌨️ 快捷键说明

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