OLE Developer Guide  Latest Git
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
flash.h File Reference

Detailed Description

Flash memory operations.

Include dependency graph for flash.h:

Go to the source code of this file.

Functions

bool Flash_ErasePage (uint32_t address)
 Erase a page of flash memory and block until the operation is complete. More...
 
bool Flash_WriteWord (uint32_t address, uint32_t data)
 Write a word (32-bits) to flash memory and block until the operation is complete. More...
 
uint32_t Flash_ReadWord (uint32_t address)
 Read a word (32-bits) from flash memory. More...
 

Function Documentation

bool Flash_ErasePage ( uint32_t  address)

Erase a page of flash memory and block until the operation is complete.

Parameters
addressThe virtual address of the page to erase.
Returns
true if the page was erased, false if there was an error.

The address must be aligned correctly. On the pic32 5xx/6xx/7xx platform, the address must be aligned to a 4k address.

uint32_t Flash_ReadWord ( uint32_t  address)

Read a word (32-bits) from flash memory.

Parameters
addressThe virtual address to read from, must be 4-byte aligned.
Returns
The value at this location.
bool Flash_WriteWord ( uint32_t  address,
uint32_t  data 
)

Write a word (32-bits) to flash memory and block until the operation is complete.

Parameters
addressThe virtual address to write to, must be 4-byte aligned.
dataThe value to write.
Returns
true if the write succeeded, false if it failed.

This page that this word belongs to must have been erased before this function is called.