PDK API Guide for J721E
PMIC RTC Driver API

Introduction

This Module explains PMIC RTC APIs and their usage. This Module has APIs to cover all PMIC RTC features. like, set/get RTC time, Alarm time, RTC frequncy compensation, timer interrupt period and enable or disable RTC and RTC/Alarm interrupts.

Supported PMIC Devices for RTC Module:

  1. TPS6594x (Leo PMIC Device)

Files

file  pmic_rtc.h
 PMIC Driver RTC API/interface file.
 

Data Structures

struct  Pmic_RtcTime_t
 RTC time configuration. The Pmic_RtcTime_s structure contains set of time parameters to set/get the RTC time. More...
 
struct  Pmic_RtcDate_t
 RTC Date configuration. The Pmic_RtcDate_s structure contains set of date parameters to set/get the RTC Date. More...
 
struct  Pmic_RtcRstStatus_t
 RTC Reset Status The Pmic_RtcRstStatus_s structure contains status of RTC Reset and power-up status. Note: validParams is input param for all Get APIs. other params except validParams is output param for Get APIs. More...
 
struct  Pmic_RtcCfg_t
 RTC configuration The Pmic_RtcRstStatus_s structure contains status of RTC Reset and power-up status. Note: validParams is input param for all Set and Get APIs. other params except validParams is input param for Set APIs and output param for Get APIs. More...
 

Functions

int32_t Pmic_rtcSetAlarmInfo (Pmic_CoreHandle_t *pPmicCoreHandle, const Pmic_RtcTime_t timeCfg, const Pmic_RtcDate_t dateCfg)
 API to Set the alarm Time and Date to PMIC RTC. More...
 
int32_t Pmic_rtcGetAlarmInfo (Pmic_CoreHandle_t *pPmicCoreHandle, Pmic_RtcTime_t *pTimeCfg, Pmic_RtcDate_t *pDateCfg)
 API to Get the alarm Time and Date from PMIC RTC function. More...
 
int32_t Pmic_rtcSetTimerPeriod (Pmic_CoreHandle_t *pPmicCoreHandle, const uint8_t timerPeriod)
 API to Set the timer interrupt Period to PMIC RTC. More...
 
int32_t Pmic_rtcGetTimerPeriod (Pmic_CoreHandle_t *pPmicCoreHandle, uint8_t *pTimerPeriod)
 API to Get the timer interrupt period from PMIC RTC. More...
 
int32_t Pmic_rtcSetTimeDateInfo (Pmic_CoreHandle_t *pPmicCoreHandle, const Pmic_RtcTime_t timeCfg, const Pmic_RtcDate_t dateCfg)
 API to Set the RTC Time and Date to PMIC RTC. More...
 
int32_t Pmic_rtcGetTimeDateInfo (Pmic_CoreHandle_t *pPmicCoreHandle, Pmic_RtcTime_t *pTimeCfg, Pmic_RtcDate_t *pDateCfg)
 API to Get the RTC Time and Date from PMIC RTC function. More...
 
int32_t Pmic_rtcSetFreqComp (Pmic_CoreHandle_t *pPmicCoreHandle, const uint16_t compensation)
 API to Set the RTC frequency compensation value. More...
 
int32_t Pmic_rtcGetFreqComp (Pmic_CoreHandle_t *pPmicCoreHandle, uint16_t *pCompensation)
 API to Get the RTC frequency compensation value. More...
 
int32_t Pmic_rtcEnable (Pmic_CoreHandle_t *pPmicCoreHandle, const bool enableRtc)
 API to Enable/Disable the RTC. More...
 
int32_t Pmic_rtcGetStatus (Pmic_CoreHandle_t *pPmicCoreHandle, bool *pRtcstatus)
 API to read RTC status which defines RTC is started or not. More...
 
int32_t Pmic_rtcEnableTimerIntr (Pmic_CoreHandle_t *pPmicCoreHandle, const bool enableIntr)
 API to Enable/Disable the RTC Timer Interrupt. More...
 
int32_t Pmic_rtcEnableAlarmIntr (Pmic_CoreHandle_t *pPmicCoreHandle, const bool enableIntr)
 API to Enable/Disable the RTC Alarm Interrupt. More...
 
int32_t Pmic_rtcGetRstStatus (Pmic_CoreHandle_t *pPmicCoreHandle, Pmic_RtcRstStatus_t *pRtcRstStatus)
 API to Get the Reset status of RTC. More...
 
int32_t Pmic_rtcClrRstStatus (Pmic_CoreHandle_t *pPmicCoreHandle, const uint8_t rtcRstStatType)
 API to clear the Reset status of RTC. More...
 
int32_t Pmic_rtcSetConfiguration (Pmic_CoreHandle_t *pPmicCoreHandle, const Pmic_RtcCfg_t rtcCfg)
 API to Set PMIC RTC Configuration. More...
 
int32_t Pmic_rtcGetConfiguration (Pmic_CoreHandle_t *pPmicCoreHandle, Pmic_RtcCfg_t *pRtcCfg)
 API to Get PMIC RTC Configuration. More...
 

PMIC RTC timer interrupt Period Values.

#define PMIC_RTC_SECOND_INTR_PERIOD   (0x0U)
 
#define PMIC_RTC_MINUTE_INTR_PERIOD   (0x1U)
 
#define PMIC_RTC_HOUR_INTR_PERIOD   (0x2U)
 
#define PMIC_RTC_DAY_INTR_PERIOD   (0x3U)
 

PMIC RTC alarm interrupt Enable/Disable

#define PMIC_RTC_ALARM_INTR_ENABLE   1U
 
#define PMIC_RTC_ALARM_INTR_DISABLE   0U
 

