;* *
;* *
;* *
-;*(C) 2003 Ullrich von Bassewitz *
-;* Römerstrasse 52 *
-;* D-70794 Filderstadt *
-;*EMail: uz@cc65.org *
+;*(C) 2003-2006, Ullrich von Bassewitz *
+;* Römerstrasse 52 *
+;* D-70794 Filderstadt *
+;*EMail: uz@cc65.org *
;* *
;* *
;*This software is provided 'as-is', without any expressed or implied *
;------------------------------------------------------------------------------
-; Offsets into the driver header
+; The driver header
+
+.struct SER_HDR
+ ID .byte 3 ; Contains 0x73, 0x65, 0x72 ("ser")
+ VERSION .byte 1 ; Interface version
+ JUMPTAB .struct
+ INSTALL .word ; INSTALL routine
+ UNINSTALL .word ; UNINSTALL routine
+ OPEN .word ; OPEN routine
+ CLOSE .word ; CLOSE routine
+ GET .word ; GET routine
+ PUT .word ; PUT routine
+ STATUS .word ; STATUS routine
+ IOCTL .word ; IOCTL routine
+ IRQ .word ; IRQ routine
+ .endstruct
+.endstruct
-SER_HDR_ID = 0 ; Contains 0x73, 0x65, 0x72 ("ser")
-SER_HDR_VERSION = 3 ; Interface version
-SER_HDR_JUMPTAB = 4
-SER_HDR_INSTALL = SER_HDR_JUMPTAB+0 ; INSTALL routine
-SER_HDR_UNINSTALL = SER_HDR_JUMPTAB+2 ; UNINSTALL routine
-SER_HDR_PARAMS = SER_HDR_JUMPTAB+4 ; PARAMS routine
-SER_HDR_GET = SER_HDR_JUMPTAB+6 ; GET routine
-SER_HDR_PUT = SER_HDR_JUMPTAB+8 ; PUT routine
-SER_HDR_PAUSE = SER_HDR_JUMPTAB+10 ; PAUSE routine
-SER_HDR_UNPAUSE = SER_HDR_JUMPTAB+12 ; UNPAUSE routine
-SER_HDR_STATUS = SER_HDR_JUMPTAB+14 ; STATUS routine
+;------------------------------------------------------------------------------
+; The SER API version, stored SER_HDR::VERSION
-SER_HDR_JUMPCOUNT = 8 ; Number of jump vectors
+SER_API_VERSION = $00
;------------------------------------------------------------------------------
-; Offsets into the struct passed to ser_params
+; ser_params
-SER_PARAMS_BAUDRATE = 0 ; Baudrate
-SER_PARAMS_DATABITS = 1 ; Number of data bits
-SER_PARAMS_STOPBITS = 2 ; Number of stop bits
-SER_PARAMS_PARITY = 3 ; Parity setting
-SER_PARAMS_HANDSHAKE = 4 ; Type of handshake to use
+.struct SER_PARAMS
+ BAUDRATE .byte ; Baudrate
+ DATABITS .byte ; Number of data bits
+ STOPBITS .byte ; Number of stop bits
+ PARITY .byte ; Parity setting
+ HANDSHAKE .byte ; Type of handshake to use
+.endstruct
;------------------------------------------------------------------------------
; Serial parameters
SER_BAUD_1200 = $08
SER_BAUD_1800 = $09
SER_BAUD_2400 = $0A
-SER_BAUD_4800 = $0B
-SER_BAUD_9600 = $0C
-SER_BAUD_19200 = $0D
-SER_BAUD_38400 = $0E
-SER_BAUD_57600 = $0F
-SER_BAUD_115200 = $10
-SER_BAUD_230400 = $11
+SER_BAUD_3600 = $0B
+SER_BAUD_4800 = $0C
+SER_BAUD_7200 = $0D
+SER_BAUD_9600 = $0E
+SER_BAUD_19200 = $0F
+SER_BAUD_38400 = $10
+SER_BAUD_57600 = $11
+SER_BAUD_115200 = $12
+SER_BAUD_230400 = $13
+SER_BAUD_31250 = $14
+SER_BAUD_62500 = $15
; Data bit settings
SER_BITS_5 = $00
.global ser_install
.global ser_uninstall
- .global ser_params
+ .global ser_open
+ .global ser_close
.global ser_get
.global ser_put
- .global ser_pause
- .global ser_unpause
.global ser_status
-
-
+ .global ser_ioctl
+ .global ser_irq
;------------------------------------------------------------------------------
-; ASM functions
+; C callable functions
.global _ser_unload
.global _ser_install
.global _ser_uninstall
- .global _ser_params
+ .global _ser_open
+ .global _ser_close
.global _ser_get
.global _ser_put
- .global _ser_pause
- .global _ser_unpause
.global _ser_status
+ .global _ser_ioctl
-
+ .global _ser_clear_ptr