![]() |
MSPM0_ValvanoWare
1.0
ECE445L starter code
|
Flash programming functions. More...
Files | |
| file | Flash.h |
| Flash programming functions. | |
| file | FlashFile.h |
| High-level implementation of the file system implementation. | |
Functions | |
| uint32_t | Flash_Write (uint32_t addr, const uint32_t *data) |
| Write to flash. More... | |
| uint32_t | Flash_WriteArray (uint32_t addr, const uint32_t *data, uint32_t count) |
| Write array to flash. More... | |
| uint32_t | Flash_Erase (uint32_t addr) |
| Write to flash. More... | |
| uint32_t | OS_File_New (uint32_t buf[64]) |
| create new file More... | |
| uint32_t | OS_File_Size (uint32_t num) |
| file size new file More... | |
| uint32_t | OS_File_Append (uint32_t num, uint32_t buf[64]) |
| append to existing file More... | |
| uint32_t * | OS_File_Read (uint32_t num, uint32_t location) |
| read from existing file More... | |
| uint32_t | OS_File_Format (void) |
| create new file More... | |
Flash programming functions.
| uint32_t Flash_Erase | ( | uint32_t | addr | ) |
Write to flash.
Erase 1024-byte sector
addr must be on 1024-byte (64-bit boundary)
Takes 2488 cycles = 31.1us running at 80 MHz
| addr | sets the location to be programmed |
| uint32_t Flash_Write | ( | uint32_t | addr, |
| const uint32_t * | data | ||
| ) |
Write to flash.
Write 64-bits, 8 bytes, to Flash
addr must have been previously erased
addr must be on 8-byte (64-bit boundary)
Takes 4055 cycles = 50.7us running at 80 MHz
| addr | sets the location to be programmed |
| data | is a 2-element array containing 64 bits |
| uint32_t Flash_WriteArray | ( | uint32_t | addr, |
| const uint32_t * | data, | ||
| uint32_t | count | ||
| ) |
Write array to flash.
Write an array of data to Flash
addr must have been previously erased
addr must be on 8-byte (64-bit boundary)
count must be even
| addr | sets the start location to be programmed |
| data | is an array containing count 32-bit words |
| count | is the number of 32-bit words to program |
| uint32_t OS_File_Append | ( | uint32_t | num, |
| uint32_t | buf[64] | ||
| ) |
append to existing file
Save 256 bytes into existing file
| num | 32-bit file number, 0 to 15 |
| buf | pointer to 256 bytes of data |
| uint32_t OS_File_Format | ( | void | ) |
create new file
Erase all files and all data
| none |
| uint32_t OS_File_New | ( | uint32_t | buf[64] | ) |
create new file
Create a new file and save first block. Save 256 bytes into the new file. Can support up to 32 files
| buf | pointer to 256 bytes of data |
| uint32_t* OS_File_Read | ( | uint32_t | num, |
| uint32_t | location | ||
| ) |
read from existing file
Read 256 bytes from the file
| num | 32-bit file number, 0 to 15 |
| location | logical address, 0 to 239 |
| uint32_t OS_File_Size | ( | uint32_t | num | ) |
file size new file
Check the size of this file
| num | 32-bit file number, 0 to 15 |