?? ex_support.s
字號:
.module EX_Support.c
.area data(ram, con, rel)
_p::
.blkb 2
.area idata
.word 0
.area data(ram, con, rel)
.dbfile D:\實例17_I2C搶答器_主機程序\EX_Support.c
.dbsym e p _p pc
_g_wSystemTimer::
.blkb 2
.area idata
.word 0
.area data(ram, con, rel)
.dbfile D:\實例17_I2C搶答器_主機程序\EX_Support.c
.dbsym e g_wSystemTimer _g_wSystemTimer i
_DoTime::
.blkb 1
.area idata
.byte 1
.area data(ram, con, rel)
.dbfile D:\實例17_I2C搶答器_主機程序\EX_Support.c
.dbsym e DoTime _DoTime c
_ShowTime::
.blkb 1
.area idata
.byte 0
.area data(ram, con, rel)
.dbfile D:\實例17_I2C搶答器_主機程序\EX_Support.c
.dbsym e ShowTime _ShowTime c
_TWIProcess::
.blkb 1
.area idata
.byte 1
.area data(ram, con, rel)
.dbfile D:\實例17_I2C搶答器_主機程序\EX_Support.c
.dbsym e TWIProcess _TWIProcess c
.area lit(rom, con, rel)
_DisTab::
.byte 252,96
.byte 218,242
.byte 'f,182
.byte 190,224
.byte 254,246
.byte 238,62
.byte 156,'z
.byte 158,142
.byte 206,28
.byte 'n,124
.byte 10,16
.byte 2,0
.dbsym e DisTab _DisTab A[24:24]kc
.area text(rom, con, rel)
.dbfile D:\實例17_I2C搶答器_主機程序\EX_Support.c
.dbfunc e Delay_ms _Delay_ms fV
; n -> R20
; Time -> R16,R17
.even
_Delay_ms::
rcall push_gset1
.dbline -1
.dbline 136
; /***********************************************************
; * 函數庫說明:底層硬件初始化驅動函數庫 *
; * 版本: *
; * 作者: *
; * 創建日期: *
; * -------------------------------------------------------- *
; * [硬件說明] *
; * 處理器: *
; * 系統時鐘: *
; * -------------------------------------------------------- *
; * [支 持 庫] *
; * 支持庫名稱:HD_Support.h *
; * 需要版本: ----- *
; * 支持庫說明:底層硬件初始化聲明庫 *
; * *
; * 支持庫名稱:EX_Support.h *
; * 需要版本: ----- *
; * 支持庫說明:底層硬件初始化驅動聲明庫 *
; * *
; * 支持庫名稱:PF_Config.h *
; * 需要版本: ----- *
; * 支持庫說明:硬件平臺配置聲明庫 *
; * -------------------------------------------------------- *
; * [版本更新] *
; * 修改: *
; * 修改日期: *
; * 版本: *
; * -------------------------------------------------------- *
; * [版本歷史] *
; * -------------------------------------------------------- *
; * [使用說明] *
; ***********************************************************/
;
; /********************
; * 頭 文 件 配 置 區 *
; ********************/
; # include "PF_Config.h"
; # include "HD_Support.h"
; # include "EX_Support.h"
;
;
; /********************
; * 系 統 宏 定 義 *
; ********************/
;
; /*------------------*
; * 常 數 宏 定 義 *
; *------------------*/
;
; #define SSend 0x08 //啟動位已發送
; #define RSSend 0x10 //復啟動位已發送
; #define SLAWSendACK 0x18 //SLA+W已發送,收到ACK
; #define SLAWSendNAK 0x20 //SLA+W已發送,收到NAK
; #define SLARSendACK 0x40 //SLA+R已發送,收到ACK
; #define SLARSendNAK 0x48 //SLA+R已發送,收到ACK
; #define TDataACK 0x28 //DATA已發送,收到ACK
; #define TDataNAK 0x30 //DATA已發送,收到NAK
; #define RDataACK 0x50 //DATA已收到,ACK已發送
; #define RDataNAK 0x58 //DATA已收到,NAK已發送
; #define SLAWRecACK 0x60 //自己的從機地址被選中,ACK已返回
; #define SRDataACK 0x80 //作為從機被地址被選中,數據已接收,ACK已返回
;
; #define TWIInProcess 0x00 //EEPROM操作中
; #define TWIProcessOver 0x01 //EEPROM操作成功完成
; #define TWIProcessNAK 0x11 //EEPROM操作中無法接收到主機應答
; #define TWIProcessERR 0x21 //EEPROM操作遇到未知錯誤而終止
;
; #define ExtPortNum 3
; #define TimeStampMax 1000
;
; /*------------------*
; * 動 作 宏 定 義 *
; *------------------*/
;
; #define SS_Low PORTB &= ~(1<<2)
; #define SS_High PORTB |= (1<<2)
;
; #define PINE PortBuffer[0]
; #define PORTF PortBuffer[1]
; #define PORTG PortBuffer[2]
;
; #define KeyPin PINE
; #define ScanPort PORTG
; #define SegPort PORTF
;
; /********************
; * 模塊結構體定義區 *
; ********************/
;
; /********************
; * 函 數 聲 明 區 *
; ********************/
; void System_INIT(void);
; void Insert_Timer0_OVF_ISR_Code(void);
;
; /********************
; * 模塊函數聲明區 *
; ********************/
; static void Driver_INIT(void);
;
; /********************
; * 模塊變量聲明區 *
; ********************/
;
; unsigned char* p = NULL;
;
; /********************
; * 全局變量聲明區 *
; ********************/
; uint16 g_wSystemTimer = 0;
; BOOL DoTime = TRUE;
; BOOL ShowTime = FALSE;
;
; unsigned char PortBuffer[3];
; unsigned char LEDDisBuffer[8];
; unsigned char TWIProcess = TWIProcessOver;
; unsigned char RecArr[6];
; unsigned int g_wSystemTimer;
;
; const unsigned char DisTab[]=
; {
; 0xFC,0x60,0xDA,0xF2,0x66, //0,1,2,3,4
; 0xB6,0xBE,0xE0,0xFE,0xF6, //5,6,7,8,9
; 0xEE,0x3E,0x9C,0x7A,0x9E, //A,b,C,d,E
; 0x8E,0xCE,0x1C,0x6E,0x7C, //F,P,L,H,U
; 0x0A,0x10,0x02,0x00 //r,_,-,SP
; };
;
; /***********************************************************
; * 函數說明:毫秒級延時函數 *
; * 輸入: 無 *
; * 輸出: 無 *
; * 調用函數:無 *
; ***********************************************************/
; void Delay_ms(unsigned int Time)
; {
.dbline 137
; unsigned char n=0;
clr R20
rjmp L3
L2:
.dbline 139
; while(Time>0)
; {
.dbline 140
; for (n=1;n<187;n++)
ldi R20,1
rjmp L8
L5:
.dbline 141
.dbline 142
nop
.dbline 143
L6:
.dbline 140
inc R20
L8:
.dbline 140
cpi R20,187
brlo L5
.dbline 144
subi R16,1
sbci R17,0
.dbline 145
L3:
.dbline 138
cpi R16,0
cpc R16,R17
brne L2
X0:
.dbline -2
L1:
rcall pop_gset1
.dbline 0 ; func end
ret
.dbsym r n 20 c
.dbsym r Time 16 i
.dbend
.dbfunc e Beep _Beep fV
; Time -> R20,R21
.even
_Beep::
rcall push_gset1
movw R20,R16
.dbline -1
.dbline 155
; {
; NOP();
; }
; Time--;
; }
; }
;
; /***********************************************************
; * 函數說明:蜂鳴器鳴叫函數 *
; * 輸入: 無 *
; * 輸出: 無 *
; * 調用函數:無 *
; ***********************************************************/
; void Beep (unsigned int Time)
; {
.dbline 156
; PORTB |= 0x01;
sbi 0x5,0
.dbline 157
; Delay_ms(Time);
movw R16,R20
rcall _Delay_ms
.dbline 158
; PORTB &= 0xFE;
in R24,0x5
andi R24,254
out 0x5,R24
.dbline -2
L9:
rcall pop_gset1
.dbline 0 ; func end
ret
.dbsym r Time 20 i
.dbend
.dbfunc s Driver_INIT _Driver_INIT fV
.even
_Driver_INIT:
.dbline -1
.dbline 168
; }
;
; /***********************************************************
; * 函數說明:軟件驅動初始化函數 *
; * 輸入: 無 *
; * 輸出: 無 *
; * 調用函數:無 *
; ***********************************************************/
; static void Driver_INIT(void)
; {
.dbline -2
L10:
.dbline 0 ; func end
ret
.dbend
.dbfunc e System_INIT _System_INIT fV
.even
_System_INIT::
.dbline -1
.dbline 179
; //*在這里插入你的各類軟件驅動初始化代碼*//
; }
;
; /***********************************************************
; * 函數說明:系統初始化函數 *
; * 輸入: 無 *
; * 輸出: 無 *
; * 調用函數:Device_INIT() Driver_INIT() *
; ***********************************************************/
; void System_INIT(void)
; {
.dbline 180
; CLI();
cli
.dbline 182
;
; Device_INIT();
rcall _Device_INIT
.dbline 183
; Driver_INIT();
rcall _Driver_INIT
.dbline 187
;
; //*在這里插入你的系統環境變量初始化代碼*//
;
; SEI();
sei
.dbline -2
L11:
.dbline 0 ; func end
ret
.dbend
.dbfunc e Insert_Timer0_OVF_ISR_Code _Insert_Timer0_OVF_ISR_Code fV
.even
_Insert_Timer0_OVF_ISR_Code::
.dbline -1
.dbline 197
; }
;
; /***********************************************************
; * 函數說明:定時器0中斷處理程序代碼插入函數 *
; * 輸入: 無 *
; * 輸出: 無 *
; * 調用函數:無 *
; ***********************************************************/
; void Insert_Timer0_OVF_ISR_Code(void)
; {
.dbline 198
; TCNT0 = 0x83; //重載定時器
ldi R24,131
out 0x26,R24
.dbline 200
;
; g_wSystemTimer++; //時標產生,以1秒為周期循環時標
lds R24,_g_wSystemTimer
lds R25,_g_wSystemTimer+1
adiw R24,1
sts _g_wSystemTimer+1,R25
sts _g_wSystemTimer,R24
.dbline 202
;
; if (g_wSystemTimer >= TimeStampMax)
cpi R24,232
ldi R30,3
cpc R25,R30
brlo L13
.dbline 203
; g_wSystemTimer = 0;
clr R2
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -