ADuCM4x50 Device Drivers API Reference Manual  Release 4.0.0.0
adi_rtc.h
1 
13 #ifndef ADI_RTC_H__
14 #define ADI_RTC_H__
15 #include "adi_processor.h"
16 
17 #include <stdint.h>
18 #include <adi_callback.h>
19 #include <adi_rtc_config.h>
20 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif /* __cplusplus */
28 
29 
30 
34 #define ADI_RTC_MEMORY_SIZE (24u)
35 
37 #define ADI_RTC_GATEWAY_FLUSH 0xa2c5
38 
40 typedef void* ADI_RTC_HANDLE;
41 
43 #define ADI_RTC_IRQ_SOURCE_OFFSET_SR0 (0u)
44 
46 #define ADI_RTC_IRQ_SOURCE_MASK_SR0 (0x7Eu)
47 
49 #define ADI_RTC_IRQ_SOURCE_OFFSET_SR2 (8u)
50 
52 #define ADI_RTC0_IRQ_SOURCE_MASK_SR2 (0x0Fu)
53 
54 #define ADI_RTC1_IRQ_SOURCE_MASK_SR2 (0x1Fu)
55 
57 #define ADI_RTC_IRQ_SOURCE_OFFSET_SR3 (16u)
58 
60 #if defined(__ADUCM302x__)
61 #define ADI_RTC_IRQ_SOURCE_MASK_SR3 (0x031Du)
62 #elif defined(__ADUCM4x50__)
63 #define ADI_RTC_IRQ_SOURCE_MASK_SR3 (0x1FFDu)
64 #endif
65 
69 typedef enum
70 {
91 
93 
94 
100 typedef uint32_t ADI_RTC_INT_TYPE;
101 
102 #define ADI_RTC_ALARM_INT 0x00000001u
103 #define ADI_RTC_MOD60ALM_INT 0x00000002u
104 #define ADI_RTC_ISO_DONE_INT 0x00000004u
105 #define ADI_RTC_WRITE_PENDERR_INT 0x00000008u
106 #define ADI_RTC_WRITE_SYNC_INT 0x00000010u
107 #define ADI_RTC_WRITE_PEND_INT 0x00000020u
108 #define ADI_RTC_COUNT_INT 0x00000040u
109 #define ADI_RTC_PSI_INT 0x00000080u
110 #define ADI_RTC_TRIM_INT 0x00000100u
111 #define ADI_RTC_COUNT_ROLLOVER_INT 0x00000200u
112 #define ADI_RTC_MOD60_ROLLOVER_INT 0x00000400u
113 #define ADI_RTC_SENSOR_STROBE_CH1_INT 0x00000800u
114 #define ADI_RTC_INPUT_CAPTURE_CH0_INT 0x00008000u
115 #define ADI_RTC_INPUT_CAPTURE_CH2_INT 0x00010000u
116 #define ADI_RTC_INPUT_CAPTURE_CH3_INT 0x00020000u
117 #define ADI_RTC_INPUT_CAPTURE_CH4_INT 0x00040000u
118 #define ADI_RTC_LFXTL_FAILURE_INT 0x00080000u
119 #define ADI_RTC_RTCSS1MSKEN 0x08000000u
121 #if defined(__ADUCM4x50__)
122 #define ADI_RTC_RTCSS4_FE_INT 0x00100000u
123 #define ADI_RTC_RTCSS3_FE_INT 0x00200000u
124 #define ADI_RTC_RTCSS2_FE_INT 0x00400000u
125 #define ADI_RTC_RTCSS1_FE_INT 0x00800000u
126 #define ADI_RTC_RTCSS4MSKEN 0x01000000u
127 #define ADI_RTC_RTCSS3MSKEN 0x02000000u
128 #define ADI_RTC_RTCSS2MSKEN 0x04000000u
129 #define ADI_RTC_CR5OCS_SS3SMPMTCHIRQEN 0x10000000u
130 #define ADI_RTC_CR5OCS_SS2SMPMTCHIRQEN 0x20000000u
131 #define ADI_RTC_CR5OCS_SS1SMPMTCHIRQEN 0x40000000u
132 #define ADI_RTC_SENSOR_STROBE_CH2_INT 0x00001000u
133 #define ADI_RTC_SENSOR_STROBE_CH3_INT 0x00002000u
134 #define ADI_RTC_SENSOR_STROBE_CH4_INT 0x00004000u
135 #endif
136 
137 #if defined(__ADUCM4x50__)
138 #define ADI_RTC_NUM_INTERRUPTS 31
139 #else
140 #define ADI_RTC_NUM_INTERRUPTS 18
141 #endif
142 
143 
147 typedef enum
148 {
150  ADI_RTC_WRITE_STATUS_CONTROL0 = 1 << BITP_RTC_SR0_WSYNCCR0,
152  ADI_RTC_WRITE_STATUS_STATUS0 = 1 << BITP_RTC_SR0_WSYNCSR0,
154  ADI_RTC_WRITE_STATUS_COUNT0 = 1 << BITP_RTC_SR0_WSYNCCNT0,
156  ADI_RTC_WRITE_STATUS_COUNT1 = 1 << BITP_RTC_SR0_WSYNCCNT1,
158  ADI_RTC_WRITE_STATUS_ALARM0 = 1 << BITP_RTC_SR0_WSYNCALM0,
160  ADI_RTC_WRITE_STATUS_ALARM1 = 1 << BITP_RTC_SR0_WSYNCALM1,
162  ADI_RTC_WRITE_STATUS_TRIM = 1 << BITP_RTC_SR0_WSYNCTRM
164 
165 
169 typedef enum
170 {
172  ADI_RTC_TRIM_INTERVAL_2 = (2 << BITP_RTC_TRM_IVL2EXPMIN | 0x0 << BITP_RTC_TRM_IVL),
174  ADI_RTC_TRIM_INTERVAL_3 = (3 << BITP_RTC_TRM_IVL2EXPMIN | 0x0 << BITP_RTC_TRM_IVL),
176  ADI_RTC_TRIM_INTERVAL_4 = (4 << BITP_RTC_TRM_IVL2EXPMIN | 0x0 << BITP_RTC_TRM_IVL),
178  ADI_RTC_TRIM_INTERVAL_5 = (5 << BITP_RTC_TRM_IVL2EXPMIN | 0x0 << BITP_RTC_TRM_IVL),
180  ADI_RTC_TRIM_INTERVAL_6 = (6 << BITP_RTC_TRM_IVL2EXPMIN | 0x0 << BITP_RTC_TRM_IVL),
182  ADI_RTC_TRIM_INTERVAL_7 = (7 << BITP_RTC_TRM_IVL2EXPMIN | 0x0 << BITP_RTC_TRM_IVL),
184  ADI_RTC_TRIM_INTERVAL_8 = (8 << BITP_RTC_TRM_IVL2EXPMIN | 0x0 << BITP_RTC_TRM_IVL),
186  ADI_RTC_TRIM_INTERVAL_9 = (9 << BITP_RTC_TRM_IVL2EXPMIN | 0x0 << BITP_RTC_TRM_IVL),
188  ADI_RTC_TRIM_INTERVAL_10 = (10 << BITP_RTC_TRM_IVL2EXPMIN | 0x0 << BITP_RTC_TRM_IVL),
190  ADI_RTC_TRIM_INTERVAL_11 = (11 << BITP_RTC_TRM_IVL2EXPMIN | 0x1 << BITP_RTC_TRM_IVL),
192  ADI_RTC_TRIM_INTERVAL_12 = (12 << BITP_RTC_TRM_IVL2EXPMIN | 0x0 << BITP_RTC_TRM_IVL),
194  ADI_RTC_TRIM_INTERVAL_13 = (13 << BITP_RTC_TRM_IVL2EXPMIN | 0x0 << BITP_RTC_TRM_IVL),
196  ADI_RTC_TRIM_INTERVAL_14 = (14 << BITP_RTC_TRM_IVL2EXPMIN | 0x0 << BITP_RTC_TRM_IVL),
198  ADI_RTC_TRIM_INTERVAL_15 = (14 << BITP_RTC_TRM_IVL2EXPMIN | 0x1 << BITP_RTC_TRM_IVL),
200  ADI_RTC_TRIM_INTERVAL_16 = (14 << BITP_RTC_TRM_IVL2EXPMIN | 0x2 << BITP_RTC_TRM_IVL ),
202  ADI_RTC_TRIM_INTERVAL_17 = (14 << BITP_RTC_TRM_IVL2EXPMIN | 0x3 << BITP_RTC_TRM_IVL)
203 
205 
209 typedef enum
210 {
212  ADI_RTC_INPUT_CHANNEL_0 = 1 << BITP_RTC_CR2IC_IC0EN,
214  ADI_RTC_INPUT_CHANNEL_2 = 1 << BITP_RTC_CR2IC_IC2EN,
216  ADI_RTC_INPUT_CHANNEL_3 = 1 << BITP_RTC_CR2IC_IC3EN,
218  ADI_RTC_INPUT_CHANNEL_4 = 1 << BITP_RTC_CR2IC_IC4EN
219 
221 
225 typedef enum
226 {
228  ADI_RTC_SS_CHANNEL_1 = 1 << BITP_RTC_CR3SS_SS1EN,
229 #if defined(__ADUCM4x50__)
230 
231  ADI_RTC_SS_CHANNEL_2 = 1 << BITP_RTC_CR3SS_SS2EN,
233  ADI_RTC_SS_CHANNEL_3 = 1 << BITP_RTC_CR3SS_SS3EN,
235  ADI_RTC_SS_CHANNEL_4 = 1 << BITP_RTC_CR3SS_SS4EN,
236 #endif /* __ADUCM4x50__ */
238 
242 typedef enum
243 {
245  ADI_RTC_TRIM_ADD = (1 << BITP_RTC_TRM_ADD),
247  ADI_RTC_TRIM_SUB = (0 << BITP_RTC_TRM_ADD),
249 
253 typedef enum
254 {
256  ADI_RTC_TRIM_0 = (0 << BITP_RTC_TRM_VALUE),
258  ADI_RTC_TRIM_1 = (1 << BITP_RTC_TRM_VALUE),
260  ADI_RTC_TRIM_2 = (2 << BITP_RTC_TRM_VALUE),
262  ADI_RTC_TRIM_3 = (3 << BITP_RTC_TRM_VALUE),
264  ADI_RTC_TRIM_4 = (4 << BITP_RTC_TRM_VALUE),
266  ADI_RTC_TRIM_5 = (5 << BITP_RTC_TRM_VALUE),
268  ADI_RTC_TRIM_6 = (6 << BITP_RTC_TRM_VALUE),
270  ADI_RTC_TRIM_7 = (7 << BITP_RTC_TRM_VALUE)
272 
276 typedef enum
277 {
283 
284 /*================ E X T E R N A L S ==================*/
285 
286 /*
287  */
288 
289 /*************************************/
290 /* RTC API */
291 /*************************************/
293  uint32_t DeviceNumber,
294  void *pDeviceMemory,
295  uint32_t MemorySize,
296  ADI_RTC_HANDLE *phDevice
297  );
298 
300  ADI_RTC_HANDLE const hDevice
301  );
302 
303 /*************************************/
304 /* Enable APIs for RTC Device */
305 /*************************************/
306 
308  ADI_RTC_HANDLE const hDevice,
309  bool bEnable
310  );
311 
313  ADI_RTC_HANDLE const hDevice,
314  bool bEnable
315  );
316 
318  ADI_RTC_HANDLE const hDevice,
319  bool bEnable
320  );
321 
323  ADI_RTC_HANDLE const hDevice,
324  ADI_RTC_INT_TYPE Interrupts,
325  bool bEnable
326  );
327 
329  ADI_RTC_HANDLE const hDevice,
330  bool bEnable
331  );
332 
334  ADI_RTC_HANDLE const hDevice,
335  ADI_RTC_SS_CHANNEL eSSChannel,
336  bool bEnable);
337 
339  ADI_RTC_HANDLE const hDevice,
340  ADI_RTC_SS_CHANNEL eSSChannel,
341  bool bEnable);
342 
344  ADI_RTC_HANDLE const hDevice,
345  ADI_RTC_INPUT_CHANNEL eInpChannel,
346  bool bEnable);
347 
349  ADI_RTC_HANDLE const hDevice,
350  ADI_RTC_SS_CHANNEL eSSChannel,
351  bool bEnable);
352 
354  ADI_RTC_HANDLE const hDevice,
355  bool bEnable);
356 
357 /*************************************/
358 /* Set APIs for RTC Device */
359 /*************************************/
360 
361 
363  ADI_RTC_HANDLE const hDevice,
364  uint8_t nPeriod
365  );
366 
368  ADI_RTC_HANDLE const hDevice,
369  uint32_t nAlarm
370  );
371 
373  (ADI_RTC_HANDLE const hDevice,
374  uint16_t nAlarm0,
375  uint16_t nAlarm1,
376  uint16_t nAlarm2);
377 
379  ADI_RTC_HANDLE const hDevice,
380  uint32_t nAlarm
381  );
382 
384  (ADI_RTC_HANDLE const hDevice,
385  uint16_t nAlarm0,
386  uint16_t nAlarm1,
387  uint16_t nAlarm2);
388 
390  ADI_RTC_HANDLE const hDevice
391  );
392 
394  ADI_RTC_HANDLE const hDevice,
395  float fAlarm
396  );
397 
398 
400  ADI_RTC_HANDLE const hDevice,
401  ADI_RTC_CONTROL_REGISTER eRegister,
402  uint32_t Control
403  );
404 
406  ADI_RTC_HANDLE const hDevice,
407  uint32_t nCount
408  );
409 
411  ADI_RTC_HANDLE const hDevice,
412  uint16_t Command
413  );
414 
415 
417  ADI_RTC_HANDLE const hDevice,
418  uint8_t nPreScale
419  );
420 
422  ADI_RTC_HANDLE const hDevice,
423  ADI_RTC_TRIM_INTERVAL eInterval,
424  ADI_RTC_TRIM_VALUE eTrimValue,
425  ADI_RTC_TRIM_POLARITY eOperation
426  );
427 
429  ADI_RTC_HANDLE const hDevice,
430  ADI_RTC_SS_CHANNEL eSSChannel,
431  uint8_t nMask);
432 
433 #if defined(__ADUCM302x__)
435  ADI_RTC_HANDLE const hDevice,
436  ADI_RTC_SS_CHANNEL eSSChannel,
437  uint16_t nValue);
438 #elif defined (__ADUCM4x50__)
440  ADI_RTC_HANDLE const hDevice,
441  ADI_RTC_SS_CHANNEL eSSChannel,
442  uint16_t nLowValue,
443  uint16_t nHighValue);
444 #else
445 #error "RTC driver not ported to this proccessor"
446 #endif
447 
448 
450  ADI_RTC_HANDLE const hDevice,
451  ADI_RTC_INPUT_CHANNEL eInpChannel,
452  bool bEnable);
453 
455  ADI_RTC_HANDLE const hDevice,
456  ADI_RTC_SS_CHANNEL eSSChannel,
457  uint16_t nValue);
458 
459 /*************************************/
460 /* Get APIs for RTC Device */
461 /*************************************/
462 
464  ADI_RTC_HANDLE hDevice,
465  uint32_t *pAlarm
466  );
467 
469  ADI_RTC_HANDLE hDevice,
470  float *pAlarm);
471 
473  ADI_RTC_HANDLE hDevice,
474  uint16_t *pAlarm0,
475  uint16_t *pAlarm1,
476  uint16_t *pAlarm2);
477 
478 
480  ADI_RTC_HANDLE hDevice,
481  ADI_RTC_CONTROL_REGISTER eRegister ,
482  uint32_t *pControl);
483 
485  ADI_RTC_HANDLE hDevice,
486  ADI_RTC_TRIM_VALUE *peTrim
487  );
488 
490  ADI_RTC_HANDLE const hDevice,
491  uint32_t *pCount
492  );
493 
495  ADI_RTC_HANDLE const hDevice,
496  float *pfCount
497  );
498 
500  ADI_RTC_HANDLE const hDevice,
501  ADI_RTC_INPUT_CHANNEL eChannel,
502  uint32_t *pValue,
503  uint16_t *pFraction);
504 
506  ADI_RTC_HANDLE const hDevice,
507  ADI_RTC_INPUT_CHANNEL eChannel,
508  uint16_t *pSnap0, uint16_t * pSnap1,
509  uint16_t * pSnap2);
510 
512  ADI_RTC_HANDLE const hDevice,
513  ADI_RTC_INPUT_CHANNEL eChannel,
514  uint16_t *pValue);
515 
517  ADI_RTC_HANDLE const hDevice,
518  ADI_RTC_WRITE_STATUS *pPendBits
519  );
520 
522  ADI_RTC_HANDLE const hDevice,
523  ADI_RTC_WRITE_STATUS *pSyncBits
524  );
525 
527  ADI_RTC_HANDLE const hDevice,
528  ADI_RTC_SS_CHANNEL eSSChannel,
529  uint16_t *pValue);
530 
532  ADI_RTC_HANDLE const hDevice,
533  uint32_t *pnCount,
534  uint32_t *pfCount);
535 
537  ADI_RTC_HANDLE const hDevice,
538  uint16_t *pValue);
539 
540 /************************************************/
541 /* RTC APIs for managing interrupt/sync */
542 /***********************************************/
543 
545  ADI_RTC_HANDLE const hDevice,
546  ADI_RTC_INT_TYPE *pStatus);
547 
549  ADI_RTC_HANDLE const hDevice,
550  ADI_RTC_INT_TYPE Status);
551 
553  ADI_RTC_HANDLE const hDevice
554  );
555 
557  ADI_RTC_HANDLE const hDevice,
558  ADI_CALLBACK const pfCallback,
559  void *const pCBparam
560  );
561 
562 #ifdef __cplusplus
563 }
564 #endif
565 
568 #endif /* ADI_RTC_H__ */
569 
ADI_RTC_RESULT adi_rtc_ClearInterruptStatus(ADI_RTC_HANDLE const hDevice, ADI_RTC_INT_TYPE Status)
Clear an RTC interrupt status bit(s).
Definition: adi_rtc.c:1629
ADI_RTC_RESULT adi_rtc_GetInputCaptureValueEx(ADI_RTC_HANDLE const hDevice, ADI_RTC_INPUT_CHANNEL eChannel, uint16_t *pSnap0, uint16_t *pSnap1, uint16_t *pSnap2)
Get input capture value for specified input channel.
Definition: adi_rtc.c:1901
ADI_RTC_RESULT adi_rtc_GetCount(ADI_RTC_HANDLE const hDevice, uint32_t *pCount)
Get current RTC count value.
Definition: adi_rtc.c:1430
ADI_RTC_RESULT adi_rtc_SetSensorStrobeValue(ADI_RTC_HANDLE const hDevice, ADI_RTC_SS_CHANNEL eSSChannel, uint16_t nValue)
Set Sensor Strobe value for the given Sensor Strobe channel.
Definition: adi_rtc.c:1820
ADI_RTC_RESULT adi_rtc_SetGateway(ADI_RTC_HANDLE const hDevice, uint16_t Command)
Set an RTC gateway command.
Definition: adi_rtc.c:2777
ADI_RTC_RESULT adi_rtc_Close(ADI_RTC_HANDLE const hDevice)
Uninitialize and deallocate an RTC device.
Definition: adi_rtc.c:385
ADI_RTC_RESULT adi_rtc_SetAlarm(ADI_RTC_HANDLE const hDevice, uint32_t nAlarm)
Set a new RTC alarm value.
Definition: adi_rtc.c:2213
ADI_RTC_RESULT adi_rtc_GetTrim(ADI_RTC_HANDLE hDevice, ADI_RTC_TRIM_VALUE *peTrim)
Get current RTC clock trim value.
Definition: adi_rtc.c:1721
uint32_t ADI_RTC_INT_TYPE
Definition: adi_rtc.h:100
ADI_RTC_RESULT adi_rtc_GetInterruptStatus(ADI_RTC_HANDLE const hDevice, ADI_RTC_INT_TYPE *pStatus)
Get current RTC interrupt source status.
Definition: adi_rtc.c:1563
ADI_RTC_RESULT adi_rtc_SetAlarmRegsAsync(ADI_RTC_HANDLE const hDevice, uint16_t nAlarm0, uint16_t nAlarm1, uint16_t nAlarm2)
Set a new RTC alarm value for RTC ALM0, ALM1 and ALM2 Registers without waiting for synchronization.
Definition: adi_rtc.c:2371
ADI_RTC_RESULT adi_rtc_SynchronizeAllWrites(ADI_RTC_HANDLE const hDevice)
Force synchronization of all pending writes.
Definition: adi_rtc.c:2867
void * ADI_RTC_HANDLE
Definition: adi_rtc.h:40
ADI_RTC_RESULT adi_rtc_GetInputCaptureValue(ADI_RTC_HANDLE const hDevice, ADI_RTC_INPUT_CHANNEL eChannel, uint16_t *pValue)
Get input capture value for specified input channel.
Definition: adi_rtc.c:1961
ADI_RTC_RESULT adi_rtc_GetSensorStrobeValue(ADI_RTC_HANDLE const hDevice, ADI_RTC_SS_CHANNEL eSSChannel, uint16_t *pValue)
Get Sensor Strobe value for the given Sensor Strobe channel.
Definition: adi_rtc.c:1760
ADI_RTC_RESULT adi_rtc_GetCountRegs(ADI_RTC_HANDLE const hDevice, uint32_t *pnCount, uint32_t *pfCount)
Get current RTC count value of all registers.
Definition: adi_rtc.c:1510
ADI_RTC_RESULT adi_rtc_GetWriteSyncStatus(ADI_RTC_HANDLE const hDevice, ADI_RTC_WRITE_STATUS *pSyncBits)
Get current RTC posted write synchronization status.
Definition: adi_rtc.c:2135
ADI_RTC_RESULT adi_rtc_SyncAlarm(ADI_RTC_HANDLE const hDevice)
Sync after writing RTC alarm registers.
Definition: adi_rtc.c:2419
ADI_RTC_RESULT adi_rtc_SetTrim(ADI_RTC_HANDLE const hDevice, ADI_RTC_TRIM_INTERVAL eInterval, ADI_RTC_TRIM_VALUE eTrimValue, ADI_RTC_TRIM_POLARITY eOperation)
Set a new RTC trim value.
Definition: adi_rtc.c:2819
ADI_RTC_RESULT adi_rtc_GetCountEx(ADI_RTC_HANDLE const hDevice, float *pfCount)
Get current RTC count value with fraction.
Definition: adi_rtc.c:1466
ADI_RTC_RESULT adi_rtc_Open(uint32_t DeviceNumber, void *pDeviceMemory, uint32_t MemorySize, ADI_RTC_HANDLE *phDevice)
RTC Initialization.
Definition: adi_rtc.c:266
ADI_RTC_RESULT adi_rtc_SetAutoReloadValue(ADI_RTC_HANDLE const hDevice, ADI_RTC_SS_CHANNEL eSSChannel, uint16_t nLowValue, uint16_t nHighValue)
Set auto reload value for the given Sensor Strobe channel.
Definition: adi_rtc.c:1062
ADI_RTC_WRITE_STATUS
Definition: adi_rtc.h:147
ADI_RTC_RESULT adi_rtc_SetPreScale(ADI_RTC_HANDLE const hDevice, uint8_t nPreScale)
Set Prescale. This is power of 2 division factor for the RTC base clock.
Definition: adi_rtc.c:2455
ADI_RTC_RESULT adi_rtc_EnableMod60Alarm(ADI_RTC_HANDLE const hDevice, bool bEnable)
Enable MOD60 RTC alarm.
Definition: adi_rtc.c:510
ADI_RTC_RESULT adi_rtc_GetAlarmEx(ADI_RTC_HANDLE hDevice, float *pAlarm)
Get current RTC alarm value with fractional part also.
Definition: adi_rtc.c:1290
ADI_RTC_RESULT adi_rtc_EnableTrim(ADI_RTC_HANDLE const hDevice, bool bEnable)
Enable RTC automatic clock trimming.
Definition: adi_rtc.c:731
ADI_RTC_RESULT adi_rtc_GetAlarmRegs(ADI_RTC_HANDLE hDevice, uint16_t *pAlarm0, uint16_t *pAlarm1, uint16_t *pAlarm2)
Get current RTC alarm value from RTC Alarm register.
Definition: adi_rtc.c:1338
ADI_RTC_RESULT adi_rtc_RegisterCallback(ADI_RTC_HANDLE const hDevice, ADI_CALLBACK const pfCallback, void *const pCBparam)
Registers a Callback function with the RTC device driver. The registered call back function will be c...
Definition: adi_rtc.c:2667
ADI_RTC_RESULT adi_rtc_SetInputCapturePolarity(ADI_RTC_HANDLE const hDevice, ADI_RTC_INPUT_CHANNEL eInpChannel, bool bEnable)
Set input capture polarity for the specified channel.
Definition: adi_rtc.c:870
ADI_RTC_RESULT adi_rtc_SetAlarmAsync(ADI_RTC_HANDLE const hDevice, uint32_t nAlarm)
Set a new RTC alarm value without waiting for synchronization.
Definition: adi_rtc.c:2321
ADI_RTC_RESULT adi_rtc_GetControl(ADI_RTC_HANDLE hDevice, ADI_RTC_CONTROL_REGISTER eRegister, uint32_t *pControl)
Get current RTC control register value.
Definition: adi_rtc.c:1382
ADI_RTC_RESULT adi_rtc_EnableInputCapture(ADI_RTC_HANDLE const hDevice, ADI_RTC_INPUT_CHANNEL eInpChannel, bool bEnable)
Enable input capture for the specified channel.
Definition: adi_rtc.c:777
ADI_RTC_RESULT adi_rtc_SetAlarmEx(ADI_RTC_HANDLE const hDevice, float fAlarm)
Set a new RTC alarm value with fractional value.
Definition: adi_rtc.c:2558
ADI_RTC_RESULT adi_rtc_Enable(ADI_RTC_HANDLE const hDevice, bool bEnable)
Enable RTC device.
Definition: adi_rtc.c:572
ADI_RTC_RESULT adi_rtc_EnableAlarm(ADI_RTC_HANDLE const hDevice, bool bEnable)
Enable RTC alarm.
Definition: adi_rtc.c:447
ADI_RTC_RESULT adi_rtc_SetSensorStrobeChannelMask(ADI_RTC_HANDLE const hDevice, ADI_RTC_SS_CHANNEL eSSChannel, uint8_t nMask)
To set channel mask for the given Sensor Strobe channel.
Definition: adi_rtc.c:1179
ADI_RTC_RESULT adi_rtc_SetControlRegister(ADI_RTC_HANDLE const hDevice, ADI_RTC_CONTROL_REGISTER eRegister, uint32_t Control)
Set a new RTC control register value.
Definition: adi_rtc.c:2619
ADI_RTC_RESULT adi_rtc_GetSnapShot(ADI_RTC_HANDLE const hDevice, ADI_RTC_INPUT_CHANNEL eChannel, uint32_t *pValue, uint16_t *pFraction)
Read RTC snapshot registers values.
Definition: adi_rtc.c:2011
ADI_RTC_RESULT adi_rtc_EnableSensorStrobeOutput(ADI_RTC_HANDLE const hDevice, ADI_RTC_SS_CHANNEL eSSChannel, bool bEnable)
Enable output for the specified Sensor Strobe Channel.
Definition: adi_rtc.c:917
ADI_RTC_TRIM_INTERVAL
Definition: adi_rtc.h:169
ADI_RTC_RESULT adi_rtc_EnableAutoReload(ADI_RTC_HANDLE const hDevice, ADI_RTC_SS_CHANNEL eSSChannel, bool bEnable)
Enable auto reload for given Sensor Strobe Channel.
Definition: adi_rtc.c:964
ADI_RTC_RESULT adi_rtc_GetAlarm(ADI_RTC_HANDLE hDevice, uint32_t *pAlarm)
Get current RTC alarm value.
Definition: adi_rtc.c:1249
ADI_RTC_RESULT
Definition: adi_rtc.h:69
ADI_RTC_RESULT adi_rtc_EnableSensorStrobeChannelMask(ADI_RTC_HANDLE const hDevice, ADI_RTC_SS_CHANNEL eSSChannel, bool bEnable)
Enable or disable thermometer-code masking for the given Sensor Strobe Channel.
Definition: adi_rtc.c:1134
ADI_RTC_RESULT adi_rtc_GetWritePendStatus(ADI_RTC_HANDLE const hDevice, ADI_RTC_WRITE_STATUS *pPendBits)
Get current RTC posted write pending status.
Definition: adi_rtc.c:2076
ADI_RTC_INPUT_CHANNEL
Definition: adi_rtc.h:209
ADI_RTC_TRIM_VALUE
Definition: adi_rtc.h:253
ADI_RTC_RESULT adi_rtc_GetISOENB(ADI_RTC_HANDLE const hDevice, uint16_t *pValue)
Get the value of the ISOENB bit.
Definition: adi_rtc.c:2168
ADI_RTC_RESULT adi_rtc_SetCount(ADI_RTC_HANDLE const hDevice, uint32_t nCount)
Set a new RTC count value.
Definition: adi_rtc.c:2719
ADI_RTC_TRIM_POLARITY
Definition: adi_rtc.h:242
ADI_RTC_SS_CHANNEL
Definition: adi_rtc.h:225
ADI_RTC_RESULT adi_rtc_SetMod60AlarmPeriod(ADI_RTC_HANDLE const hDevice, uint8_t nPeriod)
Set the modulo-60 alarm value. This positions a periodic (repeating) alarm interrupt from the RTC at ...
Definition: adi_rtc.c:2502
ADI_RTC_CONTROL_REGISTER
Definition: adi_rtc.h:276
ADI_RTC_RESULT adi_rtc_SetAlarmRegs(ADI_RTC_HANDLE const hDevice, uint16_t nAlarm0, uint16_t nAlarm1, uint16_t nAlarm2)
Set a new RTC alarm value for RTC ALM0,ALM1 and ALM2 Register.
Definition: adi_rtc.c:2265
ADI_RTC_RESULT adi_rtc_EnableInterrupts(ADI_RTC_HANDLE const hDevice, ADI_RTC_INT_TYPE Interrupts, bool bEnable)
Manage interrupt enable/disable in the RTC and NVIC controller.
Definition: adi_rtc.c:632
ADI_RTC_RESULT adi_rtc_EnableOverwriteSnapshot(ADI_RTC_HANDLE const hDevice, bool bEnable)
Enable Overwrite of Unread Snapshots for all RTC Input Capture Channels.
Definition: adi_rtc.c:823