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

📄 spt6605.inc

📁 cid file. the prgram is used to get caller id
💻 INC
字号:
//============================================================================*/
//                         Register address definitions                       */
//============================================================================*/
//-------------------------------*/
//         Port A, B, C, D       */
//-------------------------------*/
.const  P_IOA_Data      = 0x7000;        //R/W, portA data
.const  P_IOA_Buf       = 0x7001;        //R, port A output latch
.const  P_IOA_Dir       = 0x7002;        //R/W, portA direction, 0/1 = I/O
.const  P_IOA_PullR     = 0x7003;        //R/W, portA pull-highs & pull-lows
.const  P_IOA_Latch     = 0x7004;        //R, latch IO for wakeup

//IOA0~6 for keyboard input

.const  B_ExtDet            = 0x0080;    //input for parallel phone detect

//---------------------------------
.const  P_IOB_Data      = 0x7005;        //R/W, portB data
.const  P_IOB_Buf       = 0x7006;        //R, portB output latch
.const  P_IOB_Dir       = 0x7007;        //R/W, portB direction, 0/1 = I/O

.const  B_MicMute           = 0x0010;    //high active
.const  B_HFO               = 0x0020;    //high active
.const  B_Mute              = 0x0040;    //high active
.const  B_DP                = 0x0080;    //low active

//---------------------------------
.const  P_IOC_Data      = 0x7008;        //R/W, portC data
.const  P_IOC_Buf       = 0x7009;        //R, portC output latch
.const  P_IOC_Dir       = 0x700A;        //R/W, portC direction

.const  B_Ioc0              = 0x0001;    //input for CID wakeup
.const  B_HookDet           = 0x0002;    //input
.const  B_Option            = 0x0004;    //low active
.const  B_SpkMute           = 0x0008;    //low active
//IOC4 shared pad with RDRC
//IOC5 shared pad with RDIN
//IOC6 not used
//IOC7 shared with BatDet

//---------------------------------
.const  P_IOD_Data      = 0x700B;        //R/W, portD data
.const  P_IOD_Buf       = 0x700C;        //R, portD output latch
.const  P_IOD_Dir       = 0x700D;        //R/W, portD direction, 0/1 = I/O

.const  B_NewLed            = 0x0001;    //low active
.const  B_PwrCtrl           = 0x0002;    //low active
.const  B_PwrDet            = 0x0004;    //input
.const  B_CASIndicator      = 0x0008;

//IOD5,6,7 used as LCD signal
//---------------------------------
.const  P_IOCD_Ctrl     = 0x700E;

//-------------------------------*/
//      Interrupt & Wake-Up      */
//-------------------------------*/
.const  P_Int           = 0x7010; // write 0/1 - disable/enable interrupt
                                  // read  0/1 - interrupt is disabled/enabled
.const  P_IntClr        = 0x7011; // write 1 - clear happened interrupt flag
                                  // read  1 - interrupt is happened
.const  P_WakeUp        = 0x7012; // write 0/1 - disable/enable wake-up
                                  // read  0/1 - wake-up is disabled/enabled
.const  P_WakeUpClr     = 0x7013; // write 1 - clear happened wake-up flag
                                  // read  1 - wake-up is happened
.const  B_Irq0          = 0x0001;        // vector = FFF8
.const  B_RiInt         = 0x0001;

.const  B_Irq1          = 0x0002;        // vector = FFF9
.const  B_IoaInt        = 0x0002;

.const  B_Irq2          = 0x0004;        // vector = FFFA
.const  B_TmrAInt       = 0x0004;
.const  B_Irq3          = 0x0008;        // vector = FFFB
.const  B_TmrBInt       = 0x0008;
.const  B_Irq4          = 0x0010;        // vector = FFFC
.const  B_T32KHzInt     = 0x0010;
.const  B_8KHzInt       = 0x0010;
.const  B_Irq5          = 0x0020;        // vector = FFFD
.const  B_T2KHzInt      = 0x0020;
.const  B_1KHzInt       = 0x0020;
.const  B_512HzInt      = 0x0020;
.const  B_Irq6          = 0x0040;        // vector = FFFE
.const  B_T128HzInt     = 0x0040;
.const  B_T8HzInt       = 0x0080;
.const  B_2HzInt        = 0x0080;
.const  B_Ioc0Int       = 0x0100;
.const  B_Ioc1Int       = 0x0200;
.const  B_LineInt       = 0x0400;

