Clock Calender device.
More...
Go to the source code of this file.
|
#define | DS1302SECONDS 0x81 |
|
#define | DS1302MINUTES 0x83 |
|
#define | DS1302HOURS 0x85 |
|
#define | DS1302DAY 0x87 |
|
#define | DS1302MONTH 0x89 |
|
#define | DS1302WEEKDAY 0x8B |
|
#define | DS1302YEAR 0x8D |
|
#define | DS1302WP 0x8F |
|
#define | DS1302BURSTRD 0xBF |
|
#define | DS1302BURSTMM 0xFF |
|
Clock Calender device.
- Author
- Michael Burmeister
- Date
- January 14, 2017
- Version
- 1.2
◆ DS1302_getAMPM()
char* DS1302_getAMPM |
( |
void |
| ) |
|
get am/pm string
- Returns
- ampm AM/PM string
◆ DS1302_getDay()
short DS1302_getDay |
( |
void |
| ) |
|
◆ DS1302_getHours()
short DS1302_getHours |
( |
void |
| ) |
|
get hours
- Returns
- seconds returns 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 |
| ) |
|
Get year value.
- Returns
- year only last 2 digits
◆ DS1302_open()
void DS1302_open |
( |
short |
mosi, |
|
|
short |
cs, |
|
|
short |
sclk, |
|
|
short |
miso |
|
) |
| |
open connection to clock chip
- Parameters
-
mosi | Master out slave in pin |
cs | Chip Select pin |
sclk | System Clock pin |
miso | Master in slave out pin |
◆ 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 | Must be in 24 hour format |
◆ DS1302_setMessage()
void DS1302_setMessage |
( |
char * |
msg | ) |
|
save message in ram
- Parameters
-
msg | Save a short message to ram 31 bytes max |
◆ 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 |
|
) |
| |
set time
- Parameters
-
hours | |
minutes | |
seconds | hours are in 24 hour format |
◆ DS1302_setWeekDay()
void DS1302_setWeekDay |
( |
short |
weekday | ) |
|
set day of the week
- Parameters
-
weekday | number from 1-sunday, 7 - saturday |
◆ DS1302_setYear()
void DS1302_setYear |
( |
short |
year | ) |
|
set year
- Parameters
-
year | only the last 2 digits of the year |