ADuCM302x Device Drivers API Reference Manual  Release 3.1.2.0
RTC Driver

Real Time Clock (RTC) Driver. More...

Modules

 Static Configuration
 

Macros

#define ADI_RTC_MEMORY_SIZE   (24u)
 
#define ADI_RTC_GATEWAY_FLUSH   0xa2c5
 
#define ADI_RTC_IRQ_SOURCE_OFFSET_SR0   (0u)
 
#define ADI_RTC_IRQ_SOURCE_MASK_SR0   (0x7Eu)
 
#define ADI_RTC_IRQ_SOURCE_OFFSET_SR2   (8u)
 
#define ADI_RTC0_IRQ_SOURCE_MASK_SR2   (0x0Fu)
 
#define ADI_RTC1_IRQ_SOURCE_MASK_SR2   (0x1Fu)
 
#define ADI_RTC_IRQ_SOURCE_OFFSET_SR3   (16u)
 
#define ADI_RTC_IRQ_SOURCE_MASK_SR3   (0x031Du)
 
#define ADI_RTC_ALARM_INT   0x00000001u
 
#define ADI_RTC_MOD60ALM_INT   0x00000002u
 
#define ADI_RTC_ISO_DONE_INT   0x00000004u
 
#define ADI_RTC_WRITE_PENDERR_INT   0x00000008u
 
#define ADI_RTC_WRITE_SYNC_INT   0x00000010u
 
#define ADI_RTC_WRITE_PEND_INT   0x00000020u
 
#define ADI_RTC_COUNT_INT   0x00000040u
 
#define ADI_RTC_PSI_INT   0x00000080u
 
#define ADI_RTC_TRIM_INT   0x00000100u
 
#define ADI_RTC_COUNT_ROLLOVER_INT   0x00000200u
 
#define ADI_RTC_MOD60_ROLLOVER_INT   0x00000400u
 
#define ADI_RTC_SENSOR_STROBE_CH1_INT   0x00000800u
 
#define ADI_RTC_INPUT_CAPTURE_CH0_INT   0x00008000u
 
#define ADI_RTC_INPUT_CAPTURE_CH2_INT   0x00010000u
 
#define ADI_RTC_INPUT_CAPTURE_CH3_INT   0x00020000u
 
#define ADI_RTC_INPUT_CAPTURE_CH4_INT   0x00040000u
 
#define ADI_RTC_LFXTL_FAILURE_INT   0x00080000u
 
#define ADI_RTC_RTCSS1MSKEN   0x08000000u
 
#define ADI_RTC_NUM_INTERRUPTS   18
 

Typedefs

typedef void * ADI_RTC_HANDLE
 
typedef uint32_t ADI_RTC_INT_TYPE
 

Enumerations

enum  ADI_RTC_RESULT {
  ADI_RTC_SUCCESS,
  ADI_RTC_FAILURE,
  ADI_RTC_CLOCK_FAILSAFE,
  ADI_RTC_IN_USE,
  ADI_RTC_INVALID_HANDLE,
  ADI_RTC_INVALID_INSTANCE,
  ADI_RTC_INVALID_OPTION,
  ADI_RTC_OPERATION_NOT_ALLOWED,
  ADI_RTC_INVALID_PARAM,
  ADI_RTC_INVALID_CHANNEL
}
 
enum  ADI_RTC_WRITE_STATUS {
  ADI_RTC_WRITE_STATUS_CONTROL0 = 1 << BITP_RTC_SR0_WSYNCCR0,
  ADI_RTC_WRITE_STATUS_STATUS0 = 1 << BITP_RTC_SR0_WSYNCSR0,
  ADI_RTC_WRITE_STATUS_COUNT0 = 1 << BITP_RTC_SR0_WSYNCCNT0,
  ADI_RTC_WRITE_STATUS_COUNT1 = 1 << BITP_RTC_SR0_WSYNCCNT1,
  ADI_RTC_WRITE_STATUS_ALARM0 = 1 << BITP_RTC_SR0_WSYNCALM0,
  ADI_RTC_WRITE_STATUS_ALARM1 = 1 << BITP_RTC_SR0_WSYNCALM1,
  ADI_RTC_WRITE_STATUS_TRIM = 1 << BITP_RTC_SR0_WSYNCTRM
}
 
enum  ADI_RTC_TRIM_INTERVAL {
  ADI_RTC_TRIM_INTERVAL_2 = (2 << BITP_RTC_TRM_IVL2EXPMIN | 0x0 << BITP_RTC_TRM_IVL),
  ADI_RTC_TRIM_INTERVAL_3 = (3 << BITP_RTC_TRM_IVL2EXPMIN | 0x0 << BITP_RTC_TRM_IVL),
  ADI_RTC_TRIM_INTERVAL_4 = (4 << BITP_RTC_TRM_IVL2EXPMIN | 0x0 << BITP_RTC_TRM_IVL),
  ADI_RTC_TRIM_INTERVAL_5 = (5 << BITP_RTC_TRM_IVL2EXPMIN | 0x0 << BITP_RTC_TRM_IVL),
  ADI_RTC_TRIM_INTERVAL_6 = (6 << BITP_RTC_TRM_IVL2EXPMIN | 0x0 << BITP_RTC_TRM_IVL),
  ADI_RTC_TRIM_INTERVAL_7 = (7 << BITP_RTC_TRM_IVL2EXPMIN | 0x0 << BITP_RTC_TRM_IVL),
  ADI_RTC_TRIM_INTERVAL_8 = (8 << BITP_RTC_TRM_IVL2EXPMIN | 0x0 << BITP_RTC_TRM_IVL),
  ADI_RTC_TRIM_INTERVAL_9 = (9 << BITP_RTC_TRM_IVL2EXPMIN | 0x0 << BITP_RTC_TRM_IVL),
  ADI_RTC_TRIM_INTERVAL_10 = (10 << BITP_RTC_TRM_IVL2EXPMIN | 0x0 << BITP_RTC_TRM_IVL),
  ADI_RTC_TRIM_INTERVAL_11 = (11 << BITP_RTC_TRM_IVL2EXPMIN | 0x1 << BITP_RTC_TRM_IVL),
  ADI_RTC_TRIM_INTERVAL_12 = (12 << BITP_RTC_TRM_IVL2EXPMIN | 0x0 << BITP_RTC_TRM_IVL),
  ADI_RTC_TRIM_INTERVAL_13 = (13 << BITP_RTC_TRM_IVL2EXPMIN | 0x0 << BITP_RTC_TRM_IVL),
  ADI_RTC_TRIM_INTERVAL_14 = (14 << BITP_RTC_TRM_IVL2EXPMIN | 0x0 << BITP_RTC_TRM_IVL),
  ADI_RTC_TRIM_INTERVAL_15 = (14 << BITP_RTC_TRM_IVL2EXPMIN | 0x1 << BITP_RTC_TRM_IVL),
  ADI_RTC_TRIM_INTERVAL_16 = (14 << BITP_RTC_TRM_IVL2EXPMIN | 0x2 << BITP_RTC_TRM_IVL ),
  ADI_RTC_TRIM_INTERVAL_17 = (14 << BITP_RTC_TRM_IVL2EXPMIN | 0x3 << BITP_RTC_TRM_IVL)
}
 
enum  ADI_RTC_INPUT_CHANNEL {
  ADI_RTC_INPUT_CHANNEL_0 = 1 << BITP_RTC_CR2IC_IC0EN,
  ADI_RTC_INPUT_CHANNEL_2 = 1 << BITP_RTC_CR2IC_IC2EN,
  ADI_RTC_INPUT_CHANNEL_3 = 1 << BITP_RTC_CR2IC_IC3EN,
  ADI_RTC_INPUT_CHANNEL_4 = 1 << BITP_RTC_CR2IC_IC4EN
}
 
enum  ADI_RTC_SS_CHANNEL { ADI_RTC_SS_CHANNEL_1 = 1 << BITP_RTC_CR3SS_SS1EN }
 
