1.1.8.4.10 DRV_SFDP_Read Function
1.1.8.4.10 C
bool DRV_SFDP_Read( const DRV_HANDLE handle, void *rx_data, uint32_t rx_data_length, uint32_t address );1.1.8.4.10 Summary
Reads n bytes of data from the specified start address of Flash memory.
1.1.8.4.10 Description
This function schedules a blocking operation for reading requested number of data bytes from the Flash memory. The read instruction and parameters are determined from SFDP discovery.
1.1.8.4.10 Precondition
The DRV_SFDP_Open() routine must have been called for the specified SFDP driver instance.
1.1.8.4.10 Parameters
| Parameters | Description |
|---|---|
| handle | A valid open-instance handle, returned from the driver's open routine |
| *rx_data | Buffer pointer into which the data read from the SFDP Flash memory will be placed |
| rx_data_length | Total number of bytes to be read |
| address | Read memory start address from where the data should be read |
1.1.8.4.10 Returns
True - If number of bytes requested are read from Flash memory.
False - If read command itself fails.
1.1.8.4.10 Example
#define BUFFER_SIZE 1024 #define MEM_ADDRESS 0x0 DRV_HANDLE handle; // Returned from DRV_SFDP_Open uint8_t CACHE_ALIGN readBuffer[BUFFER_SIZE]; if (DRV_SFDP_Read(handle, (void *)&readBuffer, BUFFER_SIZE, MEM_ADDRESS) == false) { // Error handling here } // Wait for read to be completed while(DRV_SFDP_TransferStatusGet(handle) == DRV_SFDP_TRANSFER_BUSY);
1.1.8.4.10 Remarks
None.
