Mistake on this page?
Report an issue in GitHub or email us
pal_rtc.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file
4  *
5  * \brief RTC timer interface file.
6  *
7  * Copyright (c) 2018 Arm Ltd. All Rights Reserved.
8  *
9  * Copyright (c) 2019-2020 Packetcraft, Inc.
10  *
11  * Licensed under the Apache License, Version 2.0 (the "License");
12  * you may not use this file except in compliance with the License.
13  * You may obtain a copy of the License at
14  *
15  * http://www.apache.org/licenses/LICENSE-2.0
16  *
17  * Unless required by applicable law or agreed to in writing, software
18  * distributed under the License is distributed on an "AS IS" BASIS,
19  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  * See the License for the specific language governing permissions and
21  * limitations under the License.
22  */
23 /*************************************************************************************************/
24 
25 #ifndef PAL_RTC_H
26 #define PAL_RTC_H
27 
28 #include "pal_types.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 /*! \addtogroup PAL_RTC
35  * \{ */
36 
37 /**************************************************************************************************
38  Macros
39 **************************************************************************************************/
40 
41 /*! \brief Max value of RTC. */
42 #define PAL_MAX_RTC_COUNTER_VAL (0x00FFFFFF)
43 
44 /*! \brief Clock frequency of the RTC timer used. */
45 #define PAL_RTC_TICKS_PER_SEC (32768) /* RTC ticks per second (with prescaler) */
46 
47 /*! \brief 23 RTC ticks time(700us) for xtal start up befor scheduler load. */
48 #define PAL_HFCLK_OSC_SETTLE_TICKS (23)
49 
50 /*! \brief Platform RTC callback. */
51 typedef void (*palRtcIrqCback_t)(void);
52 
53 /**************************************************************************************************
54  Type Definitions
55 **************************************************************************************************/
56 
57 /*! \brief Operational states. */
58 typedef enum
59 {
60  PAL_RTC_STATE_UNINIT = 0, /*!< Uninitialized state. */
61  PAL_RTC_STATE_ERROR = 0, /*!< Error state. */
62  PAL_RTC_STATE_READY = 1 /*!< Ready state. */
64 
65 /**************************************************************************************************
66  Function Declarations
67 **************************************************************************************************/
68 
69 /* Initialization */
70 void PalRtcInit(void);
71 
72 /* Control and Status */
73 void PalRtcEnableCompareIrq(uint8_t channelId);
74 void PalRtcDisableCompareIrq(uint8_t channelId);
75 uint32_t PalRtcCounterGet(void);
76 void PalRtcCompareSet(uint8_t channelId, uint32_t value);
77 
78 /*! \} */ /* PAL_RTC */
79 
80 #ifdef __cplusplus
81 };
82 #endif
83 
84 #endif
Platform-independent data types.
PalRtcState_t
Operational states.
Definition: pal_rtc.h:58
void(* palRtcIrqCback_t)(void)
Platform RTC callback.
Definition: pal_rtc.h:51
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.