1 /* 2 * PROJECT: NEC PC-98 series onboard hardware 3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later) 4 * PURPOSE: NEC uPD1990A/uPD4990A RTC header file 5 * COPYRIGHT: Copyright 2020 Dmitry Borisov (di.sean@protonmail.com) 6 */ 7 8 #pragma once 9 10 #define RTC_IO_o_DATA 0x20 11 /* Input terminals */ 12 #define RTC_DATA_INPUT 0x20 13 #define RTC_CLOCK 0x10 14 #define RTC_STROBE 0x08 15 /* Commands, shift register 40 bit */ 16 #define RTC_CMD_REGISTER_HOLD 0x00 17 #define RTC_CMD_REGISTER_SHIFT 0x01 18 #define RTC_CMD_TIME_SET_COUNTER_HOLD 0x02 19 #define RTC_CMD_TIME_READ 0x03 20 #define RTC_CMD_TIMING_PULSE_64_HZ 0x04 21 #define RTC_CMD_TIMING_PULSE_256_HZ 0x05 22 #define RTC_CMD_TIMING_PULSE_2048_HZ 0x06 23 #define RTC_CMD_SERIAL_TRANSFER_MODE 0x07 24 /* Serial data commands, shift register 52 bit (uPD4990A only) */ 25 #define RTC_CMD_TIMING_PULSE_4096_HZ 0x07 26 #define RTC_CMD_TIMING_PULSE_1_S_INT 0x08 27 #define RTC_CMD_TIMING_PULSE_10_S_INT 0x09 28 #define RTC_CMD_TIMING_PULSE_30_S_INT 0x0A 29 #define RTC_CMD_TIMING_PULSE_60_S_INT 0x0B 30 #define RTC_CMD_INTERRUPT_RESET 0x0C 31 #define RTC_CMD_INTERRUPT_START 0x0D 32 #define RTC_CMD_INTERRUPT_STOP 0x0E 33 #define RTC_CMD_TEST_MODE 0x0F 34 35 #define RTC_IO_o_MODE 0x22 36 37 #define RTC_IO_o_INT_CLOCK_DIVISOR 0x128 38 #define RTC_INT_CLOCK_DIVISOR_64 0x00 39 #define RTC_INT_CLOCK_DIVISOR_32 0x01 40 #define RTC_INT_CLOCK_DIVISOR_0 0x02 41 #define RTC_INT_CLOCK_DIVISOR_16 0x03 42 43 #define RTC_IO_i_MODE 0x22 44 #define RTC_IO_i_INTERRUPT_RESET 0x128 45