;03 3 in - "UART" status: bit 0 = rx, bit 1 = tx
;04 4 in - "UART" data register, no wait
;
+;------------------------ Virtual I2C interface --------------------------
+;05 5 out - Control Port: 1 = Start read operation
+; 2 = Start write operation
+;05 5 in - Status of last Transfer: 0 = ok, else fail
+;06 6 in/out - Number of bytes to transfer, including Slave address
+;07,08 7,8 in/out - Read/Write address low/high
+;
+;------------------------ Disk I/O ---------------------------------------
;0D,0E 13,14 in/out - Set address of Bios Controll Block
;0F 15 in/out - Disk select
;10,11 16,17 in/out - Track select
;16 22 in - Result of last read/write operation.
; 0x00 = ok, 0xff = error (--> Bad Sector)
;
+;
+;
+;------------------------ Wall Clock and Timers --------------------------
;40 64-71 in/out - Timer/Clock control.
;41-46
;
-;47-4C clock - Binary format: y, m, d, h, m, s
+;47-4D clock - BCD format: ss, mm, hh, DD, MM, YYl, YYh
+;
+;------------------------ Ports ------------------------------------------
+;80-87 in/out - Port-Expander PCF8574 (max. 8 Chips)
+;88-8F in/out - Port-Expander PCF8574A (not implemented yet!)
; ---------------------------------------------- Start of Code Segment
.dw utimeget
.dw utimeput
- .db CLOCKPORT,6 ;Clock format (bin): y, m, d, h, m, s
+ .db CLOCKPORT,7 ;Clock format (bcd): ss, mm, hh, DD, MM, YYl, YYh
.dw clockget
.dw clockput
.db DEBUGPORT,1
.dw dbg_stat
.dw dbg_ctrl
+
+#if I2C
+ .db I2CCTRL,1
+ .dw vi2c_stat_get
+ .dw vi2c_ctrl
+
+ .db I2CBLEN,3 ;
+ .dw vi2c_param_get
+ .dw vi2c_param_set
+
+ .db PORT,8
+ .dw pcf8574_in
+ .dw pcf8574_out
+#endif
+
.db 0,0 ; Stop mark
;---------------------------------------------------------------------
adiw z,4
rjmp vprw_loop
vprw_found:
- brtc PC+2
- adiw z,2
+ brtc PC+2 ;read or write?
+ adiw z,2 ;skip read function pointer
lpm _tmp0,z+
lpm _tmp1,z+
movw z,_tmp0
clr temp
lds temp2,rxcount
cpse temp2,_0
- rjmp uartgetc
+ ljmp uartgetc
ret
uartout:
lds temp2,txcount
cpi temp2,TXBUFSIZE
breq uartout_1
- rjmp uartputc
+ ljmp uartputc
uartout_1:
ret
dbgOut:
printnewline
printstring "Debug: "
- rcall printhex
+ lcall printhex
ret