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