//-------------------------------*/
.const  P_IoaWakeUp     = 0x7014; // R/W, b7~b0=1 to enable IOA7~0 wake-up

//-------------------------------*/
//        System Clock           */
//-------------------------------*/
.const  P_SystemClock   = 0x7015;
.const   B_FoscDivBy1      = 0x0000;
.const   B_FoscDivBy2      = 0x0001;
.const   B_FoscDivBy4      = 0x0002;
.const   B_FoscDivBy8      = 0x0003;
.const   B_Sleep           = 0x0007;
.const   B_NormalCpuClock  = B_FoscDivBy4;
.const   B_10M             = 0x0080;

.const  P_WatchdogClr   = 0x7016; // period = 2sec
                                  // write 16-bit value to reset watch dog

//-------------------------------*/
//          Time Base            */
//-------------------------------*/
.const  P_TimeBaseSet   = 0x7018;
// Time Base, generated by 32768Hz, is a combination of frequency selection
// for timers and interrupt.
.const  B_Enable32768   = 0x8000;
.const  B_Strong32768   = 0x4000; // After powering on, set 32768 at strong mode
                                  // for 2 sec. Afterwards, change to weak mode
.const  B_1Hz           = 0x0000;
.const  B_2Hz           = 0x0001;
.const  B_4Hz           = 0x0002;
.const  B_8Hz           = 0x0003;
.const  B_16Hz          = 0x0000;
.const  B_32Hz          = 0x0004;
.const  B_64Hz          = 0x0008;
.const  B_128Hz         = 0x000C;
.const  B_256Hz         = 0x0000;
.const  B_512Hz         = 0x0010;
.const  B_1KHz          = 0x0020;
.const  B_2KHz          = 0x0030;
.const  B_4KHz          = 0x0000;
.const  B_8KHz          = 0x0040;
.const  B_16KHz         = 0x0080;
.const  B_32KHz         = 0x00C0;

//-------------------------------*/
//          Timer A & B          */
//-------------------------------*/
// Writing a value of N to P_TimerA_Data or P_TimerB_Data and selecting an
// appropriate clock sources, the timer will count up from N, N+1, N+2, ....
// ,FFFE, FFFF. After the timer reaches 'FFFF', and INT signal is generated
// and is sent to INT controller for processing. At the same time, N will be
// reloaded into timer and count up again.

.const  P_Tmr_Ctrl    = 0x701A;
.const  P_TmrA_Data   = 0x701B; // R/W, up-counter
.const  P_TmrA_Load   = 0x701C; // W, write any value to load data to timer A

.const  P_TmrB_Data   = 0x701E; // R/W, up-counter
.const  P_TmrB_Load   = 0x701F; // W, write any value to load data to timer B

//-------------------------------*/
//      Low Voltage Detect       */
//-------------------------------*/
.const   P_BatDet          = 0x7021;

.const   B_EnBatDet        = 0x0080;
.const   B_BatDet          = 0x0020;

//(0,0,0) Battery detect threshold is 2.38V @3V(default)
//(0,0,1) Battery detect threshold is 2.46V @3V
//(0,1,0) Battery detect threshold is 2.58V @3V
//(0,1,1) Battery detect threshold is 2.66V @3V
//(1,0,0) Battery detect threshold is 2.78V @3V
//(1,0,1) Battery detect threshold is 2.88V @3V
//(1,1,0) Battery detect threshold is 2.96V @3V
//(1,1,1) Battery detect threshold is 3.06V @3V

//-------------------------------*/
//      DTMF & Tone Generator    */
//-------------------------------*/
.const  P_DtmfTone      = 0x7022;
.const  B_Tone0En       = 0x0004;
.const  B_DacEn         = 0x0100;
.const  B_Dac2Sel       = 0x0200;
.const  B_DisableBias   = 0x0400;

.const  P_Ch0Envelope   = 0x7023;

//-------------------------------*/
//          A/D & AGC            */
//-------------------------------*/
.const  P_AgcCtrl       = 0x7025;
.const  B_AdcQuickCharge = 0x0080;

.const  P_AdcCtrl       = 0x7026;
.const  P_PgaInSelect   = 0x702C;

