Handout
This commit is contained in:
46
kernel/arch/cmos.h
Normal file
46
kernel/arch/cmos.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/*! \file
|
||||
* \brief Controlling the \ref CMOS "complementary metal oxide semiconductor
|
||||
* (CMOS)"
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
|
||||
/*!
|
||||
* \defgroup CMOS CMOS
|
||||
* \brief complementary metal oxide semiconductor (CMOS)
|
||||
*/
|
||||
|
||||
/*! \brief CMOS
|
||||
* \ingroup CMOS
|
||||
*/
|
||||
namespace CMOS {
|
||||
|
||||
enum class Register {
|
||||
SECOND = 0x0, ///< RTC
|
||||
ALARM_SECOND = 0x1, ///< RTC
|
||||
MINUTE = 0x2, ///< RTC
|
||||
ALARM_MINUTE = 0x3, ///< RTC
|
||||
HOUR = 0x4, ///< RTC
|
||||
ALARM_HOUR = 0x5, ///< RTC
|
||||
WEEKDAY = 0x6, ///< RTC
|
||||
DAYOFMONTH = 0x7, ///< RTC
|
||||
MONTH = 0x8, ///< RTC
|
||||
YEAR = 0x9, ///< RTC
|
||||
STATUS_A = 0xa, ///< RTC
|
||||
STATUS_B = 0xb, ///< RTC
|
||||
STATUS_C = 0xc, ///< RTC
|
||||
STATUS_D = 0xd, ///< RTC
|
||||
STATUS_DIAGNOSE = 0xe,
|
||||
STATUS_SHUTDOWN = 0xf
|
||||
};
|
||||
|
||||
uint8_t read(enum Register reg);
|
||||
void write(enum Register reg, uint8_t value);
|
||||
|
||||
namespace NMI {
|
||||
void enable();
|
||||
void disable();
|
||||
bool isEnabled();
|
||||
} // namespace NMI
|
||||
} // namespace CMOS
|
||||
Reference in New Issue
Block a user