]> git.sur5r.net Git - cc65/blobdiff - include/serial.h
Stefan Haubenthal fixed a few typos.
[cc65] / include / serial.h
index 8ccb5ac381c8e22fc2f1d1b267d993086aaf829d..671ec193ff12da997a42d8f2276f4be2250404b5 100644 (file)
 #define SER_BAUD_1200                  0x08
 #define SER_BAUD_1800           0x09
 #define SER_BAUD_2400                  0x0A
-#define SER_BAUD_4800                  0x0B
-#define SER_BAUD_9600                  0x0C
-#define SER_BAUD_19200                 0x0D
-#define SER_BAUD_38400                 0x0E
-#define SER_BAUD_57600                 0x0F
-#define SER_BAUD_115200                0x10
-#define SER_BAUD_230400                0x11
+#define SER_BAUD_3600           0x0B
+#define SER_BAUD_4800                  0x0C
+#define SER_BAUD_7200           0x0D
+#define SER_BAUD_9600                  0x0E
+#define SER_BAUD_19200                 0x0F
+#define SER_BAUD_38400                 0x10
+#define SER_BAUD_57600                 0x11
+#define SER_BAUD_115200                0x12
+#define SER_BAUD_230400                0x13
+#define SER_BAUD_31250         0x14
+#define SER_BAUD_62500         0x15
 
 /* Data bit settings */
 #define SER_BITS_5                     0x00
@@ -86,7 +90,9 @@
 #define SER_HS_HW               0x01    /* Hardware (RTS/CTS) handshake */
 #define SER_HS_SW               0x02    /* Software handshake */
 
-/* Bit masks to mask out things from the status returned by rs232_status */
+/* Bit masks to mask out things from the status returned by ser_status.
+ * These are 6551 specific and must be mapped by drivers for other chips.
+ */
 #define SER_STATUS_PE                  0x01    /* Parity error */
 #define SER_STATUS_FE                  0x02    /* Framing error */
 #define SER_STATUS_OE           0x04   /* Overrun error */
 #define SER_ERR_NO_DATA                0x06    /* Nothing to read */
 #define SER_ERR_OVERFLOW               0x07    /* No room in send buffer */
 #define SER_ERR_INIT_FAILED     0x08           /* Initialization failed */
+#define SER_ERR_INV_IOCTL       0x09    /* IOCTL not supported */
 
 /* Struct containing parameters for the serial port */
 struct ser_params {
@@ -134,8 +141,11 @@ unsigned char __fastcall__ ser_uninstall (void);
  * 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
@@ -148,15 +158,12 @@ unsigned char __fastcall__ ser_put (char b);
  * 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. */
 
+unsigned char __fastcall__ ser_ioctl (unsigned char code, void* data);
+/* Driver specific entry. */
+
 
 
 /* End of serial.h */