enum  ADI_RTC_TRIM_POLARITY {
  ADI_RTC_TRIM_ADD = (1 << BITP_RTC_TRM_ADD),
  ADI_RTC_TRIM_SUB = (0 << BITP_RTC_TRM_ADD)
}
 
enum  ADI_RTC_TRIM_VALUE {
  ADI_RTC_TRIM_0 = (0 << BITP_RTC_TRM_VALUE),
  ADI_RTC_TRIM_1 = (1 << BITP_RTC_TRM_VALUE),
  ADI_RTC_TRIM_2 = (2 << BITP_RTC_TRM_VALUE),
  ADI_RTC_TRIM_3 = (3 << BITP_RTC_TRM_VALUE),
  ADI_RTC_TRIM_4 = (4 << BITP_RTC_TRM_VALUE),
  ADI_RTC_TRIM_5 = (5 << BITP_RTC_TRM_VALUE),
  ADI_RTC_TRIM_6 = (6 << BITP_RTC_TRM_VALUE),
  ADI_RTC_TRIM_7 = (7 << BITP_RTC_TRM_VALUE)
}
 
enum  ADI_RTC_CONTROL_REGISTER {
  ADI_RTC_CONTROL_REGISTER_0,
  ADI_RTC_CONTROL_REGISTER_1
}
 

Functions

ADI_RTC_RESULT adi_rtc_Open (uint32_t DeviceNumber, void *pDeviceMemory, uint32_t MemorySize, ADI_RTC_HANDLE *phDevice)
 RTC Initialization. More...
 
ADI_RTC_RESULT adi_rtc_Close (ADI_RTC_HANDLE const hDevice)
 Uninitialize and deallocate an RTC device. More...
 
ADI_RTC_RESULT adi_rtc_EnableAlarm (ADI_RTC_HANDLE const hDevice, bool bEnable)
 Enable RTC alarm. More...
 
ADI_RTC_RESULT adi_rtc_EnableMod60Alarm (ADI_RTC_HANDLE const hDevice, bool bEnable)
 Enable MOD60 RTC alarm. More...
 
ADI_RTC_RESULT adi_rtc_Enable (ADI_RTC_HANDLE const hDevice, bool bEnable)
 Enable RTC device. More...
 
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. More...
 
ADI_RTC_RESULT adi_rtc_EnableTrim (ADI_RTC_HANDLE const hDevice, bool bEnable)
 Enable RTC automatic clock trimming. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
ADI_RTC_RESULT adi_rtc_EnableOverwriteSnapshot (ADI_RTC_HANDLE const hDevice, bool bEnable)
 Enable Overwrite of Unread Snapshots for all RTC Input Capture Channels. More...
 
ADI_RTC_RESULT adi_rtc_SetMod60AlarmPeriod (ADI_RTC_HANDLE const hDevice, uint8_t nPeriod)
 Set the pre-scale. This is power of 2 division factor for the RTC base clock. More...
 
ADI_RTC_RESULT adi_rtc_SetAlarm (ADI_RTC_HANDLE const hDevice, uint32_t nAlarm)
 Set a new RTC alarm value. More...
 
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. More...
 
ADI_RTC_RESULT adi_rtc_SetAlarmAsync (ADI_RTC_HANDLE const hDevice, uint32_t nAlarm)
 Set a new RTC alarm value without waiting for synchronization. More...
 
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. More...
 
ADI_RTC_RESULT adi_rtc_SyncAlarm (ADI_RTC_HANDLE const hDevice)
 Sync after writing RTC alarm registers. More...
 
ADI_RTC_RESULT adi_rtc_SetAlarmEx (ADI_RTC_HANDLE const hDevice, float fAlarm)
 Set a new RTC alarm value with fractional value. More...
 
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. More...
 
ADI_RTC_RESULT adi_rtc_SetCount (ADI_RTC_HANDLE const hDevice, uint32_t nCount)
 Set a new RTC count value. More...
 
ADI_RTC_RESULT adi_rtc_SetGateway (ADI_RTC_HANDLE const hDevice, uint16_t Command)
 Set an RTC gateway command. More...
 
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. More...
 
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. More...
 
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. More...
 
ADI_RTC_RESULT adi_rtc_SetAutoReloadValue (ADI_RTC_HANDLE const hDevice, ADI_RTC_SS_CHANNEL eSSChannel, uint16_t nValue)
 Set auto reload value for the given Sensor Strobe channel. More...
 
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. More...
 
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. More...
 
ADI_RTC_RESULT adi_rtc_GetAlarm (ADI_RTC_HANDLE hDevice, uint32_t *pAlarm)
 Get current RTC alarm value. More...
 
ADI_RTC_RESULT adi_rtc_GetAlarmEx (ADI_RTC_HANDLE hDevice, float *pAlarm)
 Get current RTC alarm value with fractional part also. More...
 
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. More...
 
ADI_RTC_RESULT adi_rtc_GetControl (ADI_RTC_HANDLE hDevice, ADI_RTC_CONTROL_REGISTER eRegister,uint32_t *pControl)
 Get current RTC control register value. More...
 
ADI_RTC_RESULT adi_rtc_GetTrim (ADI_RTC_HANDLE hDevice, ADI_RTC_TRIM_VALUE *peTrim)
 Get current RTC clock trim value. More...
 
ADI_RTC_RESULT adi_rtc_GetCount (ADI_RTC_HANDLE const hDevice, uint32_t *pCount)
 Get current RTC count value. More...
 
ADI_RTC_RESULT adi_rtc_GetCountEx (ADI_RTC_HANDLE const hDevice, float *pfCount)
 Get current RTC count value with fraction. More...
 
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. More...
 
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. More...
 
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. More...
 
ADI_RTC_RESULT adi_rtc_GetWritePendStatus (ADI_RTC_HANDLE const hDevice, ADI_RTC_WRITE_STATUS *pPendBits)
 Get current RTC posted write pending status. More...
 
ADI_RTC_RESULT adi_rtc_GetWriteSyncStatus (ADI_RTC_HANDLE const hDevice, ADI_RTC_WRITE_STATUS *pSyncBits)
 Get current RTC posted write synchronization status. More...
 
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. More...
 
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. More...
 
ADI_RTC_RESULT adi_rtc_GetInterruptStatus (ADI_RTC_HANDLE const hDevice, ADI_RTC_INT_TYPE *pStatus)
 Get current RTC interrupt source status. More...
 
ADI_RTC_RESULT adi_rtc_ClearInterruptStatus (ADI_RTC_HANDLE const hDevice, ADI_RTC_INT_TYPE Status)
 Clear an RTC interrupt status bit(s). More...
 
ADI_RTC_RESULT adi_rtc_SynchronizeAllWrites (ADI_RTC_HANDLE const hDevice)
 Force synchronization of all pending writes. More...
 
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 called when an event is detected. More...
 

Detailed Description

Real Time Clock (RTC) Driver.

The RTC driver manages all instances of the RTC peripheral.

Note
The application must include drivers/rtc/adi_rtc.h to use this driver

Macro Definition Documentation

◆ ADI_RTC_MEMORY_SIZE

#define ADI_RTC_MEMORY_SIZE   (24u)

Amount of memory(In bytes) required by the RTC device driver for managing the operation. This memory is completely owned by the driver till the end of the operation.

Definition at line 68 of file adi_rtc.h.

Referenced by adi_rtc_Open().

◆ ADI_RTC_GATEWAY_FLUSH

#define ADI_RTC_GATEWAY_FLUSH   0xa2c5

Emergency flush command to gatweay register

Definition at line 71 of file adi_rtc.h.

◆ ADI_RTC_IRQ_SOURCE_OFFSET_SR0

#define ADI_RTC_IRQ_SOURCE_OFFSET_SR0   (0u)

Offset to get SR0 interrupt bits stored in ADI_RTC_INT_TYPE values

Definition at line 77 of file adi_rtc.h.

