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
-SER_HDR_IOCTL = SER_HDR_JUMPTAB+16 ; IOCTL routine
+SER_HDR_OPEN = SER_HDR_JUMPTAB+4 ; OPEN routine
+SER_HDR_CLOSE = SER_HDR_JUMPTAB+6 ; CLOSE routine
+SER_HDR_GET = SER_HDR_JUMPTAB+8 ; GET routine
+SER_HDR_PUT = SER_HDR_JUMPTAB+10 ; PUT routine
+SER_HDR_STATUS = SER_HDR_JUMPTAB+12 ; STATUS routine
+SER_HDR_IOCTL = SER_HDR_JUMPTAB+14 ; IOCTL routine
-SER_HDR_JUMPCOUNT = 9 ; Number of jump vectors
+SER_HDR_JUMPCOUNT = 8 ; Number of jump vectors
;------------------------------------------------------------------------------
; Offsets into the struct passed to ser_params
SER_BAUD_57600 = $11
SER_BAUD_115200 = $12
SER_BAUD_230400 = $13
-
+
; Data bit settings
SER_BITS_5 = $00
SER_BITS_6 = $01
.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_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
* Note: This call does not free allocated memory.
*/
-unsigned char __fastcall__ ser_params (const struct ser_params* params);
-/* Set the port parameters. This will also enable the port. */
+unsigned char __fastcall__ ser_open (const struct ser_params* params);
+/* "Open" the port by setting the port parameters and enable interrupts. */
+
+unsigned char __fastcall__ ser_close (void);
+/* "Close" the port. Clear buffers and and disable interrupts. */
unsigned char __fastcall__ ser_get (char* b);
/* Get a character from the serial port. If no characters are available, the
* SER_ERR_OVERFLOW if there is no space left in the transmit buffer.
*/
-unsigned char __fastcall__ ser_pause (void);
-/* Assert flow control and disable interrupts. */
-
-unsigned char __fastcall__ ser_unpause (void);
-/* Re-enable interrupts and release flow control */
-
unsigned char __fastcall__ ser_status (unsigned char* status);
/* Return the serial port status. */
C_OBJS = ser_load.o
S_OBJS = ser-kernel.o \
+ ser_close.o \
ser_get.o \
- ser_params.o \
- ser_pause.o \
+ ser_open.o \
ser_put.o \
ser_status.o \
- ser_unload.o \
- ser_unpause.o
+ ser_unload.o
#--------------------------------------------------------------------------
ser_vectors:
ser_install: jmp return0
ser_uninstall: jmp return0
-ser_params: jmp return0
+ser_open: jmp return0
+ser_close: jmp return0
ser_get: jmp return0
ser_put: jmp return0
-ser_pause: jmp return0
-ser_unpause: jmp return0
ser_status: jmp return0
ser_ioctl: jmp return0
--- /dev/null
+;
+; Ullrich von Bassewitz, 2003-08-22
+;
+; unsigned char __fastcall__ ser_close (void);
+; /* "Close" the port. Clear buffers and and disable interrupts. */
+
+
+ .include "ser-kernel.inc"
+
+ _ser_close = ser_close
+
+
--- /dev/null
+;
+; Ullrich von Bassewitz, 2003-08-22
+;
+; unsigned char __fastcall__ ser_open (const struct ser_params* params);
+; /* "Open" the port by setting the port parameters and enable interrupts. */
+
+
+
+ .importzp ptr1
+
+ .include "ser-kernel.inc"
+
+
+
+.proc _ser_open
+
+ sta ptr1
+ stx ptr1+1 ; Save pointer to params
+ jmp ser_open ; Call the driver
+
+.endproc
+
+
+
+++ /dev/null
-;
-; Ullrich von Bassewitz, 2003-04-18
-;
-; unsigned char __fastcall__ ser_pause (void);
-; /* Assert flow control and disable interrupts. */
-
-
-
- .include "ser-kernel.inc"
-
- _ser_pause = ser_pause
-
+++ /dev/null
-;
-; Ullrich von Bassewitz, 2003-04-18
-;
-; unsigned char __fastcall__ ser_unpause (void);
-; /* Re-enable interrupts and release flow control */
-
-
- .include "ser-kernel.inc"
-
- _ser_unpause = ser_unpause
-