File lt_flash.c
FileList > api > lt_flash.c
Go to the source code of this file.
#include "lt_flash.h"#include <fal.h>
Public Functions
| Type | Name |
|---|---|
| __attribute__ ((weak)) |
|
| bool | lt_flash_erase (uint32_t offset, size_t length) Erase flash area. Flash can only be erased in blocks (usually 4 KiB). |
| bool | lt_flash_erase_block (uint32_t offset) Erase a single block of flash (usually 4 KiB). |
| uint32_t | lt_flash_read (uint32_t offset, uint8_t * data, size_t length) Read data from the flash. |
| uint32_t | lt_flash_write (uint32_t offset, const uint8_t * data, size_t length) Write data to the flash. |
Public Functions Documentation
function __attribute__
function lt_flash_erase
Erase flash area. Flash can only be erased in blocks (usually 4 KiB).
Parameters:
offsetstarting offset to erase (in bytes); must be multiple of the flash chip's block sizelengthlength of data to erase (in bytes); will be rounded up to block size
Returns:
whether erasing was successful
function lt_flash_erase_block
Erase a single block of flash (usually 4 KiB).
Parameters:
offsetoffset of the block (in bytes); must be multiple of the flash chip's block size
Returns:
whether erasing was successful
function lt_flash_read
Read data from the flash.
Parameters:
offsetstarting offset (in bytes)datapointer to where to store the datalengthlength of data to read
Returns:
length of data successfully read (should equal 'length')
function lt_flash_write
Write data to the flash.
Parameters:
offsetstarting offset (in bytes)datapointer to data to writelengthlength of data to write
Returns:
length of data successfully written (should equal 'length')
The documentation for this class was generated from the following file cores/common/base/api/lt_flash.c