Changes between Version 2 and Version 3 of sdc_driver
- Timestamp:
- Mar 28, 2015, 2:41:08 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
sdc_driver
v2 v3 7 7 This component is a single channel, block oriented, external mass storage peripheral, implemented on a SD card. 8 8 9 The ''sdc_driver'' uses the lower level ''spi_driver''to access the SD card.9 The SDC driver uses the lower level SPI driver to access the SD card. 10 10 11 The ''sdc_driver'' is called by the generic ''ioc_driver''when the USE_IOC_SPI flag is set in the hard_config.h file.11 It is called by the generic FAT handler when the USE_IOC_SPI flag is set in the hard_config.h file. 12 12 13 13 The SEG_IOC_BASE address must be defined in the hard_config.h file. 14 14 15 In this implementation, the SDC peripheral is acting as a target (no DMA capability) : the '''_sdc_ read()''' and '''_sdc_write()''' are blocking until the transfer is fully completed, and does not use any interrupt to signal completion.15 In this implementation, the SDC peripheral is acting as a target (no DMA capability) : the '''_sdc_access()''' function is blocking until the transfer is fully completed, and does not use any interrupt to signal completion, whatever the requested mode. 16 16 17 WARNING : The '''_sdc_write()''' function is not implemented yet17 WARNING : Write transfers (from memory to SD card) are not supported yet. 18 18 19 19 == __Access functions__ == 20 20 21 21 === unsigned int '''_sdc_init'''() === … … 23 23 Returns 0 if success, >0 if failure 24 24 25 === unsigned int '''_sdc_ read'''( unsigned int mode, unsigned int lba, paddr_tbuffer, unsigned int count ) ===25 === unsigned int '''_sdc_access'''( unsigned int use_irq , unsigned int to_mem , unsigned int lba, unsigned long long buffer, unsigned int count ) === 26 26 Transfer data from the SD card to a memory buffer. 27 * mode : BOOT / KERNEL / USER (Not used in this implementation) 28 * lba : first block index on the SD card 29 * buffer : physical base address of the memory buffer 30 * count : number of blocks to be transfered. 27 * '''use_irq''' : unused, access is always synchronous. 28 * '''to_mem''' : must be non zero as write transfer are not supported yet. 29 * '''lba''' : first block index on the SD card. 30 * '''buffer''' : physical base address of the memory buffer 31 * '''count''' : number of blocks to be transfered. 31 32 Returns 0 if success, > 0 if error. 32 33 === unsigned int '''_sdc_write'''( unsigned int mode, unsigned int lba, paddr_t buffer, unsigned int count ) ===34 Transfer data from a memory buffer to the SD card.35 * mode : BOOT / KERNEL / USER (Not used in this implementation)36 * lba : first block index on the SD card.37 * buffer : physical base address of the memory buffer38 * count : number of blocks to be transfered.39 Returns 0 if success, > 0 if error.40 WARNING: The _sdc_write() is not implemented yet.41 42 === unsigned int '''_sdc_get_status'''() ===43 This function should not be called for this implementation of the SDC driver (No DMA).44 45 === unsigned int '''_sdc_get_block_size'''() ===46 Returns the block size (bytes).47 33 48 34