35 #include "debug/PcSpeaker.hh"
45 controlVal.timer =
timer->outputHigh(2) ? 1 : 0;
47 "Reading from speaker device: gate %s, speaker %s, output %s.\n",
48 controlVal.gate ?
"on" :
"off",
49 controlVal.speaker ?
"on" :
"off",
50 controlVal.timer ?
"on" :
"off");
51 pkt->
set((uint8_t)controlVal);
59 assert(pkt->
getAddr() == pioAddr);
61 SpeakerControl
val = pkt->
get<uint8_t>();
62 controlVal.gate = val.gate;
65 warn(
"The gate bit of the pc speaker isn't implemented and "
70 controlVal.speaker = val.speaker;
71 DPRINTF(PcSpeaker,
"Writing to speaker device: gate %s, speaker %s.\n",
72 controlVal.gate ?
"on" :
"off", controlVal.speaker ?
"on" :
"off");
80 uint8_t controlValData = controlVal.__data;
87 uint8_t controlValData;
89 controlVal.__data = controlValData;
93 PcSpeakerParams::create()
void set(T v, ByteOrder endian)
Set the value in the data pointer to v using the specified endianness.
T get(ByteOrder endian) const
Get the data in the packet byte swapped from the specified endianness.
#define UNSERIALIZE_SCALAR(scalar)
void makeAtomicResponse()
uint64_t Tick
Tick count type.
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
void serialize(CheckpointOut &cp) const override
Serialize an object.
#define SERIALIZE_SCALAR(scalar)
Declaration of the Packet class.
std::ostream CheckpointOut
Addr pioAddr
Address that the device listens to.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.