Loading...
Searching...
No Matches
MTD wrapper for Flashpage devices

Driver for internal flash devices implementing flashpage interface. More...

Detailed Description

Driver for internal flash devices implementing flashpage interface.

The MTD device created by MTD_FLASHPAGE_INIT_VAL spans the complete accessible flash page memory. To expose merely an area of that as a single MTD partition, the MTD address mapper can be used.

Files

file  mtd_flashpage.h
 Interface definition for the flashpage memory driver.
 

Data Structures

struct  mtd_flashpage_t
 MTD flashpage descriptor. More...
 

Macros

#define MTD_FLASHPAGE_INIT_VAL(_pages_per_sector)
 Macro helper to initialize a mtd_t with flashpage driver.
 
#define MTD_FLASHPAGE_AUX_INIT_VAL(start, len)
 Macro helper to initialize a mtd_t with a portion of the flash.
 
#define CONFIG_SLOT_AUX_LEN   0
 Size of the auxiliary slot on the internal flash Must align with the flash page size.
 
#define CONFIG_SLOT_AUX_MTD_OFFSET   1
 Default MTD offset for the AUX slot.
 

Variables

const mtd_desc_t mtd_flashpage_driver
 Flashpage MTD device operations table.
 
mtd_flashpage_t mtd_flash_aux_slot
 MTD device representing the auxiliary flash slot.
 
mtd_dev_tmtd_aux
 Generic MTD device backed by the auxiliary flash slot.
 

Macro Definition Documentation

◆ CONFIG_SLOT_AUX_LEN

#define CONFIG_SLOT_AUX_LEN   0

Size of the auxiliary slot on the internal flash Must align with the flash page size.

Note
Don't set this config value directly! Instead set SLOT_AUX_LEN in the board's Makefile.include

This value is fixed and can not be changed in the field / via firmware updates. Changing this value requires re-flashing of riotboot.

Definition at line 106 of file mtd_flashpage.h.

◆ CONFIG_SLOT_AUX_MTD_OFFSET

#define CONFIG_SLOT_AUX_MTD_OFFSET   1

Default MTD offset for the AUX slot.

Definition at line 113 of file mtd_flashpage.h.

◆ MTD_FLASHPAGE_AUX_INIT_VAL

#define MTD_FLASHPAGE_AUX_INIT_VAL (   start,
  len 
)
Value:
{ \
.base = { \
.driver = &mtd_flashpage_driver, \
.sector_count = len / FLASHPAGE_SIZE, \
.pages_per_sector = 1, \
.page_size = FLASHPAGE_SIZE, \
.write_size = 1, \
}, \
.offset = start / FLASHPAGE_SIZE, \
}
#define FLASHPAGE_SIZE
Flash page configuration.
Definition cpu_conf.h:50
const mtd_desc_t mtd_flashpage_driver
Flashpage MTD device operations table.

Macro helper to initialize a mtd_t with a portion of the flash.

Parameters
[in]startStart address of the flash section
[in]lenSize of the flash section in bytes

Definition at line 56 of file mtd_flashpage.h.

◆ MTD_FLASHPAGE_INIT_VAL

#define MTD_FLASHPAGE_INIT_VAL (   _pages_per_sector)
Value:
{ \
.base = { \
.driver = &mtd_flashpage_driver, \
.sector_count = FLASHPAGE_NUMOF, \
.pages_per_sector = _pages_per_sector, \
.page_size = FLASHPAGE_SIZE / _pages_per_sector, \
.write_size = 1 \
}, \
}

Macro helper to initialize a mtd_t with flashpage driver.

Definition at line 40 of file mtd_flashpage.h.