Clock Calender device.
More...
#include "ds1302.h"
#include "simpletools.h"
#include "sys/time.h"
|
short | _MM [] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334} |
|
char | AMPM [][3] = {"AM", "PM"} |
|
char | _Msg [32] |
|
short | _AMPM |
|
short | _SCLK |
|
short | _MOSI |
|
short | _CS |
|
short | _MISO |
|
Clock Calender device.
- Author
- Michael Burmeister
- Date
- January 14, 2017
- Version
- 1.0
◆ DS1302_getAMPM()
char* DS1302_getAMPM |
( |
void |
| ) |
|
get am/pm string
- Returns
- ampm
◆ DS1302_getDay()
short DS1302_getDay |
( |
void |
| ) |
|
◆ DS1302_getHours()
short DS1302_getHours |
( |
void |
| ) |
|
get hours
- Returns
- seconds @detailed return the hours in 24 hour format or 12 hour format. In 12 hour format use getAMPM to return a string with AM/PM value.
◆ DS1302_getMessage()
char* DS1302_getMessage |
( |
void |
| ) |
|
get message from ram
- Returns
- message
◆ DS1302_getMinutes()
short DS1302_getMinutes |
( |
void |
| ) |
|
get minutes
- Returns
- minutes
◆ DS1302_getMonth()
short DS1302_getMonth |
( |
void |
| ) |
|
◆ DS1302_getSeconds()
short DS1302_getSeconds |
( |
void |
| ) |
|
get seconds
- Returns
- seconds
◆ DS1302_getWeekDay()
short DS1302_getWeekDay |
( |
void |
| ) |
|
get day of the week
- Returns
- day
◆ DS1302_getWriteProtect()
short DS1302_getWriteProtect |
( |
void |
| ) |
|
get write protect state
- Returns
- 0 - false 1 - true
◆ DS1302_getYear()
short DS1302_getYear |
( |
void |
| ) |
|
◆ DS1302_open()
void DS1302_open |
( |
short |
mosi, |
|
|
short |
cs, |
|
|
short |
sclk, |
|
|
short |
miso |
|
) |
| |
open connection to clock chip
- Parameters
-
mosi | Master out slave in |
cs | Chip Select |
sclk | System Clock |
miso | Master in slave out |
◆ DS1302_set12Hour()
void DS1302_set12Hour |
( |
short |
hour, |
|
|
char |
AmPm |
|
) |
| |
set 12 hour format
- Parameters
-
hour | in 12 hour format |
AmPm | use A for AM and P for PM |
◆ DS1302_setDate()
void DS1302_setDate |
( |
short |
year, |
|
|
short |
month, |
|
|
short |
day |
|
) |
| |
set Date
- Parameters
-
year | last two digits only |
month | |
day | |
◆ DS1302_setDay()
void DS1302_setDay |
( |
short |
day | ) |
|
◆ DS1302_setHour()
void DS1302_setHour |
( |
short |
hour | ) |
|
set hours
- Parameters
-
hour | @detailed must be in 24 hour format |
◆ DS1302_setMinute()
void DS1302_setMinute |
( |
short |
minutes | ) |
|
◆ DS1302_setMonth()
void DS1302_setMonth |
( |
short |
month | ) |
|
◆ DS1302_setSecond()
void DS1302_setSecond |
( |
short |
seconds | ) |
|
◆ DS1302_setTime()
void DS1302_setTime |
( |
short |
hours, |
|
|
short |
minutes, |
|
|
short |
seconds |
|
) |
| |
◆ DS1302_setWeekDay()
void DS1302_setWeekDay |
( |
short |
weekday | ) |
|
set day of the week
- Parameters
-
weekday | 1-sunday, 7 - saturday |
◆ DS1302_setYear()
void DS1302_setYear |
( |
short |
year | ) |
|