1 ;****************************************************************************
5 ;* Serial communication API *
9 ;*(C) 2003-2006, Ullrich von Bassewitz *
11 ;* D-70794 Filderstadt *
12 ;*EMail: uz@cc65.org *
15 ;*This software is provided 'as-is', without any expressed or implied *
16 ;*warranty. In no event will the authors be held liable for any damages *
17 ;*arising from the use of this software. *
19 ;*Permission is granted to anyone to use this software for any purpose, *
20 ;*including commercial applications, and to alter it and redistribute it *
21 ;*freely, subject to the following restrictions: *
23 ;*1. The origin of this software must not be misrepresented; you must not *
24 ;* claim that you wrote the original software. If you use this software *
25 ;* in a product, an acknowledgment in the product documentation would be *
26 ;* appreciated but is not required. *
27 ;*2. Altered source versions must be plainly marked as such, and must not *
28 ;* be misrepresented as being the original software. *
29 ;*3. This notice may not be removed or altered from any source *
32 ;****************************************************************************
36 ;------------------------------------------------------------------------------
40 ID .byte 3 ; Contains 0x73, 0x65, 0x72 ("ser")
41 VERSION .byte 1 ; Interface version
42 LIBREF .addr ; Library reference
44 SER_INSTALL .addr ; SER_INSTALL routine
45 SER_UNINSTALL .addr ; SER_UNINSTALL routine
46 SER_OPEN .addr ; SER_OPEN routine
47 SER_CLOSE .addr ; SER_CLOSE routine
48 SER_GET .addr ; SER_GET routine
49 SER_PUT .addr ; SER_PUT routine
50 SER_STATUS .addr ; SER_STATUS routine
51 SER_IOCTL .addr ; SER_IOCTL routine
52 SER_IRQ .addr ; SER_IRQ routine
57 ;------------------------------------------------------------------------------
58 ; The SER API version, stored SER_HDR::VERSION
62 ;------------------------------------------------------------------------------
66 BAUDRATE .byte ; Baudrate
67 DATABITS .byte ; Number of data bits
68 STOPBITS .byte ; Number of stop bits
69 PARITY .byte ; Parity setting
70 HANDSHAKE .byte ; Type of handshake to use
73 ;------------------------------------------------------------------------------
119 SER_HS_NONE = $00 ; No handshake
120 SER_HS_HW = $01 ; Hardware (RTS/CTS) handshake
121 SER_HS_SW = $02 ; Software handshake
123 ; Bit masks to mask out things from the status returned by ser_status
124 SER_STATUS_PE = $01 ; Parity error
125 SER_STATUS_FE = $02 ; Framing error
126 SER_STATUS_OE = $04 ; Overrun error
127 SER_STATUS_DCD = $20 ; NOT data carrier detect
128 SER_STATUS_DSR = $40 ; NOT data set ready
130 ;------------------------------------------------------------------------------
133 .global _ser_drv ; Pointer to driver
135 ;------------------------------------------------------------------------------
136 ; Driver entry points
139 .global ser_uninstall
148 ;------------------------------------------------------------------------------
149 ; C callable functions
151 .global _ser_load_driver
154 .global _ser_uninstall
162 .global _ser_clear_ptr