2020-01-18 08:38:21 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
*
|
2021-04-22 08:24:48 +00:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 08:38:21 +00:00
|
|
|
*/
|
|
|
|
|
2019-06-07 17:29:34 +00:00
|
|
|
#include <Kernel/CMOS.h>
|
2020-05-16 10:00:04 +00:00
|
|
|
#include <Kernel/IO.h>
|
2018-10-16 09:01:38 +00:00
|
|
|
|
|
|
|
namespace CMOS {
|
|
|
|
|
2019-07-03 19:17:35 +00:00
|
|
|
u8 read(u8 index)
|
2018-10-16 09:01:38 +00:00
|
|
|
{
|
|
|
|
IO::out8(0x70, index);
|
|
|
|
return IO::in8(0x71);
|
|
|
|
}
|
|
|
|
|
2019-07-03 19:17:35 +00:00
|
|
|
void write(u8 index, u8 data)
|
2018-10-16 09:01:38 +00:00
|
|
|
{
|
|
|
|
IO::out8(0x70, index);
|
|
|
|
IO::out8(0x71, data);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|