; pcmcia includes

 STRUCTURE	CardHandle,0
	STRUCT	cah_CardNode,LN_SIZE
	APTR	cah_CardRemoved
	APTR	cah_CardInserted
	APTR	cah_CardStatus
	UBYTE	cah_CardFlags
	UBYTE	cah_
	LABEL	CardHandle_SIZEOF

cah_sizeof = cardhandle_sizeof

 STRUCTURE	DeviceTData,0
	ULONG	dtd_DTsize			;Size of card (bytes)
	ULONG	dtd_DTspeed			;Speed of card in nanoseconds
	UBYTE	dtd_DTtype			;Type of card
	UBYTE	dtd_DTflags			;other flags
	UBYTE	dtd_
	LABEL	DeviceTData_SIZEOF


CISTPL_DEVICE    = $01   ; device descriptor, common memory
CISTPL_INFO_V1   = $15   ; information
CISTPL_CONF_MAP  = $1A   ; Card Configuration map
CISTPL_CONFIG    = $1B   ; Card Configuration entry
CISTPL_MANUF_ID  = $20   ; manufacturer's ID
CISTPL_FUNC_ID   = $21   ; function of card

CISTPL_FUNCID_MULTI     = $00
CISTPL_FUNCID_MEMORY    = $01
CISTPL_FUNCID_SERIAL    = $02
CISTPL_FUNCID_PARALLEL  = $03
CISTPL_FUNCID_FIXED     = $04
CISTPL_FUNCID_VIDEO     = $05
CISTPL_FUNCID_NETWORK   = $06
CISTPL_FUNCID_AIMS      = $07
CISTPL_FUNCID_SCSI      = $08


DTTYPE_ETHER  = 1


 STRUCTURE	CardMemoryMap,0
	APTR	cmm_CommonMemory
	APTR	cmm_AttributeMemory
	APTR	cmm_IOMemory
	LABEL	CardMemoryMap_SIZEOF

* CardHandle.cah_CardFlags for OwnCard() function

	; The CARDB_RESETREMOVE flag means you want the machine to
	; perform a HARDWARE RESET if the card in the credit-card slot is
	; removed while you own the CardSemaphore.

	BITDEF	CARD,RESETREMOVE,0	;Hardware reset on card remove

	; The CARDB_IFAVAILABLE flag means you only want your CardHandle
	; structure enqueued IF the credit card can be owned immediately.

	BITDEF	CARD,IFAVAILABLE,1

	; The CARDB_DELAYOWNERSHIP flag means you never want a successful
	; return from OwnCard() even if the credit-card is available.  Rather
	; you will be notified of ownership via your cah_CardInserted
	; interrupt vector.

	BITDEF	CARD,DELAYOWNERSHIP,2

	; The CARDB_POSTSTATUS flag is new for card.resource V39 (check
	; VERSION in resource base before using).  It tells the resource
	; that you want your Status Change Interrupt (if provided) to
	; be called twice in a row.  See OwnCard() for details.
	;

	BITDEF	CARD,POSTSTATUS,3

* ReleaseCard() function flags

	; The CARDB_REMOVEHANDLE flag means you want to remove your
	; CardHandle structure from the list of CardHandle structures
	; whether or not you own the credit-card in the slot.

	BITDEF	CARD,REMOVEHANDLE,0

* ReadStatus() return flags

	BITDEF	CARD_STATUS,CCDET,6	; Credit CARD_STATUS detect (1 == detected)
	BITDEF	CARD_STATUS,BVD1,5	; Battery Voltage Detect 1
	BITDEF	CARD_STATUS,SC,5	; Credit-CARD_STATUS (internal) status change
	BITDEF	CARD_STATUS,BVD2,4	; Battery Voltage Detect 2
	BITDEF	CARD_STATUS,DA,4	; Digital audio
	BITDEF	CARD_STATUS,WR,3	; Write enable (1 == enabled)
	BITDEF	CARD_STATUS,BSY,2	; Credit CARD_STATUS Busy
	BITDEF	CARD_STATUS,IRQ,2	; Interrupt request

* CardProgramVoltage() defines

CARD_VOLTAGE_0V		EQU	0	; Set to default; maybe the same as 5V
CARD_VOLTAGE_5V		EQU	1
CARD_VOLTAGE_12V	EQU	2

* CardMiscControl() defines

	BITDEF	CARD,ENABLE_DIGAUDIO,1
	BITDEF	CARD,DISABLE_WP,3

* CardInterface() defines

CARD_INTERFACE_AMIGA_0	EQU	0

*
* Resource Vector Offsets
*

RES_RESERVED	EQU	0
RES_USERDEF	EQU	LIB_BASE-(RES_RESERVED*LIB_VECTSIZE)
RES_NONSTD	EQU	RES_USERDEF

RESINIT		MACRO	; [baseOffset ]
		IFC	'\1',''
COUNT_RES	SET	RES_USERDEF
		ENDC
		IFNC	'\1',''
COUNT_RES	SET	\1
		ENDC
		ENDM


RESDEF		MACRO	; library Function Symbol
\1		EQU	COUNT_RES
COUNT_RES	SET	COUNT_RES-LIB_VECTSIZE
		ENDM

	RESINIT
	RESDEF	_LVOOwnCard
	RESDEF	_LVOReleaseCard
	RESDEF	_LVOGetCardMap
	RESDEF	_LVOBeginCardAccess
	RESDEF	_LVOEndCardAccess
	RESDEF	_LVOReadCardStatus
	RESDEF	_LVOCardResetRemove
	RESDEF	_LVOCardMiscControl
	RESDEF	_LVOCardAccessSpeed
	RESDEF	_LVOCardProgramVoltage
	RESDEF	_LVOCardResetCard
	RESDEF	_LVOCopyTuple
	RESDEF	_LVODeviceTuple
	RESDEF	_LVOIfAmigaXIP
	RESDEF	_LVOCardForceChange
	RESDEF	_LVOCardChangeCount
	RESDEF	_LVOCardInterface