PMIC RTC timer interrupt Enable/Disable

#define PMIC_RTC_TIMER_INTR_ENABLE   1U
 
#define PMIC_RTC_TIMER_INTR_DISABLE   0U
 

PMIC RTC Time Mode

#define PMIC_RTC_24_HOUR_MODE   (0x0U)
 
#define PMIC_RTC_12_HOUR_MODE   (0x1U)
 

PMIC RTC Meridien Mode

#define PMIC_RTC_AM_MODE   (0x0U)
 
#define PMIC_RTC_PM_MODE   (0x1U)
 

PMIC RTC State to START/STOP RTC

#define PMIC_RTC_STOP   0U
 
#define PMIC_RTC_START   1U
 

PMIC RTC Current Status

#define PMIC_RTC_STATUS_FROZEN   0U
 
#define PMIC_RTC_STATUS_RUNNING   1U
 

PMIC RTC Reset Status

#define PMIC_RTC_RST_STATUS_RESET_VAL   (0x0U)
 RESET_STATUS_RTC reset value when RTC domain is powered down. More...
 
#define PMIC_RTC_RST_STATUS_SET_VAL   (0x1U)
 Used to set RESET_STATUS_RTC register bit field. More...
 

PMIC RTC power-up Status

#define PMIC_RTC_POWERUP_STATUS_CLR_VAL   (0x0U)
 Used to clear POWERUP_STATUS register bit field. More...
 
#define PMIC_RTC_POWERUP_STATUS_RESET_VAL   (0x1U)
 POWERUP_STATUS reset value when RTC domain is powered down. More...
 

PMIC RTC Week Days

#define PMIC_RTC_WEEKDAY_SUNDAY   (1U)
 
#define PMIC_RTC_WEEKDAY_MONDAY   (2U)
 
#define PMIC_RTC_WEEKDAY_TUESDAY   (3U)
 
#define PMIC_RTC_WEEKDAY_WEDNESDAY   (4U)
 
#define PMIC_RTC_WEEKDAY_THURSDAY   (5U)
 
#define PMIC_RTC_WEEKDAY_FRIDAY   (6U)
 
#define PMIC_RTC_WEEKDAY_SATURDAY   (7U)
 

PMIC RTC Months

List of calendar months.

#define PMIC_RTC_MONTH_JAN   (1U)
 
#define PMIC_RTC_MONTH_FEB   (2U)
 
#define PMIC_RTC_MONTH_MAR   (3U)
 
#define PMIC_RTC_MONTH_APR   (4U)
 
#define PMIC_RTC_MONTH_MAY   (5U)
 
#define PMIC_RTC_MONTH_JUN   (6U)
 
#define PMIC_RTC_MONTH_JUL   (7U)
 
#define PMIC_RTC_MONTH_AUG   (8U)
 
#define PMIC_RTC_MONTH_SEP   (9U)
 
#define PMIC_RTC_MONTH_OCT   (10U)
 
#define PMIC_RTC_MONTH_NOV   (11U)
 
#define PMIC_RTC_MONTH_DEC   (12U)
 

PMIC RTC 32k Counter Configuration

#define PMIC_RTC_32K_COUNTER_COMP_VAL_SET   (0x1U)
 Set 32K counter with RTC compensation values. More...
 

Selects PMIC RTC Crystal Oscillator Configuration

#define PMIC_RTC_CRYSTAL_OSC_DISABLE   0U
 
#define PMIC_RTC_CRYSTAL_OSC_ENABLE   1U
 

PMIC RTC round the time to closest minute

#define PMIC_RTC_ROUND_TIME_SET   (0x1U)
 Round the time to closest minute. More...
 

PMIC RTC Time Date Register Selection

#define PMIC_RTC_DYNAMIC_REG_SEL   (0x0U)
 RTC register read from Dynamic registers. More...
 
#define PMIC_RTC_STATIC_SHADOWED_REG_SEL   (0x1U)
 RTC register read from Static Shadowed registers. More...
 

Selects PMIC RTC Crystal Oscillator Type

#define PMIC_RTC_CRYSTAL_OSC_TYPE_6PF   (0x0U)
 Selects Crystal Oscillator type as 6PF. More...
 
#define PMIC_RTC_CRYSTAL_OSC_TYPE_9PF   (0x1U)
 Selects Crystal Oscillator type as 9PF. More...
 
#define PMIC_RTC_CRYSTAL_OSC_TYPE_12_5PF   (0x2U)
 Selects Crystal Oscillator type as 12.5PF. More...
 

Selects PMIC RTC Reset Status Type

#define PMIC_RTC_RST_STATUS   (0x0U)
 Selects RTC Reset Status. More...
 
#define PMIC_RTC_POWERUP_STATUS   (0x1U)
 Selects RTC Powerup Status. More...
 

PMIC RTC Time strcture Param Bit Positions

#define PMIC_RTC_TIME_CFG_SEC_VALID   (0U)
 validParams value used to set/get Value to represent the Seconds More...
 
#define PMIC_RTC_TIME_CFG_MIN_VALID   (1U)
 validParams value used to set/get Value to represent the Minutes More...
 
#define PMIC_RTC_TIME_CFG_HRS_VALID   (2U)
 validParams value used to set/get Value to represent the Hours More...
 
#define PMIC_RTC_TIME_CFG_TIMEMODE_VALID   (3U)
 validParams value used to set/get Time Mode More...
 
#define PMIC_RTC_TIME_CFG_MERIDIAN_VALID   (4U)
 validParams value used to set/get Maridian Mode More...
 

PMIC RTC Time Structure Param Bit shift values

Application can use below shifted values to set the validParam member defined in Pmic_RtcTime_t structure

