source: rtems/c/src/lib/libcpu/sh/sh7045/include/io_types.h @ 1c98d28

4.104.114.84.95
Last change on this file since 1c98d28 was 4a238002, checked in by Joel Sherrill <joel.sherrill@…>, on 11/18/99 at 21:22:58

Patch from "John M. Mills" <jmills@…> with subsequent cleanup from
Ralf Corsepius <corsepiu@…> that adds initial Hitachi SH-2
support to RTEMS. Ralf's comments are:

Changes:
------

  1. SH-Port:
  • Many files renamed.
  • CONSOLE_DEVNAME and MHZ defines removed from libcpu.
  • console.c moved to libbsp/sh/shared, build in libbsp/sh/<BSP>/console applying VPATH.
  • CONSOLE_DEVNAME made BSP-specific, replacement is defined in bsp.h
  • MHZ define replaced with HZ (extendent resolution) in custom/*.cfg
  • -DHZ=HZ used in bspstart.c, only
  • Makefile variable HZ used in bsp-dependent directories only.
  1. SH1-Port
  • clock-driver rewritten to provide better resolution for odd CPU frequencies. This driver is only partially tested on hardware, ie. sightly experimental, but I don't expect severe problems with it.
  • Polling SCI-driver added. This driver is experimental and completly untested yet. Therefore it is not yet used for the console (/dev/console is still pointing to /dev/null, cf. gensh1/bsp.h).
  • minor changes to the timer driver
  • SH1 specific delay()/CPU_delay() now is implemented as a function
  1. SH2-Port
  • Merged
  • IMO, the code is still in its infancy. Therefore I have interspersed comments (FIXME) it for items which I think John should look after.
  • sci and console drivers partially rewritten and extended (John, I hope you don't mind).
  • Copyright notices are not yet adapted
  • Property mode set to 100644
File size: 2.5 KB
Line 
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 *
19 *      John M. Mills (jmills@tga.com)
20 *      TGA Technologies, Inc.
21 *  100 Pinnacle Way, Suite 140
22 *      Norcross, GA 30071 U.S.A.
23 *
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.
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
40typedef enum {SCI0, SCI1} portNo;
41typedef enum {eight, seven} dataBits;
42typedef enum {one, two} stopBits;
43typedef enum {even, odd} parity;
44
45typedef struct {
46        portNo          line;
47        int                             speed_ix;
48        dataBits        dBits;
49        int                             parEn; 
50        parity          par;
51        int                             mulPro;
52        stopBits        sBits;
53} sci_setup_t;
54
55typedef 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
68typedef 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
81typedef struct {
82  unsigned char n ;
83  unsigned char N ;
84} sci_bitrate_t;
85
86#endif /* _sh_io_types_h */
87
Note: See TracBrowser for help on using the repository browser.