33#include "debug/PcSpeaker.hh"
46 controlVal.timer =
timer->outputHigh(2) ? 1 : 0;
48 "Reading from speaker device: gate %s, speaker %s, output %s.\n",
49 controlVal.gate ?
"on" :
"off",
50 controlVal.speaker ?
"on" :
"off",
51 controlVal.timer ?
"on" :
"off");
52 pkt->
setLE((uint8_t)controlVal);
60 assert(pkt->
getAddr() == pioAddr);
62 SpeakerControl
val = pkt->
getLE<uint8_t>();
63 controlVal.gate =
val.gate;
66 warn(
"The gate bit of the pc speaker isn't implemented and "
71 controlVal.speaker =
val.speaker;
72 DPRINTF(PcSpeaker,
"Writing to speaker device: gate %s, speaker %s.\n",
73 controlVal.gate ?
"on" :
"off", controlVal.speaker ?
"on" :
"off");
Addr pioAddr
Address that the device listens to.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
void setLE(T v)
Set the value in the data pointer to v as little endian.
void makeAtomicResponse()
T getLE() const
Get the data in the packet byte swapped from little endian to host endian.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
void serialize(CheckpointOut &cp) const override
Serialize an object.
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::ostream CheckpointOut
uint64_t Tick
Tick count type.
Declaration of the Packet class.
#define UNSERIALIZE_SCALAR(scalar)
#define SERIALIZE_SCALAR(scalar)