Esempio n. 1
0
void ds1302_write_register(uint8_t reg, uint8_t val)
{
    ds1302_set_pin_ce(true);
    ds1302_send_byte(reg);
    ds1302_send_byte(val);
    ds1302_set_pin_ce(false);
    ds1302_set_pin_clk(false);
}
Esempio n. 2
0
void ds1302_init(void)
{
    time_t tod;

    /* initialise the hardware into a sensible state */
    ds1302_set_pin_data_driven(true);
    ds1302_set_pin_data(false);
    ds1302_set_pin_ce(false);
    ds1302_set_pin_clk(false);
    ds1302_check_rtc();
    wrtime(&tod);
}
Esempio n. 3
0
void ds1302_init(void)
{
    time_t tod;

    /* initialise the hardware into a sensible state */
    ds1302_set_pin_data_driven(true);
    ds1302_set_pin_data(false);
    ds1302_set_pin_ce(false);
    ds1302_set_pin_clk(false);

    tod.high = 0;                   /* until 2106 */
    tod.low = ds1302_read_rtc();
    wrtime(&tod);
}