Source

loolog.avr / clock.h

Full commit
/**
  * @author      $Author: Sven Hendriks <sven@loolog.org> $ (Sven Hendriks)
  * @copyright   (c) 2009 Sven Hendriks
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  */

#ifndef CLOCK_H_INCLUDED
#define CLOCK_H_INCLUDED

#include <stdint.h>

#define CLOCK_MAX_BASE 20

struct {
    uint16_t year;
    uint8_t  month, day, hour, minute, second, weekDay, daySavingTime;
} dateTime;

void clock_init(void);
void clock_incOneSec(void);
void clock_setDateTime(uint16_t year,     uint8_t month,  uint8_t day, 
                           uint8_t  hour,     uint8_t minute, uint8_t second, 
                           uint8_t  week_day, uint8_t day_saving_time);
uint8_t* clock_to7SegmentData(uint8_t base);
void clock_toStr(uint8_t *str);

#endif