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 |
sub function Flash_Write_Buffer(dim address as longword, dim buffer as ^byte, dim length as word) as longint |
---|---|
Description |
This sub 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 |
sub function Flash_Read_Buffer(dim address as longword, dim buffer as ^byte, dim length as word) as longint |
---|---|
Description |
This sub 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 |
sub function Flash_wait_semaphore() as integer |
---|---|
Description |
The sub 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) then ... end if |
Notes |
None. |
Flash_release_semaphore
Prototype |
sub procedure Flash_release_semaphore() |
---|---|
Description |
The sub 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!