?? uart.s
字號:
.module uart.c
.area text(rom, con, rel)
.dbfile F:\job\stk500\AVRMEG~1\bldSTK500\uart.c
.dbfunc e putChar _putChar fV
; sentData -> R16
.even
_putChar::
.dbline -1
.dbline 22
; /****************************************Copyright (c)**************************************************
; **
; ** 開 發 部
; **
; ** 文 件 名: uart.c
; ** 最后修改日期: 2005-7-9 20:36
; ** 描 述: ATmega16L的操作函數
; ** 版 本: V1.0
; ** 主 控 芯 片:M16 晶振頻率:7.3728MHZ,
; **********************************************************************************************************/
; #include <iom16v.h>
; #include <macros.h>
; #include "define.h"
; #include "function.h"
; #include "extern.h"
;
; /**********************************************************************
; functionName:putChar(uint8 sentData)
; description:通過串口發送數據sentData
; **********************************************************************/
; void putChar(uint08 sentData)
; {
L2:
.dbline 23
L3:
.dbline 23
; while(!(UCSRA&(1<<UDRE)));
sbis 0xb,5
rjmp L2
.dbline 24
; UDR=sentData;
out 0xc,R16
.dbline -2
L1:
.dbline 0 ; func end
ret
.dbsym r sentData 16 c
.dbend
.dbfunc e getChar _getChar fc
.even
_getChar::
.dbline -1
.dbline 32
; }
;
; /**********************************************************************
; functionName:putChars(uint08 *sentData)
; description:通過串口接受數據
; **********************************************************************/
; uint08 getChar(void)
; {
xjmp L7
L6:
.dbline 34
; while(!(UCSRA&BIT(RXC)))
; {
.dbline 35
; if(!flag)
lds R2,_flag
tst R2
brne L9
.dbline 36
; if(TCNT1 < 20)
in R24,0x2c
in R25,0x2d
cpi R24,20
ldi R30,0
cpc R25,R30
brsh L11
.dbline 37
; asm("jmp 0x000000\n");
jmp 0x000000
L11:
L9:
.dbline 38
L7:
.dbline 33
sbis 0xb,7
rjmp L6
.dbline 38
; };
.dbline 39
; return(UDR);
in R16,0xc
.dbline -2
L5:
.dbline 0 ; func end
ret
.dbend
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -