Component: ByteEEPROM
Provide access to, and sharing of, the mote flash
chip. ByteEEPROM
does not interact properly with the
(deprecated) Logger
component.
The flash chip is shared by giving each user a separate "region" of the
flash. These regions are identified by the parameter to the
AllocationReq
, WriteData
,
ReadData
and LogData
parameterised
interfaces. A user of byte eeprom should define a constant with
enum { MY_FLASH_REGION_ID = unique("ByteEEPROM") };
in some .h file, and use MY_FLASH_REGION_ID
when wiring
interfaces to ByteEEPROM
.
Flash regions must be allocated via the AllocationReq
interface. All allocation requests must be made at mote initialisation
time (in StdControl.init
commands). Later allocation
requests will be refused.
ReadData
and WriteData
provides
straightforward data reading and writing at arbitrary offsets in a flash
region. The WriteData
interface guarantees that the data
has been committed to the flash when the writeDone
event
completes successfully. As this has high overhead (both in time and
power), the alternative LogData
interface is provided for
high-speed, low-overhead data logging.
The BufferedLog
component can be used in conjunction with
ByteEEPROM
to provide even lower logging overhead at the cost
of extra RAM buffers. The HighFrequencySampling
application
is an example of all this.
Author:
| Nelson Lee
|
|
David Gay
|