]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil/driverlib/rtc_c.h
Final V8.2.1 release ready for tagging:
[freertos] / FreeRTOS / Demo / CORTEX_M4F_MSP432_LaunchPad_IAR_CCS_Keil / driverlib / rtc_c.h
1 /*
2  * -------------------------------------------
3  *    MSP432 DriverLib - v01_04_00_18 
4  * -------------------------------------------
5  *
6  * --COPYRIGHT--,BSD,BSD
7  * Copyright (c) 2015, Texas Instruments Incorporated
8  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  *
14  * *  Redistributions of source code must retain the above copyright
15  *    notice, this list of conditions and the following disclaimer.
16  *
17  * *  Redistributions in binary form must reproduce the above copyright
18  *    notice, this list of conditions and the following disclaimer in the
19  *    documentation and/or other materials provided with the distribution.
20  *
21  * *  Neither the name of Texas Instruments Incorporated nor the names of
22  *    its contributors may be used to endorse or promote products derived
23  *    from this software without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
27  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
29  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
32  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
33  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
34  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
35  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  * --/COPYRIGHT--*/
37 #ifndef RTC_C_H_
38 #define RTC_C_H_
39
40 //*****************************************************************************
41 //
42 //! \addtogroup rtc_api
43 //! @{
44 //
45 //*****************************************************************************
46
47
48 //*****************************************************************************
49 //
50 // If building with a C++ compiler, make all of the definitions in this header
51 // have a C binding.
52 //
53 //*****************************************************************************
54 #ifdef __cplusplus
55 extern "C"
56 {
57 #endif
58
59 #include <stdint.h>
60 #include <stdbool.h>
61 #include <msp.h>
62
63 //*****************************************************************************
64 //
65 //The following is a struct that can be passed to RTC_CalendarInit() in the
66 //CalendarTime parameter, as well as returned by RTC_getCalendarTime()
67 //
68 //*****************************************************************************
69 typedef struct _RTC_C_Calendar
70 {
71     uint_fast8_t seconds;
72     uint_fast8_t minutes;
73     uint_fast8_t hours;
74     uint_fast8_t dayOfWeek;
75     uint_fast8_t dayOfmonth;
76     uint_fast8_t month;
77     uint_fast16_t year;
78 } RTC_C_Calendar;
79
80 //*****************************************************************************
81 //
82 //The following are values that can be passed to RTC_setCalibrationData()
83 //
84 //*****************************************************************************
85 #define RTC_C_CALIBRATIONFREQ_OFF   (RTCCALF_0)
86 #define RTC_C_CALIBRATIONFREQ_512HZ (RTCCALF_1)
87 #define RTC_C_CALIBRATIONFREQ_256HZ (RTCCALF_2)
88 #define RTC_C_CALIBRATIONFREQ_1HZ   (RTCCALF_3)
89
90 //*****************************************************************************
91 //
92 //The following are values that can be passed to RTC_setCalibrationData()
93 //
94 //*****************************************************************************
95 #define RTC_C_CALIBRATION_DOWN1PPM  ( !(RTCOCALS) )
96 #define RTC_C_CALIBRATION_UP1PPM    (RTCOCALS)
97
98 //*****************************************************************************
99 //
100 //The following are values that can be passed to
101 //RTC_setTemperatureCompensation()
102 //
103 //*****************************************************************************
104 #define RTC_C_COMPENSATION_DOWN1PPM  ( !(RTCTCMPS) )
105 #define RTC_C_COMPENSATION_UP1PPM    (RTCTCMPS)
106
107 //*****************************************************************************
108 //
109 //The following are values that can be passed to RTC_iniRTC_Calendar()
110 //
111 //*****************************************************************************
112 #define RTC_C_FORMAT_BINARY  ( !(RTCBCD) )
113 #define RTC_C_FORMAT_BCD     (RTCBCD)
114
115 //*****************************************************************************
116 //
117 //The following is a value that can be passed to RTC_seRTC_CalendarAlarm()
118 //
119 //*****************************************************************************
120 #define RTC_C_ALARMCONDITION_OFF  (0x80)
121
122 //*****************************************************************************
123 //
124 //The following are values that can be passed to RTC_seRTC_CalendarEvent()
125 //in the eventSelect parameter.
126 //
127 //*****************************************************************************
128 #define RTC_C_CALENDAREVENT_MINUTECHANGE  (RTCTEV_0)
129 #define RTC_C_CALENDAREVENT_HOURCHANGE    (RTCTEV_1)
130 #define RTC_C_CALENDAREVENT_NOON          (RTCTEV_2)
131 #define RTC_C_CALENDAREVENT_MIDNIGHT      (RTCTEV_3)
132
133 //*****************************************************************************
134 //
135 //The following are values that can be passed to RTC_definePrescaleEvent()
136 //
137 //*****************************************************************************
138 #define RTC_C_PRESCALE_0  (0x0)
139 #define RTC_C_PRESCALE_1  (0x1)
140
141 //*****************************************************************************
142 //
143 //The following are values that can be passed to RTC_definePrescaleEvent()
144 //in the prescaleEventDivider parameter.
145 //
146 //*****************************************************************************
147 #define RTC_C_PSEVENTDIVIDER_2   (RT0IP_0)
148 #define RTC_C_PSEVENTDIVIDER_4   (RT0IP_1)
149 #define RTC_C_PSEVENTDIVIDER_8   (RT0IP_2)
150 #define RTC_C_PSEVENTDIVIDER_16  (RT0IP_3)
151 #define RTC_C_PSEVENTDIVIDER_32  (RT0IP_4)
152 #define RTC_C_PSEVENTDIVIDER_64  (RT0IP_5)
153 #define RTC_C_PSEVENTDIVIDER_128 (RT0IP_6)
154 #define RTC_C_PSEVENTDIVIDER_256 (RT0IP_7)
155
156 //*****************************************************************************
157 //
158 //The following are values that can be passed to the interrupt functions
159 //
160 //*****************************************************************************
161 #define RTC_C_OSCILLATOR_FAULT_INTERRUPT  RTCOFIE
162 #define RTC_C_TIME_EVENT_INTERRUPT        RTCTEVIE
163 #define RTC_C_CLOCK_ALARM_INTERRUPT       RTCAIE
164 #define RTC_C_CLOCK_READ_READY_INTERRUPT  RTCRDYIE
165 #define RTC_C_PRESCALE_TIMER0_INTERRUPT   0x02
166 #define RTC_C_PRESCALE_TIMER1_INTERRUPT   0x01
167
168 //*****************************************************************************
169 //
170 //! Starts the RTC.
171 //!
172 //! This function clears the RTC main hold bit to allow the RTC to function.
173 //!
174 //! \return None
175 //
176 //*****************************************************************************
177 extern void RTC_C_startClock(void);
178
179 //*****************************************************************************
180 //
181 //! Holds the RTC.
182 //!
183 //! This function sets the RTC main hold bit to disable RTC functionality.
184 //!
185 //! \return None
186 //
187 //*****************************************************************************
188 extern void RTC_C_holdClock(void);
189
190 //*****************************************************************************
191 //
192 //! Allows and Sets the frequency output to RTCLK pin for calibration
193 //! measurement.
194 //!
195 //! \param frequencySelect is the frequency output to RTCLK.
196 //!        Valid values are
197 //!        - \b   RTC_C_CALIBRATIONFREQ_OFF - turn off calibration
198 //!                                                 output [Default]
199 //!        - \b   RTC_C_CALIBRATIONFREQ_512HZ - output signal at 512Hz
200 //!                                                     for calibration
201 //!        - \b   RTC_C_CALIBRATIONFREQ_256HZ - output signal at 256Hz
202 //!                                                     for calibration
203 //!        - \b   RTC_C_CALIBRATIONFREQ_1HZ - output signal at 1Hz
204 //!                                                     for calibration
205 //!
206 //! This function sets a frequency to measure at the RTCLK output pin. After
207 //! testing the set frequency, the calibration could be set accordingly.
208 //!
209 //! \return None
210 //
211 //*****************************************************************************
212 extern void RTC_C_setCalibrationFrequency(uint_fast16_t frequencySelect);
213
214 //*****************************************************************************
215 //
216 //! Sets the specified calibration for the RTC.
217 //!
218 //! \param offsetDirection is the direction that the calibration offset will
219 //!        go. Valid values are
220 //!        - \b   RTC_C_CALIBRATION_DOWN1PPM - calibrate at steps of -1
221 //!        - \b   RTC_C_CALIBRATION_UP1PPM - calibrat at steps of +1
222 //! \param offsetValue is the value that the offset will be a factor of; a
223 //!       valid value is any integer from 1-240.
224 //!
225 //! This function sets the calibration offset to make the RTC as accurate as
226 //! possible. The offsetDirection can be either +1-ppm or -1-ppm, and the
227 //! offsetValue should be from 1-240 and is multiplied by the direction setting
228 //! (i.e. +1-ppm * 8 (offsetValue) = +8-ppm).
229 //!
230 //! \return None
231 //
232 //*****************************************************************************
233 extern void RTC_C_setCalibrationData(uint_fast8_t offsetDirection,
234         uint_fast8_t offsetValue);
235
236 //*****************************************************************************
237 //
238 //! Sets the specified temperature compensation for the RTC.
239 //!
240 //! \param offsetDirection is the direction that the calibration offset will
241 //!        go. Valid values are
242 //!        - \b   RTC_C_COMPENSATION_DOWN1PPM - calibrate at steps of -1
243 //!        - \b   RTC_C_COMPENSATION_UP1PPM - calibrate at steps of +1
244 //! \param offsetValue is the value that the offset will be a factor of; a
245 //!       value is any integer from 1-240.
246 //!
247 //! This function sets the calibration offset to make the RTC as accurate as
248 //! possible. The offsetDirection can be either +1-ppm or -1-ppm, and the
249 //! offsetValue should be from 1-240 and is multiplied by the direction setting
250 //! (i.e. +1-ppm * 8 (offsetValue) = +8-ppm).
251 //!
252 //! \return true if calibration was set, false if it could not be set
253 //!
254 //
255 //*****************************************************************************
256 extern bool RTC_C_setTemperatureCompensation(uint_fast16_t offsetDirection,
257         uint_fast8_t offsetValue);
258
259 //*****************************************************************************
260 //
261 //! Initializes the settings to operate the RTC in Calendar mode.
262 //!
263 //! \param calendarTime is the structure containing the values for the Calendar
264 //!       to be initialized to.
265 //!        Valid values should be of type Calendar and should contain the
266 //!        following members and corresponding values:
267 //!        - \b   seconds between 0-59
268 //!        - \b   minutes between 0-59
269 //!        - \b   hours between 0-24
270 //!        - \b   dayOfWeek between 0-6
271 //!        - \b   dayOfmonth between 0-31
272 //!        - \b   year between 0-4095
273 //!        \note Values beyond the ones specified may result in eradic behavior.
274 //! \param formatSelect is the format for the Calendar registers to use.
275 //!        Valid values are
276 //!        - \b   RTC_FORMAT_BINARY [Default]
277 //!        - \b   RTC_FORMAT_BCD
278 //!
279 //! This function initializes the Calendar mode of the RTC module.
280 //!
281 //! \return None
282 //
283 //*****************************************************************************
284 extern void RTC_C_initCalendar(const RTC_C_Calendar *calendarTime,
285         uint_fast16_t formatSelect);
286
287 //*****************************************************************************
288 //
289 //! Returns the Calendar Time stored in the Calendar registers of the RTC.
290 //!
291 //!
292 //! This function returns the current Calendar time in the form of a Calendar
293 //! structure.
294 //!
295 //! \return A Calendar structure containing the current time.
296 //
297 //*****************************************************************************
298 extern RTC_C_Calendar RTC_C_getCalendarTime(void);
299
300 //*****************************************************************************
301 //
302 //! Sets and Enables the desired Calendar Alarm settings.
303 //!
304 //! \param minutesAlarm is the alarm condition for the minutes.
305 //!        Valid values are
306 //!        - An integer between 0-59, OR
307 //!        - \b   RTC_C_ALARMCONDITION_OFF [Default]
308 //! \param hoursAlarm is the alarm condition for the hours.
309 //!        Valid values are
310 //!        - An integer between 0-24, OR
311 //!        - \b   RTC_C_ALARMCONDITION_OFF [Default]
312 //! \param dayOfWeekAlarm is the alarm condition for the day of week.
313 //!        Valid values are
314 //!        - An integer between 0-6, OR
315 //!        - \b   RTC_C_ALARMCONDITION_OFF [Default]
316 //! \param dayOfmonthAlarm is the alarm condition for the day of the month.
317 //!        Valid values are
318 //!        - An integer between 0-31, OR
319 //!        - \b   RTC_C_ALARMCONDITION_OFF [Default]
320 //!
321 //! This function sets a Calendar interrupt condition to assert the RTCAIFG
322 //! interrupt flag. The condition is a logical and of all of the parameters.
323 //! For example if the minutes and hours alarm is set, then the interrupt will
324 //! only assert when the minutes AND the hours change to the specified setting.
325 //! Use the RTC_ALARM_OFF for any alarm settings that should not be apart of
326 //! the alarm condition.
327 //!
328 //! \return None
329 //
330 //*****************************************************************************
331 extern void RTC_C_setCalendarAlarm(uint_fast8_t minutesAlarm,
332         uint_fast8_t hoursAlarm, uint_fast8_t dayOfWeekAlarm,
333         uint_fast8_t dayOfmonthAlarm);
334
335 //*****************************************************************************
336 //
337 //! Sets a single specified Calendar interrupt condition.
338 //!
339 //! \param eventSelect is the condition selected.
340 //!        Valid values are
341 //!        - \b   RTC_C_CALENDAREVENT_MINUTECHANGE - assert interrupt on every
342 //!             minute
343 //!        - \b   RTC_C_CALENDAREVENT_HOURCHANGE - assert interrupt on every hour
344 //!        - \b   RTC_C_CALENDAREVENT_NOON - assert interrupt when hour is 12
345 //!        - \b   RTC_C_CALENDAREVENT_MIDNIGHT - assert interrupt when hour is 0
346 //!
347 //! This function sets a specified event to assert the RTCTEVIFG interrupt. This
348 //! interrupt is independent from the Calendar alarm interrupt.
349 //!
350 //! \return None
351 //
352 //*****************************************************************************
353 extern void RTC_C_setCalendarEvent(uint_fast16_t eventSelect);
354
355 //*****************************************************************************
356 //
357 //! Sets up an interrupt condition for the selected Prescaler.
358 //!
359 //! \param prescaleSelect is the prescaler to define an interrupt for.
360 //!        Valid values are
361 //!        - \b   RTC_C_PRESCALE_0
362 //!        - \b   RTC_C_PRESCALE_1
363 //! \param prescaleEventDivider is a divider to specify when an interrupt can
364 //!       occur based on the clock source of the selected prescaler.
365 //!       (Does not affect timer of the selected prescaler).
366 //!       Valid values are
367 //!       - \b   RTC_C_PSEVENTDIVIDER_2 [Default]
368 //!       - \b   RTC_C_PSEVENTDIVIDER_4
369 //!       - \b   RTC_C_PSEVENTDIVIDER_8
370 //!       - \b   RTC_C_PSEVENTDIVIDER_16
371 //!       - \b   RTC_C_PSEVENTDIVIDER_32
372 //!       - \b   RTC_C_PSEVENTDIVIDER_64
373 //!       - \b   RTC_C_PSEVENTDIVIDER_128
374 //!       - \b   RTC_C_PSEVENTDIVIDER_256
375 //!
376 //! This function sets the condition for an interrupt to assert based on the
377 //! individual prescalers.
378 //!
379 //! \return None
380 //
381 //*****************************************************************************
382 extern void RTC_C_definePrescaleEvent(uint_fast8_t prescaleSelect,
383         uint_fast8_t prescaleEventDivider);
384
385 //*****************************************************************************
386 //
387 //! Returns the selected Prescaler value.
388 //!
389 //! \param prescaleSelect is the prescaler to obtain the value of.
390 //!        Valid values are
391 //!        - \b   RTC_C_PRESCALE_0
392 //!        - \b   RTC_C_PRESCALE_1
393 //!
394 //! This function returns the value of the selected prescale counter register.
395 //! The counter should be held before reading. If in counter mode, the
396 //! individual prescaler can be held, while in Calendar mode the whole RTC must
397 //! be held.
398 //!
399 //! \return The value of the specified Prescaler count register
400 //
401 //*****************************************************************************
402 extern uint_fast8_t RTC_C_getPrescaleValue(uint_fast8_t prescaleSelect);
403
404 //*****************************************************************************
405 //
406 //! Sets the selected Prescaler value.
407 //!
408 //! \param prescaleSelect is the prescaler to set the value for.
409 //!        Valid values are
410 //!        - \b   RTC_C_PRESCALE_0
411 //!        - \b   RTC_C_PRESCALE_1
412 //! \param prescaleCounterValue is the specified value to set the prescaler to;
413 //!       a valid value is any integer from 0-255.
414 //!
415 //! This function sets the prescale counter value. Before setting the prescale
416 //! counter, it should be held.
417 //!
418 //! \return None
419 //
420 //*****************************************************************************
421 extern void RTC_C_setPrescaleValue(uint_fast8_t prescaleSelect,
422         uint_fast8_t prescaleCounterValue);
423
424 //*****************************************************************************
425 //
426 //! Returns the given BCD value in Binary Format
427 //!
428 //! \param valueToConvert is the raw value in BCD format to convert to
429 //!        Binary.
430 //!
431 //! This function converts BCD values to Binary format.
432 //!
433 //! \return The Binary version of the valueToConvert parameter.
434 //
435 //*****************************************************************************
436 extern uint16_t RTC_C_convertBCDToBinary(uint16_t valueToConvert);
437
438 //*****************************************************************************
439 //
440 //! Returns the given Binary value in BCD Format
441 //!
442
443 //! \param valueToConvert is the raw value in Binary format to convert to
444 //!        BCD.
445 //!
446 //! This function converts Binary values to BCD format.
447 //!
448 //! \return The BCD version of the valueToConvert parameter.
449 //
450 //*****************************************************************************
451 extern uint16_t RTC_C_convertBinaryToBCD(uint16_t valueToConvert);
452
453 //*****************************************************************************
454 //
455 //! Enables selected RTC interrupt sources.
456 //!
457 //! \param interruptMask is a bit mask of the interrupts to enable.
458 //!        Mask Value is the logical OR of any of the following
459 //!        - \b  RTC_C_TIME_EVENT_INTERRUPT - asserts when counter overflows in
460 //!             counter mode or when Calendar event condition defined by
461 //!             defineCalendarEvent() is met.
462 //!        - \b  RTC_C_CLOCK_ALARM_INTERRUPT - asserts when alarm condition in
463 //!             Calendar mode is met.
464 //!        - \b  RTC_C_CLOCK_READ_READY_INTERRUPT - asserts when Calendar
465 //!             registers are settled.
466 //!        - \b  RTC_C_PRESCALE_TIMER0_INTERRUPT - asserts when Prescaler 0
467 //!             event condition is met.
468 //!        - \b  RTC_C_PRESCALE_TIMER1_INTERRUPT - asserts when Prescaler 1
469 //!             event condition is met.
470 //!        - \b  RTC_C_OSCILLATOR_FAULT_INTERRUPT - asserts if there is
471 //!             a problem with the 32kHz oscillator, while the RTC is running.
472 //!
473 //! This function enables the selected RTC interrupt source.  Only the sources
474 //! that are enabled can be reflected to the processor interrupt; disabled
475 //! sources have no effect on the processor.
476 //!
477 //! \return None
478 //
479 //*****************************************************************************
480 extern void RTC_C_enableInterrupt(uint8_t interruptMask);
481
482 //*****************************************************************************
483 //
484 //! Disables selected RTC interrupt sources.
485 //!
486 //! \param interruptMask is a bit mask of the interrupts to disable.
487 //!        Mask Value is the logical OR of any of the following
488 //!        - \b  RTC_C_TIME_EVENT_INTERRUPT - asserts when counter overflows in
489 //!             counter mode or when Calendar event condition defined by
490 //!             defineCalendarEvent() is met.
491 //!        - \b  RTC_C_CLOCK_ALARM_INTERRUPT - asserts when alarm condition in
492 //!             Calendar mode is met.
493 //!        - \b  RTC_CLOCK_READ_READY_INTERRUPT - asserts when Calendar
494 //!             registers are settled.
495 //!        - \b  RTC_C_PRESCALE_TIMER0_INTERRUPT - asserts when Prescaler 0
496 //!             event condition is met.
497 //!        - \b  RTC_C_PRESCALE_TIMER1_INTERRUPT - asserts when Prescaler 1
498 //!             event condition is met.
499 //!        - \b  RTC_C_OSCILLATOR_FAULT_INTERRUPT - asserts if there is a
500 //!             problem with the 32kHz oscillator, while the RTC is running.
501 //!
502 //! This function disables the selected RTC interrupt source.  Only the sources
503 //! that are enabled can be reflected to the processor interrupt; disabled
504 //! sources have no effect on the processor.
505 //!
506 //! \return None
507 //
508 //*****************************************************************************
509 extern void RTC_C_disableInterrupt(uint8_t interruptMask);
510
511 //*****************************************************************************
512 //
513 //! Returns the status of the interrupts flags.
514 //!
515 //! \return A bit mask of the selected interrupt flag's status.
516 //!        Mask Value is the logical OR of any of the following
517 //!        - \b  RTC_C_TIME_EVENT_INTERRUPT - asserts when counter overflows in
518 //!             counter mode or when Calendar event condition defined by
519 //!             defineCalendarEvent() is met.
520 //!        - \b  RTC_C_CLOCK_ALARM_INTERRUPT - asserts when alarm condition in
521 //!             Calendar mode is met.
522 //!        - \b  RTC_C_CLOCK_READ_READY_INTERRUPT - asserts when Calendar
523 //!             registers are settled.
524 //!        - \b  RTC_C_PRESCALE_TIMER0_INTERRUPT - asserts when Prescaler 0
525 //!             event condition is met.
526 //!        - \b  RTC_C_PRESCALE_TIMER1_INTERRUPT - asserts when Prescaler 1
527 //!             event condition is met.
528 //!        - \b  RTC_C_OSCILLATOR_FAULT_INTERRUPT - asserts if there is a
529 //!             problem with the 32kHz oscillator, while the RTC is running.
530 //
531 //*****************************************************************************
532 extern uint_fast8_t RTC_C_getInterruptStatus(void);
533
534 //*****************************************************************************
535 //
536 //! Returns the status of the interrupts flags masked with the enabled
537 //! interrupts.  This function is useful to call in ISRs to get a
538 //! list of pending interrupts that are actually enabled and could have caused
539 //! the ISR.
540 //!
541 //! \return A bit mask of the selected interrupt flag's status.
542 //!        Mask Value is the logical OR of any of the following
543 //!        - \b  RTC_TIME_EVENT_INTERRUPT - asserts when counter overflows in
544 //!             counter mode or when Calendar event condition defined by
545 //!             defineCalendarEvent() is met.
546 //!        - \b  RTC_CLOCK_ALARM_INTERRUPT - asserts when alarm condition in
547 //!             Calendar mode is met.
548 //!        - \b  RTC_CLOCK_READ_READY_INTERRUPT - asserts when Calendar
549 //!             registers are settled.
550 //!        - \b  RTC_C_PRESCALE_TIMER0_INTERRUPT - asserts when Prescaler 0
551 //!             event condition is met.
552 //!        - \b  RTC_C_PRESCALE_TIMER1_INTERRUPT - asserts when Prescaler 1
553 //!             event condition is met.
554 //!        - \b  RTC_OSCILLATOR_FAULT_INTERRUPT - asserts if there is a problem
555 //!             with the 32kHz oscillator, while the RTC is running.
556 //
557 //*****************************************************************************
558 extern uint_fast8_t RTC_C_getEnabledInterruptStatus(void);
559
560 //*****************************************************************************
561 //
562 //! Clears selected RTC interrupt flags.
563 //!
564 //! \param interruptFlagMask is a bit mask of the interrupt flags to be
565 //!        cleared. Mask Value is the logical OR of any of the following
566 //!        - \b  RTC_C_TIME_EVENT_INTERRUPT - asserts when counter overflows in
567 //!             counter mode or when Calendar event condition defined by
568 //!             defineCalendarEvent() is met.
569 //!        - \b  RTC_C_CLOCK_ALARM_INTERRUPT - asserts when alarm condition in
570 //!             Calendar mode is met.
571 //!        - \b  RTC_C_CLOCK_READ_READY_INTERRUPT - asserts when Calendar
572 //!             registers are settled.
573 //!        - \b  RTC_C_PRESCALE_TIMER0_INTERRUPT - asserts when Prescaler 0
574 //!             event condition is met.
575 //!        - \b  RTC_C_PRESCALE_TIMER1_INTERRUPT - asserts when Prescaler 1
576 //!             event condition is met.
577 //!        - \b  RTC_C_OSCILLATOR_FAULT_INTERRUPT - asserts if there is
578 //!             a problem with the 32kHz oscillator, while the RTC is running.
579 //!
580 //! This function clears the RTC interrupt flag is cleared, so that it no longer
581 //! asserts.
582 //!
583 //! \return None
584 //
585 //*****************************************************************************
586 extern void RTC_C_clearInterruptFlag(uint_fast8_t interruptFlagMask);
587
588 //*****************************************************************************
589 //
590 //! Registers an interrupt handler for the RTC interrupt.
591 //!
592 //! \param intHandler is a pointer to the function to be called when the
593 //! RTC interrupt occurs.
594 //!
595 //! This function registers the handler to be called when a RTC
596 //! interrupt occurs. This function enables the global interrupt in the
597 //! interrupt controller; specific AES interrupts must be enabled
598 //! via RTC_enableInterrupt().  It is the interrupt handler's responsibility to
599 //! clear the interrupt source via RTC_clearInterruptFlag().
600 //!
601 //! \return None.
602 //
603 //*****************************************************************************
604 extern void RTC_C_registerInterrupt(void (*intHandler)(void));
605
606 //*****************************************************************************
607 //
608 //! Unregisters the interrupt handler for the RTC interrupt
609 //!
610 //! This function unregisters the handler to be called when RTC
611 //! interrupt occurs.  This function also masks off the interrupt in the
612 //! interrupt controller so that the interrupt handler no longer is called.
613 //!
614 //! \sa Interrupt_registerInterrupt() for important information about
615 //! registering interrupt handlers.
616 //!
617 //! \return None.
618 //
619 //*****************************************************************************
620 extern void RTC_C_unregisterInterrupt(void);
621
622 /* Defines for future devices that might have multiple instances */
623 #define RTC_C_startClockMultipleInstance(a) RTC_C_startClock()
624 #define RTC_C_holdClockMultipleInstance(a) RTC_C_holdClock()
625 #define RTC_C_setCalibrationFrequencyMultipleInstance(a,b) RTC_C_setCalibrationFrequency(b)
626 #define RTC_C_setCalibrationDataMultipleInstance(a,b,c) RTC_C_setCalibrationData(b,c)
627 #define RTC_C_setTemperatureCompensationMultipleInstance(a,b,c) RTC_C_setTemperatureCompensation(b,c)
628 #define RTC_C_initCalendarMultipleInstance(a,b,c) RTC_C_initCalendar(b,c)
629 #define RTC_C_getCalendarTimeMultipleInstance(a) RTC_C_getCalendarTime()
630 #define RTC_C_setCalendarAlarmMultipleInstance(a,b,c,d,e) RTC_C_setCalendarAlarm(b,c,d,e)
631 #define RTC_C_setCalendarEventMultipleInstance(a,b) RTC_C_setCalendarEvent(b)
632 #define RTC_C_definePrescaleEventMultipleInstance(a,b,c) RTC_C_definePrescaleEvent(b,c)
633 #define RTC_C_getPrescaleValueMultipleInstance(a,b) RTC_C_getPrescaleValue(b)
634 #define RTC_C_setPrescaleValueMultipleInstance(a,b,c) RTC_C_setPrescaleValue(b,c)
635 #define RTC_C_convertBCDToBinaryMultipleInstance(a,b) RTC_C_convertBCDToBinary(b)
636 #define RTC_C_convertBinaryToBCDMultipleInstance(a,b) RTC_C_convertBinaryToBCD(b)
637 #define RTC_C_enableInterruptMultipleInstance(a,b) RTC_C_enableInterrupt(b)
638 #define RTC_C_disableInterruptMultipleInstance(a,b) RTC_C_disableInterrupt(b)
639 #define RTC_C_getInterruptStatusMultipleInstance(a) RTC_C_getInterruptStatus()
640 #define RTC_C_getEnabledInterruptStatusMultipleInstance(a) RTC_C_getEnabledInterruptStatus()
641 #define RTC_C_clearInterruptFlagMultipleInstance(a,b) RTC_C_clearInterruptFlag(b)
642 #define RTC_C_registerInterruptMultipleInstance(a,b) RTC_C_registerInterrupt(b)
643 #define RTC_C_unregisterInterruptMultipleInstance(a) RTC_C_unregisterInterrupt()
644
645 //*****************************************************************************
646 //
647 // Mark the end of the C bindings section for C++ compilers.
648 //
649 //*****************************************************************************
650 #ifdef __cplusplus
651 }
652 #endif
653
654 //*****************************************************************************
655 //
656 // Close the Doxygen group.
657 //! @}
658 //
659 //*****************************************************************************
660
661 #endif /* RTC_H */