| 9120e874 Andy McCall |
1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
#ifndef _RTC_H_ |
| 6 |
#define _RTC_H_ |
| 7 |
|
| 8 |
#include <stdint.h> |
| 9 |
#include <stdbool.h> |
| 10 |
|
| 11 |
#ifdef __cplusplus |
| 12 |
extern "C" { |
| 13 |
#endif |
| 14 |
|
| 15 |
void rtc_i2c_data(uint8_t v); |
| 16 |
void rtc_init(bool set_system_time); |
| 17 |
void rtc_set_system_time(); |
| 18 |
void rtc_step(int c); |
| 19 |
uint8_t rtc_read(); |
| 20 |
void rtc_write(); |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
typedef struct { |
| 30 |
bool running; |
| 31 |
bool h24; |
| 32 |
int seconds; |
| 33 |
int minutes; |
| 34 |
int hours; |
| 35 |
int day_of_week; |
| 36 |
int day; |
| 37 |
int month; |
| 38 |
int year; |
| 39 |
uint8_t i2c_data_pos; |
| 40 |
uint8_t nvram[0x40]; |
| 41 |
bool nvram_dirty; |
| 42 |
} rtc_debug_state_t; |
| 43 |
|
| 44 |
void rtc_debug_get_state(rtc_debug_state_t *out); |
| 45 |
|
| 46 |
#ifdef __cplusplus |
| 47 |
} |
| 48 |
#endif |
| 49 |
|
| 50 |
#endif |