Main Page   Modules   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

/projects/cubeos/src_current/drivers/hardware/RG.c

Go to the documentation of this file.
00001 /*  src_experimental/drivers/hardware/RG.c
00002    CubeOS Version 0.4.90 experimental
00003    Copyright (C) 1999,2000 Holger Kenn
00004 
00005    CubeOS is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or any later version.
00009 
00010    CubeOS is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015  */
00016 #include <cubeos.h>
00017 
00018 
00019 /* this is the init function for the RoboGuard hardware. */
00020 
00021 int RG_init ()
00022 {
00023 #ifdef RG_BASE
00024         if ((RG_BASE) != 0) {
00025                 unsigned short v;
00026                 writeshort (SIM_CSBAR3, RG_BASE >> 8);
00027                 writeshort (SIM_CSOR3, 0x747e);         /* ASYNC,H+L,W only,DS,1 wait, 
00028                                                            S+U SP */
00029                 /* 0111 0100 0111 1110 */
00030                 /* 7    4    7    e */
00031                 v = readshort (SIM_CSPAR0);
00032                 v |= 0x300;
00033                 v &= 0xfeff;
00034                 writeshort (SIM_CSPAR0, v);     /* enables CS3 as 8 bit port */
00035 
00036                 return 0;
00037         } else {
00038                 return -1;
00039         }
00040 #else
00041         return -1;
00042 #endif
00043 }

Generated on Thu Feb 20 15:38:43 2003 for cubeOS by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002