My Project  1.3
WaveShare DS1302 Clock Module
ds1302.h
Go to the documentation of this file.
1 
11 #define DS1302SECONDS 0x81
12 #define DS1302MINUTES 0x83
13 #define DS1302HOURS 0x85
14 #define DS1302DAY 0x87
15 #define DS1302MONTH 0x89
16 #define DS1302WEEKDAY 0x8B
17 #define DS1302YEAR 0x8D
18 #define DS1302WP 0x8F
19 #define DS1302BURSTRD 0xBF
20 #define DS1302BURSTMM 0xFF
21 
30 void DS1302_open(short mosi, short cs, short sclk, short miso);
31 
37 short DS1302_getSeconds(void);
38 
43 short DS1302_getMinutes(void);
44 
52 short DS1302_getHours(void);
53 
58 char *DS1302_getAMPM(void);
59 
64 short DS1302_getDay(void);
65 
70 short DS1302_getMonth(void);
71 
76 short DS1302_getWeekDay(void);
77 
82 short DS1302_getYear(void);
83 
90 void DS1302_setDate(short year, short month, short day);
91 
96 void DS1302_setYear(short year);
97 
102 void DS1302_setMonth(short month);
103 
108 void DS1302_setDay(short day);
109 
114 void DS1302_setWeekDay(short weekday);
115 
123 void DS1302_setTime(short hours, short minutes, short seconds);
124 
130 void DS1302_setHour(short hour);
131 
137 void DS1302_set12Hour(short hour, char AmPm);
138 
143 void DS1302_setMinute(short minutes);
144 
149 void DS1302_setSecond(short seconds);
150 
155 short DS1302_getWriteProtect(void);
156 
162 void DS1302_setWriteProtect(void);
163 
169 void DS1302_clearWriteProtect(void);
170 
179 void DS1302_setDateTime(void);
180 
187 void DS1302_setMessage(char *msg);
188 
193 char *DS1302_getMessage(void);
char * DS1302_getAMPM(void)
get am/pm string
Definition: ds1302.c:85
short DS1302_getSeconds(void)
get seconds
Definition: ds1302.c:37
short DS1302_getMonth(void)
get month
Definition: ds1302.c:100
void DS1302_setHour(short hour)
set hours
Definition: ds1302.c:180
short DS1302_getWeekDay(void)
get day of the week
Definition: ds1302.c:110
void DS1302_setMonth(short month)
set month
Definition: ds1302.c:145
short DS1302_getDay(void)
get day
Definition: ds1302.c:90
void DS1302_setWeekDay(short weekday)
set day of the week
Definition: ds1302.c:165
void DS1302_open(short mosi, short cs, short sclk, short miso)
open connection to clock chip
Definition: ds1302.c:26
void DS1302_setMessage(char *msg)
save message in ram
Definition: ds1302.c:289
void DS1302_setYear(short year)
set year
Definition: ds1302.c:135
void DS1302_setTime(short hours, short minutes, short seconds)
set time
Definition: ds1302.c:173
void DS1302_setDateTime(void)
set propeller date/time This sets the tick value for unix date time functions used in the propeller l...
Definition: ds1302.c:244
char * DS1302_getMessage(void)
get message from ram
Definition: ds1302.c:302
void DS1302_setDate(short year, short month, short day)
set Date
Definition: ds1302.c:128
void DS1302_setMinute(short minutes)
set minutes
Definition: ds1302.c:203
short DS1302_getWriteProtect(void)
get write protect state
Definition: ds1302.c:223
short DS1302_getYear(void)
Get year value.
Definition: ds1302.c:118
void DS1302_setWriteProtect(void)
set write protect state prevents any register from being written to
Definition: ds1302.c:234
short DS1302_getHours(void)
get hours
Definition: ds1302.c:59
void DS1302_set12Hour(short hour, char AmPm)
set 12 hour format
Definition: ds1302.c:190
short DS1302_getMinutes(void)
get minutes
Definition: ds1302.c:48
void DS1302_setDay(short day)
set day
Definition: ds1302.c:155
void DS1302_setSecond(short seconds)
set seconds
Definition: ds1302.c:213
void DS1302_clearWriteProtect(void)
clear write protect state must be called before changing any date/time value or message
Definition: ds1302.c:239