# Autogenerated constants for Real time clock service
from enum import IntEnum
from jacdac.constants import *
from jacdac.system.constants import *
JD_SERVICE_CLASS_REAL_TIME_CLOCK = const(0x1a8b1a28)


class RealTimeClockVariant(IntEnum):
    COMPUTER = const(0x1)
    CRYSTAL = const(0x2)
    CUCKOO = const(0x3)


JD_REAL_TIME_CLOCK_REG_LOCAL_TIME = const(JD_REG_READING)
JD_REAL_TIME_CLOCK_REG_DRIFT = const(0x180)
JD_REAL_TIME_CLOCK_REG_PRECISION = const(0x181)
JD_REAL_TIME_CLOCK_REG_VARIANT = const(JD_REG_VARIANT)
JD_REAL_TIME_CLOCK_CMD_SET_TIME = const(0x80)
JD_REAL_TIME_CLOCK_PACK_FORMATS = {
    JD_REAL_TIME_CLOCK_REG_LOCAL_TIME: "u16 u8 u8 u8 u8 u8 u8",
    JD_REAL_TIME_CLOCK_REG_DRIFT: "u16.16",
    JD_REAL_TIME_CLOCK_REG_PRECISION: "u16.16",
    JD_REAL_TIME_CLOCK_REG_VARIANT: "u8",
    JD_REAL_TIME_CLOCK_CMD_SET_TIME: "u16 u8 u8 u8 u8 u8 u8"
}
