Flash Memory Library
This library provides routines for accessing microcontroller's (internal) Flash memory.

Please bear in mind that when the Flash memory is acquired and not released from the CPU I/O interface, any further Flash memory manipulation is not possible until the MCU is reprogrammed.
Use the Flash_release_semaphore and Flash_wait_semaphore routines to release/check the current status of the Flash memory controller.
Library Routines
Flash_Write_Buffer
Prototype |
long Flash_Write_Buffer(uint32_t address, uint8_t *buffer, uint16_t length); |
---|---|
Description |
This function will write an array of bytes into the on-chip Flash memory. |
Parameters |
|
Returns |
|
Requires |
Nothing. |
Example |
Flash_Write_Buffer(Address, buff, 16); // write 16 bytes to Flash memory |
Notes |
None. |
Flash_Read_Buffer
Prototype |
long Flash_Read_Buffer(uint32_t address, uint8_t *buffer, uint16_t length); |
---|---|
Description |
This function will read an array of bytes from the on-chip Flash memory. |
Parameters |
|
Returns |
|
Requires |
Nothing. |
Example |
Flash_Read_Buffer(Address, buff, 16); // read 16 bytes from the Flash memory |
Notes |
None. |
Flash_wait_semaphore
Prototype |
int Flash_wait_semaphore(); |
---|---|
Description |
The function tests if the Flash memory resource is acquired by the CPU I/O interface. |
Parameters |
None. |
Returns |
|
Requires |
Nothing. |
Example |
if (Flash_wait_semaphore() == 0) { ... } |
Notes |
None. |
Flash_release_semaphore
Prototype |
void Flash_release_semaphore(); |
---|---|
Description |
The function releases the Flash memory resource from CPU I/O interface. |
Parameters |
None. |
Returns |
None. |
Requires |
Nothing. |
Example |
Flash_release_semaphore(); |
Notes |
None. |
What do you think about this topic ? Send us feedback!