Search
lxdream.org :: lxdream/src/serial.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/serial.h
changeset 19:9da7a8e38f9d
next561:533f6b478071
author nkeynes
date Thu Nov 22 11:10:15 2007 +0000 (16 years ago)
permissions -rw-r--r--
last change Re-add "Load Binary" menu item (misplaced in GUI rewrite)
Prevent running with no code loaded
file annotate diff log raw
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/serial.h Thu Nov 22 11:10:15 2007 +0000
1.3 @@ -0,0 +1,51 @@
1.4 +/**
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.7 + * sh4/scif.c
1.8 + *
1.9 + * Copyright (c) 2005 Nathan Keynes.
1.10 + *
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.15 + *
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.20 + */
1.21 +#ifndef dream_serial_H
1.22 +#define dream_serial_H 1
1.23 +
1.24 +#include <stdint.h>
1.25 +
1.26 +#ifdef __cplusplus
1.27 +extern "C" {
1.28 +#endif
1.29 +
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.37 +
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.43 +
1.44 +void serial_attach_device( serial_device_t dev );
1.45 +void serial_detach_device( );
1.46 +
1.47 +void serial_transmit_data( char *data, int length );
1.48 +void serial_transmit_break( void );
1.49 +
1.50 +#ifdef __cplusplus
1.51 +}
1.52 +#endif
1.53 +
1.54 +#endif
.