#define PMIC_RTC_TIME_CFG_SEC_VALID_SHIFT   (1U << PMIC_RTC_TIME_CFG_SEC_VALID)
 
#define PMIC_RTC_TIME_CFG_MIN_VALID_SHIFT   (1U << PMIC_RTC_TIME_CFG_MIN_VALID)
 
#define PMIC_RTC_TIME_CFG_HRS_VALID_SHIFT   (1U << PMIC_RTC_TIME_CFG_HRS_VALID)
 
#define PMIC_RTC_TIME_CFG_TIMEMODE_VALID_SHIFT   (1U << PMIC_RTC_TIME_CFG_TIMEMODE_VALID)
 
#define PMIC_RTC_TIME_CFG_MERIDIAN_VALID_SHIFT   (1U << PMIC_RTC_TIME_CFG_MERIDIAN_VALID)
 

PMIC RTC Date strcture Param Bit Positions

#define PMIC_RTC_DATE_CFG_DAY_VALID   (0U)
 validParams value used to set/get Value to represent the day More...
 
#define PMIC_RTC_DATE_CFG_MONTH_VALID   (1U)
 validParams value used to set/get Value to represent the Month More...
 
#define PMIC_RTC_DATE_CFG_YEAR_VALID   (2U)
 validParams value used to set/get Value to represent the Year More...
 
#define PMIC_RTC_DATE_CFG_WEEKDAY_VALID   (3U)
 validParams value used to set/get Value to represent the weekday of the week More...
 

PMIC RTC Date Structure Param Bit shift values

Application can use below shifted values to set the validParam member defined in Pmic_RtcDate_t structure

#define PMIC_RTC_DATE_CFG_DAY_VALID_SHIFT   (1U << PMIC_RTC_DATE_CFG_DAY_VALID)
 
#define PMIC_RTC_DATE_CFG_MONTH_VALID_SHIFT   (1U << PMIC_RTC_DATE_CFG_MONTH_VALID)
 
#define PMIC_RTC_DATE_CFG_YEAR_VALID_SHIFT   (1U << PMIC_RTC_DATE_CFG_YEAR_VALID)
 
#define PMIC_RTC_DATE_CFG_WEEKDAY_VALID_SHIFT   (1U << PMIC_RTC_DATE_CFG_WEEKDAY_VALID)
 

PMIC RTC Status strcture Param Bit Positions

#define PMIC_RTC_RESET_STATUS_VALID   (0U)
 validParams value used to get reset status of RTC More...
 
#define PMIC_RTC_POWERUP_STATUS_VALID   (1U)
 validParams value used to get power-up status of RTC More...
 

PMIC RTC Status Structure Param Bit shift values

Application can use below shifted values to set the validParam member defined in Pmic_RtcRstStatus_t structure

#define PMIC_RTC_RESET_STATUS_VALID_SHIFT   (1U << PMIC_RTC_RESET_STATUS_VALID)
 
#define PMIC_RTC_POWERUP_STATUS_VALID_SHIFT   (1U << PMIC_RTC_POWERUP_STATUS_VALID)
 

PMIC RTC configuration strcture Param Bit Positions

#define PMIC_RTC_CFG_32K_COUNTER_COMP_VAL_SET_VALID   (0U)
 validParams value used to set/get configuration of 32K counter with compensation values More...
 
#define PMIC_RTC_CFG_RTC_TIME_ROUND_30S_SET_VALID   (1U)
 validParams value used to set/get configuration of RTC time config to Round the time to closest minute More...
 
#define PMIC_RTC_CFG_CRYSTAL_OSC_EN_VALID   (2U)
 validParams value used to set/get to Enable/Disable Crystal Oscillator More...
 
#define PMIC_RTC_CFG_TIME_DATE_REG_SEL_VALID   (3U)
 validParams value used to set/get to Select RTC Time and Date Register read from Dynamic or Static Shadowed Registers More...
 
#define PMIC_RTC_CFG_CRYSTAL_OSC_TYPE_VALID   (4U)
 validParams value used to set/get to Select Crystal Oscillator Type More...
 

PMIC RTC Configuration Structure Param Bit shift values

Application can use below shifted values to set the validParam member defined in Pmic_RtcCfg_t structure

#define PMIC_RTC_CFG_32K_COUNTER_COMP_VAL_SET_VALID_SHIFT   (1U << PMIC_RTC_CFG_32K_COUNTER_COMP_VAL_SET_VALID)
 
#define PMIC_RTC_CFG_RTC_TIME_ROUND_30S_SET_VALID_SHIFT   (1U << PMIC_RTC_CFG_RTC_TIME_ROUND_30S_SET_VALID)
 
#define PMIC_RTC_CFG_CRYSTAL_OSC_EN_VALID_SHIFT   (1U << PMIC_RTC_CFG_CRYSTAL_OSC_EN_VALID)
 
#define PMIC_RTC_CFG_TIME_DATE_REG_SEL_VALID_SHIFT   (1U << PMIC_RTC_CFG_TIME_DATE_REG_SEL_VALID)
 
#define PMIC_RTC_CFG_CRYSTAL_OSC_TYPE_VALID_SHIFT   (1U << PMIC_RTC_CFG_CRYSTAL_OSC_TYPE_VALID)
 

Macro Definition Documentation

◆ PMIC_RTC_SECOND_INTR_PERIOD

#define PMIC_RTC_SECOND_INTR_PERIOD   (0x0U)

◆ PMIC_RTC_MINUTE_INTR_PERIOD

#define PMIC_RTC_MINUTE_INTR_PERIOD   (0x1U)

◆ PMIC_RTC_HOUR_INTR_PERIOD

