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