X-Git-Url: http://cloudbase.mooo.com/gitweb/avrcpm.git/blobdiff_plain/989795411ee623d1811073698620c97c467acc86..e8384f88b1a073f47591b9ca13b73da12a7c59a8:/avr/virt_ports.asm?ds=sidebyside diff --git a/avr/virt_ports.asm b/avr/virt_ports.asm index e832d08..660f4e7 100644 --- a/avr/virt_ports.asm +++ b/avr/virt_ports.asm @@ -25,12 +25,14 @@ ; Port Direction Function ;hex dez ;------------------------------------------------------------------------- -;00 0 in - Con status. +;00 0 in - Con status. (deprecated) ; Returns 0xFF if the UART has a byte, 0 otherwise. ;01 1 in/out - Console input, aka UDR. / Console Output ;02 2 out - Console Output (deprecated) -;03 3 in - "UART" status: bit 0 = rx, bit 1 = tx -;04 4 in - "UART" data register, no wait +;03 3 in - "UART" status: bit 0 = rx (UARTRXRDY) +; bit 1 = tx (UARTTXRDY) +;03 3 out - "UART" control (tbd) +;04 4 in/out - "UART" data register, no wait ; ;------------------------ Virtual I2C interface -------------------------- ;05 5 out - Control Port: 1 = Start read operation @@ -87,18 +89,22 @@ .cseg vport_tbl: - .db 00,1 ;Port 0, length 1 + .db 00,1 ;Port 0, length, 1 deprecated .dw conStatus ; in .dw dbgOut ; out - .db 01,1 - .dw uartgetc - .dw uartputc - .db 02,1 ;Port 2 (old console output) - .dw uartgetc ; filler - .dw uartputc ; deprecated - .db 03,1 + + .db UARTDR,1 ;Port UARTDR, length 1 + .dw uartgetc ; in + .dw uartputc ; out + +; .db 02,1 ;Port 2 (old console output) +; .dw uartgetc ; filler +; .dw uartputc ; deprecated + + .db UARTCSR,1 .dw uartstat .dw vport_out_dummy + .db 04,1 .dw uartin .dw uartout @@ -248,15 +254,17 @@ vprw_exit: vport_out_dummy: ret +;--------------------------------------------------------------------- + uartstat: clr temp lds temp2,rxcount cpse temp2,_0 - sbr temp,0x01 + sbr temp,UARTRXRDY lds temp2,txcount cpi temp2,TXBUFSIZE breq uartst_1 - sbr temp,0x02 + sbr temp,UARTTXRDY uartst_1: ret