#define PMIC_RTC_HOUR_INTR_PERIOD   (0x2U)

◆ PMIC_RTC_DAY_INTR_PERIOD

#define PMIC_RTC_DAY_INTR_PERIOD   (0x3U)

◆ PMIC_RTC_ALARM_INTR_ENABLE

#define PMIC_RTC_ALARM_INTR_ENABLE   1U

◆ PMIC_RTC_ALARM_INTR_DISABLE

#define PMIC_RTC_ALARM_INTR_DISABLE   0U

◆ PMIC_RTC_TIMER_INTR_ENABLE

#define PMIC_RTC_TIMER_INTR_ENABLE   1U

◆ PMIC_RTC_TIMER_INTR_DISABLE

#define PMIC_RTC_TIMER_INTR_DISABLE   0U

◆ PMIC_RTC_24_HOUR_MODE

#define PMIC_RTC_24_HOUR_MODE   (0x0U)

◆ PMIC_RTC_12_HOUR_MODE

#define PMIC_RTC_12_HOUR_MODE   (0x1U)

◆ PMIC_RTC_AM_MODE

#define PMIC_RTC_AM_MODE   (0x0U)

◆ PMIC_RTC_PM_MODE

#define PMIC_RTC_PM_MODE   (0x1U)

◆ PMIC_RTC_STOP

#define PMIC_RTC_STOP   0U

◆ PMIC_RTC_START

#define PMIC_RTC_START   1U

◆ PMIC_RTC_STATUS_FROZEN

#define PMIC_RTC_STATUS_FROZEN   0U

◆ PMIC_RTC_STATUS_RUNNING

#define PMIC_RTC_STATUS_RUNNING   1U

◆ PMIC_RTC_RST_STATUS_RESET_VAL

#define PMIC_RTC_RST_STATUS_RESET_VAL   (0x0U)

RESET_STATUS_RTC reset value when RTC domain is powered down.

◆ PMIC_RTC_RST_STATUS_SET_VAL

#define PMIC_RTC_RST_STATUS_SET_VAL   (0x1U)

Used to set RESET_STATUS_RTC register bit field.

◆ PMIC_RTC_POWERUP_STATUS_CLR_VAL

#define PMIC_RTC_POWERUP_STATUS_CLR_VAL   (0x0U)

Used to clear POWERUP_STATUS register bit field.

◆ PMIC_RTC_POWERUP_STATUS_RESET_VAL

#define PMIC_RTC_POWERUP_STATUS_RESET_VAL   (0x1U)

POWERUP_STATUS reset value when RTC domain is powered down.

◆ PMIC_RTC_WEEKDAY_SUNDAY

#define PMIC_RTC_WEEKDAY_SUNDAY   (1U)

◆ PMIC_RTC_WEEKDAY_MONDAY

#define PMIC_RTC_WEEKDAY_MONDAY   (2U)

◆ PMIC_RTC_WEEKDAY_TUESDAY

#define PMIC_RTC_WEEKDAY_TUESDAY   (3U)

◆ PMIC_RTC_WEEKDAY_WEDNESDAY

#define PMIC_RTC_WEEKDAY_WEDNESDAY   (4U)

◆ PMIC_RTC_WEEKDAY_THURSDAY

#define PMIC_RTC_WEEKDAY_THURSDAY   (5U)

◆ PMIC_RTC_WEEKDAY_FRIDAY

#define PMIC_RTC_WEEKDAY_FRIDAY   (6U)

◆ PMIC_RTC_WEEKDAY_SATURDAY

#define PMIC_RTC_WEEKDAY_SATURDAY   (7U)

◆ PMIC_RTC_MONTH_JAN

#define PMIC_RTC_MONTH_JAN   (1U)

◆ PMIC_RTC_MONTH_FEB

#define PMIC_RTC_MONTH_FEB   (2U)

◆ PMIC_RTC_MONTH_MAR

#define PMIC_RTC_MONTH_MAR   (3U)

◆ PMIC_RTC_MONTH_APR

#define PMIC_RTC_MONTH_APR   (4U)

◆ PMIC_RTC_MONTH_MAY

#define PMIC_RTC_MONTH_MAY   (5U)

◆ PMIC_RTC_MONTH_JUN

#define PMIC_RTC_MONTH_JUN   (6U)

◆ PMIC_RTC_MONTH_JUL

#define PMIC_RTC_MONTH_JUL   (7U)

◆ PMIC_RTC_MONTH_AUG

#define PMIC_RTC_MONTH_AUG   (8U)

◆ PMIC_RTC_MONTH_SEP

#define PMIC_RTC_MONTH_SEP   (9U)

◆ PMIC_RTC_MONTH_OCT

#define PMIC_RTC_MONTH_OCT   (10U)

◆ PMIC_RTC_MONTH_NOV

#define PMIC_RTC_MONTH_NOV   (11U)

◆ PMIC_RTC_MONTH_DEC

#define PMIC_RTC_MONTH_DEC   (12U)

◆ PMIC_RTC_32K_COUNTER_COMP_VAL_SET

#define PMIC_RTC_32K_COUNTER_COMP_VAL_SET   (0x1U)

Set 32K counter with RTC compensation values.

◆ PMIC_RTC_CRYSTAL_OSC_DISABLE

#define PMIC_RTC_CRYSTAL_OSC_DISABLE   0U

◆ PMIC_RTC_CRYSTAL_OSC_ENABLE

#define PMIC_RTC_CRYSTAL_OSC_ENABLE   1U

◆ PMIC_RTC_ROUND_TIME_SET

#define PMIC_RTC_ROUND_TIME_SET   (0x1U)

Round the time to closest minute.

◆ PMIC_RTC_DYNAMIC_REG_SEL

