?? eeprom.s
字號:
.module eeprom.c
.area text(rom, con, rel)
.dbfile E:\item\car\AT45DB041D\eeprom.c
.dbfunc e eeprom_write_byte _eeprom_write_byte fV
; ucData -> R18
; address -> R16,R17
.even
_eeprom_write_byte::
.dbline -1
.dbline 5
; #include <iom16v.h>
; #include <macros.h>
;
; void eeprom_write_byte(unsigned int address,unsigned char ucData)
; {
L2:
.dbline 8
; /* 等待上一次寫操作結(jié)束 */
; while(EECR & (1<<EEWE))
; ;
L3:
.dbline 7
sbic 0x1c,1
rjmp L2
X0:
.dbline 10
; /* 設(shè)置地址和數(shù)據(jù)寄存器 */
; EEAR = address;
out 0x1f,R17
out 0x1e,R16
.dbline 11
; EEDR = ucData;
out 0x1d,R18
.dbline 13
; /* 置位EEMWE */
; EECR |= (1<<EEMWE);
sbi 0x1c,2
.dbline 15
; /* 置位EEWE以啟動寫操作 */
; EECR |= (1<<EEWE);
sbi 0x1c,1
.dbline -2
L1:
.dbline 0 ; func end
ret
.dbsym r ucData 18 c
.dbsym r address 16 i
.dbend
; }
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -