2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
5 Desc: CardAccessSpeed() function.
9 #include "card_intern.h"
11 AROS_LH2(ULONG
, CardAccessSpeed
,
12 AROS_LHA(struct CardHandle
*, handle
, A1
),
13 AROS_LHA(ULONG
, nanoseconds
, D0
),
14 struct CardResource
*, CardResource
, 9, Card
)
18 volatile struct GayleIO
*gio
= (struct GayleIO
*)GAYLE_BASE
;
21 CARDDEBUG(bug("CardAccessSpeed(%p,%d)\n", handle
, nanoseconds
));
28 if (nanoseconds
> 720)
31 if (nanoseconds
> 250) {
32 speed
= GAYLE_CFG_720NS
;
34 } else if (nanoseconds
> 150) {
35 speed
= GAYLE_CFG_250NS
;
37 } else if (nanoseconds
> 100) {
38 speed
= GAYLE_CFG_150NS
;
41 speed
= GAYLE_CFG_100NS
;
46 v
= gio
->config
& ~GAYLE_CFG_SPEED
;