#define PMIC_RTC_DYNAMIC_REG_SEL   (0x0U)

RTC register read from Dynamic registers.

◆ PMIC_RTC_STATIC_SHADOWED_REG_SEL

#define PMIC_RTC_STATIC_SHADOWED_REG_SEL   (0x1U)

RTC register read from Static Shadowed registers.

◆ PMIC_RTC_CRYSTAL_OSC_TYPE_6PF

#define PMIC_RTC_CRYSTAL_OSC_TYPE_6PF   (0x0U)

Selects Crystal Oscillator type as 6PF.

◆ PMIC_RTC_CRYSTAL_OSC_TYPE_9PF

#define PMIC_RTC_CRYSTAL_OSC_TYPE_9PF   (0x1U)

Selects Crystal Oscillator type as 9PF.

◆ PMIC_RTC_CRYSTAL_OSC_TYPE_12_5PF

#define PMIC_RTC_CRYSTAL_OSC_TYPE_12_5PF   (0x2U)

Selects Crystal Oscillator type as 12.5PF.

◆ PMIC_RTC_RST_STATUS

#define PMIC_RTC_RST_STATUS   (0x0U)

Selects RTC Reset Status.

◆ PMIC_RTC_POWERUP_STATUS

#define PMIC_RTC_POWERUP_STATUS   (0x1U)

Selects RTC Powerup Status.

◆ PMIC_RTC_TIME_CFG_SEC_VALID

#define PMIC_RTC_TIME_CFG_SEC_VALID   (0U)

validParams value used to set/get Value to represent the Seconds

◆ PMIC_RTC_TIME_CFG_MIN_VALID

#define PMIC_RTC_TIME_CFG_MIN_VALID   (1U)

validParams value used to set/get Value to represent the Minutes

◆ PMIC_RTC_TIME_CFG_HRS_VALID

#define PMIC_RTC_TIME_CFG_HRS_VALID   (2U)

validParams value used to set/get Value to represent the Hours

◆ PMIC_RTC_TIME_CFG_TIMEMODE_VALID

#define PMIC_RTC_TIME_CFG_TIMEMODE_VALID   (3U)

validParams value used to set/get Time Mode

◆ PMIC_RTC_TIME_CFG_MERIDIAN_VALID

#define PMIC_RTC_TIME_CFG_MERIDIAN_VALID   (4U)

validParams value used to set/get Maridian Mode

◆ PMIC_RTC_TIME_CFG_SEC_VALID_SHIFT

#define PMIC_RTC_TIME_CFG_SEC_VALID_SHIFT   (1U << PMIC_RTC_TIME_CFG_SEC_VALID)

◆ PMIC_RTC_TIME_CFG_MIN_VALID_SHIFT

#define PMIC_RTC_TIME_CFG_MIN_VALID_SHIFT   (1U << PMIC_RTC_TIME_CFG_MIN_VALID)

◆ PMIC_RTC_TIME_CFG_HRS_VALID_SHIFT

#define PMIC_RTC_TIME_CFG_HRS_VALID_SHIFT   (1U << PMIC_RTC_TIME_CFG_HRS_VALID)

◆ PMIC_RTC_TIME_CFG_TIMEMODE_VALID_SHIFT

#define PMIC_RTC_TIME_CFG_TIMEMODE_VALID_SHIFT   (1U << PMIC_RTC_TIME_CFG_TIMEMODE_VALID)

◆ PMIC_RTC_TIME_CFG_MERIDIAN_VALID_SHIFT

#define PMIC_RTC_TIME_CFG_MERIDIAN_VALID_SHIFT   (1U << PMIC_RTC_TIME_CFG_MERIDIAN_VALID)

◆ PMIC_RTC_DATE_CFG_DAY_VALID

#define PMIC_RTC_DATE_CFG_DAY_VALID   (0U)

validParams value used to set/get Value to represent the day

◆ PMIC_RTC_DATE_CFG_MONTH_VALID

#define PMIC_RTC_DATE_CFG_MONTH_VALID   (1U)

validParams value used to set/get Value to represent the Month

◆ PMIC_RTC_DATE_CFG_YEAR_VALID

#define PMIC_RTC_DATE_CFG_YEAR_VALID   (2U)

validParams value used to set/get Value to represent the Year

◆ PMIC_RTC_DATE_CFG_WEEKDAY_VALID

#define PMIC_RTC_DATE_CFG_WEEKDAY_VALID   (3U)

validParams value used to set/get Value to represent the weekday of the week

◆ PMIC_RTC_DATE_CFG_DAY_VALID_SHIFT

#define PMIC_RTC_DATE_CFG_DAY_VALID_SHIFT   (1U << PMIC_RTC_DATE_CFG_DAY_VALID)

◆ PMIC_RTC_DATE_CFG_MONTH_VALID_SHIFT

#define PMIC_RTC_DATE_CFG_MONTH_VALID_SHIFT   (1U << PMIC_RTC_DATE_CFG_MONTH_VALID)

◆ PMIC_RTC_DATE_CFG_YEAR_VALID_SHIFT

#define PMIC_RTC_DATE_CFG_YEAR_VALID_SHIFT   (1U << PMIC_RTC_DATE_CFG_YEAR_VALID)

◆ PMIC_RTC_DATE_CFG_WEEKDAY_VALID_SHIFT

#define PMIC_RTC_DATE_CFG_WEEKDAY_VALID_SHIFT   (1U << PMIC_RTC_DATE_CFG_WEEKDAY_VALID)

◆ PMIC_RTC_RESET_STATUS_VALID

#define PMIC_RTC_RESET_STATUS_VALID   (0U)

validParams value used to get reset status of RTC