Referenced by adi_rtc_ClearInterruptStatus(), and adi_rtc_GetInterruptStatus().

◆ ADI_RTC_IRQ_SOURCE_MASK_SR0

#define ADI_RTC_IRQ_SOURCE_MASK_SR0   (0x7Eu)

Mask to isolate SR0 interrupt status bits (common to RTC0 and RTC1)

Definition at line 80 of file adi_rtc.h.

Referenced by adi_rtc_ClearInterruptStatus(), adi_rtc_GetInterruptStatus(), adi_rtc_Open(), and adi_rtc_SynchronizeAllWrites().

◆ ADI_RTC_IRQ_SOURCE_OFFSET_SR2

#define ADI_RTC_IRQ_SOURCE_OFFSET_SR2   (8u)

Offset to get SR2 interrupt bits stored in ADI_RTC_INT_TYPE values

Definition at line 83 of file adi_rtc.h.

Referenced by adi_rtc_ClearInterruptStatus(), and adi_rtc_GetInterruptStatus().

◆ ADI_RTC0_IRQ_SOURCE_MASK_SR2

#define ADI_RTC0_IRQ_SOURCE_MASK_SR2   (0x0Fu)

Mask to isolate RTC0 SR2 interrupt status bits

Definition at line 86 of file adi_rtc.h.

Referenced by adi_rtc_ClearInterruptStatus(), adi_rtc_GetInterruptStatus(), and adi_rtc_SynchronizeAllWrites().

◆ ADI_RTC1_IRQ_SOURCE_MASK_SR2

#define ADI_RTC1_IRQ_SOURCE_MASK_SR2   (0x1Fu)

Mask to isolate RTC1 SR2 interrupt status bits

Definition at line 88 of file adi_rtc.h.

Referenced by adi_rtc_ClearInterruptStatus(), adi_rtc_GetInterruptStatus(), and adi_rtc_SynchronizeAllWrites().

◆ ADI_RTC_IRQ_SOURCE_OFFSET_SR3

#define ADI_RTC_IRQ_SOURCE_OFFSET_SR3   (16u)

Offset to get SR3 interrupt bits stored in ADI_RTC_INT_TYPE values (RTC1 only)

Definition at line 91 of file adi_rtc.h.

Referenced by adi_rtc_ClearInterruptStatus(), and adi_rtc_GetInterruptStatus().

◆ ADI_RTC_IRQ_SOURCE_MASK_SR3

#define ADI_RTC_IRQ_SOURCE_MASK_SR3   (0x031Du)

Mask to isolate SR3 interrupt status bits

Definition at line 95 of file adi_rtc.h.

Referenced by adi_rtc_ClearInterruptStatus(), adi_rtc_GetInterruptStatus(), and adi_rtc_SynchronizeAllWrites().

◆ ADI_RTC_ALARM_INT

#define ADI_RTC_ALARM_INT   0x00000001u

Alarm interrupt enable bit

Definition at line 136 of file adi_rtc.h.

Referenced by adi_rtc_SynchronizeAllWrites().

◆ ADI_RTC_MOD60ALM_INT

#define ADI_RTC_MOD60ALM_INT   0x00000002u

modulo 60 Alarm interrupt enable

Definition at line 137 of file adi_rtc.h.

Referenced by adi_rtc_EnableInterrupts(), and adi_rtc_SynchronizeAllWrites().

◆ ADI_RTC_ISO_DONE_INT

#define ADI_RTC_ISO_DONE_INT   0x00000004u

Power isolation done interrupt enable

Definition at line 138 of file adi_rtc.h.

Referenced by adi_rtc_EnableInterrupts(), and adi_rtc_SynchronizeAllWrites().

◆ ADI_RTC_WRITE_PENDERR_INT

#define ADI_RTC_WRITE_PENDERR_INT   0x00000008u

Write pend error interrupt enable

Definition at line 139 of file adi_rtc.h.

Referenced by adi_rtc_SynchronizeAllWrites().

◆ ADI_RTC_WRITE_SYNC_INT

#define ADI_RTC_WRITE_SYNC_INT   0x00000010u

Write sync interrupt enable

Definition at line 140 of file adi_rtc.h.

Referenced by adi_rtc_SynchronizeAllWrites().

◆ ADI_RTC_WRITE_PEND_INT

#define ADI_RTC_WRITE_PEND_INT   0x00000020u

Write pend interrupt enable

Definition at line 141 of file adi_rtc.h.

Referenced by adi_rtc_SynchronizeAllWrites().

◆ ADI_RTC_COUNT_INT

#define ADI_RTC_COUNT_INT   0x00000040u

RTC count interrupt source enable

Definition at line 142 of file adi_rtc.h.

Referenced by adi_rtc_EnableInterrupts(), and adi_rtc_SynchronizeAllWrites().

◆ ADI_RTC_PSI_INT

#define ADI_RTC_PSI_INT   0x00000080u

Precaled Module 1 interrupt

Definition at line 143 of file adi_rtc.h.

Referenced by adi_rtc_SynchronizeAllWrites().

◆ ADI_RTC_TRIM_INT

#define ADI_RTC_TRIM_INT   0x00000100u

Enable for the RTC trim interrupt source

Definition at line 144 of file adi_rtc.h.

Referenced by adi_rtc_EnableInterrupts(), and adi_rtc_SynchronizeAllWrites().

◆ ADI_RTC_COUNT_ROLLOVER_INT

#define ADI_RTC_COUNT_ROLLOVER_INT   0x00000200u

Enable for the RTC count roll-over interrupt source

Definition at line 145 of file adi_rtc.h.

Referenced by adi_rtc_EnableInterrupts(), and adi_rtc_SynchronizeAllWrites().

◆ ADI_RTC_MOD60_ROLLOVER_INT

#define ADI_RTC_MOD60_ROLLOVER_INT   0x00000400u

Enable for the RTC modulo-60 count roll-over interrupt source

Definition at line 146 of file adi_rtc.h.

Referenced by adi_rtc_EnableInterrupts(), and adi_rtc_SynchronizeAllWrites().

◆ ADI_RTC_SENSOR_STROBE_CH1_INT

#define ADI_RTC_SENSOR_STROBE_CH1_INT   0x00000800u

Enable interrupt for sensor strobe channel -1

Definition at line 147 of file adi_rtc.h.

Referenced by adi_rtc_SynchronizeAllWrites().

◆ ADI_RTC_INPUT_CAPTURE_CH0_INT

#define ADI_RTC_INPUT_CAPTURE_CH0_INT   0x00008000u

Enable interrupt for input capture channel -0

Definition at line 148 of file adi_rtc.h.

Referenced by adi_rtc_SynchronizeAllWrites().

◆ ADI_RTC_INPUT_CAPTURE_CH2_INT

#define ADI_RTC_INPUT_CAPTURE_CH2_INT   0x00010000u

Enable interrupt for input capture channel -2

Definition at line 149 of file adi_rtc.h.

Referenced by adi_rtc_SynchronizeAllWrites().

◆ ADI_RTC_INPUT_CAPTURE_CH3_INT

#define ADI_RTC_INPUT_CAPTURE_CH3_INT   0x00020000u

Enable interrupt for input capture channel -3

Definition at line 150 of file adi_rtc.h.

Referenced by adi_rtc_SynchronizeAllWrites().

◆ ADI_RTC_INPUT_CAPTURE_CH4_INT

#define ADI_RTC_INPUT_CAPTURE_CH4_INT   0x00040000u

Enable interrupt for input capture channel -4

Definition at line 151 of file adi_rtc.h.

Referenced by adi_rtc_SynchronizeAllWrites().

◆ ADI_RTC_LFXTL_FAILURE_INT

#define ADI_RTC_LFXTL_FAILURE_INT   0x00080000u

Interrupt for LFXTL failure. LFXTL failure interrupt is mapped to RTC1 interrupt.

Definition at line 152 of file adi_rtc.h.

◆ ADI_RTC_RTCSS1MSKEN

#define ADI_RTC_RTCSS1MSKEN   0x08000000u

Enable interrupt for Sensor Strobe channel 1 Mask

Definition at line 153 of file adi_rtc.h.

◆ ADI_RTC_NUM_INTERRUPTS

#define ADI_RTC_NUM_INTERRUPTS   18

Number of RTC interrupts.

Definition at line 174 of file adi_rtc.h.

Referenced by adi_rtc_EnableInterrupts().

Typedef Documentation

◆ ADI_RTC_HANDLE

typedef void* ADI_RTC_HANDLE

A device handle used in all API functions to identify the RTC device.

Definition at line 74 of file adi_rtc.h.

◆ ADI_RTC_INT_TYPE

typedef uint32_t ADI_RTC_INT_TYPE

RTC Interrupt Enable Bits.

Definition at line 134 of file adi_rtc.h.

Enumeration Type Documentation

◆ ADI_RTC_RESULT

RTC API return codes

Enumerator
ADI_RTC_SUCCESS 

No Error, API succeeded

ADI_RTC_FAILURE 

Generic failure

ADI_RTC_CLOCK_FAILSAFE 

RTC is in failsafe mode and not reliable

ADI_RTC_IN_USE 

RTC is already initialized

ADI_RTC_INVALID_HANDLE 

Invalid device handle passed

ADI_RTC_INVALID_INSTANCE 

Asking to initialize an unknown instance

ADI_RTC_INVALID_OPTION 

Parameter is out of range

ADI_RTC_OPERATION_NOT_ALLOWED 

Specified operation not allowed

ADI_RTC_INVALID_PARAM 

One of the parameters is invalid

ADI_RTC_INVALID_CHANNEL 

Input/SensorStrobe channel is invalid for the specified operation

Definition at line 103 of file adi_rtc.h.

◆ ADI_RTC_WRITE_STATUS

RTC Posted Write Status Bits.

Enumerator
ADI_RTC_WRITE_STATUS_CONTROL0 

Posted write control register-0 status bit

ADI_RTC_WRITE_STATUS_STATUS0 

Posted write status0 register status bit

ADI_RTC_WRITE_STATUS_COUNT0 

Posted write count0 register status bit

ADI_RTC_WRITE_STATUS_COUNT1 

Posted write count1 register status bit

ADI_RTC_WRITE_STATUS_ALARM0 

Posted write alarm0 register status bit

ADI_RTC_WRITE_STATUS_ALARM1 

Posted write alarm1 register status bit

ADI_RTC_WRITE_STATUS_TRIM 

Posted write trim register status bit

Definition at line 181 of file adi_rtc.h.

◆ ADI_RTC_TRIM_INTERVAL

RTC Trim intervals.

Enumerator
ADI_RTC_TRIM_INTERVAL_2 

Trim interval is 2^2 seconds

ADI_RTC_TRIM_INTERVAL_3 

Trim interval is 2^3 seconds

ADI_RTC_TRIM_INTERVAL_4 

Trim interval is 2^4 seconds

ADI_RTC_TRIM_INTERVAL_5 

Trim interval is 2^5 seconds

ADI_RTC_TRIM_INTERVAL_6 

Trim interval is 2^6 seconds

ADI_RTC_TRIM_INTERVAL_7 

Trim interval is 2^7 seconds

ADI_RTC_TRIM_INTERVAL_8 

Trim interval is 2^8 seconds

ADI_RTC_TRIM_INTERVAL_9 

Trim interval is 2^9 seconds

ADI_RTC_TRIM_INTERVAL_10 

Trim interval is 2^10 seconds

ADI_RTC_TRIM_INTERVAL_11 

Trim interval is 2^11 seconds

ADI_RTC_TRIM_INTERVAL_12 

Trim interval is 2^12 seconds

ADI_RTC_TRIM_INTERVAL_13 

Trim interval is 2^13 seconds

ADI_RTC_TRIM_INTERVAL_14 

Trim interval is 2^14 seconds

ADI_RTC_TRIM_INTERVAL_15 

Trim interval is 2^15 seconds

ADI_RTC_TRIM_INTERVAL_16 

Trim interval is 2^16 seconds

ADI_RTC_TRIM_INTERVAL_17 

Trim interval is 2^17 seconds

Definition at line 203 of file adi_rtc.h.

◆ ADI_RTC_INPUT_CHANNEL

RTC input capture channels.

Enumerator
ADI_RTC_INPUT_CHANNEL_0 

Input capture channel-0

ADI_RTC_INPUT_CHANNEL_2 

Input capture channel-2

ADI_RTC_INPUT_CHANNEL_3 

Input capture channel-3

ADI_RTC_INPUT_CHANNEL_4 

Input capture channel-4

Definition at line 243 of file adi_rtc.h.

◆ ADI_RTC_SS_CHANNEL

RTC Sensor Strobe channels.

Enumerator
ADI_RTC_SS_CHANNEL_1 

Sensor Strobe channel-1

Definition at line 259 of file adi_rtc.h.

◆ ADI_RTC_TRIM_POLARITY

RTC Trim polarity.

Enumerator
ADI_RTC_TRIM_ADD 

Trim value is added every trim interval

ADI_RTC_TRIM_SUB 

Trim value is subtracted every trim interval

Definition at line 276 of file adi_rtc.h.

◆ ADI_RTC_TRIM_VALUE

RTC Trim values.

Enumerator
ADI_RTC_TRIM_0 

Trim value is +/- 0

ADI_RTC_TRIM_1 

Trim value is +/- 1

ADI_RTC_TRIM_2 

Trim value is +/- 2

ADI_RTC_TRIM_3 

Trim value is +/- 3

ADI_RTC_TRIM_4 

Trim value is +/- 4

ADI_RTC_TRIM_5 

Trim value is +/- 5

ADI_RTC_TRIM_6 

Trim value is +/- 6

ADI_RTC_TRIM_7 

Trim value is +/- 7

Definition at line 287 of file adi_rtc.h.

◆ ADI_RTC_CONTROL_REGISTER

RTC control register set.

Enumerator
ADI_RTC_CONTROL_REGISTER_0 

Specify the RTC-Control register-0

ADI_RTC_CONTROL_REGISTER_1 

Specify the RTC-Control register-1

Definition at line 310 of file adi_rtc.h.

Function Documentation

◆ adi_rtc_Open()

ADI_RTC_RESULT adi_rtc_Open ( uint32_t  DeviceNumber,
void *  pDeviceMemory,
uint32_t  MemorySize,
ADI_RTC_HANDLE phDevice 
)

RTC Initialization.

Parameters
[in]DeviceNumberThe RTC device instance number to be opened.
[in]pDeviceMemoryThe pointer to the device memory passed by application.
[in]MemorySizeThe memory size passed by application.
[out]phDeviceThe pointer to a location where the handle to the opened RTC device is written.
Returns
Status

The RTC controller interrupt enable state is unaltered during driver initialization. Use the adi_rtc_EnableInterrupts API to manage interrupting.

Note
The contents of phDevice will be set to NULL upon failure.

On ADI_RTC_SUCCESS the RTC device driver is initialized and made ready for use, though pending interrupts may be latched. During initialization, the content of the various RTC control, count, alarm and status registers are untouched to preserve prior RTC initializations and operation. The core NVIC RTC interrupt is enabled.

SAFE WRITES: The "safe write" mode is enabled by default and can be changed using the macro "ADI_RTC_CFG_ENABLE_SAFE_WRITE" defined in adi_rtc_config.h file.
See also
adi_rtc_Enable().
adi_rtc_EnableInterrupts().
adi_rtc_SetCount().
adi_rtc_Close()

Definition at line 301 of file adi_rtc.c.

◆ adi_rtc_Close()

ADI_RTC_RESULT adi_rtc_Close ( ADI_RTC_HANDLE const  hDevice)

Uninitialize and deallocate an RTC device.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
Returns
Status

Uninitialize and release an allocated RTC device for other use. The core NVIC RTC interrupt is disabled.

