29#ifndef __DEV_MC146818_HH__
30#define __DEV_MC146818_HH__
46 warn(
"No RTC event handler defined.\n");
136 static inline bool rega_dv_disabled(
const RtcRegA &
reg);
157 bool bcd,
Tick frequency);
Real-Time Clock (MC146818)
virtual void handleEvent()
EndBitUnion(RtcRegA) static inline bool rega_dv_disabled(const RtcRegA ®)
Is the DV field in regA set to disabled?
void setTime(const struct tm time)
MC146818(EventManager *em, const std::string &name, const struct tm time, bool bcd, Tick frequency)
const std::string & name() const
RTCTickEvent tickEvent
RTC tick event.
Bitfield< 2 > dm
1 = output sqare wave at SQW pin
EndBitUnion(RtcRegB) RtcRegA stat_regA
USA Daylight Savings Time enable.
Bitfield< 6, 4 > dv
1 = date and time update in progress
virtual void startup()
Start ticking.
Bitfield< 3 > sqwe
1 = enable update-ended interrupt
Bitfield< 1 > format24h
0 = BCD, 1 = Binary coded time
RtcRegB stat_regB
RTC status register B.
Bitfield< 6 > pie
stop clock updates
Bitfield< 4 > uie
1 = enable alarm interrupt
Bitfield< 5 > aie
1 = enable periodic clock interrupt
Bitfield< 0 > dse
0 = 12 hours, 1 = 24 hours
BitUnion8(RtcRegB) Bitfield< 7 > set
BitUnion8(RtcRegA) Bitfield< 7 > uip
void serialize(const std::string &base, CheckpointOut &cp) const
Serialize this object to the given output stream.
void unserialize(const std::string &base, CheckpointIn &cp)
Reconstruct the state of this object from a checkpoint.
Bitfield< 3, 0 > rs
Divider configuration.
RTCEvent event
RTC periodic interrupt event.
uint8_t readData(const uint8_t addr)
RTC read data.
void writeData(const uint8_t addr, const uint8_t data)
RTC write data.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::ostream CheckpointOut
uint64_t Tick
Tick count type.
Event for RTC periodic interrupt.
virtual const char * description() const
Event description.
RTCEvent(MC146818 *_parent, Tick i)
virtual void process()
Event process to occur at interrupt.
void scheduleIntr()
Schedule the RTC periodic interrupt.
Event for RTC periodic interrupt.
const char * description() const
Event description.
RTCTickEvent(MC146818 *_parent)
void process()
Event process to occur at interrupt.