• Joshua Clayton's avatar
    rtc: Add functions to set and read rtc offset · b3967067
    Joshua Clayton authored
    A number of rtc devices, such as the NXP pcf2123 include a facility
    to adjust the clock in order to compensate for temperature or a
    crystal, capacitor, etc, that results in the rtc clock not running
    at exactly 32.768 kHz.
    
    Data sheets I have seen refer to this as a clock offset, and measure it
    in parts per million, however they often reference ppm to 2 digits of
    precision, which makes integer ppm less than ideal.
    
    We use parts per billion, which more than covers the precision needed
    and works nicely within 32 bits
    Signed-off-by: 's avatarJoshua Clayton <stillcompiling@gmail.com>
    Signed-off-by: 's avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
    b3967067
rtc.h 7.12 KB