SPI Flash Driver complaint with FAT-FS System. More...


Go to the source code of this file.
Functions | |
| DSTATUS | flash_initialize () |
| DRESULT | flash_read_sectors (unsigned char *pData, int sectorNum, int sectorCount) |
| DRESULT | flash_write_sectors (unsigned char *pData, int sectorNum, int sectorCount) |
| DRESULT | flash_ioctl (BYTE ctrl, void *buff) |
| void | flash_write_permanent_id (char *id_64bytes) |
| void | flash_read_permanent_id (char *id_64bytes) |
| void | flash_chip_erase (void) |
| uint32_t | flash_get_page_count (void) |
| uint32_t | flash_get_page_size (void) |
| bool | flash_supports_metadata (void) |
| uint32_t | flash_get_page_write_count (uint32_t page_number) |
Detailed Description
SPI Flash Driver complaint with FAT-FS System.
Function Documentation
| void flash_chip_erase | ( | void | ) |
This will ERASE the entire chip, including the meta-data!! This can take several seconds to perform the chip erase...
| uint32_t flash_get_page_count | ( | void | ) |
Flash memory metadata functions If the flash memory contains additional space for each page, then each time a page is written, we also write its write-counter value. You can then retrieve the page write count values by the page number.
| uint32_t flash_get_page_size | ( | void | ) |
| uint32_t flash_get_page_write_count | ( | uint32_t | page_number | ) |
- Warning
- DO NOT USE THIS FUNCTION WITHOUT THE SPI SEMAPHORE!!!
| DSTATUS flash_initialize | ( | ) |
Initializes the Flash Memory
Gets control information from this flash memory drive, such as sector count, sector size
- Parameters
-
ctrl The type of information to get buff The pointer to save the requested information to
| void flash_read_permanent_id | ( | char * | id_64bytes | ) |
Reads the permanent ID programmed into the SPI flash
- Warning
- DO NOT USE THIS FUNCTION WITHOUT THE SPI SEMAPHORE!!!
| DRESULT flash_read_sectors | ( | unsigned char * | pData, |
| int | sectorNum, | ||
| int | sectorCount | ||
| ) |
Reads a sector from the Flash Memory
- Parameters
-
pData The pointer to the data to save the read sectorNum The sector number to read with each sector being 512 bytes sectorCount The number of sectors to read
| bool flash_supports_metadata | ( | void | ) |
| void flash_write_permanent_id | ( | char * | id_64bytes | ) |
Writes a permanent ID on the SPI Flash
- Warning
- THIS CAN ONLY BE DONE ONCE IN A LIFETIME OF THE SPI FLASH
- DO NOT USE THIS FUNCTION WITHOUT THE SPI SEMAPHORE!!!
| DRESULT flash_write_sectors | ( | unsigned char * | pData, |
| int | sectorNum, | ||
| int | sectorCount | ||
| ) |
Writes a sector to the Flash Memory
- Parameters
-
pData The pointer to the data to write sectorNum The sector number to write with each sector being 512 bytes sectorCount The number of sectors to write

1.8.11