◆ PMIC_RTC_POWERUP_STATUS_VALID

#define PMIC_RTC_POWERUP_STATUS_VALID   (1U)

validParams value used to get power-up status of RTC

◆ PMIC_RTC_RESET_STATUS_VALID_SHIFT

#define PMIC_RTC_RESET_STATUS_VALID_SHIFT   (1U << PMIC_RTC_RESET_STATUS_VALID)

◆ PMIC_RTC_POWERUP_STATUS_VALID_SHIFT

#define PMIC_RTC_POWERUP_STATUS_VALID_SHIFT   (1U << PMIC_RTC_POWERUP_STATUS_VALID)

◆ PMIC_RTC_CFG_32K_COUNTER_COMP_VAL_SET_VALID

#define PMIC_RTC_CFG_32K_COUNTER_COMP_VAL_SET_VALID   (0U)

validParams value used to set/get configuration of 32K counter with compensation values

◆ PMIC_RTC_CFG_RTC_TIME_ROUND_30S_SET_VALID

#define PMIC_RTC_CFG_RTC_TIME_ROUND_30S_SET_VALID   (1U)

validParams value used to set/get configuration of RTC time config to Round the time to closest minute

◆ PMIC_RTC_CFG_CRYSTAL_OSC_EN_VALID

#define PMIC_RTC_CFG_CRYSTAL_OSC_EN_VALID   (2U)

validParams value used to set/get to Enable/Disable Crystal Oscillator

◆ PMIC_RTC_CFG_TIME_DATE_REG_SEL_VALID

#define PMIC_RTC_CFG_TIME_DATE_REG_SEL_VALID   (3U)

validParams value used to set/get to Select RTC Time and Date Register read from Dynamic or Static Shadowed Registers

◆ PMIC_RTC_CFG_CRYSTAL_OSC_TYPE_VALID

#define PMIC_RTC_CFG_CRYSTAL_OSC_TYPE_VALID   (4U)

validParams value used to set/get to Select Crystal Oscillator Type

◆ PMIC_RTC_CFG_32K_COUNTER_COMP_VAL_SET_VALID_SHIFT

#define PMIC_RTC_CFG_32K_COUNTER_COMP_VAL_SET_VALID_SHIFT   (1U << PMIC_RTC_CFG_32K_COUNTER_COMP_VAL_SET_VALID)

◆ PMIC_RTC_CFG_RTC_TIME_ROUND_30S_SET_VALID_SHIFT

#define PMIC_RTC_CFG_RTC_TIME_ROUND_30S_SET_VALID_SHIFT   (1U << PMIC_RTC_CFG_RTC_TIME_ROUND_30S_SET_VALID)

◆ PMIC_RTC_CFG_CRYSTAL_OSC_EN_VALID_SHIFT

#define PMIC_RTC_CFG_CRYSTAL_OSC_EN_VALID_SHIFT   (1U << PMIC_RTC_CFG_CRYSTAL_OSC_EN_VALID)

◆ PMIC_RTC_CFG_TIME_DATE_REG_SEL_VALID_SHIFT

#define PMIC_RTC_CFG_TIME_DATE_REG_SEL_VALID_SHIFT   (1U << PMIC_RTC_CFG_TIME_DATE_REG_SEL_VALID)

◆ PMIC_RTC_CFG_CRYSTAL_OSC_TYPE_VALID_SHIFT

#define PMIC_RTC_CFG_CRYSTAL_OSC_TYPE_VALID_SHIFT   (1U << PMIC_RTC_CFG_CRYSTAL_OSC_TYPE_VALID)

Function Documentation

◆ Pmic_rtcSetAlarmInfo()

int32_t Pmic_rtcSetAlarmInfo ( Pmic_CoreHandle_t pPmicCoreHandle,
const Pmic_RtcTime_t  timeCfg,
const Pmic_RtcDate_t  dateCfg 
)

API to Set the alarm Time and Date to PMIC RTC.

Requirement: REQ_TAG(PDK-5855) Design: did_pmic_rtc_cfg_readback Architecture: aid_pmic_rtc_cfg

     This function is used to set the alarm Date and Time parameters
     depending upon the bit fields set in validParams of Time and Date
     structures in RTC of PMIC Device.
Parameters
pPmicCoreHandle[IN] PMIC Interface Handle.
timeCfg[IN] PMIC RTC time configuration
dateCfg[IN] PMIC RTC date configuration
Return values
PMIC_ST_SUCCESSin case of success or appropriate error code. For valid values Pmic_ErrorCodes.

◆ Pmic_rtcGetAlarmInfo()

int32_t Pmic_rtcGetAlarmInfo ( Pmic_CoreHandle_t pPmicCoreHandle,
Pmic_RtcTime_t pTimeCfg,
Pmic_RtcDate_t pDateCfg 
)

API to Get the alarm Time and Date from PMIC RTC function.

Requirement: REQ_TAG(PDK-5855) Design: did_pmic_rtc_cfg_readback Architecture: aid_pmic_rtc_cfg

     This function is used to Get the alarm date and time parameters
     depending upon the bit fields set in validParams of Time and Date
     structures in RTC of the PMIC Device.
Parameters
pPmicCoreHandle[IN] PMIC Interface Handle.
pTimeCfg[OUT] PMIC RTC time configuration
pDateCfg[OUT] PMIC RTC date configuration
Return values
PMIC_ST_SUCCESSin case of success or appropriate error code. For valid values Pmic_ErrorCodes

◆ Pmic_rtcSetTimerPeriod()

int32_t Pmic_rtcSetTimerPeriod ( Pmic_CoreHandle_t pPmicCoreHandle,
const uint8_t  timerPeriod 
)