See also
adi_rtc_Open().

Definition at line 399 of file adi_rtc.c.

◆ adi_rtc_EnableAlarm()

ADI_RTC_RESULT adi_rtc_EnableAlarm ( ADI_RTC_HANDLE const  hDevice,
bool  bEnable 
)

Enable RTC alarm.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[in]bEnableboolean Flag to enable/disable alarm logic.
  • true : Enable alarm logic.
  • false : Disable alarm logic.
Returns
Status

Enable/disable operation of RTC internal alarm logic.

Alarm events and interrupt notifications are gated by enabling the alarm logic. RTC alarm interrupts require both RTC device and RTC alarm interrupt to be enabled to have been set.

The alarm is relative to some future alarm value match against the RTC counter.

Note
The RTC device driver does not modify the alarm enable on the hardware except through use of this API.
See also
adi_rtc_Open().
adi_rtc_Enable().
adi_rtc_EnableInterrupts().
adi_rtc_GetAlarm().
adi_rtc_GetCount().
adi_rtc_SetAlarm().
adi_rtc_SetCount().

Definition at line 461 of file adi_rtc.c.

◆ adi_rtc_EnableMod60Alarm()

ADI_RTC_RESULT adi_rtc_EnableMod60Alarm ( ADI_RTC_HANDLE const  hDevice,
bool  bEnable 
)

Enable MOD60 RTC alarm.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[in]bEnableboolean Flag for enable/disable mod60 alarm logic.
  • true : Enable mod60 alarm logic.
  • false : Disable mod60 alarm logic.
Returns
Status

Enable/disable operation of RTC internal MOD60 alarm logic.

Alarm events and interrupt notifications are gated by enabling the alarm logic. RTC alarm interrupts require both RTC device and RTC alarm interrupt to be enabled to have been set.

The alarm is relative to some future alarm value match against the RTC counter.

Note
The RTC device driver does not modify the alarm enable on the hardware except through use of this API.
See also
adi_rtc_Open().
adi_rtc_Enable().
adi_rtc_EnableInterrupts().
adi_rtc_GetAlarm().
adi_rtc_GetCount().
adi_rtc_SetAlarm().
adi_rtc_SetCount().

Definition at line 524 of file adi_rtc.c.

◆ adi_rtc_Enable()

ADI_RTC_RESULT adi_rtc_Enable ( ADI_RTC_HANDLE const  hDevice,
bool  bEnable 
)

Enable RTC device.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[in]bEnableboolean Flag for enabling/disabling the RTC device.
  • true : Enable RTC device.
  • false : Disable RTC device.
Returns
Status

Global enable/disable of the RTC controller. Enables counting of elapsed real time and acts as a master enable for the RTC.

Note
When enabled, the RTC input clock pre-scaler and trim interval are realigned.
The RTC device driver does not modify the device enable on the hardware except through use of this API.
See also
adi_rtc_Open().
adi_rtc_EnableAlarm().

Definition at line 586 of file adi_rtc.c.

◆ adi_rtc_EnableInterrupts()

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.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[in]InterruptsConveys which interrupts are affected.
[in]bEnableFlag which controls whether to enable or disable RTC interrupt.
  • true : Enable RTC interrupts.
  • false : Disable RTC interrupts.
Returns
Status

Enable/disable RTC interrupt as well as manage global NVIC enable/disable for the RTC. Input parameter Interrupts is a interrupt ID of type ADI_RTC_INT_TYPE designating the interrupt to be enabled or disabled. The interrupt parameter may be zero, which will then simply manage the NVIC RTC enable and leave the individual RTC interrupt enables unchanged. Input parameter bEnable controls whether to enable or disable the designated set of interrupts.

Note
The RTC device driver does not modify the interrupt enables on the hardware except through use of this API.
See also
adi_rtc_Open().
adi_rtc_Enable().

Definition at line 646 of file adi_rtc.c.

◆ adi_rtc_EnableTrim()

ADI_RTC_RESULT adi_rtc_EnableTrim ( ADI_RTC_HANDLE const  hDevice,
bool  bEnable 
)

Enable RTC automatic clock trimming.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[in]bEnableFlag controlling RTC enabling trim.
  • true Enable RTC trimming.
  • false Disable RTC trimming.
Returns
Status

Enable/disable automatic application of trim values to the main RTC clock. Allows application of periodic real-time RTC clock adjustments to correct for drift. Trim values are pre-calibrated and stored at manufacture. Trim values may be recalibrated by monitoring the RTC clock externally and computing/storing new trim values (see adi_rtc_SetTrim).

Note
The trim interval is reset with device enable, adi_rtc_Enable().
The RTC device driver does not modify the trim enable on the hardware except through use of this API.
See also
adi_rtc_Open().
adi_rtc_Enable().
adi_rtc_GetTrim().
adi_rtc_SetTrim().

Definition at line 745 of file adi_rtc.c.

◆ adi_rtc_EnableAutoReload()

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.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[in]eSSChannelSensor Strobe Channel number.
[in]bEnableFlag to enable auto reload for given Sensor Strobe Channel.
  • true Enable auto reload.
  • false Disable auto reload.
Returns
Status

Definition at line 978 of file adi_rtc.c.

◆ adi_rtc_EnableSensorStrobeOutput()

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.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[in]eSSChannelSpecify which Sensor Strobe channel.
[in]bEnableFlag for enabling output for specified Sensor Strobe channel.
  • true Enable output.
  • false Disable output.
Returns
Status

Definition at line 931 of file adi_rtc.c.

◆ adi_rtc_EnableInputCapture()

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.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[in]eInpChannelSpecify input compare channel.
[in]bEnableFlag for enabling RTC input capture for specified channel.
  • true Enable input capture.
  • false Disable input capture.
Returns
Status

Definition at line 791 of file adi_rtc.c.

◆ adi_rtc_EnableSensorStrobeChannelMask()

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.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[in]eSSChannelSensor Strobe channel for which thermometer-code masking to be enabled or disabled.
[in]bEnableFlag to enable or disable masking for the given Sensor Strobe channel.
  • true Enable masking .
  • false Disable masking.
Returns
Status

Definition at line 1148 of file adi_rtc.c.

◆ adi_rtc_EnableOverwriteSnapshot()

ADI_RTC_RESULT adi_rtc_EnableOverwriteSnapshot ( ADI_RTC_HANDLE const  hDevice,
bool  bEnable 
)

Enable Overwrite of Unread Snapshots for all RTC Input Capture Channels.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[in]bEnableFlag for enabling overwriting the unread snapshot.
  • true Enable overwrite snapshot.
  • false Disable overwrite of snapshot.
Returns
Status

Definition at line 837 of file adi_rtc.c.

◆ adi_rtc_SetMod60AlarmPeriod()

ADI_RTC_RESULT adi_rtc_SetMod60AlarmPeriod ( ADI_RTC_HANDLE const  hDevice,
uint8_t  nPeriod 
)

Set the pre-scale. This is power of 2 division factor for the RTC base clock.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[in]nPeriodPeriodic, modulo-60 alarm time in pre-scaled RTC time units beyond a modulo-60 boundary.
Returns
Status
Note
This API helps the CPU to position a periodic (repeating) alarm interrupt from the RTC at any integer number of pre-scaled RTC time units from a modulo-60 boundary (roll-over event) of the value of count.
See also
adi_rtc_Open().
adi_rtc_GetAlarm().
adi_rtc_EnableAlarm().
adi_rtc_GetWritePendStatus().
adi_rtc_SynchronizeAllWrites().

Definition at line 2488 of file adi_rtc.c.

◆ adi_rtc_SetAlarm()

ADI_RTC_RESULT adi_rtc_SetAlarm ( ADI_RTC_HANDLE const  hDevice,
uint32_t  nAlarm 
)

Set a new RTC alarm value.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[in]nAlarmNew alarm value to set.
Returns
Status

Writes the 32-bit RTC alarm comparator with the value provided by Alarm.

