12 * This class is an abstraction of all types of memory
13 * available on the chip: SRAM, ERAM, Flash.
15 * It allows read and write operations and maintains
16 * the raw data associated with the memory.
20 Memory(unsigned int size
);
25 * Reads \e size bytes of raw data from memory starting at
26 * offset \e offset. It returns a pointer to this data.
28 * \exception RuntimeException { When the data requested is
29 * not available, this exception is thrown }
31 const unsigned char *read(unsigned int offset
, unsigned int size
= 1) const;
34 * Reads a single bytes of raw data from memory at
37 * \exception RuntimeException { When the data requested is
38 * not available, this exception is thrown }
40 byte
readByte(unsigned int offset
) const;
43 * Reads a word of raw data from memory starting at
46 * \exception RuntimeException { When the data requested is
47 * not available, this exception is thrown }
49 word
readWord(unsigned int offset
) const;
52 * Write \e size bytes of raw data to memory starting at
53 * offset \e offset. The data to be written is passed via
54 * the \e block variable.
56 * \exception RuntimeException { When the write exceeds
57 * amount of memory, this exception is thrown }
59 virtual void write(unsigned int offset
, unsigned char *block
, unsigned int size
= 1);
62 * Fill the entire memory chunk with value \e val.
64 void fill(unsigned char val
);
67 * \returns the size of the memory chunk.
69 unsigned int size() const;
72 * Dump the memory content to disk
74 void dump(const char *fname
) const;
81 inline unsigned int Memory::size() const {
86 #endif /*AVR_MEMORY_H*/