HP85 GPIB Disk Emulator  1.0
HP85GPIBDiskEmulator
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
rtc.h
Go to the documentation of this file.
1 
13 #ifndef _RTC_H_
14 #define _RTC_H_
15 
16 #include "user_config.h"
17 
18 int rtc_ok;
19 
20 #define DS1307 0x68
21 #define DS1307_REG_SIZE 8
22 
23 /* rtc.c */
24 uint8_t BINtoBCD ( uint8_t data );
25 uint8_t BCDtoBIN ( uint8_t data );
26 int8_t i2c_rtc_write ( uint8_t address , uint8_t ind , uint8_t *buf , uint8_t len );
27 int8_t i2c_rtc_read ( uint8_t address , uint8_t ind , uint8_t *buf , uint8_t len );
28 void i2c_rtc_init ( void );
29 uint8_t rtc_write ( tm_t *t );
30 uint8_t rtc_read ( tm_t *t );
31 int rtc_run ( int run );
32 int8_t rtc_run_test ( void );
33 uint8_t rtc_init ( int force , time_t seconds );
34 // uint32_t tm_to_fat ( tm_t *t );
35 // uint32_t get_fattime ( void );
36 
37 #endif
rtc_init
uint8_t rtc_init(int force, time_t seconds)
Initialize DS1307 rtc if not initialied - or if forced.
Definition: rtc.c:285
BINtoBCD
uint8_t BINtoBCD(uint8_t data)
RTC BCD conversion functions.
Definition: rtc.c:27
i2c_rtc_init
void i2c_rtc_init(void)
RTC I2C initialization code.
Definition: rtc.c:123
rtc_run_test
int8_t rtc_run_test(void)
DS1307 run test.
Definition: rtc.c:271
i2c_rtc_read
int8_t i2c_rtc_read(uint8_t address, uint8_t ind, uint8_t *buf, uint8_t len)
RTC I2C READ function.
Definition: rtc.c:90
rtc_write
uint8_t rtc_write(tm_t *t)
RTC functions.
Definition: rtc.c:138
rtc_ok
int rtc_ok
Definition: rtc.h:18
user_config.h
Master Include for FatFs, RTC, Timers AVR8 - Part of HP85 disk emulator.
BCDtoBIN
uint8_t BCDtoBIN(uint8_t data)
Convert two "digit" BCD number to binary.
Definition: rtc.c:38
i2c_rtc_write
int8_t i2c_rtc_write(uint8_t address, uint8_t ind, uint8_t *buf, uint8_t len)
RTC HAL.
Definition: rtc.c:55
tm
POSIX struct tm.
Definition: time.h:40
time_t
uint32_t time_t
type of EPOCH result.
Definition: time.h:34
rtc_run
int rtc_run(int run)
Set DS1307 run state.
Definition: rtc.c:240
rtc_read
uint8_t rtc_read(tm_t *t)
Read DS1307 RTC into POSIX struct tm * structure.
Definition: rtc.c:189