Fixed problem in DeviceSettings::strParam, returned wrong string
[avr-sim.git] / src / SRam.h
blobcfcf59fcbdc94ed7931e0b5e050d6cbe17226eef
1 #ifndef AVR_SRAM_H
2 #define AVR_SRAM_H
4 #include "Memory.h"
6 namespace avr {
8 /**
9 * @author Tom Haber
10 * @date Apr 23, 2008
11 * @brief Static ram inside the AVR chip.
13 * The static ram inside the chip, provides an interface
14 * for reading and writing. This interface is used by the MMU.
16 class SRam : public Memory {
17 public:
18 SRam(unsigned int size);
20 public:
21 /**
22 * Reads a single bytes of raw data from memory at
23 * offset \e offset.
25 * \exception AccessViolation { When the data requested is
26 * not available, this exception is thrown }
28 void writeByte(unsigned int offset, byte val);
30 /**
31 * Reads a word of raw data from memory starting at
32 * offset \e offset.
34 * \exception AccessViolation { When the data requested is
35 * not available, this exception is thrown }
37 void writeWord(unsigned int offset, word val);
40 inline SRam::SRam(unsigned int size) : Memory(size) {
41 fill(0);
44 inline void SRam::writeByte(unsigned int offset, byte val) {
45 write(offset, &val, 1);
48 inline void SRam::writeWord(unsigned int offset, word val) {
49 write(offset, (unsigned char *)&val, 2);
54 #endif /*AVR_SRAM_H*/