.const  P_Adc           = 0x7027; // (R) 10-bits ADC (b15~b6)

.const  P_RiDet         = 0x7028; // (R/W)
.const  B_RiDet         = 0x0040;
.const  B_EnRiDet       = 0x0080;

//-------------------------------*/
//            L C D              */
//-------------------------------*/
.const  P_LcdCtrl       = 0x7020;

.const  B_Duty          = 0x8000; // 0-1/8,1-1/16
.const  B_LcdEn         = 0x0080; // enable LCD
.const  B_LcdAllOn      = 0x0020;
.const  B_LcdAllOff     = 0x0010;

//-------------------------------*/
.const  B_Com0          = 0x0001;
.const  B_Com1          = 0x0002;
.const  B_Com2          = 0x0004;
.const  B_Com3          = 0x0008;
.const  B_Com4          = 0x0010;
.const  B_Com5          = 0x0020;
.const  B_Com6          = 0x0040;
.const  B_Com7          = 0x0080;
.const  B_Com8                   = 0x0100;
.const  B_Com9                   = 0x0200
.const  B_Com10                  = 0x0400
.const  B_Com11                  = 0x0800
.const  B_Com12                  = 0x1000
.const  B_Com13                  = 0x2000
.const  B_Com14                  = 0x4000
.const  B_Com15                  = 0x8000;

.const  P_Seg0          = 0x7100;
.const  P_Seg1          = 0x7101;
.const  P_Seg2          = 0x7102;
.const  P_Seg3          = 0x7103;
.const  P_Seg4          = 0x7104;
.const  P_Seg5          = 0x7105;
.const  P_Seg6          = 0x7106;
.const  P_Seg7          = 0x7107;
.const  P_Seg8          = 0x7108;
.const  P_Seg9          = 0x7109;
.const  P_Seg10         = 0x710A;
.const  P_Seg11         = 0x710B;
.const  P_Seg12         = 0x710C;
.const  P_Seg13         = 0x710D;
.const  P_Seg14         = 0x710E;
.const  P_Seg15         = 0x710F;
.const  P_Seg16         = 0x7110;
.const  P_Seg17         = 0x7111;
.const  P_Seg18         = 0x7112;
.const  P_Seg19         = 0x7113;
.const  P_Seg20         = 0x7114;
.const  P_Seg21         = 0x7115;
.const  P_Seg22         = 0x7116;
.const  P_Seg23         = 0x7117;
.const  P_Seg24         = 0x7118;
.const  P_Seg25         = 0x7119;
.const  P_Seg26         = 0x711A;
.const  P_Seg27         = 0x711B;
.const  P_Seg28          = 0x711C
.const  P_Seg29          = 0x711D
.const  P_Seg30          = 0x711E
.const  P_Seg31          = 0x711F
.const  P_Seg32          = 0x7120
.const  P_Seg33          = 0x7121
.const  P_Seg34          = 0x7122
.const  P_Seg35          = 0x7123
.const  P_Seg36          = 0x7124
.const  P_Seg37          = 0x7125
.const  P_Seg38          = 0x7126
.const  P_Seg39          = 0x7127

//-----------------------------------------------------------------------------//
//Line Control
//Procedure : 1. Enable Line det.
//            2. Latch line status
//            3. Enable wakeup/int
//            4. Set wakeup/int sources
//            5. Sleep....
//-----------------------------------------------------------------------------//
.const  P_LineDetCtrl   = 0x702E; //(R/W)

.const  B_CMPOut        = 0x0001; //
.const  B_EnLineIntWp   = 0x0040; //
.const  B_EnLineDet     = 0x0080; //

.const  P_LatchLine     = 0x702F; //

//-----------------------------------------------------------------------------//
.const  P_KeyScanCtrl   = 0x703B;
.const  B_AKSEN       = 0x0080;   //0/1 - disable/enable auto key scan function
.const  B_HIZ1        = 0x0002;   //0/1 - disable/enable normal key scan mode of P_Seg15~8
.const  B_HIZ0        = 0x0001;   //0/1 - disable/enable normal key scan mode of P_Seg7~0

.const  P_KeyScanMode   = 0x703A; //b0~b8 select IOAx as wakeup source
.const  P_KeyScanPort   = 0x703C; //maually scan key

⌨️ 快捷键说明

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