Allow card.resource to be built with the right name again (by using the
[AROS.git] / arch / m68k-amiga / card / cardprogramvoltage.c
blob4d078ad15fb493d9c980a3daa34588b5416ec34c
1 /*
2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: CardProgramVoltage() function.
6 Lang: english
7 */
9 #include "card_intern.h"
11 AROS_LH2(LONG, CardProgramVoltage,
12 AROS_LHA(struct CardHandle*, handle, A1),
13 AROS_LHA(ULONG, voltage, D0),
14 struct CardResource*, CardResource, 10, Card)
16 AROS_LIBFUNC_INIT
18 volatile struct GayleIO *gio = (struct GayleIO*)GAYLE_BASE;
19 UBYTE v;
21 CARDDEBUG(bug("CardProgramVoltage(%p,%d)\n", handle, voltage));
23 if (!ISMINE)
24 return 0;
26 if (voltage != GAYLE_CFG_0V && voltage != GAYLE_CFG_5V)
27 return -1; /* Don't want 12V at this point.. */
29 Disable();
30 v = gio->config & ~GAYLE_CFG_VOLTAGE;
31 v |= voltage;
32 gio->config = v;
33 Enable();
35 return 1;
37 AROS_LIBFUNC_EXIT