root / proj / include / rtc.h @ 269
History | View | Annotate | Download (1.71 KB)
1 |
#ifndef RTC_H_INCLUDED
|
---|---|
2 |
#define RTC_H_INCLUDED
|
3 |
|
4 |
#include <stdint.h> |
5 |
|
6 |
/**
|
7 |
* @brief Subscribes RTC Interrupts
|
8 |
* @param interrupt_bit Bit of Interrupt Vector that will be set when RTC Interrupt is pending
|
9 |
* @param interrupt_id RTC Interrupt ID to specify the RTC Interrupt in other calls
|
10 |
* @return ERROR_CODE code representing the result of the operation, SUCCESS code is returned if everything is OK
|
11 |
* @see {_ERRORS_H_::errors}
|
12 |
*/
|
13 |
int (subscribe_rtc_interrupt)(uint8_t interrupt_bit, int *interrupt_id); |
14 |
|
15 |
int (rtc_read_register)(uint32_t reg, uint8_t *data);
|
16 |
|
17 |
int (rtc_write_register)(uint32_t reg, uint8_t data);
|
18 |
|
19 |
/**
|
20 |
* @brief Checks if there's an update in progress.
|
21 |
* @return The value of the flag UIP, or ERROR_CODE if error occurs.
|
22 |
*/
|
23 |
int (rtc_check_update)(void); |
24 |
|
25 |
/**
|
26 |
* @brief Enables/Disables updates of time/date registers.
|
27 |
* @param on zero to disable, any other value to enable
|
28 |
* @return ERROR_CODE code representing the result of the operation, SUCCESS code is returned if everything is OK
|
29 |
*/
|
30 |
int (rtc_set_updates)(int on); |
31 |
|
32 |
/**
|
33 |
* @brief Reads time from RTC.
|
34 |
* @param time Pointer to array of 3 bytes to store the information about time (hours, minutes, seconds)
|
35 |
* @return ERROR_CODE code representing the result of the operation, SUCCESS code is returned if everything is OK
|
36 |
*/
|
37 |
int (rtc_read_time)(uint8_t *time);
|
38 |
|
39 |
/**
|
40 |
* @brief Reads date from RTC.
|
41 |
* @param date Pointer to array of 4 bytes to store the information about date (year, month, day, weekday)
|
42 |
* @return ERROR_CODE code representing the result of the operation, SUCCESS code is returned if everything is OK
|
43 |
*/
|
44 |
int (rtc_read_date)(uint8_t *date);
|
45 |
|
46 |
#endif /* end of include guard: RTC_H_INCLUDED */ |