TMPM4G9  V1.0.0.0
horol.h
Go to the documentation of this file.
1 
13 /*------------------------------------------------------------------------------*/
14 /* Define to prevent recursive inclusion */
15 /*------------------------------------------------------------------------------*/
16 #ifndef __HOROL_H
17 #define __HOROL_H
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 /*------------------------------------------------------------------------------*/
24 /* Includes */
25 /*------------------------------------------------------------------------------*/
26 #include "txz_sample_def.h"
27 #include "bsp_rtc.h"
28 
38 /*------------------------------------------------------------------------------*/
39 /* Macro Function */
40 /*------------------------------------------------------------------------------*/
46 /* no define */
47  /* End of group RTC_UART_Private_macro */
51 
52 
53 /*------------------------------------------------------------------------------*/
54 /* Configuration */
55 /*------------------------------------------------------------------------------*/
61 /* no define */
62  /* End of group RTC_UART_Private_define */
66 
67 
68 /*------------------------------------------------------------------------------*/
69 /* Macro Definition */
70 /*------------------------------------------------------------------------------*/
76 /* no define */
77  /* End of group RTC_UART_Private_define */
81 
82 
83 /*------------------------------------------------------------------------------*/
84 /* Enumerated Type Definition */
85 /*------------------------------------------------------------------------------*/
90 /*----------------------------------*/
94 /*----------------------------------*/
95 typedef enum
96 {
99  /*>>> be set bottom */
101  /*<<< be set bottom */
102 } HorolValueLayer; /* End of group RTC_UART_Private_define */
106 
107 
108 /*------------------------------------------------------------------------------*/
109 /* Structure Definition */
110 /*------------------------------------------------------------------------------*/
115 /*----------------------------------*/
119 /*----------------------------------*/
120 typedef struct
121 {
122  uint8_t century;
123  uint8_t year;
125  uint8_t notation;
127  uint8_t meridiem;
129  uint8_t month;
131  uint8_t date;
133  uint8_t day;
135  uint8_t hour;
137  uint8_t min;
139  uint8_t sec;
142 
143 /*----------------------------------*/
148 /*----------------------------------*/
149 typedef struct
150 {
151  uint32_t id;
153  void (*clock_update)(uint32_t id);
155 
156 /*----------------------------------*/
160 /*----------------------------------*/
161 typedef struct
162 {
166  struct
167  {
168  HorolValueLayer read;
170  } clock;
172 
173 /*----------------------------------*/
177 /*----------------------------------*/
178 typedef struct
179 {
182 } horol_t;
183  /* End of group RTC_UART_Private_typedef */
187 
188 
189 /*------------------------------------------------------------------------------*/
190 /* Functions */
191 /*------------------------------------------------------------------------------*/
197 void horol_finalize(horol_t *p_instance);
198 void horol_start(horol_t *p_instance);
199 void horol_stop(horol_t *p_instance);
200 void horol_get_current_clock(horol_t *p_instance, horol_clock_value_t *p_dst);
201 void horol_irq_handler(horol_t *p_instance);
202 uint32_t horol_make_anno_domini(uint8_t century, uint8_t year);
203 TXZ_Result horol_set_alarm_clock(horol_t *p_instance, horol_clock_value_t *p_src); /* End of group RTC_UART_Exported_functions */
207  /* End of group RTC_UART */
211  /* End of group Example */
215 
216 #ifdef __cplusplus
217 }
218 #endif /* __cplusplus */
219 #endif /* __HOROL_H */
220 
221 
This file provides all the functions prototypes for RTC Class.
uint8_t hour
Definition: horol.h:135
uint8_t min
Definition: horol.h:137
Definition: horol.h:100
TXZ_Result
Definition: txz_driver_def.h:43
RTC handle structure definenition.
Definition: bsp_rtc.h:309
uint8_t century
Definition: horol.h:122
Clock Information.
Definition: horol.h:120
uint8_t date
Definition: horol.h:131
horol_private_info_t info
Definition: horol.h:181
Definition: horol.h:98
uint32_t id
Definition: horol.h:151
TXZ_FunctionalState
Definition: txz_driver_def.h:53
void horol_finalize(horol_t *p_instance)
Finalize.
Definition: horol.c:375
HorolValueLayer read
Definition: horol.h:168
Definition: horol.h:97
uint8_t year
Definition: horol.h:123
TXZ_Result horol_set_alarm_clock(horol_t *p_instance, horol_clock_value_t *p_src)
Set alarm clock.
Definition: horol.c:645
horol_t * horol_initialize(horol_initial_setting_t *p_param)
Initialize.
Definition: horol.c:268
Horologe Class.
Definition: horol.h:178
HorolValueLayer
Clock Value Layer.
Definition: horol.h:95
uint8_t day
Definition: horol.h:133
Private Information.
Definition: horol.h:161
void horol_irq_handler(horol_t *p_instance)
IRQ Handler.
Definition: horol.c:497
uint8_t notation
Definition: horol.h:125
Initial setting. User must be set.
Definition: horol.h:149
horol_clock_value_t setting
Definition: horol.h:152
TXZ_FunctionalState end
Definition: horol.h:164
uint8_t month
Definition: horol.h:129
void horol_get_current_clock(horol_t *p_instance, horol_clock_value_t *p_dst)
Get Current Clock Information.
Definition: horol.c:469
void horol_stop(horol_t *p_instance)
Stop.
Definition: horol.c:437
void horol_start(horol_t *p_instance)
Start.
Definition: horol.c:407
uint8_t sec
Definition: horol.h:139
uint32_t horol_make_anno_domini(uint8_t century, uint8_t year)
Make A.D.
Definition: horol.c:621
uint8_t meridiem
Definition: horol.h:127
horol_initial_setting_t init
Definition: horol.h:180
rtc_t rtc
Definition: horol.h:163