Home |
RTTarget-32 Programming Manual Function RTPCInit Function RTPCSetConfigRegister System Management BIOS (SMBIOS) Advanced Programmable Interrupt Controller (APIC) |
Function RTPCInitFunction RTPCInit initializes the PCMCIA driver and determines the type of controller installed. It must be called exactly once before the driver can be used: int RTPCInit(int IRQ, int IOBase, int Sockets, RTPCCardEventHandler Handler); ParametersIRQSpecifies the IRQ used by the PCMCIA controller to signal insertion/removal events. A value typically used on many PCs is 5. If IRQ is set to -1, the driver will install no interrupt handler and operate in polling mode. The application must call RTPCPollCardStatus periodically in polling mode. IOBaseDefines the first of two I/O port addresses used by the PCMCIA controller. If 0 is specified, the default value 3E0h is assumed. SocketsSpecifies the number of sockets supported by the controller. This parameter may be 1, 2, or 4. HandlerThe address of a callback handler function which the PCMCIA driver will call whenever a card status change event is detected. The handler must be defined as: void RTTAPI RTPCCardEventHandler(int Socket, BYTE Event); When an event is detected, the handler will be called with parameter Socket containing the zero-based number of the socket that has caused the event. Parameter Event can have any of the following bits set, possibly several simultaneously:
Unless operating in polling mode, the handler is called from an interrupt handler with interrupts enabled. The handler may not call any PCMCIA driver functions. Instead, it should record the event or signal a thread to enable the event to be processed later. Applications that do not need to process events may set the Handler parameter to NULL. return valueIf this function succeeds, a value identifying the PCMCIA controller found is returned. If the return value is 0, no controller was detected.
|