Revision 380
fixed rtc
rtc.h | ||
---|---|---|
11 | 11 |
|
12 | 12 |
#include <stdint.h> |
13 | 13 |
|
14 |
// RTC IRQ Line |
|
15 |
|
|
16 |
#define RTC_IRQ 8 /* @brief RTC IRQ Line */ |
|
17 |
|
|
14 | 18 |
/** |
15 | 19 |
* @brief Subscribes RTC Interrupts |
16 | 20 |
* @param interrupt_bit Bit of Interrupt Vector that will be set when RTC Interrupt is pending |
... | ... | |
38 | 42 |
int (rtc_write_register)(uint32_t reg, uint8_t data); |
39 | 43 |
|
40 | 44 |
/** |
45 |
* @brief Reads seconds register. |
|
46 |
* |
|
47 |
* @param sec Address to store value |
|
48 |
* @return ERROR_CODE code representing the result of the operation, SUCCESS code is returned if everything is OK |
|
49 |
* @see {_ERRORS_H_::errors} |
|
50 |
*/ |
|
51 |
int rtc_read_sec(uint8_t *sec); |
|
52 |
|
|
53 |
/** |
|
54 |
* @brief Reads minutes register. |
|
55 |
* |
|
56 |
* @param min Address to store value |
|
57 |
* @return ERROR_CODE code representing the result of the operation, SUCCESS code is returned if everything is OK |
|
58 |
* @see {_ERRORS_H_::errors} |
|
59 |
*/ |
|
60 |
int rtc_read_min(uint8_t *min); |
|
61 |
|
|
62 |
/** |
|
63 |
* @brief Reads hours register. |
|
64 |
* |
|
65 |
* @param hour Address to store value |
|
66 |
* @return ERROR_CODE code representing the result of the operation, SUCCESS code is returned if everything is OK |
|
67 |
* @see {_ERRORS_H_::errors} |
|
68 |
*/ |
|
69 |
int rtc_read_hour(uint8_t *hour); |
|
70 |
/** |
|
71 |
* @brief Reads weekday register. |
|
72 |
* |
|
73 |
* @param hour Address to store value |
|
74 |
* @return ERROR_CODE code representing the result of the operation, SUCCESS code is returned if everything is OK |
|
75 |
* @see {_ERRORS_H_::errors} |
|
76 |
*/ |
|
77 |
int (rtc_read_weekday)(uint8_t *weekday); |
|
78 |
/** |
|
79 |
* @brief Reads day register. |
|
80 |
* |
|
81 |
* @param hour Address to store value |
|
82 |
* @return ERROR_CODE code representing the result of the operation, SUCCESS code is returned if everything is OK |
|
83 |
* @see {_ERRORS_H_::errors} |
|
84 |
*/ |
|
85 |
int (rtc_read_day)(uint8_t *day); |
|
86 |
/** |
|
87 |
* @brief Reads month register. |
|
88 |
* |
|
89 |
* @param hour Address to store value |
|
90 |
* @return ERROR_CODE code representing the result of the operation, SUCCESS code is returned if everything is OK |
|
91 |
* @see {_ERRORS_H_::errors} |
|
92 |
*/ |
|
93 |
int (rtc_read_month)(uint8_t *month); |
|
94 |
/** |
|
95 |
* @brief Reads year register. |
|
96 |
* |
|
97 |
* @param hour Address to store value |
|
98 |
* @return ERROR_CODE code representing the result of the operation, SUCCESS code is returned if everything is OK |
|
99 |
* @see {_ERRORS_H_::errors} |
|
100 |
*/ |
|
101 |
int (rtc_read_year)(uint8_t *year); |
|
102 |
|
|
103 |
/** |
|
41 | 104 |
* @brief Checks if there's an update in progress. |
42 | 105 |
* @return The value of the flag UIP, or ERROR_CODE if error occurs. |
43 | 106 |
*/ |
44 | 107 |
int (rtc_check_update)(void); |
45 | 108 |
|
46 | 109 |
/** |
47 |
* @brief Enables/Disables updates of time/date registers.
|
|
110 |
* @brief Enables/Disables interrupts on update.
|
|
48 | 111 |
* @param on zero to disable, any other value to enable |
49 | 112 |
* @return ERROR_CODE code representing the result of the operation, SUCCESS code is returned if everything is OK |
50 | 113 |
*/ |
51 |
int (rtc_set_updates)(int on); |
|
114 |
int (rtc_set_updates_int)(int on);
|
|
52 | 115 |
|
53 | 116 |
/** |
54 | 117 |
* @brief Reads time from RTC. |
... | ... | |
63 | 126 |
* @return ERROR_CODE code representing the result of the operation, SUCCESS code is returned if everything is OK |
64 | 127 |
*/ |
65 | 128 |
int (rtc_read_date)(uint8_t *date); |
129 |
/// @brief RTC Interrupt Handler |
|
130 |
void rtc_ih(); |
|
66 | 131 |
|
67 | 132 |
/** |
68 | 133 |
* @} |
Also available in: Unified diff