Interface: tos.chips.at45db.At45dbBlockConfig

interface At45dbBlockConfig

Private interface between the AT45DB implementations of config and block storage

Author::
David Gay <dgay@acm.org>

Commands
command int flipped() Query which half of the block is used by the current config state
command int isConfig() Check if this block is a config volumes
command int writeHook() Hook called by block storage just before the start of each write

Events
event at45page_t npages() Return size of a config volume in pages (half of the actual block)
event at45page_t remap(at45page_t page) Map a volume-relative page to an absolute flash page, taking account of the current flipped status
event void writeContinue(error_t error) Continue or abort write suspended as a result of a writeHook event

Commands - Details

flipped

command int flipped()

Query which half of the block is used by the current config state

Returns:
TRUE for 2nd half, FALSE for 1st half

isConfig

command int isConfig()

Check if this block is a config volumes

Returns:
TRUE for config volumes, FALSE for block volumes

writeHook

command int writeHook()

Hook called by block storage just before the start of each write

Returns:
TRUE to delay the write until writeContinue is called, FALSE to proceed immediately.

Events - Details

npages

event at45page_t npages()

Return size of a config volume in pages (half of the actual block)

Returns:
Config volume size

remap

event at45page_t remap(at45page_t page)

Map a volume-relative page to an absolute flash page, taking account of the current flipped status

Parameters:
page - Volume-relative page
Returns:
Actual flash page for page

writeContinue

event void writeContinue(error_t error)

Continue or abort write suspended as a result of a writeHook event

Parameters:
error - SUCCESS to continue write, anything else to abort write returning that error code