1 /***************************************************************************//**
\r
3 * @brief Real Time Counter (RTCC) peripheral API.
\r
5 *******************************************************************************
\r
7 * <b>(C) Copyright 2015 Silicon Labs, http://www.silabs.com</b>
\r
8 *******************************************************************************
\r
10 * Permission is granted to anyone to use this software for any purpose,
\r
11 * including commercial applications, and to alter it and redistribute it
\r
12 * freely, subject to the following restrictions:
\r
14 * 1. The origin of this software must not be misrepresented; you must not
\r
15 * claim that you wrote the original software.
\r
16 * 2. Altered source versions must be plainly marked as such, and must not be
\r
17 * misrepresented as being the original software.
\r
18 * 3. This notice may not be removed or altered from any source distribution.
\r
20 * DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Silicon Labs has no
\r
21 * obligation to support this Software. Silicon Labs is providing the
\r
22 * Software "AS IS", with no express or implied warranties of any kind,
\r
23 * including, but not limited to, any implied warranties of merchantability
\r
24 * or fitness for any particular purpose or warranties against infringement
\r
25 * of any proprietary rights of a third party.
\r
27 * Silicon Labs will not be liable for any consequential, incidental, or
\r
28 * special damages, or any other relief, or for any claim by any third party,
\r
29 * arising from your use of this Software.
\r
31 ******************************************************************************/
\r
33 #ifndef __SILICON_LABS_EM_RTCC_H__
\r
34 #define __SILICON_LABS_EM_RTCC_H__
\r
36 #include "em_device.h"
\r
37 #if defined( RTCC_COUNT ) && ( RTCC_COUNT == 1 )
\r
39 #include <stdbool.h>
\r
40 #include "em_assert.h"
\r
46 /***************************************************************************//**
\r
47 * @addtogroup EM_Library
\r
49 ******************************************************************************/
\r
51 /***************************************************************************//**
\r
54 ******************************************************************************/
\r
56 /*******************************************************************************
\r
57 ********************************* ENUM ************************************
\r
58 ******************************************************************************/
\r
60 /** Operational mode of the counter. */
\r
63 /** Normal counter mode. The counter is incremented by 1 for each tick. */
\r
64 rtccCntModeNormal = _RTCC_CTRL_CNTTICK_PRESC,
\r
66 /** Calendar mode. Refer to the RTCC chapter of the Reference Manual for more
\r
67 * details on the calendar mode. */
\r
68 rtccCntModeCalendar = _RTCC_CTRL_CNTTICK_CCV0MATCH
\r
69 } RTCC_CntMode_TypeDef;
\r
71 /** Counter prescaler selection. */
\r
74 rtccCntPresc_1 = _RTCC_CTRL_CNTPRESC_DIV1, /**< Divide clock by 1. */
\r
75 rtccCntPresc_2 = _RTCC_CTRL_CNTPRESC_DIV2, /**< Divide clock by 2. */
\r
76 rtccCntPresc_4 = _RTCC_CTRL_CNTPRESC_DIV4, /**< Divide clock by 4. */
\r
77 rtccCntPresc_8 = _RTCC_CTRL_CNTPRESC_DIV8, /**< Divide clock by 8. */
\r
78 rtccCntPresc_16 = _RTCC_CTRL_CNTPRESC_DIV16, /**< Divide clock by 16. */
\r
79 rtccCntPresc_32 = _RTCC_CTRL_CNTPRESC_DIV32, /**< Divide clock by 32. */
\r
80 rtccCntPresc_64 = _RTCC_CTRL_CNTPRESC_DIV64, /**< Divide clock by 64. */
\r
81 rtccCntPresc_128 = _RTCC_CTRL_CNTPRESC_DIV128, /**< Divide clock by 128. */
\r
82 rtccCntPresc_256 = _RTCC_CTRL_CNTPRESC_DIV256, /**< Divide clock by 256. */
\r
83 rtccCntPresc_512 = _RTCC_CTRL_CNTPRESC_DIV512, /**< Divide clock by 512. */
\r
84 rtccCntPresc_1024 = _RTCC_CTRL_CNTPRESC_DIV1024, /**< Divide clock by 1024. */
\r
85 rtccCntPresc_2048 = _RTCC_CTRL_CNTPRESC_DIV2048, /**< Divide clock by 2048. */
\r
86 rtccCntPresc_4096 = _RTCC_CTRL_CNTPRESC_DIV4096, /**< Divide clock by 4096. */
\r
87 rtccCntPresc_8192 = _RTCC_CTRL_CNTPRESC_DIV8192, /**< Divide clock by 8192. */
\r
88 rtccCntPresc_16384 = _RTCC_CTRL_CNTPRESC_DIV16384, /**< Divide clock by 16384. */
\r
89 rtccCntPresc_32768 = _RTCC_CTRL_CNTPRESC_DIV32768 /**< Divide clock by 32768. */
\r
90 } RTCC_CntPresc_TypeDef;
\r
93 /** Prescaler mode of the RTCC counter. */
\r
96 /** CNT register ticks according to the prescaler value. */
\r
97 rtccCntTickPresc = _RTCC_CTRL_CNTTICK_PRESC,
\r
99 /** CNT register ticks when PRECNT matches the 15 least significant bits of
\r
100 * ch. 0 CCV register. */
\r
101 rtccCntTickCCV0Match = _RTCC_CTRL_CNTTICK_CCV0MATCH
\r
102 } RTCC_PrescMode_TypeDef;
\r
105 /** Capture/Compare channel mode. */
\r
108 rtccCapComChModeOff = _RTCC_CC_CTRL_MODE_OFF, /**< Capture/Compare channel turned off. */
\r
109 rtccCapComChModeCapture = _RTCC_CC_CTRL_MODE_INPUTCAPTURE, /**< Capture mode. */
\r
110 rtccCapComChModeCompare = _RTCC_CC_CTRL_MODE_OUTPUTCOMPARE, /**< Compare mode. */
\r
111 } RTCC_CapComChMode_TypeDef;
\r
113 /** Compare match output action mode. */
\r
116 rtccCompMatchOutActionPulse = _RTCC_CC_CTRL_CMOA_PULSE, /**< Generate a pulse. */
\r
117 rtccCompMatchOutActionToggle = _RTCC_CC_CTRL_CMOA_TOGGLE, /**< Toggle output. */
\r
118 rtccCompMatchOutActionClear = _RTCC_CC_CTRL_CMOA_CLEAR, /**< Clear output. */
\r
119 rtccCompMatchOutActionSet = _RTCC_CC_CTRL_CMOA_SET /**< Set output. */
\r
120 } RTCC_CompMatchOutAction_TypeDef;
\r
123 /** PRS input sources. */
\r
126 rtccPRSCh0 = _RTCC_CC_CTRL_PRSSEL_PRSCH0, /**< PRS channel 0. */
\r
127 rtccPRSCh1 = _RTCC_CC_CTRL_PRSSEL_PRSCH1, /**< PRS channel 1. */
\r
128 rtccPRSCh2 = _RTCC_CC_CTRL_PRSSEL_PRSCH2, /**< PRS channel 2. */
\r
129 rtccPRSCh3 = _RTCC_CC_CTRL_PRSSEL_PRSCH3, /**< PRS channel 3. */
\r
130 rtccPRSCh4 = _RTCC_CC_CTRL_PRSSEL_PRSCH4, /**< PRS channel 4. */
\r
131 rtccPRSCh5 = _RTCC_CC_CTRL_PRSSEL_PRSCH5, /**< PRS channel 5. */
\r
132 rtccPRSCh6 = _RTCC_CC_CTRL_PRSSEL_PRSCH6, /**< PRS channel 6. */
\r
133 rtccPRSCh7 = _RTCC_CC_CTRL_PRSSEL_PRSCH7, /**< PRS channel 7. */
\r
134 rtccPRSCh8 = _RTCC_CC_CTRL_PRSSEL_PRSCH8, /**< PRS channel 8. */
\r
135 rtccPRSCh9 = _RTCC_CC_CTRL_PRSSEL_PRSCH9, /**< PRS channel 9. */
\r
136 rtccPRSCh10 = _RTCC_CC_CTRL_PRSSEL_PRSCH10, /**< PRS channel 10. */
\r
137 rtccPRSCh11 = _RTCC_CC_CTRL_PRSSEL_PRSCH11 /**< PRS channel 11. */
\r
138 } RTCC_PRSSel_TypeDef;
\r
141 /** Input edge select. */
\r
144 rtccInEdgeRising = _RTCC_CC_CTRL_ICEDGE_RISING, /**< Rising edges detected. */
\r
145 rtccInEdgeFalling = _RTCC_CC_CTRL_ICEDGE_FALLING, /**< Falling edges detected. */
\r
146 rtccInEdgeBoth = _RTCC_CC_CTRL_ICEDGE_BOTH, /**< Both edges detected. */
\r
147 rtccInEdgeNone = _RTCC_CC_CTRL_ICEDGE_NONE /**< No edge detection, signal is left as is. */
\r
148 } RTCC_InEdgeSel_TypeDef;
\r
151 /** Capture/Compare channel compare mode. */
\r
154 /** CCVx is compared with the CNT register. */
\r
155 rtccCompBaseCnt = _RTCC_CC_CTRL_COMPBASE_CNT,
\r
157 /** CCVx is compared with a CNT[16:0] and PRECNT[14:0]. */
\r
158 rtccCompBasePreCnt = _RTCC_CC_CTRL_COMPBASE_PRECNT
\r
159 } RTCC_CompBase_TypeDef;
\r
161 /** Day compare mode. */
\r
164 rtccDayCompareModeMonth = _RTCC_CC_CTRL_DAYCC_MONTH, /**< Day of month is selected for Capture/Compare. */
\r
165 rtccDayCompareModeWeek = _RTCC_CC_CTRL_DAYCC_WEEK /**< Day of week is selected for Capture/Compare. */
\r
166 } RTCC_DayCompareMode_TypeDef;
\r
168 /*******************************************************************************
\r
169 ******************************* STRUCTS ***********************************
\r
170 ******************************************************************************/
\r
172 /** RTCC initialization structure. */
\r
175 /** Enable/disable counting when initialization is completed. */
\r
178 /** Enable/disable timer counting during debug halt. */
\r
181 /** Enable/disable precounter wrap on ch. 0 CCV value. */
\r
182 bool precntWrapOnCCV0;
\r
184 /** Enable/disable counter wrap on ch. 1 CCV value. */
\r
185 bool cntWrapOnCCV1;
\r
187 /** Counter prescaler. */
\r
188 RTCC_CntPresc_TypeDef presc;
\r
190 /** Prescaler mode. */
\r
191 RTCC_PrescMode_TypeDef prescMode;
\r
193 #if defined(_RTCC_CTRL_BUMODETSEN_MASK)
\r
194 /** Enable/disable storing RTCC counter value in RTCC_CCV2 upon backup mode
\r
196 bool enaBackupModeSet;
\r
199 /** Enable/disable the check that sets the OSCFFAIL interrupt flag if no
\r
200 * LFCLK-RTCC ticks are detected within one ULFRCO cycles. */
\r
201 bool enaOSCFailDetect;
\r
203 /** Select the operational mode of the counter. */
\r
204 RTCC_CntMode_TypeDef cntMode;
\r
206 /** Disable leap year correction for the calendar mode. When this parameter is
\r
207 * set to false, February has 29 days if (year % 4 == 0). If true, February
\r
208 * always has 28 days. */
\r
209 bool disLeapYearCorr;
\r
210 } RTCC_Init_TypeDef;
\r
213 /** RTCC capture/compare channel configuration structure. */
\r
216 /** Select the mode of the Capture/Compare channel. */
\r
217 RTCC_CapComChMode_TypeDef chMode;
\r
219 /** Compare mode channel match output action. */
\r
220 RTCC_CompMatchOutAction_TypeDef compMatchOutAction;
\r
222 /** Capture mode channel PRS input channel selection. */
\r
223 RTCC_PRSSel_TypeDef prsSel;
\r
225 /** Capture mode channel input edge selection. */
\r
226 RTCC_InEdgeSel_TypeDef inputEdgeSel;
\r
228 /** Comparison base of the channel in compare mode. */
\r
229 RTCC_CompBase_TypeDef compBase;
\r
231 /** The COMPMASK (5 bit) most significant bits of the compare value will not
\r
232 * be subject to comparison. */
\r
235 /** Day compare mode. */
\r
236 RTCC_DayCompareMode_TypeDef dayCompMode;
\r
237 } RTCC_CCChConf_TypeDef;
\r
240 /*******************************************************************************
\r
241 ******************************* DEFINES ***********************************
\r
242 ******************************************************************************/
\r
244 /** Default RTCC init structure. */
\r
245 #if defined(_RTCC_CTRL_BUMODETSEN_MASK)
\r
246 #define RTCC_INIT_DEFAULT \
\r
248 true, /* Start counting when init done. */ \
\r
249 false, /* Disable RTCC during debug halt. */ \
\r
250 false, /* Disable precounter wrap on ch. 0 CCV value. */ \
\r
251 false, /* Disable counter wrap on ch. 1 CCV value. */ \
\r
252 rtccCntPresc_32, /* 977 us per tick. */ \
\r
253 rtccCntTickPresc, /* Counter increments according to prescaler value. */ \
\r
254 false, /* No RTCC storage on backup mode entry. */ \
\r
255 false, /* No RTCC oscillator failure detection. */ \
\r
256 rtccCntModeNormal, /* Normal RTCC mode. */ \
\r
257 false, /* No leap year correction. */ \
\r
260 #define RTCC_INIT_DEFAULT \
\r
262 true, /* Start counting when init done. */ \
\r
263 false, /* Disable RTCC during debug halt. */ \
\r
264 false, /* Disable precounter wrap on ch. 0 CCV value. */ \
\r
265 false, /* Disable counter wrap on ch. 1 CCV value. */ \
\r
266 rtccCntPresc_32, /* 977 us per tick. */ \
\r
267 rtccCntTickPresc, /* Counter increments according to prescaler value. */ \
\r
268 false, /* No RTCC oscillator failure detection. */ \
\r
269 rtccCntModeNormal, /* Normal RTCC mode. */ \
\r
270 false, /* No leap year correction. */ \
\r
274 /** Default RTCC channel output compare init structure. */
\r
275 #define RTCC_CH_INIT_COMPARE_DEFAULT \
\r
277 rtccCapComChModeCompare, /* Select output compare mode. */ \
\r
278 rtccCompMatchOutActionPulse, /* Create pulse on compare match. */ \
\r
279 rtccPRSCh0, /* PRS channel 0 (not used). */ \
\r
280 rtccInEdgeNone, /* No edge detection. */ \
\r
281 rtccCompBaseCnt, /* Counter comparison base. */ \
\r
282 0, /* No compare mask bits set. */ \
\r
283 rtccDayCompareModeMonth /* Don't care */ \
\r
286 /** Default RTCC channel input capture init structure. */
\r
287 #define RTCC_CH_INIT_CAPTURE_DEFAULT \
\r
289 rtccCapComChModeCapture, /* Select input capture mode. */ \
\r
290 rtccCompMatchOutActionPulse, /* Create pulse on capture. */ \
\r
291 rtccPRSCh0, /* PRS channel 0. */ \
\r
292 rtccInEdgeRising, /* Rising edge detection. */ \
\r
293 rtccCompBaseCnt, /* Don't care. */ \
\r
294 0, /* Don't care. */ \
\r
295 rtccDayCompareModeMonth /* Don't care */ \
\r
298 /** Validation of valid RTCC channel for assert statements. */
\r
299 #define RTCC_CH_VALID( ch ) ( ( ch ) < 3 )
\r
301 /*******************************************************************************
\r
302 ***************************** PROTOTYPES **********************************
\r
303 ******************************************************************************/
\r
305 /***************************************************************************//**
\r
307 * Get RTCC capture/compare register value (CCV) for selected channel.
\r
310 * Channel selector.
\r
313 * Capture/compare register value.
\r
314 ******************************************************************************/
\r
315 __STATIC_INLINE uint32_t RTCC_ChannelCCVGet( int ch )
\r
317 EFM_ASSERT( RTCC_CH_VALID( ch ) );
\r
318 return RTCC->CC[ ch ].CCV;
\r
321 /***************************************************************************//**
\r
323 * Set RTCC capture/compare register value (CCV) for selected channel.
\r
326 * Channel selector.
\r
330 ******************************************************************************/
\r
331 __STATIC_INLINE void RTCC_ChannelCCVSet( int ch, uint32_t value )
\r
333 EFM_ASSERT( RTCC_CH_VALID( ch ) );
\r
334 RTCC->CC[ ch ].CCV = value;
\r
337 /***************************************************************************//**
\r
339 * Get the calendar DATE register content for selected channel.
\r
342 * Channel selector.
\r
345 * DATE register value.
\r
346 ******************************************************************************/
\r
347 __STATIC_INLINE uint32_t RTCC_ChannelDateGet( int ch )
\r
349 EFM_ASSERT( RTCC_CH_VALID( ch ) );
\r
350 return RTCC->CC[ ch ].DATE;
\r
353 /***************************************************************************//**
\r
355 * Set the calendar DATE register for selected channel.
\r
358 * Channel selector.
\r
362 ******************************************************************************/
\r
363 __STATIC_INLINE void RTCC_ChannelDateSet( int ch, uint32_t date )
\r
365 EFM_ASSERT( RTCC_CH_VALID( ch ) );
\r
366 RTCC->CC[ ch ].DATE = date;
\r
369 void RTCC_ChannelInit( int ch, RTCC_CCChConf_TypeDef const *confPtr );
\r
371 /***************************************************************************//**
\r
373 * Get the calendar TIME register content for selected channel.
\r
376 * Channel selector.
\r
379 * TIME register value.
\r
380 ******************************************************************************/
\r
381 __STATIC_INLINE uint32_t RTCC_ChannelTimeGet( int ch )
\r
383 EFM_ASSERT( RTCC_CH_VALID( ch ) );
\r
384 return RTCC->CC[ ch ].TIME;
\r
387 /***************************************************************************//**
\r
389 * Set the calendar TIME register for selected channel.
\r
392 * Channel selector.
\r
396 ******************************************************************************/
\r
397 __STATIC_INLINE void RTCC_ChannelTimeSet( int ch, uint32_t time )
\r
399 EFM_ASSERT( RTCC_CH_VALID( ch ) );
\r
400 RTCC->CC[ ch ].TIME = time;
\r
403 /***************************************************************************//**
\r
405 * Get the combined CNT/PRECNT register content.
\r
408 * CNT/PRECNT register value.
\r
409 ******************************************************************************/
\r
410 __STATIC_INLINE uint32_t RTCC_CombinedCounterGet( void )
\r
412 return RTCC->COMBCNT;
\r
415 /***************************************************************************//**
\r
417 * Get RTCC counter value.
\r
420 * Current RTCC counter value.
\r
421 ******************************************************************************/
\r
422 __STATIC_INLINE uint32_t RTCC_CounterGet( void )
\r
427 /***************************************************************************//**
\r
429 * Set RTCC CNT counter.
\r
433 ******************************************************************************/
\r
434 __STATIC_INLINE void RTCC_CounterSet( uint32_t value )
\r
439 /***************************************************************************//**
\r
441 * Get DATE register value.
\r
444 * Current DATE register value.
\r
445 ******************************************************************************/
\r
446 __STATIC_INLINE uint32_t RTCC_DateGet( void )
\r
451 /***************************************************************************//**
\r
453 * Set RTCC DATE register.
\r
457 ******************************************************************************/
\r
458 __STATIC_INLINE void RTCC_DateSet( uint32_t date )
\r
463 /***************************************************************************//**
\r
465 * Enable/disable EM4 wakeup capability.
\r
467 * @param[in] enable
\r
468 * True to enable EM4 wakeup, false to disable.
\r
469 ******************************************************************************/
\r
470 __STATIC_INLINE void RTCC_EM4WakeupEnable( bool enable )
\r
474 RTCC->EM4WUEN = RTCC_EM4WUEN_EM4WU;
\r
482 void RTCC_Enable( bool enable );
\r
484 void RTCC_Init( const RTCC_Init_TypeDef *init );
\r
486 /***************************************************************************//**
\r
488 * Clear one or more pending RTCC interrupts.
\r
491 * RTCC interrupt sources to clear. Use a set of interrupt flags OR-ed
\r
492 * together to clear multiple interrupt sources.
\r
493 ******************************************************************************/
\r
494 __STATIC_INLINE void RTCC_IntClear( uint32_t flags )
\r
499 /***************************************************************************//**
\r
501 * Disable one or more RTCC interrupts.
\r
504 * RTCC interrupt sources to disable. Use a set of interrupt flags OR-ed
\r
505 * together to disable multiple interrupt.
\r
506 ******************************************************************************/
\r
507 __STATIC_INLINE void RTCC_IntDisable( uint32_t flags )
\r
509 RTCC->IEN &= ~flags;
\r
512 /***************************************************************************//**
\r
514 * Enable one or more RTCC interrupts.
\r
517 * Depending on the use, a pending interrupt may already be set prior to
\r
518 * enabling the interrupt. Consider using RTCC_IntClear() prior to enabling
\r
519 * if such a pending interrupt should be ignored.
\r
522 * RTCC interrupt sources to enable. Use a set of interrupt flags OR-ed
\r
523 * together to set multiple interrupt.
\r
524 ******************************************************************************/
\r
525 __STATIC_INLINE void RTCC_IntEnable( uint32_t flags )
\r
527 RTCC->IEN |= flags;
\r
530 /***************************************************************************//**
\r
532 * Get pending RTCC interrupt flags.
\r
535 * The event bits are not cleared by the use of this function.
\r
538 * Pending RTCC interrupt sources. Returns a set of interrupt flags OR-ed
\r
539 * together for the interrupt sources set.
\r
540 ******************************************************************************/
\r
541 __STATIC_INLINE uint32_t RTCC_IntGet( void )
\r
546 /***************************************************************************//**
\r
548 * Get enabled and pending RTCC interrupt flags.
\r
551 * Useful for handling more interrupt sources in the same interrupt handler.
\r
554 * Pending and enabled RTCC interrupt sources. Returns a set of interrupt
\r
555 * flags OR-ed together for the interrupt sources set.
\r
556 ******************************************************************************/
\r
557 __STATIC_INLINE uint32_t RTCC_IntGetEnabled( void )
\r
563 /* Bitwise AND of pending and enabled interrupt flags. */
\r
564 return RTCC->IF & tmp;
\r
567 /***************************************************************************//**
\r
569 * Set one or more pending RTCC interrupts from SW.
\r
572 * RTCC interrupt sources to set to pending. Use a set of interrupt flags
\r
574 ******************************************************************************/
\r
575 __STATIC_INLINE void RTCC_IntSet( uint32_t flags )
\r
580 /***************************************************************************//**
\r
582 * Lock RTCC registers.
\r
585 * When RTCC registers are locked, RTCC_CTRL, RTCC_PRECNT, RTCC_CNT,
\r
586 * RTCC_TIME, RTCC_DATE, RTCC_IEN, RTCC_POWERDOWN and RTCC_CCx_XXX registers
\r
587 * can not be written to.
\r
588 ******************************************************************************/
\r
589 __STATIC_INLINE void RTCC_Lock( void )
\r
591 RTCC->LOCK = RTCC_LOCK_LOCKKEY_LOCK;
\r
594 /***************************************************************************//**
\r
596 * Get RTCC pre-counter value.
\r
599 * Current RTCC pre-counter value.
\r
600 ******************************************************************************/
\r
601 __STATIC_INLINE uint32_t RTCC_PreCounterGet( void )
\r
603 return RTCC->PRECNT;
\r
606 /***************************************************************************//**
\r
608 * Set RTCC pre-counter value.
\r
610 * @param[in] preCntVal
\r
611 * RTCC pre-counter value to be set.
\r
612 ******************************************************************************/
\r
613 __STATIC_INLINE void RTCC_PreCounterSet( uint32_t preCntVal )
\r
615 RTCC->PRECNT = preCntVal;
\r
618 void RTCC_Reset( void );
\r
620 /***************************************************************************//**
\r
622 * Power down the retention ram.
\r
625 * Once retention ram is powered down, it cannot be powered up again.
\r
626 ******************************************************************************/
\r
627 __STATIC_INLINE void RTCC_RetentionRamPowerDown( void )
\r
629 RTCC->POWERDOWN = RTCC_POWERDOWN_RAM;
\r
632 void RTCC_StatusClear( void );
\r
634 /***************************************************************************//**
\r
636 * Get STATUS register value.
\r
639 * Current STATUS register value.
\r
640 ******************************************************************************/
\r
641 __STATIC_INLINE uint32_t RTCC_StatusGet( void )
\r
643 while ( RTCC->SYNCBUSY & RTCC_SYNCBUSY_CMD )
\r
645 // Wait for syncronization.
\r
647 return RTCC->STATUS;
\r
650 /***************************************************************************//**
\r
652 * Get TIME register value.
\r
655 * Current TIME register value.
\r
656 ******************************************************************************/
\r
657 __STATIC_INLINE uint32_t RTCC_TimeGet( void )
\r
662 /***************************************************************************//**
\r
664 * Set RTCC TIME register.
\r
668 ******************************************************************************/
\r
669 __STATIC_INLINE void RTCC_TimeSet( uint32_t time )
\r
674 /***************************************************************************//**
\r
676 * Unlock RTCC registers.
\r
679 * When RTCC registers are locked, RTCC_CTRL, RTCC_PRECNT, RTCC_CNT,
\r
680 * RTCC_TIME, RTCC_DATE, RTCC_IEN, RTCC_POWERDOWN and RTCC_CCx_XXX registers
\r
681 * can not be written to.
\r
682 ******************************************************************************/
\r
683 __STATIC_INLINE void RTCC_Unlock( void )
\r
685 RTCC->LOCK = RTCC_LOCK_LOCKKEY_UNLOCK;
\r
688 /** @} (end addtogroup RTCC) */
\r
689 /** @} (end addtogroup EM_Library) */
\r
695 #endif /* defined( RTCC_COUNT ) && ( RTC_COUNT == 1 ) */
\r
696 #endif /* __SILICON_LABS_EM_RTCC_H__ */
\r