1 /* $Id: controller.c,v 1.7 2001/05/29 10:53:44 lcs Exp $ */
4 ISA-PnP -- A Plug And Play ISA software layer for AmigaOS.
5 Copyright (C) 2001 Martin Blom <martin@blom.org>
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
17 You should have received a copy of the GNU Library General Public
18 License along with this library; if not, write to the
19 Free Software Foundation, Inc., 59 Temple Place - Suite 330, Cambridge,
24 #include <libraries/configvars.h>
25 #include <libraries/expansion.h>
27 #include <proto/expansion.h>
29 #include "controller.h"
30 #include "isapnp_private.h"
32 /******************************************************************************
33 *** Controller functions ******************************************************
34 ******************************************************************************/
37 ISAC_SetMasterInt( REG( d0
, BOOL on
),
38 REG( a6
, struct ISAPNPBase
* res
) )
40 bug("[ISAPNP] ISAC_SetMasterInt() is not implemented\n");
41 /*UWORD* reg2 = (UWORD*)( res->m_Base + 0x18002 );
55 ISAC_GetMasterInt( REG( a6
, struct ISAPNPBase
* res
) )
57 bug("[ISAPNP] ISAC_GetMasterInt() is not implemented\n");
58 /*UWORD* reg1 = (UWORD*)( res->m_Base + 0x18000 );
60 return ( ReadWord( reg1 ) & 1 ) != 0;*/
65 ISAC_SetWaitState( REG( d0
, BOOL on
),
66 REG( a6
, struct ISAPNPBase
* res
) )
68 bug("[ISAPNP] ISAC_SetWaitState() is not implemented\n");
70 UBYTE
* reg3
= (UBYTE
*) ( isa_Base
+ 0x18007 );
72 if( ( on
&& !WaitState() ) ||
73 ( !on
&& WaitState() ) )
82 ISAC_GetWaitState( REG( a6
, struct ISAPNPBase
* res
) )
84 bug("[ISAPNP] ISAC_GetWaitState() is not implemented\n");
85 /*UWORD* reg1 = (UWORD*)( res->m_Base + 0x18000 );
87 return ( ReadWord( reg1 ) & 2 ) != 0;*/
92 ISAC_GetInterruptStatus( REG( d0
, UBYTE interrupt
),
93 REG( a6
, struct ISAPNPBase
* res
) )
95 bug("[ISAPNP] ISAC_GetInterruptStatus() is not implemented\n");
96 /*UWORD* reg1 = (UWORD*)( res->m_Base + 0x18000 );
101 return ( ReadWord( reg1 ) & 4 ) != 0;
104 return ( ReadWord( reg1 ) & 8 ) != 0;
107 return ( ReadWord( reg1 ) & 16 ) != 0;
110 return ( ReadWord( reg1 ) & 32 ) != 0;
113 return ( ReadWord( reg1 ) & 64 ) != 0;
116 return ( ReadWord( reg1 ) & 128 ) != 0;
119 return ( ReadWord( reg1 ) & 256 ) != 0;
122 return ( ReadWord( reg1 ) & 512 ) != 0;
125 return ( ReadWord( reg1 ) & 1024 ) != 0;
128 return ( ReadWord( reg1 ) & 2048 ) != 0;
131 return ( ReadWord( reg1 ) & 4096 ) != 0;
139 ISAC_GetRegByte( REG( d0
, UWORD reg
),
140 REG( a6
, struct ISAPNPBase
* res
) )
147 ISAC_SetRegByte( REG( d0
, UWORD reg
),
148 REG( d1
, UBYTE value
),
149 REG( a6
, struct ISAPNPBase
* res
) )
156 ISAC_GetRegWord( REG( d0
, UWORD reg
),
157 REG( a6
, struct ISAPNPBase
* res
) )
164 ISAC_SetRegWord( REG( d0
, UWORD reg
),
165 REG( d1
, UWORD value
),
166 REG( a6
, struct ISAPNPBase
* res
) )
173 ISAC_GetRegLong( REG( d0
, UWORD reg
),
174 REG( a6
, struct ISAPNPBase
* res
) )
181 ISAC_SetRegLong( REG( d0
, UWORD reg
),
182 REG( d1
, ULONG value
),
183 REG( a6
, struct ISAPNPBase
* res
) )
190 ISAC_ReadByte( REG( d0
, ULONG address
),
191 REG( a6
, struct ISAPNPBase
* res
) )
193 return *(UBYTE
*)address
;
198 ISAC_WriteByte( REG( d0
, ULONG address
),
199 REG( d1
, UBYTE value
),
200 REG( a6
, struct ISAPNPBase
* res
) )
202 *(UBYTE
*)address
= value
;
207 ISAC_ReadWord( REG( d0
, ULONG address
),
208 REG( a6
, struct ISAPNPBase
* res
) )
210 return *(UWORD
*)address
;
215 ISAC_WriteWord( REG( d0
, ULONG address
),
216 REG( d1
, UWORD value
),
217 REG( a6
, struct ISAPNPBase
* res
) )
219 *(UWORD
*)address
= value
;
224 ISAC_ReadLong( REG( d0
, ULONG address
),
225 REG( a6
, struct ISAPNPBase
* res
) )
227 return *(ULONG
*)address
;
232 ISAC_WriteLong( REG( d0
, ULONG address
),
233 REG( d1
, ULONG value
),
234 REG( a6
, struct ISAPNPBase
* res
) )
236 *(ULONG
*)address
= value
;