Honours the safe write mode if set. Otherwise, it is the application's responsibility to synchronize any multiple writes to the same register.

See also
adi_rtc_Open().
adi_rtc_GetAlarm().
adi_rtc_EnableAlarm().
adi_rtc_GetWritePendStatus().
adi_rtc_SynchronizeAllWrites().

Definition at line 2199 of file adi_rtc.c.

◆ adi_rtc_SetAlarmRegs()

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.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[in]nAlarm0alarm value to set RTC ALM0 register.
[in]nAlarm1alarm value to set RTC ALM1 register.
[in]nAlarm2alarm value to set RTC ALM2 register.
Returns
Status

Writes the 16-bit RTC alarm value to set RTC Alarm Registers with the value provided as input params.

Honours the safe write mode if set. Otherwise, it is the application's responsibility to synchronize any multiple writes to the same register.

See also
adi_rtc_Open().
adi_rtc_GetAlarm().
adi_rtc_EnableAlarm().
adi_rtc_GetWritePendStatus().
adi_rtc_SynchronizeAllWrites().

Definition at line 2251 of file adi_rtc.c.

◆ adi_rtc_SetAlarmAsync()

ADI_RTC_RESULT adi_rtc_SetAlarmAsync ( ADI_RTC_HANDLE const  hDevice,
uint32_t  nAlarm 
)

Set a new RTC alarm value without waiting for synchronization.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[in]nAlarmNew alarm value to set.
Returns
Status

Writes the 32-bit RTC alarm comparator with the value provided by Alarm.

Honours pending before write if the safe write mode is set. Otherwise, it is the application's responsibility to synchronize any multiple writes to the same register.

This version does not sync after write: it is the application's responsibility to synchronize after alarm registers have been set. (See adi_rtc_SyncAlarm)

See also
adi_rtc_Open().
adi_rtc_GetAlarm().
adi_rtc_EnableAlarm().
adi_rtc_GetWritePendStatus().
adi_rtc_SynchronizeAllWrites().
adi_rtc_SyncAlarm().

Definition at line 2307 of file adi_rtc.c.

◆ adi_rtc_SetAlarmRegsAsync()

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.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[in]nAlarm0alarm value to set RTC ALM0 register.
[in]nAlarm1alarm value to set RTC ALM1 register.
[in]nAlarm2alarm value to set RTC ALM2 register.
Returns
Status

Writes the 16-bit RTC alarm value to set RTC Alarm Registers with the value provided as input params.

Honours pending before write if the safe write mode is set. Otherwise, it is the application's responsibility to synchronize any multiple writes to the same register.

See also
adi_rtc_Open().
adi_rtc_GetAlarm().
adi_rtc_EnableAlarm().
adi_rtc_GetWritePendStatus().
adi_rtc_SynchronizeAllWrites().
adi_rtc_SyncAlarm().

Definition at line 2357 of file adi_rtc.c.

◆ adi_rtc_SyncAlarm()

ADI_RTC_RESULT adi_rtc_SyncAlarm ( ADI_RTC_HANDLE const  hDevice)

Sync after writing RTC alarm registers.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[in]nAlarmNew alarm value to set.
Returns
Status

Writes the 32-bit RTC alarm comparator with the value provided by Alarm.

Sync after write (alarm regsiters only): this function is to be used with adi_rtc_SetAlarmAsync.

See also
adi_rtc_Open().
adi_rtc_GetAlarm().
adi_rtc_SetAlarmAsync().
adi_rtc_EnableAlarm().
adi_rtc_GetWritePendStatus().
adi_rtc_SynchronizeAllWrites().

Definition at line 2406 of file adi_rtc.c.

◆ adi_rtc_SetAlarmEx()

ADI_RTC_RESULT adi_rtc_SetAlarmEx ( ADI_RTC_HANDLE const  hDevice,
float  fAlarm 
)

Set a new RTC alarm value with fractional value.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[in]fAlarmNew alarm value to set.
Returns
Status

Writes the 32-bit RTC alarm comparator with the value provided by Alarm.

Honours the safe write mode if set. Otherwise, it is the application's responsibility to synchronize any multiple writes to the same register.

See also
adi_rtc_Open().
adi_rtc_GetAlarm().
adi_rtc_EnableAlarm().
adi_rtc_GetWritePendStatus().
adi_rtc_SynchronizeAllWrites().

Definition at line 2544 of file adi_rtc.c.

◆ adi_rtc_SetControlRegister()

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.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[in]eRegisterSpecify which register need to be initialized.
[in]ControlNew control register value to set.
Returns
Status

Writes the 16-bit RTC control register with the value provided by Control.

Honours the safe write mode if set. Otherwise, it is the application's responsibility to synchronize any multiple writes to the same register.

See also
adi_rtc_Open().
adi_rtc_GetControlRegister().
adi_rtc_GetWritePendStatus().
adi_rtc_SynchronizeAllWrites().

Definition at line 2605 of file adi_rtc.c.

◆ adi_rtc_SetCount()

ADI_RTC_RESULT adi_rtc_SetCount ( ADI_RTC_HANDLE const  hDevice,
uint32_t  nCount 
)

Set a new RTC count value.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[in]nCountNew count value to set.
Returns
Status

Writes the main 32-bit RTC counter with the value provided by Count.

Honours the safe write mode if set. Otherwise, it is the application's responsibility to synchronize any multiple writes to the same register.

See also
adi_rtc_Open().
adi_rtc_SetCount().
adi_rtc_GetWritePendStatus().
adi_rtc_SynchronizeAllWrites().

Definition at line 2705 of file adi_rtc.c.

◆ adi_rtc_SetGateway()

ADI_RTC_RESULT adi_rtc_SetGateway ( ADI_RTC_HANDLE const  hDevice,
uint16_t  Command 
)

Set an RTC gateway command.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[in]CommandGateway command value.
Returns
Status

Writes the 16-bit RTC gateway register with the command provided by Command.

The gateway register is used to force the RTC to perform some urgent action.

Currently, only the ADI_RTC_GATEWAY_FLUSH command is defined, which will cancel all RTC register write transactions, both pending and executing. It is intended to truncate all core interactions in preparation for an imminent power loss when the RTC power isolation barrier will be activated.

See also
adi_rtc_Open().

Definition at line 2763 of file adi_rtc.c.

◆ adi_rtc_SetPreScale()

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.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[in]nPreScalePrescale value to be set. if "nPreScale" is 5, RTC base clock is divided by 32.
Returns
Status
See also
adi_rtc_Open().
adi_rtc_GetAlarm().
adi_rtc_EnableAlarm().
adi_rtc_GetWritePendStatus().
adi_rtc_SynchronizeAllWrites().

Definition at line 2442 of file adi_rtc.c.

◆ adi_rtc_SetTrim()

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.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[in]eIntervalSpecify the trimming interval and will always in the range of (2^2 to S^17 pre-scaled RTC clock ).
[in]eTrimValueSpecify the trimming value.
[in]eOperationSpecify the operation(Add or subtract) need to be performed for trimming.
Returns
Status

The RTC hardware has the ability to automatically trim the clock to compensate for variations in oscillator tolerance . Automatic trimming is enabled with the adi_rtc_EnableTrim() API.

Note
Alarms are not affected by automatic trim operations.
The trim boundary (interval) alignment is reset when new trim values are written.
See also
adi_rtc_Open().
adi_rtc_EnableTrim().
adi_rtc_GetTrim().

Definition at line 2805 of file adi_rtc.c.

◆ adi_rtc_SetSensorStrobeChannelMask()

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.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[in]eSSChannelSensor Strobe Channel for which the mask to be set.
[in]nMaskChannel Mask to be set for Sensor Strobe channel.
Returns
Status

Definition at line 1193 of file adi_rtc.c.

◆ adi_rtc_SetAutoReloadValue()

ADI_RTC_RESULT adi_rtc_SetAutoReloadValue ( ADI_RTC_HANDLE const  hDevice,
ADI_RTC_SS_CHANNEL  eSSChannel,
uint16_t  nValue 
)

