[4a238002] | 1 | /************************************************************************ |
---|
| 2 | * |
---|
| 3 | * Data types and constants for Hitachi SH704X on-chip peripherals |
---|
| 4 | * |
---|
| 5 | * Author: John M.Mills (jmills@tga.com) |
---|
| 6 | * |
---|
| 7 | * COPYRIGHT (c) 1999, TGA Technologies, Norcross, GA, USA |
---|
| 8 | * |
---|
| 9 | * This program is distributed in the hope that it will be useful, |
---|
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
---|
| 12 | * |
---|
| 13 | * This file may be distributed as part of the RTEMS software item. |
---|
| 14 | * |
---|
| 15 | * The license and distribution terms for this file may be |
---|
| 16 | * found in the file LICENSE in this distribution or at |
---|
| 17 | * http://www.OARcorp.com/rtems/license.html. |
---|
| 18 | * |
---|
[8b91282] | 19 | * John M. Mills (jmills@tga.com) |
---|
| 20 | * TGA Technologies, Inc. |
---|
| 21 | * 100 Pinnacle Way, Suite 140 |
---|
| 22 | * Norcross, GA 30071 U.S.A. |
---|
[4a238002] | 23 | * |
---|
[8b91282] | 24 | * This modified file may be copied and distributed in accordance |
---|
| 25 | * the above-referenced license. It is provided for critique and |
---|
| 26 | * developmental purposes without any warranty nor representation |
---|
| 27 | * by the authors or by TGA Technologies. |
---|
[4a238002] | 28 | * |
---|
| 29 | * $Id$ |
---|
| 30 | * |
---|
| 31 | * |
---|
| 32 | ************************************************************************/ |
---|
| 33 | |
---|
| 34 | #ifndef _sh_io_types_h |
---|
| 35 | #define _sh_io_types_h |
---|
| 36 | |
---|
| 37 | #include <rtems/score/iosh7045.h> |
---|
| 38 | #include <termios.h> |
---|
| 39 | |
---|
| 40 | typedef enum {SCI0, SCI1} portNo; |
---|
| 41 | typedef enum {eight, seven} dataBits; |
---|
| 42 | typedef enum {one, two} stopBits; |
---|
| 43 | typedef enum {even, odd} parity; |
---|
| 44 | |
---|
| 45 | typedef struct { |
---|
[8b91282] | 46 | portNo line; |
---|
| 47 | int speed_ix; |
---|
| 48 | dataBits dBits; |
---|
| 49 | int parEn; |
---|
| 50 | parity par; |
---|
| 51 | int mulPro; |
---|
| 52 | stopBits sBits; |
---|
[4a238002] | 53 | } sci_setup_t; |
---|
| 54 | |
---|
| 55 | typedef union{ |
---|
| 56 | unsigned char Reg; /* By Register */ |
---|
| 57 | struct { /* By Field */ |
---|
| 58 | unsigned char Sync :1; /* Async/Sync */ |
---|
| 59 | unsigned char DBts :1; /* Char.Length */ |
---|
| 60 | unsigned char ParEn :1; /* Parity En.*/ |
---|
| 61 | unsigned char Odd :1; /* Even/Odd */ |
---|
| 62 | unsigned char SBts :1; /* No.Stop Bits */ |
---|
| 63 | unsigned char MulP :1; /* Multi-Proc. */ |
---|
| 64 | unsigned char Dvsr :2; /* Clock Sel. */ |
---|
| 65 | } Fld; |
---|
| 66 | } sci_smr_t; |
---|
| 67 | |
---|
| 68 | typedef union { |
---|
| 69 | unsigned char Reg; /* By Register */ |
---|
| 70 | struct { /* By Field */ |
---|
| 71 | unsigned char TIE :1; /* Tx.Int.En. */ |
---|
| 72 | unsigned char RIE :1; /* Rx.Int.En. */ |
---|
| 73 | unsigned char TE :1; /* Tx.En. */ |
---|
| 74 | unsigned char RE :1; /* Rx.En. */ |
---|
| 75 | unsigned char MPIE:1; /* Mult.Pro.Int.En. */ |
---|
| 76 | unsigned char TEIE:1; /* Tx.End Int.En. */ |
---|
| 77 | unsigned char CkSrc :2; /* Clock Src. */ |
---|
| 78 | } Fld; |
---|
| 79 | } sci_scr_t; |
---|
| 80 | |
---|
| 81 | typedef struct { |
---|
| 82 | unsigned char n ; |
---|
| 83 | unsigned char N ; |
---|
| 84 | } sci_bitrate_t; |
---|
| 85 | |
---|
| 86 | #endif /* _sh_io_types_h */ |
---|
| 87 | |
---|