RTC communication interface.
More...
|
file | rtc.h |
| RTC interface.
Communication interface to use the RTC from the CARME-M4.
|
|
file | rtc.c |
| Communication interface to use the RTC on the controller.
|
|
RTC communication interface.
#define CARME_ERROR_RTC CARME_ERROR_RTC_BASE + 0 |
Common RTC error
Definition at line 83 of file rtc.h.
#define CARME_RTC_STATE_INIT_OK 0x35AC |
RTC initialized
Definition at line 86 of file rtc.c.
#define CARME_RTC_STATE_REG RTC_BKP_DR0 |
Status register
Definition at line 85 of file rtc.c.
#define CARME_RTC_STATE_TIME_OK 0xA3C5 |
RTC set
Definition at line 87 of file rtc.c.
#define CARME_RTC_USE_WAKEUP_ISR 0 |
Disable wakeup interrupt
Definition at line 86 of file rtc.h.
Get the date and time from the internal rtc.
- Parameters
-
[out] | time | Buffer structure to save the date and time. |
- Returns
- None
Definition at line 204 of file rtc.c.
void CARME_RTC_Init |
( |
void |
| ) |
|
Initialize and start the internal RTC of the STM32F4xx.
The date and time is set from the external RTC on the mainboard.
- Returns
- None
- Examples:
- sdcard.c.
Definition at line 105 of file rtc.c.
Set the internal rtc date and time.
- Parameters
-
[in] | time | Date and time to write to the internal rtc. |
- Returns
- ERROR_CODES
Definition at line 167 of file rtc.c.
uint32_t get_fattime |
( |
void |
| ) |
|
Get the time from the RTC.
This function is used from the FatFs and the function prototype is given by the FatFs module.
- Returns
- Bit 25 to 31: Year from 1980 (0..127)
Bit 21 to 24: Month (1..12)
Bit 16 to 20: Day in month (1..31)
Bit 11 to 15: Hour (0..23)
Bit 5 to 10: Minute (0..59)
Bit 1 to 4: Second / 2 (0..29)
Definition at line 326 of file rtc.c.