NHS31xx SW API
rtc_nss.h
1 /*
2  * Copyright 2014-2020 NXP
3  * This software is owned or controlled by NXP and may only be used strictly
4  * in accordance with the applicable license terms. By expressly accepting
5  * such terms or by downloading, installing, activating and/or otherwise using
6  * the software, you are agreeing that you have read, and that you agree to
7  * comply with and are bound by, such license terms. If you do not agree to
8  * be bound by the applicable license terms, then you may not retain, install,
9  * activate or otherwise use the software.
10  */
11 
12 #ifndef __RTC_NSS_H_
13 #define __RTC_NSS_H_
14 
15 #include "chip.h"
16 
109 typedef struct NSS_RTC_S {
110  __IO uint32_t CR;
111  __IO uint32_t SR;
112  __IO uint32_t CAL;
113  __IO uint32_t SLEEPT;
114  __I uint32_t VAL;
115  __IO uint32_t IMSC;
116  __I uint32_t RIS;
117  __I uint32_t MIS;
118  __O uint32_t ICR;
119  __I uint32_t ACCSTAT;
120  __I uint32_t RESERVED[2];/* reserved */
121  __IO uint32_t TIME;
122 } NSS_RTC_T;
123 
124 
138 typedef enum RTC_WAKEUPCTRL {
140  RTC_WAKEUPCTRL_AUTO = (1 << 1),
143  RTC_WAKEUPCTRL_START = (1 << 2),
147 
149 typedef enum RTC_INT {
150  RTC_INT_WAKEUP = (1 << 0),
151  RTC_INT_ALL = 0x01,
153 } RTC_INT_T;
154 
161 void Chip_RTC_Init(NSS_RTC_T * pRTC);
162 
174 void Chip_RTC_DeInit(NSS_RTC_T * pRTC);
175 
183 void Chip_RTC_SetCalibration(NSS_RTC_T *pRTC, int calibValue);
184 
193 
204 
215 
228 void Chip_RTC_Wakeup_SetReload(NSS_RTC_T *pRTC, int ticks);
229 
239 
248 
257 
268 
278 void Chip_RTC_Time_SetValue(NSS_RTC_T *pRTC, int tickValue);
279 
289 
298 
308 
317 
318 #endif
void Chip_RTC_Int_ClearRawStatus(NSS_RTC_T *pRTC, RTC_INT_T flags)
Definition: rtc_nss.h:150
volatile uint32_t TIME
Definition: rtc_nss.h:121
volatile uint32_t SR
Definition: rtc_nss.h:111
RTC_WAKEUPCTRL_T
Definition: rtc_nss.h:138
volatile uint32_t SLEEPT
Definition: rtc_nss.h:113
volatile uint32_t CAL
Definition: rtc_nss.h:112
volatile const uint32_t VAL
Definition: rtc_nss.h:114
volatile uint32_t ICR
Definition: rtc_nss.h:118
#define __IO
Definition: core_cm0plus.h:167
#define __I
Definition: core_cm0plus.h:164
bool Chip_RTC_Wakeup_IsRunning(NSS_RTC_T *pRTC)
void Chip_RTC_Wakeup_SetReload(NSS_RTC_T *pRTC, int ticks)
RTC_INT_T
Definition: rtc_nss.h:149
int Chip_RTC_GetCalibration(NSS_RTC_T *pRTC)
RTC_WAKEUPCTRL_T Chip_RTC_Wakeup_GetControl(NSS_RTC_T *pRTC)
void Chip_RTC_Int_SetEnabledMask(NSS_RTC_T *pRTC, RTC_INT_T mask)
Definition: rtc_nss.h:143
void Chip_RTC_Init(NSS_RTC_T *pRTC)
Definition: rtc_nss.h:152
volatile const uint32_t MIS
Definition: rtc_nss.h:117
Definition: rtc_nss.h:139
Definition: rtc_nss.h:151
void Chip_RTC_Wakeup_SetControl(NSS_RTC_T *pRTC, RTC_WAKEUPCTRL_T control)
Definition: rtc_nss.h:140
void Chip_RTC_Time_SetValue(NSS_RTC_T *pRTC, int tickValue)
volatile const uint32_t ACCSTAT
Definition: rtc_nss.h:119
#define __O
Definition: core_cm0plus.h:166
int Chip_RTC_Wakeup_GetReload(NSS_RTC_T *pRTC)
void Chip_RTC_DeInit(NSS_RTC_T *pRTC)
Definition: rtc_nss.h:109
int Chip_RTC_Wakeup_GetRemaining(NSS_RTC_T *pRTC)
Definition: rtc_nss.h:145
void Chip_RTC_SetCalibration(NSS_RTC_T *pRTC, int calibValue)
RTC_INT_T Chip_RTC_Int_GetEnabledMask(NSS_RTC_T *pRTC)
int Chip_RTC_Time_GetValue(NSS_RTC_T *pRTC)
volatile const uint32_t RIS
Definition: rtc_nss.h:116
volatile uint32_t CR
Definition: rtc_nss.h:110
RTC_INT_T Chip_RTC_Int_GetRawStatus(NSS_RTC_T *pRTC)
volatile uint32_t IMSC
Definition: rtc_nss.h:115