// Autogenerated C header file for Real time clock
#ifndef _JACDAC_SPEC_REAL_TIME_CLOCK_H
#define _JACDAC_SPEC_REAL_TIME_CLOCK_H 1

#define JD_SERVICE_CLASS_REAL_TIME_CLOCK  0x1a8b1a28

// enum Variant (uint8_t)
#define JD_REAL_TIME_CLOCK_VARIANT_COMPUTER 0x1
#define JD_REAL_TIME_CLOCK_VARIANT_CRYSTAL 0x2
#define JD_REAL_TIME_CLOCK_VARIANT_CUCKOO 0x3

/**
 * Current time in 24h representation. Default streaming period is 1 second.
 */
#define JD_REAL_TIME_CLOCK_REG_LOCAL_TIME JD_REG_READING
typedef struct jd_real_time_clock_local_time {
    uint16_t year;
    uint8_t month;
    uint8_t day_of_month;
    uint8_t day_of_week;
    uint8_t hour;
    uint8_t min;
    uint8_t sec;
} jd_real_time_clock_local_time_t;


/**
 * Read-only s u16.16 (uint32_t). Time drift since the last call to the `set_time` command.
 */
#define JD_REAL_TIME_CLOCK_REG_DRIFT 0x180

/**
 * Constant ppm u16.16 (uint32_t). Error on the clock, in parts per million of seconds.
 */
#define JD_REAL_TIME_CLOCK_REG_PRECISION 0x181

/**
 * Constant Variant (uint8_t). The type of physical clock used by the sensor.
 */
#define JD_REAL_TIME_CLOCK_REG_VARIANT JD_REG_VARIANT

/**
 * Sets the current time and resets the error.
 */
#define JD_REAL_TIME_CLOCK_CMD_SET_TIME 0x80
typedef struct jd_real_time_clock_set_time {
    uint16_t year;
    uint8_t month;
    uint8_t day_of_month;
    uint8_t day_of_week;
    uint8_t hour;
    uint8_t min;
    uint8_t sec;
} jd_real_time_clock_set_time_t;


#endif
