Functions | |
void | FlashCtl_eraseSegment (uint8_t *flash_ptr) |
Erase a single segment of the flash memory. More... | |
void | FlashCtl_eraseBank (uint8_t *flash_ptr) |
Erase a single bank of the flash memory. More... | |
void | FlashCtl_performMassErase (uint8_t *flash_ptr) |
Erase all flash memory. More... | |
bool | FlashCtl_performEraseCheck (uint8_t *flash_ptr, uint16_t numberOfBytes) |
Erase check of the flash memory. More... | |
void | FlashCtl_write8 (uint8_t *data_ptr, uint8_t *flash_ptr, uint16_t count) |
Write data into the flash memory in byte format, pass by reference. More... | |
void | FlashCtl_write16 (uint16_t *data_ptr, uint16_t *flash_ptr, uint16_t count) |
Write data into the flash memory in 16-bit word format, pass by reference. More... | |
void | FlashCtl_write32 (uint32_t *data_ptr, uint32_t *flash_ptr, uint16_t count) |
Write data into the flash memory in 32-bit word format, pass by reference. More... | |
void | FlashCtl_fillMemory32 (uint32_t value, uint32_t *flash_ptr, uint16_t count) |
Write data into the flash memory in 32-bit word format, pass by value. More... | |
uint8_t | FlashCtl_getStatus (uint8_t mask) |
Check FlashCtl status to see if it is currently busy erasing or programming. More... | |
void | FlashCtl_lockInfoA (void) |
Locks the information flash memory segment A. More... | |
void | FlashCtl_unlockInfoA (void) |
Unlocks the information flash memory segment A. More... | |
void FlashCtl_eraseBank | ( | uint8_t * | flash_ptr | ) |
Erase a single bank of the flash memory.
This function erases a single bank of the flash memory. This API will erase the entire flash if device contains only one flash bank.
flash_ptr | is a pointer into the bank to be erased |
void FlashCtl_eraseSegment | ( | uint8_t * | flash_ptr | ) |
Erase a single segment of the flash memory.
For devices like MSP430i204x, if the specified segment is the information flash segment, the FLASH_unlockInfo API must be called prior to calling this API.
flash_ptr | is the pointer into the flash segment to be erased |
void FlashCtl_fillMemory32 | ( | uint32_t | value, |
uint32_t * | flash_ptr, | ||
uint16_t | count | ||
) |
Write data into the flash memory in 32-bit word format, pass by value.
This function writes a 32-bit data value into flash memory, count times. Assumes the flash memory is already erased and unlocked. FlashCtl_eraseSegment can be used to erase a segment.
value | value to fill memory with |
flash_ptr | is the pointer into which to write the data |
count | number of times to write the value |
uint8_t FlashCtl_getStatus | ( | uint8_t | mask | ) |
Check FlashCtl status to see if it is currently busy erasing or programming.
This function checks the status register to determine if the flash memory is ready for writing.
mask | FLASHCTL status to read Mask value is the logical OR of any of the following:
|
void FlashCtl_lockInfoA | ( | void | ) |
Locks the information flash memory segment A.
This function is typically called after an erase or write operation on the information flash segment is performed by any of the other API functions in order to re-lock the information flash segment.
bool FlashCtl_performEraseCheck | ( | uint8_t * | flash_ptr, |
uint16_t | numberOfBytes | ||
) |
Erase check of the flash memory.
This function checks bytes in flash memory to make sure that they are in an erased state (are set to 0xFF).
flash_ptr | is the pointer to the starting location of the erase check |
numberOfBytes | is the number of bytes to be checked |
void FlashCtl_performMassErase | ( | uint8_t * | flash_ptr | ) |
Erase all flash memory.
This function erases all the flash memory banks. For devices like MSP430i204x, this API erases main memory and information flash memory if the FLASH_unlockInfo API was previously executed (otherwise the information flash is not erased). Also note that erasing information flash memory in the MSP430i204x impacts the TLV calibration constants located at the information memory.
flash_ptr | is a pointer into the bank to be erased |
void FlashCtl_unlockInfoA | ( | void | ) |
Unlocks the information flash memory segment A.
This function must be called before an erase or write operation on the information flash segment is performed by any of the other API functions.
void FlashCtl_write16 | ( | uint16_t * | data_ptr, |
uint16_t * | flash_ptr, | ||
uint16_t | count | ||
) |
Write data into the flash memory in 16-bit word format, pass by reference.
This function writes a 16-bit word array of size count into flash memory. Assumes the flash memory is already erased and unlocked. FlashCtl_eraseSegment can be used to erase a segment.
data_ptr | is the pointer to the data to be written |
flash_ptr | is the pointer into which to write the data |
count | number of times to write the value |
void FlashCtl_write32 | ( | uint32_t * | data_ptr, |
uint32_t * | flash_ptr, | ||
uint16_t | count | ||
) |
Write data into the flash memory in 32-bit word format, pass by reference.
This function writes a 32-bit array of size count into flash memory. Assumes the flash memory is already erased and unlocked. FlashCtl_eraseSegment can be used to erase a segment.
data_ptr | is the pointer to the data to be written |
flash_ptr | is the pointer into which to write the data |
count | number of times to write the value |
void FlashCtl_write8 | ( | uint8_t * | data_ptr, |
uint8_t * | flash_ptr, | ||
uint16_t | count | ||
) |
Write data into the flash memory in byte format, pass by reference.
This function writes a byte array of size count into flash memory. Assumes the flash memory is already erased and unlocked. FlashCtl_eraseSegment can be used to erase a segment.
data_ptr | is the pointer to the data to be written |
flash_ptr | is the pointer into which to write the data |
count | number of times to write the value |