|
TM STM32F4xx Libraries
v1.0.0
Libraries for STM32F4xx devices from Tilen Majerle
|
Library Functions. More...
Functions | |
| TM_DS1307_Result_t | TM_DS1307_Init (void) |
| Initializes DS1307 RTC library. More... | |
| uint8_t | TM_DS1307_GetSeconds (void) |
| Gets seconds from DS1307. More... | |
| uint8_t | TM_DS1307_GetMinutes (void) |
| Gets minutes from DS1307. More... | |
| uint8_t | TM_DS1307_GetHours (void) |
| Gets hours from DS1307. More... | |
| uint8_t | TM_DS1307_GetDay (void) |
| Gets day in a week from DS1307. More... | |
| uint8_t | TM_DS1307_GetDate (void) |
| Gets date from DS1307. More... | |
| uint8_t | TM_DS1307_GetMonth (void) |
| Gets month from DS1307. More... | |
| uint8_t | TM_DS1307_GetYear (void) |
| Gets year from DS1307. More... | |
| void | TM_DS1307_SetSeconds (uint8_t seconds) |
| Sets seconds to DS1307. More... | |
| void | TM_DS1307_SetMinutes (uint8_t minutes) |
| Sets minutes to DS1307. More... | |
| void | TM_DS1307_SetHours (uint8_t hours) |
| Sets hours to DS1307. More... | |
| void | TM_DS1307_SetDay (uint8_t day) |
| Sets day to DS1307. More... | |
| void | TM_DS1307_SetDate (uint8_t date) |
| Sets date to DS1307. More... | |
| void | TM_DS1307_SetMonth (uint8_t month) |
| Sets month to DS1307. More... | |
| void | TM_DS1307_SetYear (uint8_t year) |
| Sets year to DS1307. More... | |
| void | TM_DS1307_GetDateTime (TM_DS1307_Time_t *time) |
| Gets full date and time from DS1307. More... | |
| void | TM_DS1307_SetDateTime (TM_DS1307_Time_t *time) |
| Sets full date and time to DS1307. More... | |
| void | TM_DS1307_EnableOutputPin (TM_DS1307_OutputFrequency_t frequency) |
| DS1307 has SQW/OUT pin, which can be enabled in various modes. It can output 32768Hz, 8192Hz, 4096Hz, 1Hz, Low or High state. This is useful if you need interrupts on MCU. 1Hz can be used to increment time by software each time. This is faster than look for date and time each time. More... | |
| void | TM_DS1307_DisableOutputPin (void) |
| Disables SQW/OUT pin. More... | |
| uint8_t | TM_DS1307_Bcd2Bin (uint8_t bcd) |
| Converts BCD to BIN data. More... | |
| uint8_t | TM_DS1307_Bin2Bcd (uint8_t bin) |
| Converts BIN to BCD data. More... | |
| uint8_t | TM_DS1307_CheckMinMax (uint8_t val, uint8_t min, uint8_t max) |
| Checks for min and max values, which can be stored to DS1307. More... | |
Library Functions.
| uint8_t TM_DS1307_Bcd2Bin | ( | uint8_t | bcd | ) |
Converts BCD to BIN data.
| bcd | BCD value to be converted |
| BIN | value from given BCD |
| uint8_t TM_DS1307_Bin2Bcd | ( | uint8_t | bin | ) |
Converts BIN to BCD data.
| bin | BIN value to be converted |
| BCD | value from given BIN |
| uint8_t TM_DS1307_CheckMinMax | ( | uint8_t | val, |
| uint8_t | min, | ||
| uint8_t | max | ||
| ) |
Checks for min and max values, which can be stored to DS1307.
| val | Value to be checked |
| min | Minimal allowed value of val |
| max | Maximal allowed value of val |
| Value | between min and max |
| void TM_DS1307_DisableOutputPin | ( | void | ) |
Disables SQW/OUT pin.
This function basically set pin to high state. To get high state you need external pull up resistor (or use pull up from MCU)
| None |
| void TM_DS1307_EnableOutputPin | ( | TM_DS1307_OutputFrequency_t | frequency | ) |
DS1307 has SQW/OUT pin, which can be enabled in various modes. It can output 32768Hz, 8192Hz, 4096Hz, 1Hz, Low or High state. This is useful if you need interrupts on MCU. 1Hz can be used to increment time by software each time. This is faster than look for date and time each time.
| frequency | SQW frequency. This parameter can be a value of TM_DS1307_OutputFrequency_t enumeration |
| None |
| uint8_t TM_DS1307_GetDate | ( | void | ) |
Gets date from DS1307.
| None |
| Date | from DS1307, 01 to 31 |
| void TM_DS1307_GetDateTime | ( | TM_DS1307_Time_t * | time | ) |
Gets full date and time from DS1307.
| *time | Pointer to TM_DS1307_Time_t structure where to set data |
| None |
| uint8_t TM_DS1307_GetDay | ( | void | ) |
Gets day in a week from DS1307.
| None |
| Day | in a week from DS1307, 1 to 7 |
| uint8_t TM_DS1307_GetHours | ( | void | ) |
Gets hours from DS1307.
| None |
| Hours | from DS1307, 00 to 23 |
| uint8_t TM_DS1307_GetMinutes | ( | void | ) |
Gets minutes from DS1307.
| None |
| Minutes | from DS1307, 00 to 59 |
| uint8_t TM_DS1307_GetMonth | ( | void | ) |
Gets month from DS1307.
| None |
| Month | from DS1307, 01 to 12 |
| uint8_t TM_DS1307_GetSeconds | ( | void | ) |
Gets seconds from DS1307.
| None |
| Seconds | from DS1307, 00 to 59 |
| uint8_t TM_DS1307_GetYear | ( | void | ) |
Gets year from DS1307.
| None | Returns year from DS1307, 00 (2000) to 99 (2099) |
| TM_DS1307_Result_t TM_DS1307_Init | ( | void | ) |
Initializes DS1307 RTC library.
| None |
| None |
| void TM_DS1307_SetDate | ( | uint8_t | date | ) |
Sets date to DS1307.
| date | Date to be set to DS1307, 01 to 31 |
| None |
| void TM_DS1307_SetDateTime | ( | TM_DS1307_Time_t * | time | ) |
Sets full date and time to DS1307.
| *time | Pointer to TM_DS1307_Time_t structure where to get data |
| None |
| void TM_DS1307_SetDay | ( | uint8_t | day | ) |
Sets day to DS1307.
| day | Day to be set to DS1307, 1 to 7 |
| None |
| void TM_DS1307_SetHours | ( | uint8_t | hours | ) |
Sets hours to DS1307.
| hours | Hours to be set to DS1307, 01 to 23 |
| None |
| void TM_DS1307_SetMinutes | ( | uint8_t | minutes | ) |
Sets minutes to DS1307.
| minutes | Minutes to be set to DS1307, 01 to 59 |
| None |
| void TM_DS1307_SetMonth | ( | uint8_t | month | ) |
Sets month to DS1307.
| month | Month to be set to DS1307, 01 to 12 |
| None |
| void TM_DS1307_SetSeconds | ( | uint8_t | seconds | ) |
Sets seconds to DS1307.
| seconds | Seconds to be set to DS1307, 01 to 59 |
| None |
| void TM_DS1307_SetYear | ( | uint8_t | year | ) |
Sets year to DS1307.
| year | Year to be set to DS1307, 00 (2000) to 99 (2099) |
| None |