• Alexandre Belloni's avatar
    rtc: pcf85363: set time accurately · 188306ac
    Alexandre Belloni authored
    As per 8.2.6 Setting and reading the time in RTC mode, first stop the clok,
    then reset it before setting the date and time registers. Finally, start
    the clock.
    
    This uses register address wrap around from 0x2f to 0x00 for efficiency.
    
    This allows to set the clock with a millisecond accuracy (drift is not
    corrected in this example):
    
    RTC        System
    1325388767 1325388767.000029180
    1325388768 1325388768.000018362
    1325388769 1325388769.000006544
    1325388770 1325388769.999992725
    1325388771 1325388770.999974544
    Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
    188306ac
rtc-pcf85363.c 9.41 KB