All Forums
 Microsoft Windows CE
 CE Flash, CF and PCMCIA
 Simulate re-insertion of PCMCIA/CF card?
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

akidder

1519 Posts

Posted - 12 Aug 2003 :  14:37:29  Show Profile  Email Poster
Q. Is it possible to simulate a removal-insertion of a PCMCIA or CF card?

Yes. See this response below.



The rest of this message is a bit obsolete, but we leave it here for reference....
While there are a couple solutions available, ADS doesn't currently have a hook in its CE drivers to simulate re-insertion of a PCMCIA or CF card. Most applications need such a feature to "insert" a card after installing drivers; for production applications, ADS can build special drivers into the CE build you are using. Contact us if you want to know the best solution for your application.

Background

The CF and PCMCIA slots detect insertion and removal of cards with two Card Detect pins. The card shorts these pins to ground when the card is inserted. At that time, the operating system powers up the bus, resets the card and reads the tuples (card information) from its Attribute memory space.

Solutions

1. You can reset the card by directly turning off power to the bus using the CE CF bus drivers, but the operating system software won't know that the card was reset. Do this only if you are certain that the reset won't put the card in a state that the software driver doesn't recognize. Generally, this technique is not recommended.

2. A second method is to control the card detect lines, simulating removal of the card. While this is possible, it is more complex than is necessary.

3. A third technique to simulate an removal/insertion cycle is to have the software drivers power-cycle and reset the card, then restart the software drivers. ADS does not currently have such a driver, but if your application requires it, the PCMCIA/CF drivers can be modified to support this feature. Contact ADS Sales if your application requires this feature.

tranker

1 Posts

Posted - 24 Jan 2004 :  09:05:54  Show Profile  Email Poster
#WM_DEVICECHANGE

Another solution is to send the WM_DEVICECHANGE message yourself from within your application.

DEV_BROADCAST_PORT msg;
msg.dbcp_devicetype = DBT_DEVTYP_PORT;
msg.dbcp_reserved = 0;
msg.dbcp_size = sizeof(DEV_BROADCAST_PORT);

::SendMessage(hWNd, WM_DEVICECHANGE, DBT_DEVICEARRIVAL, (LPARAM)&msg);
Go to Top of Page

t0671dl

27 Posts

Posted - 24 Jan 2004 :  09:30:47  Show Profile  Email Poster
Very nice solution. Thanks
Go to Top of Page
  Topic  
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.02 seconds. Snitz Forums 2000