API to Set the timer interrupt Period to PMIC RTC.

Requirement: REQ_TAG(PDK-5855) Design: did_pmic_rtc_cfg_readback Architecture: aid_pmic_rtc_cfg

     This function is used to set the timer interrupt Period to
     the RTC present in the PMIC.
Parameters
pPmicCoreHandle[IN] PMIC Interface Handle.
timerPeriod[IN] Timer interrupt periods. For Valid values: Pmic_RtcTimerIntrPeriod.
Return values
PMIC_ST_SUCCESSin case of success or appropriate error code. For valid values Pmic_ErrorCodes

◆ Pmic_rtcGetTimerPeriod()

int32_t Pmic_rtcGetTimerPeriod ( Pmic_CoreHandle_t pPmicCoreHandle,
uint8_t *  pTimerPeriod 
)

API to Get the timer interrupt period from PMIC RTC.

Requirement: REQ_TAG(PDK-5855) Design: did_pmic_rtc_cfg_readback Architecture: aid_pmic_rtc_cfg

     This function is used to get the timer interrupt period from RTC
     present in the PMIC.
Parameters
pPmicCoreHandle[IN] PMIC Interface Handle.
pTimerPeriod[OUT] Timer interrupt period
Return values
PMIC_ST_SUCCESSin case of success or appropriate error code. For valid values Pmic_ErrorCodes

◆ Pmic_rtcSetTimeDateInfo()

int32_t Pmic_rtcSetTimeDateInfo ( Pmic_CoreHandle_t pPmicCoreHandle,
const Pmic_RtcTime_t  timeCfg,
const Pmic_RtcDate_t  dateCfg 
)

API to Set the RTC Time and Date to PMIC RTC.

Requirement: REQ_TAG(PDK-5855) Design: did_pmic_rtc_cfg_readback Architecture: aid_pmic_rtc_cfg

     This function is used to set the RTC Date and Time parameters
     depending upon the bit fields set in validParams of Time and Date
     structures in RTC of PMIC Device.
Parameters
pPmicCoreHandle[IN] PMIC Interface Handle.
timeCfg[IN] PMIC RTC time configuration
dateCfg[IN] PMIC RTC date configuration
Return values
PMIC_ST_SUCCESSin case of success or appropriate error code. For valid values Pmic_ErrorCodes.

◆ Pmic_rtcGetTimeDateInfo()

int32_t Pmic_rtcGetTimeDateInfo ( Pmic_CoreHandle_t pPmicCoreHandle,
Pmic_RtcTime_t pTimeCfg,
Pmic_RtcDate_t pDateCfg 
)

API to Get the RTC Time and Date from PMIC RTC function.

Requirement: REQ_TAG(PDK-5855) Design: did_pmic_rtc_cfg_readback Architecture: aid_pmic_rtc_cfg

     This function is used to Get the RTC date and time parameters
     depending upon the bit fields set in validParams of Time and Date
     structures in RTC of the PMIC Device.
Parameters
pPmicCoreHandle[IN] PMIC Interface Handle.
pTimeCfg[OUT] PMIC RTC time configuration
pDateCfg[OUT] PMIC RTC date configuration
Return values
PMIC_ST_SUCCESSin case of success or appropriate error code. For valid values Pmic_ErrorCodes

◆ Pmic_rtcSetFreqComp()

int32_t Pmic_rtcSetFreqComp ( Pmic_CoreHandle_t pPmicCoreHandle,
const uint16_t  compensation 
)

API to Set the RTC frequency compensation value.

Requirement: REQ_TAG(PDK-5855) Design: did_pmic_rtc_cfg_readback Architecture: aid_pmic_rtc_cfg

     This function is used to set the frequency compensation
     value in the RTC of the PMIC Device.
Parameters
pPmicCoreHandle[IN] PMIC Interface Handle.
compensation[IN] PMIC RTC frequency compensation value
Return values
PMIC_ST_SUCCESSin case of success or appropriate error code. For valid values Pmic_ErrorCodes

◆ Pmic_rtcGetFreqComp()

int32_t Pmic_rtcGetFreqComp ( Pmic_CoreHandle_t pPmicCoreHandle,
uint16_t *  pCompensation 
)

API to Get the RTC frequency compensation value.

Requirement: REQ_TAG(PDK-5855) Design: did_pmic_rtc_cfg_readback Architecture: aid_pmic_rtc_cfg

     This function is used to get the frequency compensation
     value from the RTC of the PMIC Device.
Parameters
pPmicCoreHandle[IN] PMIC Interface Handle.
pCompensation[OUT] Pointer to store frequency compensation value
Return values
PMIC_ST_SUCCESSin case of success or appropriate error code. For valid values Pmic_ErrorCodes

◆ Pmic_rtcEnable()

int32_t Pmic_rtcEnable ( Pmic_CoreHandle_t pPmicCoreHandle,
const bool  enableRtc 
)

API to Enable/Disable the RTC.

Requirement: REQ_TAG(PDK-5855) Design: did_pmic_rtc_cfg_readback Architecture: aid_pmic_rtc_cfg

     This function is used to Start/Stop the RTC present in PMIC.
Parameters
pPmicCoreHandle[IN] PMIC Interface Handle.
enableRtc[IN] Parameter to start/stop RTC. Valid values: Pmic_RtcState
Return values
PMIC_ST_SUCCESSin case of success or appropriate error code. For valid values Pmic_ErrorCodes

◆ Pmic_rtcGetStatus()

int32_t Pmic_rtcGetStatus ( Pmic_CoreHandle_t pPmicCoreHandle,
bool *  pRtcstatus 
)

API to read RTC status which defines RTC is started or not.

