44 lines
1.3 KiB
C
44 lines
1.3 KiB
C
/*
|
|
* gruvin9x Author Bryan J.Rentoul (Gruvin) <gruvin@gmail.com>
|
|
*
|
|
* gruvin9x is based on code named er9x by
|
|
* Author - Erez Raviv <erezraviv@gmail.com>, which is in turn
|
|
* based on th9x -> http://code.google.com/p/th9x/
|
|
*
|
|
* rtc.cpp code take from (TODO. Re-locate and fix this credit.)
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation.
|
|
*
|
|
* 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 RTC_H
|
|
#define RTC_H
|
|
|
|
#include "integer.h"
|
|
|
|
typedef struct {
|
|
WORD year; /* 2000..2099 */
|
|
BYTE month; /* 1..12 */
|
|
BYTE mday; /* 1.. 31 */
|
|
BYTE wday; /* 1..7 */
|
|
BYTE hour; /* 0..23 */
|
|
BYTE min; /* 0..59 */
|
|
BYTE sec; /* 0..59 */
|
|
} RTC;
|
|
|
|
int iic_write (BYTE, UINT, UINT, const void*); /* Write to IIC device */
|
|
int iic_read (BYTE, UINT, UINT, void*); /* Read from IIC device */
|
|
|
|
int rtc_init (void); /* Initialize RTC */
|
|
int rtc_gettime (RTC*); /* Get time */
|
|
int rtc_settime (const RTC*); /* Set time */
|
|
|
|
#endif
|