Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Globals   Related Pages  

serial.h File Reference

Serial/RS232 port driver header. More...

Go to the source code of this file.

Defines

#define PORT1   0x3F8
 Serial port base address (for COM1).

#define PORT2   0x2F8
 Serial port base address (for COM2).

#define PORT3   0x3E8
 Serial port base address (for COM3).

#define PORT4   0x2E8
 Serial port base address (for COM4).

#define COM1   PORT1
 COM1 port address.

#define COM2   PORT2
 COM2 port address.

#define COM3   PORT3
 COM3 port address.

#define COM4   PORT4
 COM4 port address.

#define BPS_115200   0x01
 115,200 BPS.

#define BPS_56700   0x02
 56,700 BPS.

#define BPS_38400   0x03
 38,400 BPS.

#define BPS_19200   0x06
 19,200 BPS.

#define BPS_9600   0x0C
 9,600 BPS.

#define BPS_4800   0x18
 4,800 BPS.

#define BPS_2400   0x30
 2,400 BPS.

#define RS232_BUF_DIM   256
 RS232 buffer size.


Functions

void rs232_handler (word port)
 RS232 common handler routine.
Parameters:
port  The serial port.


void init_rs232 (word port, byte divisor)
 Initialize the RS232 interface with a bps rate.
Parameters:
port  The serial port to initialize.
divisor  The divisor to set the bps rate (see serial.h).


void close_rs232 (word port)
 Close a specific RS232 port.
Parameters:
port  The port to close.


byte rs232_getchar ()
 Get a character from the current serial port.
Returns:
The ASCII code of the character read.


void rs232_putchar (byte c)
 Write a character to the current serial port.
Parameters:
c  The ASCII code of the character to write.


void rs232_chat ()


Detailed Description

Serial/RS232 port driver header.

Author:
Andrea Righi <drizzt@inwind.it>
Date:
Last update: 2003-11-08
Note:
Copyright (©) 2003 Andrea Righi

Definition in file serial.h.


Define Documentation

#define BPS_115200   0x01
 

115,200 BPS.

Definition at line 31 of file serial.h.

#define BPS_19200   0x06
 

19,200 BPS.

Definition at line 34 of file serial.h.

#define BPS_2400   0x30
 

2,400 BPS.

Definition at line 37 of file serial.h.

#define BPS_38400   0x03
 

38,400 BPS.

Definition at line 33 of file serial.h.

#define BPS_4800   0x18
 

4,800 BPS.

Definition at line 36 of file serial.h.

#define BPS_56700   0x02
 

56,700 BPS.

Definition at line 32 of file serial.h.

#define BPS_9600   0x0C
 

9,600 BPS.

Definition at line 35 of file serial.h.

#define COM1   PORT1
 

COM1 port address.

Definition at line 21 of file serial.h.

#define COM2   PORT2
 

COM2 port address.

Definition at line 23 of file serial.h.

#define COM3   PORT3
 

COM3 port address.

Definition at line 25 of file serial.h.

#define COM4   PORT4
 

COM4 port address.

Definition at line 27 of file serial.h.

#define PORT1   0x3F8
 

Serial port base address (for COM1).

Definition at line 12 of file serial.h.

#define PORT2   0x2F8
 

Serial port base address (for COM2).

Definition at line 14 of file serial.h.

#define PORT3   0x3E8
 

Serial port base address (for COM3).

Definition at line 16 of file serial.h.

#define PORT4   0x2E8
 

Serial port base address (for COM4).

Definition at line 18 of file serial.h.

#define RS232_BUF_DIM   256
 

RS232 buffer size.

Definition at line 40 of file serial.h.


Function Documentation

void rs232_chat  
 


Generated on Fri Feb 20 15:32:20 2004 for Minirighi by doxygen1.2.18