Search
lxdream.org :: lxdream/src/serial.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/serial.h
changeset 19:9da7a8e38f9d
next561:533f6b478071
author nkeynes
date Tue Oct 16 12:36:59 2007 +0000 (16 years ago)
permissions -rw-r--r--
last change Downgrade the errors to warnings - they're more whinges than anything fatal
view annotate diff log raw
     1 /**
     2  * $Id: serial.h,v 1.1 2005-12-22 07:38:06 nkeynes Exp $
     3  * External interface to the dreamcast serial port, implemented by 
     4  * sh4/scif.c
     5  *
     6  * Copyright (c) 2005 Nathan Keynes.
     7  *
     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.
    12  *
    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.
    17  */
    18 #ifndef dream_serial_H
    19 #define dream_serial_H 1
    21 #include <stdint.h>
    23 #ifdef __cplusplus
    24 extern "C" {
    25 #endif
    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);
    39 } *serial_device_t;
    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 );
    47 #ifdef __cplusplus
    48 }
    49 #endif
    51 #endif
.