Set auto reload value for the given Sensor Strobe channel.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[in]eSSChannelSensor Strobe channel for which auto reload to be set.
[in]nValueAuto reload value to be set.
Returns
Status

Definition at line 1057 of file adi_rtc.c.

◆ adi_rtc_SetInputCapturePolarity()

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.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[in]eInpChannelSpecify which input capture channel.
[in]bEnableFlag for selecting RTC input capture polarity.
  • false channel uses a high-to-low transition on its GPIO pin to signal an input capture event
  • true channel uses a low-to-high transition on its GPIO pin to signal an input capture event.
Returns
Status

Definition at line 884 of file adi_rtc.c.

◆ adi_rtc_SetSensorStrobeValue()

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.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[in]eSSChannelSensor Strobe Channel.
[out]nValueSensor Strobe value to be set for the given Sensor Strobe channel .
Returns
Status
See also
adi_rtc_Open().
adi_rtc_Enable().
adi_rtc_SetCount().

Definition at line 1834 of file adi_rtc.c.

◆ adi_rtc_GetAlarm()

ADI_RTC_RESULT adi_rtc_GetAlarm ( ADI_RTC_HANDLE  hDevice,
uint32_t *  pAlarm 
)

Get current RTC alarm value.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[out]pAlarmPointer to application memory where the alarm value is written.
Returns
Status

Read the currently programmed 32-bit RTC alarm value and write it to the address provided by parameter pAlarm.

See also
adi_rtc_Open().
adi_rtc_SetAlarm().

Definition at line 1263 of file adi_rtc.c.

◆ adi_rtc_GetAlarmEx()

ADI_RTC_RESULT adi_rtc_GetAlarmEx ( ADI_RTC_HANDLE  hDevice,
float *  pAlarm 
)

Get current RTC alarm value with fractional part also.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[out]pAlarmPointer to application memory where the alarm value is written.
Returns
Status

Read the currently programmed 32-bit RTC alarm value and write it to the address provided by parameter pAlarm.

See also
adi_rtc_Open().
adi_rtc_SetAlarm().

Definition at line 1304 of file adi_rtc.c.

◆ adi_rtc_GetAlarmRegs()

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.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[out]pAlarm0Pointer to application memory where the alarm value is written for RTC ALM0.
[out]pAlarm1Pointer to application memory where the alarm value is written.for RTC ALM1.
[out]pAlarm2Pointer to application memory where the alarm value is written.for RTC ALM2.
Returns
Status

Read the currently programmed RTC alarm Registers value and write it to the address provided by output params.

See also
adi_rtc_Open().
adi_rtc_SetAlarm().

Definition at line 1352 of file adi_rtc.c.

◆ adi_rtc_GetControl()

ADI_RTC_RESULT adi_rtc_GetControl ( ADI_RTC_HANDLE  hDevice,
ADI_RTC_CONTROL_REGISTER  eRegister,
uint32_t *  pControl 
)

Get current RTC control register value.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[in]eRegisterSpecify which register content need to be returned.
[out]pControlPointer to application memory where the control register value is written.
Returns
Status

Read the currently programmed 16-bit RTC control register value and write it to the address provided by parameter pControl.

See also
adi_rtc_Open().
adi_rtcSetControl().

Definition at line 1396 of file adi_rtc.c.

◆ adi_rtc_GetTrim()

ADI_RTC_RESULT adi_rtc_GetTrim ( ADI_RTC_HANDLE  hDevice,
ADI_RTC_TRIM_VALUE peTrim 
)

Get current RTC clock trim value.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[out]peTrimPointer to ADI_RTC_TRIM_VALUE where the trim value is to be written.
Returns
Status

Read the current 16-bit RTC trim value and write it to the address provided by parameter pTrim.

See also
adi_rtc_Open().
adi_rtc_EnableInterrupts().
adi_rtc_EnableTrim().
adi_rtc_GetWritePendStatus().
adi_rtc_GetWriteSyncStatus().
adi_rtc_SetTrim().

Definition at line 1735 of file adi_rtc.c.

◆ adi_rtc_GetCount()

ADI_RTC_RESULT adi_rtc_GetCount ( ADI_RTC_HANDLE const  hDevice,
uint32_t *  pCount 
)

Get current RTC count value.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[out]pCountPointer to application memory where the count value is written.
Returns
Status

Read the current 32-bit RTC count value and write it to the address provided by parameter pCount.

See also
adi_rtc_Open().
adi_rtc_Enable().
adi_rtc_SetCount().

Definition at line 1444 of file adi_rtc.c.

◆ adi_rtc_GetCountEx()

ADI_RTC_RESULT adi_rtc_GetCountEx ( ADI_RTC_HANDLE const  hDevice,
float *  pfCount 
)

Get current RTC count value with fraction.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[out]pfCountPointer to application memory where the count(with fraction) value is written.
Returns
Status

Read the current 32-bit RTC count value and write it to the address provided by parameter pCount.

See also
adi_rtc_Open().
adi_rtc_Enable().
adi_rtc_SetCount().

Definition at line 1480 of file adi_rtc.c.

◆ adi_rtc_GetSnapShot()

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.

Read RTC snapshot registers values. This function does not take snapshots: they must have been taken already.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[in]eChannelSpecify input channel from which captured value to be obtained.
[in]pFractionPointer to application memory where the fractional part of snap shot value to be written.
[out]pValuePointer to application memory where the snap shot value of RTC to be written.
Returns
Status
See also
adi_rtc_Open().
adi_rtc_Enable().
adi_rtc_SetCount().

Definition at line 2025 of file adi_rtc.c.

◆ adi_rtc_GetInputCaptureValueEx()

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.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[in]eChannelSpecify which input capture channel.
[out]pSnap0Pointer to application memory where the following value will be written
  • If eChannel specifies channel 0: SNAP0 register contents
  • If eChannel specifies channels 2, 3 or 4: 0
[out]pSnap1Pointer to application memory where the following value will be written
  • If eChannel specifies channel 0: SNAP1 register contents
  • If eChannel specifies channels 2, 3 or 4: 0
[out]pSnap2Pointer to application memory where the following value will be written
  • If eChannel specifies channel 0: SNAP2 register contents
  • If eChannel specifies channel 2: input capture2 (IC2) register contents
  • If eChannel specifies channel 3: input capture3 (IC3) register contents
  • If eChannel specifies channel 4: input capture4 (IC4) register contents
Returns
Status
Note
For channel 0 the API adi_rtc_GetCount may write to the snapshot registers so it is not guaranteed that their value is the one from the last input capture.
See also
adi_rtc_Open().
adi_rtc_Enable().
adi_rtc_SetCount().

Definition at line 1915 of file adi_rtc.c.

◆ adi_rtc_GetInputCaptureValue()

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.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[in]eChannelSpecify which input capture channel.
[out]pValuePointer to application memory where the input capture value to be written.
Returns
Status
See also
adi_rtc_Open().
adi_rtc_Enable().
adi_rtc_SetCount().

Definition at line 1975 of file adi_rtc.c.

◆ adi_rtc_GetWritePendStatus()

ADI_RTC_RESULT adi_rtc_GetWritePendStatus ( ADI_RTC_HANDLE const  hDevice,
ADI_RTC_WRITE_STATUS pPendBits 
)

Get current RTC posted write pending status.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[out]pPendBitsPointer to application memory where the posted write status is written.
Returns
Status

Pending Writes: Register writes to internal RTC registers take time to complete because the RTC controller clock is running at a much slower (32kHz) rate than the core processor clock. So each RTC write register has a one-deep FIFO to hold write values until the RTC can effect them. This gives rise to the notion of a pending write state: if a write is already pending and another write from the core comes along before the first (pending) write has cleared to its destination register, the second write may be lost because the FIFO is full already.

