• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (C) 2022 Beken Corporation
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #pragma once
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 typedef volatile struct {
22 	union {
23 		struct {
24 			uint32_t cnt_reset: 1; /**< bit[0] reset current counter(tick) value to 0 */
25 			uint32_t cnt_stop: 1; /**< bit[1] pause the current counter(tick). RW: 0: goon increase tick cnt, 1: pause the current counter(tick) */
26 			uint32_t up_int_en: 1; /**< bit[2] the upper tick value interrupt enable:if the tick cnt increase to the upper tick value, will report int to CPU, value is in ; */
27 			uint32_t tick_int_en: 1; /**< bit[3] the selected value interrupt enable:if the tick cnt increase to the selected tick value, will report irq to CPU */
28 			uint32_t up_int_sts: 1; /**< bit[4] the intrrupt status of whehter the current counter(tick) value is equal upper tick value */
29 			uint32_t tick_int_sts: 1; /**< bit[5] the intrrupt status of whehter the current counter(tick) value is equal selected tick value */
30 			uint32_t en: 1; /**< bit[6] enable the 32k clk of rtc core */
31 		};
32 		uint32_t ctrl_v;
33 	} ctrl;
34 
35 	/* RW:set the upper tick value;
36 	 * if the counter(tick) value is equal upper, the counter(tick) value will count form 0;
37 	 * it will update up_int_sts and report irq to cpu if enable the irq:up_int_en;
38 	 */
39 	uint32_t upper_val;
40 	/* RW:set the selected tick value;
41 	 * it will update select_int_sts and report irq to cpu if the counter(tick) value is equal this value,and enable the irq:select_int_en.
42 	 */
43 	uint32_t tick_val;
44 
45 	uint32_t counter_val;	//RO:current tick value of the counter
46 	uint32_t up_val_lpo;	//RO:update upper value to lpo
47 	uint32_t tick_val_lpo;	//RO:update tick value to lpo
48 }aon_rtc_hw_t;
49 
50 #ifdef __cplusplus
51 }
52 #endif
53 
54 
55