3 * External interface to the dreamcast serial port, implemented by
6 * Copyright (c) 2005 Nathan Keynes.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 #ifndef lxdream_serial_H
19 #define lxdream_serial_H 1
27 #define SERIAL_8BIT 0x00
28 #define SERIAL_7BIT 0x40
29 #define SERIAL_PARITY_OFF 0x00
30 #define SERIAL_PARITY_EVEN 0x20
31 #define SERIAL_PARITY_ODD 0x30
32 #define SERIAL_1STOPBIT 0x00
33 #define SERIAL_2STOPBITS 0x08
35 typedef struct serial_device {
36 void (*set_line_speed)(uint32_t bps);
37 void (*set_line_params)(int flags);
38 void (*receive_data)(uint8_t value);
41 void serial_attach_device( serial_device_t dev );
42 void serial_detach_device( );
44 void serial_transmit_data( char *data, int length );
45 void serial_transmit_break( void );
51 #endif /* !lxdream_serial_H */
.