ADuCM4x50 Device Drivers API Reference Manual
Release 4.0.0.0
|
Real Time Clock (RTC) Driver. More...
Modules | |
Static Configuration | |
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, ADI_RTC_SS_CHANNEL_2 = 1 << BITP_RTC_CR3SS_SS2EN, ADI_RTC_SS_CHANNEL_3 = 1 << BITP_RTC_CR3SS_SS3EN, ADI_RTC_SS_CHANNEL_4 = 1 << BITP_RTC_CR3SS_SS4EN } |
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 modulo-60 alarm value. This positions a periodic (repeating) alarm interrupt from the RTC at any integer number of prescaled RTC time units from a modulo-60 boundary. 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 nLowValue, uint16_t nHighValue) |
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_GetISOENB (ADI_RTC_HANDLE const hDevice, uint16_t *pValue) |
Get the value of the ISOENB bit. 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... | |
Real Time Clock (RTC) Driver.
The RTC driver manages all instances of the RTC peripheral.
#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 (0x1FFDu) |
#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_RTCSS4_FE_INT 0x00100000u |
#define ADI_RTC_RTCSS3_FE_INT 0x00200000u |
#define ADI_RTC_RTCSS2_FE_INT 0x00400000u |
#define ADI_RTC_RTCSS1_FE_INT 0x00800000u |
#define ADI_RTC_RTCSS4MSKEN 0x01000000u |
#define ADI_RTC_RTCSS3MSKEN 0x02000000u |
#define ADI_RTC_RTCSS2MSKEN 0x04000000u |
#define ADI_RTC_CR5OCS_SS3SMPMTCHIRQEN 0x10000000u |
#define ADI_RTC_CR5OCS_SS2SMPMTCHIRQEN 0x20000000u |
#define ADI_RTC_CR5OCS_SS1SMPMTCHIRQEN 0x40000000u |
#define ADI_RTC_SENSOR_STROBE_CH2_INT 0x00001000u |
#define ADI_RTC_SENSOR_STROBE_CH3_INT 0x00002000u |
#define ADI_RTC_SENSOR_STROBE_CH4_INT 0x00004000u |
#define ADI_RTC_NUM_INTERRUPTS 31 |
typedef void* ADI_RTC_HANDLE |
typedef uint32_t ADI_RTC_INT_TYPE |
enum ADI_RTC_RESULT |
RTC API return codes
enum ADI_RTC_WRITE_STATUS |
RTC Posted Write Status Bits.
RTC Trim intervals.
enum ADI_RTC_SS_CHANNEL |
enum ADI_RTC_TRIM_VALUE |
RTC Trim values.
ADI_RTC_RESULT adi_rtc_Open | ( | uint32_t | DeviceNumber, |
void * | pDeviceMemory, | ||
uint32_t | MemorySize, | ||
ADI_RTC_HANDLE * | phDevice | ||
) |
RTC Initialization.
[in] | DeviceNumber | The RTC device instance number to be opened. |
[in] | pDeviceMemory | The pointer to the device memory passed by application. |
[in] | MemorySize | The memory size passed by application. |
[out] | phDevice | The pointer to a location where the handle to the opened RTC device is written. |
The RTC controller interrupt enable state is unaltered during driver initialization. Use the adi_rtc_EnableInterrupts API to manage interrupting.
ADI_RTC_RESULT adi_rtc_Close | ( | ADI_RTC_HANDLE const | hDevice | ) |
Uninitialize and deallocate an RTC device.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
Uninitialize and release an allocated RTC device for other use. The core NVIC RTC interrupt is disabled.
ADI_RTC_RESULT adi_rtc_EnableAlarm | ( | ADI_RTC_HANDLE const | hDevice, |
bool | bEnable | ||
) |
Enable RTC alarm.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[in] | bEnable | boolean Flag to enable/disable alarm logic.
|
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.
ADI_RTC_RESULT adi_rtc_EnableMod60Alarm | ( | ADI_RTC_HANDLE const | hDevice, |
bool | bEnable | ||
) |
Enable MOD60 RTC alarm.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[in] | bEnable | boolean Flag for enable/disable mod60 alarm logic.
|
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.
ADI_RTC_RESULT adi_rtc_Enable | ( | ADI_RTC_HANDLE const | hDevice, |
bool | bEnable | ||
) |
Enable RTC device.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[in] | bEnable | boolean Flag for enabling/disabling the RTC device.
|
Global enable/disable of the RTC controller. Enables counting of elapsed real time and acts as a master enable for the RTC.
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.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[in] | Interrupts | Conveys which interrupts are affected. |
[in] | bEnable | Flag which controls whether to enable or disable RTC interrupt.
|
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.
ADI_RTC_RESULT adi_rtc_EnableTrim | ( | ADI_RTC_HANDLE const | hDevice, |
bool | bEnable | ||
) |
Enable RTC automatic clock trimming.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[in] | bEnable | Flag controlling RTC enabling trim.
|
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).
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.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[in] | eSSChannel | Sensor Strobe Channel number. |
[in] | bEnable | Flag to enable auto reload for given Sensor Strobe Channel.
|
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.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[in] | eSSChannel | Specify which Sensor Strobe channel. |
[in] | bEnable | Flag for enabling output for specified Sensor Strobe channel.
|
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.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[in] | eInpChannel | Specify input compare channel. |
[in] | bEnable | Flag for enabling RTC input capture for specified channel.
|
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.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[in] | eSSChannel | Sensor Strobe channel for which thermometer-code masking to be enabled or disabled. |
[in] | bEnable | Flag to enable or disable masking for the given Sensor Strobe channel.
|
ADI_RTC_RESULT adi_rtc_EnableOverwriteSnapshot | ( | ADI_RTC_HANDLE const | hDevice, |
bool | bEnable | ||
) |
Enable Overwrite of Unread Snapshots for all RTC Input Capture Channels.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[in] | bEnable | Flag for enabling overwriting the unread snapshot.
|
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 any integer number of prescaled RTC time units from a modulo-60 boundary.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[in] | nPeriod | Periodic, modulo-60 alarm time in pre-scaled RTC time units beyond a modulo-60 boundary. |
ADI_RTC_RESULT adi_rtc_SetAlarm | ( | ADI_RTC_HANDLE const | hDevice, |
uint32_t | nAlarm | ||
) |
Set a new RTC alarm value.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[in] | nAlarm | New alarm value to set. |
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.
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.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[in] | nAlarm0 | alarm value to set RTC ALM0 register. |
[in] | nAlarm1 | alarm value to set RTC ALM1 register. |
[in] | nAlarm2 | alarm value to set RTC ALM2 register. |
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.
ADI_RTC_RESULT adi_rtc_SetAlarmAsync | ( | ADI_RTC_HANDLE const | hDevice, |
uint32_t | nAlarm | ||
) |
Set a new RTC alarm value without waiting for synchronization.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[in] | nAlarm | New alarm value to set. |
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)
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.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[in] | nAlarm0 | alarm value to set RTC ALM0 register. |
[in] | nAlarm1 | alarm value to set RTC ALM1 register. |
[in] | nAlarm2 | alarm value to set RTC ALM2 register. |
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.
ADI_RTC_RESULT adi_rtc_SyncAlarm | ( | ADI_RTC_HANDLE const | hDevice | ) |
Sync after writing RTC alarm registers.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
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.
ADI_RTC_RESULT adi_rtc_SetAlarmEx | ( | ADI_RTC_HANDLE const | hDevice, |
float | fAlarm | ||
) |
Set a new RTC alarm value with fractional value.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[in] | fAlarm | New alarm value to set. |
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.
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.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[in] | eRegister | Specify which register need to be initialized. |
[in] | Control | New control register value to set. |
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.
ADI_RTC_RESULT adi_rtc_SetCount | ( | ADI_RTC_HANDLE const | hDevice, |
uint32_t | nCount | ||
) |
Set a new RTC count value.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[in] | nCount | New count value to set. |
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.
ADI_RTC_RESULT adi_rtc_SetGateway | ( | ADI_RTC_HANDLE const | hDevice, |
uint16_t | Command | ||
) |
Set an RTC gateway command.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[in] | Command | Gateway command value. |
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.
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.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[in] | nPreScale | Prescale value to be set. if "nPreScale" is 5, RTC base clock is divided by 32. |
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.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[in] | eInterval | Specify the trimming interval and will always in the range of (2^2 to S^17 pre-scaled RTC clock ). |
[in] | eTrimValue | Specify the trimming value. |
[in] | eOperation | Specify the operation(Add or subtract) need to be performed for trimming. |
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.
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.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[in] | eSSChannel | Sensor Strobe Channel for which the mask to be set. |
[in] | nMask | Channel Mask to be set for Sensor Strobe channel. |
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.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[in] | eSSChannel | Sensor Strobe channel for which auto reload to be set. |
[in] | nLowValue | Low duration Auto reload value to be set. |
[in] | nHighValue | High duration Auto reload value to be set. |
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.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[in] | eInpChannel | Specify which input capture channel. |
[in] | bEnable | Flag for selecting RTC input capture polarity.
|
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.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[in] | eSSChannel | Sensor Strobe Channel. |
[out] | nValue | Sensor Strobe value to be set for the given Sensor Strobe channel . |
ADI_RTC_RESULT adi_rtc_GetAlarm | ( | ADI_RTC_HANDLE | hDevice, |
uint32_t * | pAlarm | ||
) |
Get current RTC alarm value.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[out] | pAlarm | Pointer to application memory where the alarm value is written. |
Read the currently programmed 32-bit RTC alarm value and write it to the address provided by parameter pAlarm.
ADI_RTC_RESULT adi_rtc_GetAlarmEx | ( | ADI_RTC_HANDLE | hDevice, |
float * | pAlarm | ||
) |
Get current RTC alarm value with fractional part also.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[out] | pAlarm | Pointer to application memory where the alarm value is written. |
Read the currently programmed 32-bit RTC alarm value and write it to the address provided by parameter pAlarm.
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.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[out] | pAlarm0 | Pointer to application memory where the alarm value is written for RTC ALM0. |
[out] | pAlarm1 | Pointer to application memory where the alarm value is written.for RTC ALM1. |
[out] | pAlarm2 | Pointer to application memory where the alarm value is written.for RTC ALM2. |
Read the currently programmed RTC alarm Registers value and write it to the address provided by output params.
ADI_RTC_RESULT adi_rtc_GetControl | ( | ADI_RTC_HANDLE | hDevice, |
ADI_RTC_CONTROL_REGISTER | eRegister, | ||
uint32_t * | pControl | ||
) |
Get current RTC control register value.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[in] | eRegister | Specify which register content need to be returned. |
[out] | pControl | Pointer to application memory where the control register value is written. |
Read the currently programmed 16-bit RTC control register value and write it to the address provided by parameter pControl.
ADI_RTC_RESULT adi_rtc_GetTrim | ( | ADI_RTC_HANDLE | hDevice, |
ADI_RTC_TRIM_VALUE * | peTrim | ||
) |
Get current RTC clock trim value.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[out] | peTrim | Pointer to ADI_RTC_TRIM_VALUE where the trim value is to be written. |
Read the current 16-bit RTC trim value and write it to the address provided by parameter pTrim.
ADI_RTC_RESULT adi_rtc_GetCount | ( | ADI_RTC_HANDLE const | hDevice, |
uint32_t * | pCount | ||
) |
Get current RTC count value.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[out] | pCount | Pointer to application memory where the count value is written. |
Read the current 32-bit RTC count value and write it to the address provided by parameter pCount.
ADI_RTC_RESULT adi_rtc_GetCountEx | ( | ADI_RTC_HANDLE const | hDevice, |
float * | pfCount | ||
) |
Get current RTC count value with fraction.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[out] | pfCount | Pointer to application memory where the count(with fraction) value is written. |
Read the current 32-bit RTC count value and write it to the address provided by parameter pCount.
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.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[in] | eChannel | Specify input channel from which captured value to be obtained. |
[in] | pFraction | Pointer to application memory where the fractional part of snap shot value to be written. |
[out] | pValue | Pointer to application memory where the snap shot value of RTC to be written. |
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.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[in] | eChannel | Specify which input capture channel. |
[out] | pSnap0 | Pointer to application memory where the following value will be written
|
[out] | pSnap1 | Pointer to application memory where the following value will be written
|
[out] | pSnap2 | Pointer to application memory where the following value will be written
|
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.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[in] | eChannel | Specify which input capture channel. |
[out] | pValue | Pointer to application memory where the input capture value to be written. |
ADI_RTC_RESULT adi_rtc_GetWritePendStatus | ( | ADI_RTC_HANDLE const | hDevice, |
ADI_RTC_WRITE_STATUS * | pPendBits | ||
) |
Get current RTC posted write pending status.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[out] | pPendBits | Pointer to application memory where the posted write status is written. |
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.
ADI_RTC_RESULT adi_rtc_GetWriteSyncStatus | ( | ADI_RTC_HANDLE const | hDevice, |
ADI_RTC_WRITE_STATUS * | pSyncBits | ||
) |
Get current RTC posted write synchronization status.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[out] | pSyncBits | Pointer to application memory where the posted write status is written. |
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.
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.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[in] | eSSChannel | Sensor Strobe Channel whose value to be read. |
[out] | pValue | Pointer to application memory where the Sensor Strobe value to be written. |
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.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[out] | pnCount | Pointer to application memory where the count's 32 MSB are written. |
[out] | pfCount | Pointer to application memory where the count's 16 LSB are written. |
Read the current 32-bit RTC count integer value and fractional value in the integer format.
ADI_RTC_RESULT adi_rtc_GetISOENB | ( | ADI_RTC_HANDLE const | hDevice, |
uint16_t * | pValue | ||
) |
Get the value of the ISOENB bit.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[out] | pValue | Pointer to the application memory where the value of the ISOENB bit is to be written. |
ADI_RTC_RESULT adi_rtc_GetInterruptStatus | ( | ADI_RTC_HANDLE const | hDevice, |
ADI_RTC_INT_TYPE * | pStatus | ||
) |
Get current RTC interrupt source status.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[out] | pStatus | Pointer 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 |
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.
ADI_RTC_RESULT adi_rtc_ClearInterruptStatus | ( | ADI_RTC_HANDLE const | hDevice, |
ADI_RTC_INT_TYPE | Status | ||
) |
Clear an RTC interrupt status bit(s).
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[in] | Status | Interrupt 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 |
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.
ADI_RTC_RESULT adi_rtc_SynchronizeAllWrites | ( | ADI_RTC_HANDLE const | hDevice | ) |
Force synchronization of all pending writes.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
Blocking call to coerce all outstanding posted RTC register writes to fully flush and synchronize.
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.
[in] | hDevice | Device handle obtained from adi_rtc_Open(). |
[in] | pfCallback | Function pointer to Callback function. Passing a NULL pointer will unregister the call back function. |
[in] | pCBparam | Call back function parameter. |