1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/serial.h Wed Oct 31 12:16:39 2007 +0000
1.5 + * $Id: serial.h,v 1.1 2005-12-22 07:38:06 nkeynes Exp $
1.6 + * External interface to the dreamcast serial port, implemented by
1.9 + * Copyright (c) 2005 Nathan Keynes.
1.11 + * This program is free software; you can redistribute it and/or modify
1.12 + * it under the terms of the GNU General Public License as published by
1.13 + * the Free Software Foundation; either version 2 of the License, or
1.14 + * (at your option) any later version.
1.16 + * This program is distributed in the hope that it will be useful,
1.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.19 + * GNU General Public License for more details.
1.21 +#ifndef dream_serial_H
1.22 +#define dream_serial_H 1
1.24 +#include <stdint.h>
1.30 +#define SERIAL_8BIT 0x00
1.31 +#define SERIAL_7BIT 0x40
1.32 +#define SERIAL_PARITY_OFF 0x00
1.33 +#define SERIAL_PARITY_EVEN 0x20
1.34 +#define SERIAL_PARITY_ODD 0x30
1.35 +#define SERIAL_1STOPBIT 0x00
1.36 +#define SERIAL_2STOPBITS 0x08
1.38 +typedef struct serial_device {
1.39 + void (*set_line_speed)(uint32_t bps);
1.40 + void (*set_line_params)(int flags);
1.41 + void (*receive_data)(uint8_t value);
1.42 +} *serial_device_t;
1.44 +void serial_attach_device( serial_device_t dev );
1.45 +void serial_detach_device( );
1.47 +void serial_transmit_data( char *data, int length );
1.48 +void serial_transmit_break( void );