Home |
The ISO 9660 File System Structure The exFAT File System Structure RTFiles-32 in Embedded Applications PCMCIA SRAM Card Driver |
PCMCIA SRAM Card DriverThe SRAM driver implements a floppy disk like drive compatible with Microsoft Windows on a PCMCIA SRAM card. Up to two cards are supported in PCMCIA sockets 0 and 1. SRAM cards are memory-mapped into the target's address space using 4k aligned windows of at least 4k size. The addresses to be used for this mapping are determined by regions named SRAMCard and SRAMCard1 for PCMCIA sockets 0 and 1, respectively. You must include such region declarations in your configuration file to use this driver. Example (also including the declarations needed for the PCMCIA controller): Region PCMCIA D4000h 4k Device NoAccess Region CARDBUS D5000h 8k Device NoAccess Region SRAMCard DA000h 4k Device NoAccess Region SRAMCard1 DC000h 4k Device NoAccess Note that PCMCIA SRAM cards do not contain a CIS (PCMCIA Configuration Information Space). Thus, the PCMCIA driver is not able to read any information from the card (e.g., vendor, card type, etc.). RTTarget-32 demo programs PCCard and PCCardMT assume that an SRAM card has been inserted whenever a card without a card function identification is found. This driver directly interfaces with the PCMCIA driver of RTTarget-32 and can therefore only be ported to other operating systems with modifications. An example device list which uses the SRAM driver is: static RTFDrvSRAMData SRAM0 = {0}; static RTFDrvSRAMData SRAM1 = {0}; RTFDevice RTFDeviceList[] = { { RTF_DEVICE_FLOPPY,0, RTF_32_BIT_IO | RTF_DEVICE_NO_MEDIA, &RTFDrvSRAM, &SRAM0 }, { RTF_DEVICE_FLOPPY,1, RTF_32_BIT_IO | RTF_DEVICE_NO_MEDIA | RTF_DEVICE_NEW_LOCK, &RTFDrvSRAM, &SRAM1 }, { 0 } } Entries in the RTFiles-32 device list must be filled as follows for the SRAM driver. RTFDevice.DeviceTypeRTFDevice.DeviceType must be set to RTF_DEVICE_FLOPPY for this driver. RTFDevice.DeviceNumberThe device number must be 0 for PCMCIA socket 0 and 1 for PCMCIA socket 1. RTFDevice.DeviceFlagsThis driver accepts flag RTF_32_BIT_IO or RTF_16_BIT_IO to instruct the driver to transfer data to/from the SRAM card using 16- or 32-bit instructions (rep movsw or rep movsd). By default, 8-bit (rep movsb) is used. Most PCI-PCMCIA controllers will support 32-bit access. Device independent flags documented in section Device List are also supported. RTFDevice.DriverThis field must point to RTFDrvSRAM. RTFDevice.DriverDataThis field must point to a unique structure of type RTFDrvSRAMData: typedef struct { UINT Sectors; // card's capacity in 512 byte sectors ... } RTFDrvSRAMData; If Sectors is zero, the driver will attempt to determine the card's capacity automatically by reading the boot sector, or, for unformatted cards, through a memory test.
|