92 osalDbgAssert(sector < descriptor->sectors_count,
"invalid sector");
94 if (descriptor->
sectors != NULL) {
118 osalDbgAssert(sector < descriptor->sectors_count,
"invalid sector");
120 if (descriptor->
sectors != NULL) {
145 if (descriptor->
sectors != NULL) {
150 sector_end = sector_start + descriptor->
sectors[i].
size - 1U;
151 if ((offset >= sector_start) && (offset <= sector_end)) {
181 return (
void *)(descriptor->
address + offset);
flash_offset_t flashGetSectorOffset(BaseFlash *devp, flash_sector_t sector)
Returns the offset of a sector.
uint32_t flashGetSectorSize(BaseFlash *devp, flash_sector_t sector)
Returns the size of a sector.
flash_sector_t flashGetOffsetSector(BaseFlash *devp, flash_offset_t offset)
Returns the sector of an offset.
uint32_t flash_sector_t
Type of a flash sector number.
flash_error_t flashWaitErase(BaseFlash *devp)
Waits until the current erase operation is finished.
uint32_t flash_offset_t
Type of a flash offset.
void * flashGetOffsetAddress(BaseFlash *devp, flash_offset_t offset)
Get absolute address from offset.
flash_error_t
Type of a flash error code.
flash_offset_t flashGetAddressOffset(BaseFlash *devp, void *addr)
Get offset from absolute address.
#define flashQueryErase(ip, msec)
Queries the driver for erase operation progress.
#define flashGetDescriptor(ip)
Gets the flash descriptor structure.
#define osalDbgAssert(c, remark)
Condition assertion.
#define osalThreadSleepMilliseconds(msecs)
Delays the invoking thread for the specified number of milliseconds.
Generic flash driver class header.
Type of a flash device descriptor.
const flash_sector_descriptor_t * sectors
List of sectors for devices with non-uniform sector sizes.
uint32_t sectors_size
Size of sectors for devices with uniform sector size.
flash_sector_t sectors_count
Number of sectors in the device.
uint8_t * address
Flash address if memory mapped or zero.
flash_offset_t offset
Sector offset.
uint32_t size
Sector size.