Requirement: REQ_TAG(PDK-9155) Design: did_pmic_rtc_status Architecture: aid_pmic_rtc_cfg

     This function is read RTC status which defines RTC is started or not
Parameters
pPmicCoreHandle[IN] PMIC Interface Handle.
pRtcstatus[IN] Pointer to store the RTC status which defines RTC is started or not Valid values: Pmic_RtcStatus
Return values
PMIC_ST_SUCCESSin case of success or appropriate error code. For valid values Pmic_ErrorCodes

◆ Pmic_rtcEnableTimerIntr()

int32_t Pmic_rtcEnableTimerIntr ( Pmic_CoreHandle_t pPmicCoreHandle,
const bool  enableIntr 
)

API to Enable/Disable the RTC Timer Interrupt.

Requirement: REQ_TAG(PDK-5855), REQ_TAG(PDK-5831) Design: did_pmic_rtc_cfg_readback, did_pmic_lpstandby_wkup_cfg Architecture: aid_pmic_rtc_cfg

     This function is used to enable/disable the RTC timer interrupt.
Parameters
pPmicCoreHandle[IN] PMIC Interface Handle.
enableIntr[IN] Parameter to enable/disable Timer Interrupt. For Valid values: Pmic_RtcTimerIntrEnable
Return values
PMIC_ST_SUCCESSin case of success or appropriate error code. For valid values Pmic_ErrorCodes

◆ Pmic_rtcEnableAlarmIntr()

int32_t Pmic_rtcEnableAlarmIntr ( Pmic_CoreHandle_t pPmicCoreHandle,
const bool  enableIntr 
)

API to Enable/Disable the RTC Alarm Interrupt.

Requirement: REQ_TAG(PDK-5855), REQ_TAG(PDK-5831) Design: did_pmic_rtc_cfg_readback, did_pmic_lpstandby_wkup_cfg Architecture: aid_pmic_rtc_cfg

     This function is used to enable/disable the RTC alarm interrupt.
Parameters
pPmicCoreHandle[IN] PMIC Interface Handle.
enableIntr[IN] Parameter to enable/disable Alarm Interrupt. For Valid values: Pmic_RtcAlramIntrEnable
Return values
PMIC_ST_SUCCESSin case of success or appropriate error code. For valid values Pmic_ErrorCodes

◆ Pmic_rtcGetRstStatus()

int32_t Pmic_rtcGetRstStatus ( Pmic_CoreHandle_t pPmicCoreHandle,
Pmic_RtcRstStatus_t pRtcRstStatus 
)

API to Get the Reset status of RTC.

Requirement: REQ_TAG(PDK-9145), REQ_TAG(PDK-9142) Design: did_pmic_rtc_rst_status Architecture: aid_pmic_rtc_cfg

     This function is used to get the Reset status of the RTC
     depending on the bit fields set in validParams of
     struct Pmic_RtcRstStatus_t structures.
Parameters
pPmicCoreHandle[IN] PMIC Interface Handle.
pRtcRstStatus[IN/OUT] Pointer to hold RTC Reset status.
Return values
PMIC_ST_SUCCESSin case of success or appropriate error code. For valid values Pmic_ErrorCodes

◆ Pmic_rtcClrRstStatus()

int32_t Pmic_rtcClrRstStatus ( Pmic_CoreHandle_t pPmicCoreHandle,
const uint8_t  rtcRstStatType 
)

API to clear the Reset status of RTC.

Requirement: REQ_TAG(PDK-9142), REQ_TAG(PDK-9145) Design: did_pmic_rtc_clr_rst_status Architecture: aid_pmic_rtc_cfg

     This function is used to clear the Reset status of the RTC
     depending on the Pmic_RtcRstStatusType
Parameters
pPmicCoreHandle[IN] PMIC Interface Handle.
rtcRstStatType[IN] RTC Reset Status Type For Valid values: Pmic_RtcRstStatusType
Return values
PMIC_ST_SUCCESSin case of success or appropriate error code. For valid values Pmic_ErrorCodes

◆ Pmic_rtcSetConfiguration()

int32_t Pmic_rtcSetConfiguration ( Pmic_CoreHandle_t pPmicCoreHandle,
const Pmic_RtcCfg_t  rtcCfg 
)

API to Set PMIC RTC Configuration.

Requirement: REQ_TAG(PDK-9141), REQ_TAG(PDK-9135), REQ_TAG(PDK-9111) Design: did_pmic_rtc_cfg_readback Architecture: aid_pmic_rtc_cfg

     This function is used to set RTC configuration depending upon the
     bit fields set in validParams of Pmic_RtcCfg_t structure.
Parameters
pPmicCoreHandle[IN] PMIC Interface Handle.
rtcCfg[IN] Set required RTC configuration
Return values
PMIC_ST_SUCCESSin case of success or appropriate error code. For valid values Pmic_ErrorCodes.

◆ Pmic_rtcGetConfiguration()

int32_t Pmic_rtcGetConfiguration ( Pmic_CoreHandle_t pPmicCoreHandle,
Pmic_RtcCfg_t pRtcCfg 
)

API to Get PMIC RTC Configuration.

Requirement: REQ_TAG(PDK-9141), REQ_TAG(PDK-9135) Design: did_pmic_rtc_cfg_readback Architecture: aid_pmic_rtc_cfg

     This function is used to Get RTC configuration depending upon the
     bit fields set in validParams of Pmic_RtcCfg_t structure.
Parameters
pPmicCoreHandle[IN] PMIC Interface Handle.
pRtcCfg[IN/OUT] Pointer to store required RTC configuration
Return values
PMIC_ST_SUCCESSin case of success or appropriate error code. For valid values Pmic_ErrorCodes.