To avoid data loss, the user may tell the RTC device driver to enforce safe writes with the configuration switch ADI_RTC_CFG_ENABLE_SAFE_WRITE. Enabeling safe writes (on be default) insures write data is never lost by detecting and pausing on pending writes prior writing new data. The penalty in using safe writes is the stall overhead in execution (which is not incurred if there is nothing pending). Additionally, all pending writes may also be synchronized manually with the adi_rtc_SynchronizeAllWrites() API, which will pause until all pending RTC writes have completed.

The distinction between "pend" status (adi_rtc_GetWritePendStatus()) and "sync" (adi_rtc_GetWriteSyncStatus()) status is that the pend state is normally clear and is set only while no room remains in a register's write FIFO, whereas sync state is normally set and is clear only while the effects of the write are not yet apparent.

Each write error source may be configured to interrupt the core by enabling the appropriate write error interrupt mask bit in the RTC control register (see the adi_rtc_EnableInterrupts() API), at which time, the RTC interrupt handler will be dispatched.

See also
adi_rtc_Open().
adi_rtc_EnableInterrupts().
adi_rtc_GetWriteSyncStatus().
adi_rtc_SynchronizeAllWrites().

Definition at line 2090 of file adi_rtc.c.

◆ adi_rtc_GetWriteSyncStatus()

ADI_RTC_RESULT adi_rtc_GetWriteSyncStatus ( ADI_RTC_HANDLE const  hDevice,
ADI_RTC_WRITE_STATUS pSyncBits 
)

Get current RTC posted write synchronization status.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[out]pSyncBitsPointer to application memory where the posted write status is written.
Returns
Status

Pending Writes: Register writes to internal RTC registers take time to complete because the RTC controller clock is running at a much slower (32kHz) rate than the core processor clock. So each RTC write register has a one-deep FIFO to hold write values until the RTC can effect them. This gives rise to the notion of a pending write state: if a write is already pending and another write from the core comes along before the first (pending) write has cleared to its destination register, the second write may be lost because the FIFO is full already.

To avoid data loss, the user may tell the RTC device driver to enforce safe writes with the ADI_RTC_CFG_ENABLE_SAFE_WRITE switch. Enabling safe writes (on be default) insures write data is never lost by detecting and pausing on pending writes prior writing new data. The penalty in using safe writes is the stall overhead in execution (which is not incurred if there is nothing pending). Additionally, all pending writes may also be synchronized manually with the adi_rtc_SynchronizeAllWrites() API, which will pause until all pending RTC writes have completed.

The distinction between "pend" status (adi_rtc_GetWritePendStatus()) and "sync" (adi_rtc_GetWriteSyncStatus()) status is that the pend state is normally clear is set only while no room remains in a register's write FIFO, whereas sync state is normally set and is clear only while the effects of the write are not yet apparent.

Each write error source may be configured to interrupt the core by enabling the appropriate write error interrupt mask bit in the RTC control register (see the adi_rtc_EnableInterrupts() API), at which time, the RTC interrupt handler will be dispatched.

See also
adi_rtc_Open().
adi_rtc_EnableInterrupts().
adi_rtc_GetWritePendStatus().
adi_rtcStallOnPendingWrites().
adi_rtc_SynchronizeAllWrites().

Definition at line 2149 of file adi_rtc.c.

◆ adi_rtc_GetSensorStrobeValue()

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.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[in]eSSChannelSensor Strobe Channel whose value to be read.
[out]pValuePointer to application memory where the Sensor Strobe value to be written.
Returns
Status
See also
adi_rtc_Open().
adi_rtc_Enable().
adi_rtc_SetCount().

Definition at line 1774 of file adi_rtc.c.

◆ adi_rtc_GetCountRegs()

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.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[out]pnCountPointer to application memory where the count's 32 MSB are written.
[out]pfCountPointer to application memory where the count's 16 LSB are written.
Returns
Status

Read the current 32-bit RTC count integer value and fractional value in the integer format.

See also
adi_rtc_Open().
adi_rtc_Enable().
adi_rtc_SetCount().

Definition at line 1524 of file adi_rtc.c.

◆ adi_rtc_GetInterruptStatus()

ADI_RTC_RESULT adi_rtc_GetInterruptStatus ( ADI_RTC_HANDLE const  hDevice,
ADI_RTC_INT_TYPE pStatus 
)

Get current RTC interrupt source status.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[out]pStatusPointer to application memory where the interrupt status is written. The value stored in *pStatus is as follows:

+--------------—+--------------—+--------------—+--------------—+ RTC0 | 0 0 0 x x x x x | x x x x x x 0 x | 0 0 0 0 x x x x | 0 x x x x x x 0 | +--------------—+--------------—+--------------—+--------------—+ | SR3 bits 15-0 | SR2 bits 7-0 | SR0 bits 7-0 |

+--------------—+--------------—+--------------—+--------------—+ RTC1 | 0 0 0 x x x x x | x x x x x x 0 x | 0 0 0 x x x x x | 0 x x x x x x 0 | +--------------—+--------------—+--------------—+--------------—+ | SR3 bits 15-0 | SR2 bits 7-0 | SR0 bits 7-0 |

Returns
Status

Read the current RTC pending interrupt source status register and write it to the address provided by parameter pStatus. Result is of type ADI_RTC_INT_SOURCE_TYPE, which is a bit field.

Note
Interrupt source status is not gated with the interrupt enable bits; source status is set regardless of interrupt enables.
See also
adi_rtc_Open().
adi_rtc_ClearInterruptStatus().

Definition at line 1577 of file adi_rtc.c.

◆ adi_rtc_ClearInterruptStatus()

ADI_RTC_RESULT adi_rtc_ClearInterruptStatus ( ADI_RTC_HANDLE const  hDevice,
ADI_RTC_INT_TYPE  Status 
)

Clear an RTC interrupt status bit(s).

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[in]StatusInterrupt status bits to write. The value expected in Status is as follows:

+--------------—+--------------—+--------------—+--------------—+ RTC0 | 0 0 0 x x x x x | x x x x x x 0 x | 0 0 0 0 x x x x | 0 x x x x x x 0 | +--------------—+--------------—+--------------—+--------------—+ | SR3 bits 15-0 | SR2 bits 7-0 | SR0 bits 7-0 |

+--------------—+--------------—+--------------—+--------------—+ RTC1 | 0 0 0 x x x x x | x x x x x x 0 x | 0 0 0 x x x x x | 0 x x x x x x 0 | +--------------—+--------------—+--------------—+--------------—+ | SR3 bits 15-0 | SR2 bits 7-0 | SR0 bits 7-0 |

Returns
Status

Clear (write-one-to-clear) the RTC interrupt status field with the value provided by Status. Bits that are set in the Status value will clear their corresponding interrupt status. Bits that are clear in the Status value will have no effect. Use the ADI_RTC_INT_TYPE enumeration to encode interrupts to clear.

Honors the safe write mode if set. Otherwise, it is the application's responsibility to synchronize any multiple writes to the same register.

See also
adi_rtc_Open().
adi_rtcGet_InterruptStatus().

Definition at line 1643 of file adi_rtc.c.

◆ adi_rtc_SynchronizeAllWrites()

ADI_RTC_RESULT adi_rtc_SynchronizeAllWrites ( ADI_RTC_HANDLE const  hDevice)

Force synchronization of all pending writes.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
Returns
Status

Blocking call to coerce all outstanding posted RTC register writes to fully flush and synchronize.

See also
adi_rtc_Open().
adi_rtc_GetWritePendStatus().
adi_rtc_GetWriteSyncStatus().

Definition at line 2853 of file adi_rtc.c.

◆ adi_rtc_RegisterCallback()

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 called when an event is detected.

Parameters
[in]hDeviceDevice handle obtained from adi_rtc_Open().
[in]pfCallbackFunction pointer to Callback function. Passing a NULL pointer will unregister the call back function.
[in]pCBparamCall back function parameter.
Returns
Status
See also
adi_rtc_Open().

Definition at line 2653 of file adi_rtc.c.