PDK API Guide for J721E
PMIC WatchDog Driver API

Introduction

This Module explains about PMIC WatchDog driver parameters and APIs usage. PMIC WatchDog Driver module covers all WatchDog features APIs. Like, set/get watchdog configuration, Enable or disable watchdog, Get watchdog error status, Get watchdog failcount, start watchdog QA sequence and start watchdog trigger mode.

Supported PMIC devices for Watchdog Module:

  1. TPS6594x (Leo PMIC Device)
  2. LP8764x (Hera PMIC Device)

Files

file  pmic_wdg.h
 PMIC Low Level Driver API/interface file for WatchDog APIs.
 

Data Structures

struct  Pmic_WdgCfg_t
 PMIC Watchdog configuration structure 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...
 
struct  Pmic_WdgErrStatus_t
 PMIC Watchdog error status structure Note: validParams is input param for all Get APIs. other params except validParams is output param for Get APIs. More...
 
struct  Pmic_WdgFailCntStat_t
 PMIC Watchdog Fail Count status structure Note: validParams is input param for all Get APIs. other params except validParams is output param for Get APIs. More...
 

Functions

int32_t Pmic_wdgEnable (Pmic_CoreHandle_t *pPmicCoreHandle)
 API to Enable Watchdog timer. More...
 
int32_t Pmic_wdgDisable (Pmic_CoreHandle_t *pPmicCoreHandle)
 API to Disable Watchdog timer. More...
 
int32_t Pmic_wdgSetCfg (Pmic_CoreHandle_t *pPmicCoreHandle, const Pmic_WdgCfg_t wdgCfg)
 API to set PMIC watchdog configurations. More...
 
int32_t Pmic_wdgGetCfg (Pmic_CoreHandle_t *pPmicCoreHandle, Pmic_WdgCfg_t *pWdgCfg)
 API to get PMIC watchdog configurations. More...
 
int32_t Pmic_wdgStartQaSequence (Pmic_CoreHandle_t *pPmicCoreHandle, uint32_t num_of_sequences, uint32_t maxCnt)
 API to Start watchdog QA mode. More...
 
int32_t Pmic_wdgGetErrorStatus (Pmic_CoreHandle_t *pPmicCoreHandle, Pmic_WdgErrStatus_t *pErrStatus)
 API to get PMIC watchdog error status. More...
 
int32_t Pmic_wdgGetFailCntStat (Pmic_CoreHandle_t *pPmicCoreHandle, Pmic_WdgFailCntStat_t *pFailCount)
 API to get PMIC watchdog fail count status. More...
 
int32_t Pmic_wdgStartTriggerSequence (Pmic_CoreHandle_t *pPmicCoreHandle)
 API to Start watchdog Trigger mode. More...
 
int32_t Pmic_wdgClrErrStatus (Pmic_CoreHandle_t *pPmicCoreHandle, const uint8_t wdgErrType)
 API to clear PMIC watchdog error status. More...
 
int32_t Pmic_wdgQaSequenceWriteAnswer (Pmic_CoreHandle_t *pPmicCoreHandle)
 API to Write Answers in Long Window/ Window1/ Window2 Interval for watchdog QA Sequence. More...
 

Macros

#define PMIC_WDG_WAIT_CNT_MIN_VAL   (30U)
 Minimum number of iterations to wait for a Good/Bad event. More...
 
#define PMIC_WD_QA_INFINITE_SEQ   (0xFFFFFFFFU)
 Macro for PMIC Watchdog QA infinite sequence. More...
 

PMIC watchdog timer En/Disable Modes

#define PMIC_WDG_DISABLE   (bool)false
 
#define PMIC_WDG_ENABLE   (bool)true
 

PMIC watchdog timer warm reset En/Disable

#define PMIC_WDG_RESET_DISABLE   (0x0U)
 
#define PMIC_WDG_RESET_ENABLE   (0x1U)
 

PMIC watchdog timer Return Long Window En/Disable

#define PMIC_WDG_RETLONGWIN_DISABLE   (bool)false
 
#define PMIC_WDG_RETLONGWIN_ENABLE   (bool)true
 

PMIC watchdog timer Power Hold En/Disable

#define PMIC_WDG_PWRHOLD_DISABLE   (0x0U)
 
#define PMIC_WDG_PWRHOLD_ENABLE   (0x1U)
 

PMIC watchdog timer Trigger/QA Mode

#define PMIC_WDG_TRIGGER_MODE   (0x0U)
 
#define PMIC_WDG_QA_MODE   (0x1U)
 

PMIC watchdog timer Reset Threshold Configurations

#define PMIC_WDG_RESET_THRESHOLD_COUNT_0   (0x0U)
 
#define PMIC_WDG_RESET_THRESHOLD_COUNT_1   (0x1U)
 
#define PMIC_WDG_RESET_THRESHOLD_COUNT_2   (0x2U)
 
#define PMIC_WDG_RESET_THRESHOLD_COUNT_3   (0x3U)
 
#define PMIC_WDG_RESET_THRESHOLD_COUNT_4   (0x4U)
 
#define PMIC_WDG_RESET_THRESHOLD_COUNT_5   (0x5U)
 
#define PMIC_WDG_RESET_THRESHOLD_COUNT_6   (0x6U)
 
#define PMIC_WDG_RESET_THRESHOLD_COUNT_7   (0x7U)
 

PMIC watchdog timer Fail Threshold Configurations

#define PMIC_WDG_FAIL_THRESHOLD_COUNT_0   (0x0U)
 
#define PMIC_WDG_FAIL_THRESHOLD_COUNT_1   (0x1U)
 
#define PMIC_WDG_FAIL_THRESHOLD_COUNT_2   (0x2U)
 
#define PMIC_WDG_FAIL_THRESHOLD_COUNT_3   (0x3U)
 
#define PMIC_WDG_FAIL_THRESHOLD_COUNT_4   (0x4U)
 
#define PMIC_WDG_FAIL_THRESHOLD_COUNT_5   (0x5U)
 
#define PMIC_WDG_FAIL_THRESHOLD_COUNT_6   (0x6U)
 
#define PMIC_WDG_FAIL_THRESHOLD_COUNT_7   (0x7U)
 

PMIC watchdog timer QA Feedback Values

#define PMIC_WDG_QA_FEEDBACK_VALUE_0   (0x0U)
 
#define PMIC_WDG_QA_FEEDBACK_VALUE_1   (0x1U)
 
#define PMIC_WDG_QA_FEEDBACK_VALUE_2   (0x2U)
 
#define PMIC_WDG_QA_FEEDBACK_VALUE_3   (0x3U)
 

PMIC watchdog timer QA LFSR Values

#define PMIC_WDG_QA_LFSR_VALUE_0   (0x0U)
 
#define PMIC_WDG_QA_LFSR_VALUE_1   (0x1U)
 
#define PMIC_WDG_QA_LFSR_VALUE_2   (0x2U)
 
#define PMIC_WDG_QA_LFSR_VALUE_3   (0x3U)
 

PMIC watchdog timer QA Question Seed Values

#define PMIC_WDG_QA_QUES_SEED_VALUE_0   (0x0U)
 
#define PMIC_WDG_QA_QUES_SEED_VALUE_1   (0x1U)
 
#define PMIC_WDG_QA_QUES_SEED_VALUE_2   (0x2U)
 
#define PMIC_WDG_QA_QUES_SEED_VALUE_3   (0x3U)
 
#define PMIC_WDG_QA_QUES_SEED_VALUE_4   (0x4U)
 
#define PMIC_WDG_QA_QUES_SEED_VALUE_5   (0x5U)
 
#define PMIC_WDG_QA_QUES_SEED_VALUE_6   (0x6U)
 
#define PMIC_WDG_QA_QUES_SEED_VALUE_7   (0x7U)
 
#define PMIC_WDG_QA_QUES_SEED_VALUE_8   (0x8U)
 
#define PMIC_WDG_QA_QUES_SEED_VALUE_9   (0x9U)
 
#define PMIC_WDG_QA_QUES_SEED_VALUE_10   (0xAU)
 
#define PMIC_WDG_QA_QUES_SEED_VALUE_11   (0xBU)
 
#define PMIC_WDG_QA_QUES_SEED_VALUE_12   (0xCU)
 
#define PMIC_WDG_QA_QUES_SEED_VALUE_13   (0xDU)
 
#define PMIC_WDG_QA_QUES_SEED_VALUE_14   (0xEU)
 
#define PMIC_WDG_QA_QUES_SEED_VALUE_15   (0xFU)
 

PMIC watchdog timer Config Structure Param Bit positions

#define PMIC_CFG_WDG_LONGWINDURATION_VALID   (0U)
 validParams value used to set/get Long Window duration More...
 
#define PMIC_CFG_WDG_WIN1DURATION_VALID   (1U)
 validParams value used to set/get Window-1 duration More...
 
#define PMIC_CFG_WDG_WIN2DURATION_VALID   (2U)
 validParams value used to set/get Window-2 duration More...
 
#define PMIC_CFG_WDG_FAILTHRESHOLD_VALID   (3U)
 validParams value used to set/get Fail threshold value More...
 
#define PMIC_CFG_WDG_RSTTHRESHOLD_VALID   (4U)
 validParams value used to set/get Reset threshold Value More...
 
#define PMIC_CFG_WDG_RSTENABLE_VALID   (5U)
 validParams value used to set/get to enable or diable warm reset on fail More...
 
#define PMIC_CFG_WDG_WDGMODE_VALID   (6U)
 validParams value used to set/get watchdog mode More...
 
#define PMIC_CFG_WDG_PWRHOLD_VALID   (7U)
 validParams value used to set/get to Enable or disable watchdog pwrHold More...
 
#define PMIC_CFG_WDG_RETLONGWIN_VALID   (8U)
 validParams value used to set/get to enable or disable return to long window More...
 
#define PMIC_CFG_WDG_QA_FDBK_VALID   (9U)
 validParams value used to set/get QA feed back value More...
 
#define PMIC_CFG_WDG_QA_LFSR_VALID   (10U)
 validParams value used to set/get QA LFSR value More...
 
#define PMIC_CFG_WDG_QA_QUES_SEED_VALID   (11U)
 validParams value used to set/get QA question seed value More...
 

PMIC WatchDog Config Structure Params Bit shift values

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

#define PMIC_CFG_WDG_LONGWINDURATION_VALID_SHIFT   (1U << PMIC_CFG_WDG_LONGWINDURATION_VALID)
 
#define PMIC_CFG_WDG_WIN1DURATION_VALID_SHIFT   (1U << PMIC_CFG_WDG_WIN1DURATION_VALID)
 
#define PMIC_CFG_WDG_WIN2DURATION_VALID_SHIFT   (1U << PMIC_CFG_WDG_WIN2DURATION_VALID)
 
#define PMIC_CFG_WDG_FAILTHRESHOLD_VALID_SHIFT   (1U << PMIC_CFG_WDG_FAILTHRESHOLD_VALID)
 
#define PMIC_CFG_WDG_RSTTHRESHOLD_VALID_SHIFT   (1U << PMIC_CFG_WDG_RSTTHRESHOLD_VALID)
 
#define PMIC_CFG_WDG_RSTENABLE_VALID_SHIFT   (1U << PMIC_CFG_WDG_RSTENABLE_VALID)
 
#define PMIC_CFG_WDG_WDGMODE_VALID_SHIFT   (1U << PMIC_CFG_WDG_WDGMODE_VALID)
 
#define PMIC_CFG_WDG_PWRHOLD_VALID_SHIFT   (1U << PMIC_CFG_WDG_PWRHOLD_VALID)
 
#define PMIC_CFG_WDG_RETLONGWIN_VALID_SHIFT   (1U << PMIC_CFG_WDG_RETLONGWIN_VALID)
 
#define PMIC_CFG_WDG_QA_FDBK_VALID_SHIFT   (1U << PMIC_CFG_WDG_QA_FDBK_VALID)
 
#define PMIC_CFG_WDG_QA_LFSR_VALID_SHIFT   (1U << PMIC_CFG_WDG_QA_LFSR_VALID)
 
#define PMIC_CFG_WDG_QA_QUES_SEED_VALID_SHIFT   (1U << PMIC_CFG_WDG_QA_QUES_SEED_VALID)
 

PMIC watchdog timer error status Structure Param Bit positions.

#define PMIC_CFG_WD_LONGWIN_TIMEOUT_ERRSTAT_VALID   (0U)
 validParams value used to get Long Window timeout error status More...
 
#define PMIC_CFG_WD_TIMEOUT_ERRSTAT_VALID   (1U)
 validParams value used to get Window1 and window2 timeout error status More...
 
#define PMIC_CFG_WD_TRIG_EARLY_ERRSTAT_VALID   (2U)
 validParams value used to get Watchdog trigger mode error status More...
 
#define PMIC_CFG_WD_ANSW_EARLY_ERRSTAT_VALID   (3U)
 validParams value used to get Watchdog early answer error status More...
 
#define PMIC_CFG_WD_SEQ_ERR_ERRSTAT_VALID   (4U)
 validParams value used to get Watchdog QA sequence error status More...
 
#define PMIC_CFG_WD_ANSW_ERR_ERRSTAT_VALID   (5U)
 validParams value used to get Watchdog QA wrong Answer error status More...
 
#define PMIC_CFG_WD_FAIL_INT_ERRSTAT_VALID   (6U)
 validParams value used to get Watchdog fail error status More...
 
#define PMIC_CFG_WD_RST_INT_ERRSTAT_VALID   (7U)
 validParams value used to get Watchdog reset error status More...
 

PMIC watchdog Fail count status Structure Param Bit positions.

#define PMIC_CFG_WD_BAD_EVENT_STAT_VALID   (0U)
 validParams value used to get status of Bad Event is detected or not More...
 
#define PMIC_CFG_WD_GOOD_EVENT_STAT_VALID   (1U)
 validParams value used to get status of Good Event is detected or not More...
 
#define PMIC_CFG_WD_FAIL_CNT_VAL_VALID   (2U)
 validParams value used to get To get Watchdog Fail Count value More...
 

PMIC WatchDog Error status Structure Params Bit shift values

Application can use below shifted values to set the validParams structure member defined in Pmic_WdgErrStatus_t structure

#define PMIC_CFG_WD_LONGWIN_TIMEOUT_ERRSTAT_VALID_SHIFT   (1U << PMIC_CFG_WD_LONGWIN_TIMEOUT_ERRSTAT_VALID)
 
#define PMIC_CFG_WD_TIMEOUT_ERRSTAT_VALID_SHIFT   (1U << PMIC_CFG_WD_TIMEOUT_ERRSTAT_VALID)
 
#define PMIC_CFG_WD_TRIG_EARLY_ERRSTAT_VALID_SHIFT   (1U << PMIC_CFG_WD_TRIG_EARLY_ERRSTAT_VALID)
 
#define PMIC_CFG_WD_ANSW_EARLY_ERRSTAT_VALID_SHIFT   (1U << PMIC_CFG_WD_ANSW_EARLY_ERRSTAT_VALID)
 
#define PMIC_CFG_WD_SEQ_ERR_ERRSTAT_VALID_SHIFT   (1U << PMIC_CFG_WD_SEQ_ERR_ERRSTAT_VALID)
 
#define PMIC_CFG_WD_ANSW_ERR_ERRSTAT_VALID_SHIFT   (1U << PMIC_CFG_WD_ANSW_ERR_ERRSTAT_VALID)
 
#define PMIC_CFG_WD_FAIL_INT_ERRSTAT_VALID_SHIFT   (1U << PMIC_CFG_WD_FAIL_INT_ERRSTAT_VALID)
 
#define PMIC_CFG_WD_RST_INT_ERRSTAT_VALID_SHIFT   (1U << PMIC_CFG_WD_RST_INT_ERRSTAT_VALID)
 

PMIC WatchDog Fail count status Structure Params Bit shift values

Application can use below shifted values to set the validParams structure member defined in Pmic_WdgErrStatus_t structure

#define PMIC_CFG_WD_BAD_EVENT_STAT_VALID_SHIFT   (1U << PMIC_CFG_WD_BAD_EVENT_STAT_VALID)
 
#define PMIC_CFG_WD_GOOD_EVENT_STAT_VALID_SHIFT   (1U << PMIC_CFG_WD_GOOD_EVENT_STAT_VALID)
 
#define PMIC_CFG_WD_FAIL_CNT_VAL_VALID_SHIFT   (1U << PMIC_CFG_WD_FAIL_CNT_VAL_VALID)
 

PMIC WDG Error TYPE

#define PMIC_WDG_ERR_LONG_WIN_TIMEOUT   (0x0U)
 
#define PMIC_WDG_ERR_TIMEOUT   (0x1U)
 
#define PMIC_WDG_ERR_TRIGGER_EARLY   (0x2U)
 
#define PMIC_WDG_ERR_ANSWER_EARLY   (0x3U)
 
#define PMIC_WDG_ERR_SEQ_ERR   (0x4U)
 
#define PMIC_WDG_ERR_ANS_ERR   (0x5U)
 
#define PMIC_WDG_ERR_FAIL_INT   (0x6U)
 
#define PMIC_WDG_ERR_RST_INT   (0x7U)
 
#define PMIC_WDG_ERR_ALL   (0x8U)
 

Macro Definition Documentation

◆ PMIC_WDG_DISABLE

#define PMIC_WDG_DISABLE   (bool)false

◆ PMIC_WDG_ENABLE

#define PMIC_WDG_ENABLE   (bool)true

◆ PMIC_WDG_RESET_DISABLE

#define PMIC_WDG_RESET_DISABLE   (0x0U)

◆ PMIC_WDG_RESET_ENABLE

#define PMIC_WDG_RESET_ENABLE   (0x1U)

◆ PMIC_WDG_RETLONGWIN_DISABLE

#define PMIC_WDG_RETLONGWIN_DISABLE   (bool)false

◆ PMIC_WDG_RETLONGWIN_ENABLE

#define PMIC_WDG_RETLONGWIN_ENABLE   (bool)true

◆ PMIC_WDG_PWRHOLD_DISABLE

#define PMIC_WDG_PWRHOLD_DISABLE   (0x0U)

◆ PMIC_WDG_PWRHOLD_ENABLE

#define PMIC_WDG_PWRHOLD_ENABLE   (0x1U)

◆ PMIC_WDG_TRIGGER_MODE

#define PMIC_WDG_TRIGGER_MODE   (0x0U)

◆ PMIC_WDG_QA_MODE

#define PMIC_WDG_QA_MODE   (0x1U)

◆ PMIC_WDG_RESET_THRESHOLD_COUNT_0

#define PMIC_WDG_RESET_THRESHOLD_COUNT_0   (0x0U)

◆ PMIC_WDG_RESET_THRESHOLD_COUNT_1

#define PMIC_WDG_RESET_THRESHOLD_COUNT_1   (0x1U)

◆ PMIC_WDG_RESET_THRESHOLD_COUNT_2

#define PMIC_WDG_RESET_THRESHOLD_COUNT_2   (0x2U)

◆ PMIC_WDG_RESET_THRESHOLD_COUNT_3

#define PMIC_WDG_RESET_THRESHOLD_COUNT_3   (0x3U)

◆ PMIC_WDG_RESET_THRESHOLD_COUNT_4

#define PMIC_WDG_RESET_THRESHOLD_COUNT_4   (0x4U)

◆ PMIC_WDG_RESET_THRESHOLD_COUNT_5

#define PMIC_WDG_RESET_THRESHOLD_COUNT_5   (0x5U)

◆ PMIC_WDG_RESET_THRESHOLD_COUNT_6

#define PMIC_WDG_RESET_THRESHOLD_COUNT_6   (0x6U)

◆ PMIC_WDG_RESET_THRESHOLD_COUNT_7

#define PMIC_WDG_RESET_THRESHOLD_COUNT_7   (0x7U)

◆ PMIC_WDG_FAIL_THRESHOLD_COUNT_0

#define PMIC_WDG_FAIL_THRESHOLD_COUNT_0   (0x0U)

◆ PMIC_WDG_FAIL_THRESHOLD_COUNT_1

#define PMIC_WDG_FAIL_THRESHOLD_COUNT_1   (0x1U)

◆ PMIC_WDG_FAIL_THRESHOLD_COUNT_2

#define PMIC_WDG_FAIL_THRESHOLD_COUNT_2   (0x2U)

◆ PMIC_WDG_FAIL_THRESHOLD_COUNT_3

#define PMIC_WDG_FAIL_THRESHOLD_COUNT_3   (0x3U)

◆ PMIC_WDG_FAIL_THRESHOLD_COUNT_4

#define PMIC_WDG_FAIL_THRESHOLD_COUNT_4   (0x4U)

◆ PMIC_WDG_FAIL_THRESHOLD_COUNT_5

#define PMIC_WDG_FAIL_THRESHOLD_COUNT_5   (0x5U)

◆ PMIC_WDG_FAIL_THRESHOLD_COUNT_6

#define PMIC_WDG_FAIL_THRESHOLD_COUNT_6   (0x6U)

◆ PMIC_WDG_FAIL_THRESHOLD_COUNT_7

#define PMIC_WDG_FAIL_THRESHOLD_COUNT_7   (0x7U)

◆ PMIC_WDG_QA_FEEDBACK_VALUE_0

#define PMIC_WDG_QA_FEEDBACK_VALUE_0   (0x0U)

◆ PMIC_WDG_QA_FEEDBACK_VALUE_1

#define PMIC_WDG_QA_FEEDBACK_VALUE_1   (0x1U)

◆ PMIC_WDG_QA_FEEDBACK_VALUE_2

#define PMIC_WDG_QA_FEEDBACK_VALUE_2   (0x2U)

◆ PMIC_WDG_QA_FEEDBACK_VALUE_3

#define PMIC_WDG_QA_FEEDBACK_VALUE_3   (0x3U)

◆ PMIC_WDG_QA_LFSR_VALUE_0

#define PMIC_WDG_QA_LFSR_VALUE_0   (0x0U)

◆ PMIC_WDG_QA_LFSR_VALUE_1

#define PMIC_WDG_QA_LFSR_VALUE_1   (0x1U)

◆ PMIC_WDG_QA_LFSR_VALUE_2

#define PMIC_WDG_QA_LFSR_VALUE_2   (0x2U)

◆ PMIC_WDG_QA_LFSR_VALUE_3

#define PMIC_WDG_QA_LFSR_VALUE_3   (0x3U)

◆ PMIC_WDG_QA_QUES_SEED_VALUE_0

#define PMIC_WDG_QA_QUES_SEED_VALUE_0   (0x0U)

◆ PMIC_WDG_QA_QUES_SEED_VALUE_1

#define PMIC_WDG_QA_QUES_SEED_VALUE_1   (0x1U)

◆ PMIC_WDG_QA_QUES_SEED_VALUE_2

#define PMIC_WDG_QA_QUES_SEED_VALUE_2   (0x2U)

◆ PMIC_WDG_QA_QUES_SEED_VALUE_3

#define PMIC_WDG_QA_QUES_SEED_VALUE_3   (0x3U)

◆ PMIC_WDG_QA_QUES_SEED_VALUE_4

#define PMIC_WDG_QA_QUES_SEED_VALUE_4   (0x4U)

◆ PMIC_WDG_QA_QUES_SEED_VALUE_5

#define PMIC_WDG_QA_QUES_SEED_VALUE_5   (0x5U)

◆ PMIC_WDG_QA_QUES_SEED_VALUE_6

#define PMIC_WDG_QA_QUES_SEED_VALUE_6   (0x6U)

◆ PMIC_WDG_QA_QUES_SEED_VALUE_7

#define PMIC_WDG_QA_QUES_SEED_VALUE_7   (0x7U)

◆ PMIC_WDG_QA_QUES_SEED_VALUE_8

#define PMIC_WDG_QA_QUES_SEED_VALUE_8   (0x8U)

◆ PMIC_WDG_QA_QUES_SEED_VALUE_9

#define PMIC_WDG_QA_QUES_SEED_VALUE_9   (0x9U)

◆ PMIC_WDG_QA_QUES_SEED_VALUE_10

#define PMIC_WDG_QA_QUES_SEED_VALUE_10   (0xAU)

◆ PMIC_WDG_QA_QUES_SEED_VALUE_11

#define PMIC_WDG_QA_QUES_SEED_VALUE_11   (0xBU)

◆ PMIC_WDG_QA_QUES_SEED_VALUE_12

#define PMIC_WDG_QA_QUES_SEED_VALUE_12   (0xCU)

◆ PMIC_WDG_QA_QUES_SEED_VALUE_13

#define PMIC_WDG_QA_QUES_SEED_VALUE_13   (0xDU)

◆ PMIC_WDG_QA_QUES_SEED_VALUE_14

#define PMIC_WDG_QA_QUES_SEED_VALUE_14   (0xEU)

◆ PMIC_WDG_QA_QUES_SEED_VALUE_15

#define PMIC_WDG_QA_QUES_SEED_VALUE_15   (0xFU)

◆ PMIC_CFG_WDG_LONGWINDURATION_VALID

#define PMIC_CFG_WDG_LONGWINDURATION_VALID   (0U)

validParams value used to set/get Long Window duration

◆ PMIC_CFG_WDG_WIN1DURATION_VALID

#define PMIC_CFG_WDG_WIN1DURATION_VALID   (1U)

validParams value used to set/get Window-1 duration

◆ PMIC_CFG_WDG_WIN2DURATION_VALID

#define PMIC_CFG_WDG_WIN2DURATION_VALID   (2U)

validParams value used to set/get Window-2 duration

◆ PMIC_CFG_WDG_FAILTHRESHOLD_VALID

#define PMIC_CFG_WDG_FAILTHRESHOLD_VALID   (3U)

validParams value used to set/get Fail threshold value

◆ PMIC_CFG_WDG_RSTTHRESHOLD_VALID

#define PMIC_CFG_WDG_RSTTHRESHOLD_VALID   (4U)

validParams value used to set/get Reset threshold Value

◆ PMIC_CFG_WDG_RSTENABLE_VALID

#define PMIC_CFG_WDG_RSTENABLE_VALID   (5U)

validParams value used to set/get to enable or diable warm reset on fail

◆ PMIC_CFG_WDG_WDGMODE_VALID

#define PMIC_CFG_WDG_WDGMODE_VALID   (6U)

validParams value used to set/get watchdog mode

◆ PMIC_CFG_WDG_PWRHOLD_VALID

#define PMIC_CFG_WDG_PWRHOLD_VALID   (7U)

validParams value used to set/get to Enable or disable watchdog pwrHold

◆ PMIC_CFG_WDG_RETLONGWIN_VALID

#define PMIC_CFG_WDG_RETLONGWIN_VALID   (8U)

validParams value used to set/get to enable or disable return to long window

◆ PMIC_CFG_WDG_QA_FDBK_VALID

#define PMIC_CFG_WDG_QA_FDBK_VALID   (9U)

validParams value used to set/get QA feed back value

◆ PMIC_CFG_WDG_QA_LFSR_VALID

#define PMIC_CFG_WDG_QA_LFSR_VALID   (10U)

validParams value used to set/get QA LFSR value

◆ PMIC_CFG_WDG_QA_QUES_SEED_VALID

#define PMIC_CFG_WDG_QA_QUES_SEED_VALID   (11U)

validParams value used to set/get QA question seed value

◆ PMIC_WDG_WAIT_CNT_MIN_VAL

#define PMIC_WDG_WAIT_CNT_MIN_VAL   (30U)

Minimum number of iterations to wait for a Good/Bad event.

◆ PMIC_CFG_WDG_LONGWINDURATION_VALID_SHIFT

#define PMIC_CFG_WDG_LONGWINDURATION_VALID_SHIFT   (1U << PMIC_CFG_WDG_LONGWINDURATION_VALID)

◆ PMIC_CFG_WDG_WIN1DURATION_VALID_SHIFT

#define PMIC_CFG_WDG_WIN1DURATION_VALID_SHIFT   (1U << PMIC_CFG_WDG_WIN1DURATION_VALID)

◆ PMIC_CFG_WDG_WIN2DURATION_VALID_SHIFT

#define PMIC_CFG_WDG_WIN2DURATION_VALID_SHIFT   (1U << PMIC_CFG_WDG_WIN2DURATION_VALID)

◆ PMIC_CFG_WDG_FAILTHRESHOLD_VALID_SHIFT

#define PMIC_CFG_WDG_FAILTHRESHOLD_VALID_SHIFT   (1U << PMIC_CFG_WDG_FAILTHRESHOLD_VALID)

◆ PMIC_CFG_WDG_RSTTHRESHOLD_VALID_SHIFT

#define PMIC_CFG_WDG_RSTTHRESHOLD_VALID_SHIFT   (1U << PMIC_CFG_WDG_RSTTHRESHOLD_VALID)

◆ PMIC_CFG_WDG_RSTENABLE_VALID_SHIFT

#define PMIC_CFG_WDG_RSTENABLE_VALID_SHIFT   (1U << PMIC_CFG_WDG_RSTENABLE_VALID)

◆ PMIC_CFG_WDG_WDGMODE_VALID_SHIFT

#define PMIC_CFG_WDG_WDGMODE_VALID_SHIFT   (1U << PMIC_CFG_WDG_WDGMODE_VALID)

◆ PMIC_CFG_WDG_PWRHOLD_VALID_SHIFT

#define PMIC_CFG_WDG_PWRHOLD_VALID_SHIFT   (1U << PMIC_CFG_WDG_PWRHOLD_VALID)

◆ PMIC_CFG_WDG_RETLONGWIN_VALID_SHIFT

#define PMIC_CFG_WDG_RETLONGWIN_VALID_SHIFT   (1U << PMIC_CFG_WDG_RETLONGWIN_VALID)

◆ PMIC_CFG_WDG_QA_FDBK_VALID_SHIFT

#define PMIC_CFG_WDG_QA_FDBK_VALID_SHIFT   (1U << PMIC_CFG_WDG_QA_FDBK_VALID)

◆ PMIC_CFG_WDG_QA_LFSR_VALID_SHIFT

#define PMIC_CFG_WDG_QA_LFSR_VALID_SHIFT   (1U << PMIC_CFG_WDG_QA_LFSR_VALID)

◆ PMIC_CFG_WDG_QA_QUES_SEED_VALID_SHIFT

#define PMIC_CFG_WDG_QA_QUES_SEED_VALID_SHIFT   (1U << PMIC_CFG_WDG_QA_QUES_SEED_VALID)

◆ PMIC_CFG_WD_LONGWIN_TIMEOUT_ERRSTAT_VALID

#define PMIC_CFG_WD_LONGWIN_TIMEOUT_ERRSTAT_VALID   (0U)

validParams value used to get Long Window timeout error status

◆ PMIC_CFG_WD_TIMEOUT_ERRSTAT_VALID

#define PMIC_CFG_WD_TIMEOUT_ERRSTAT_VALID   (1U)

validParams value used to get Window1 and window2 timeout error status

◆ PMIC_CFG_WD_TRIG_EARLY_ERRSTAT_VALID

#define PMIC_CFG_WD_TRIG_EARLY_ERRSTAT_VALID   (2U)

validParams value used to get Watchdog trigger mode error status

◆ PMIC_CFG_WD_ANSW_EARLY_ERRSTAT_VALID

#define PMIC_CFG_WD_ANSW_EARLY_ERRSTAT_VALID   (3U)

validParams value used to get Watchdog early answer error status

◆ PMIC_CFG_WD_SEQ_ERR_ERRSTAT_VALID

#define PMIC_CFG_WD_SEQ_ERR_ERRSTAT_VALID   (4U)

validParams value used to get Watchdog QA sequence error status

◆ PMIC_CFG_WD_ANSW_ERR_ERRSTAT_VALID

#define PMIC_CFG_WD_ANSW_ERR_ERRSTAT_VALID   (5U)

validParams value used to get Watchdog QA wrong Answer error status

◆ PMIC_CFG_WD_FAIL_INT_ERRSTAT_VALID

#define PMIC_CFG_WD_FAIL_INT_ERRSTAT_VALID   (6U)

validParams value used to get Watchdog fail error status

◆ PMIC_CFG_WD_RST_INT_ERRSTAT_VALID

#define PMIC_CFG_WD_RST_INT_ERRSTAT_VALID   (7U)

validParams value used to get Watchdog reset error status

◆ PMIC_CFG_WD_BAD_EVENT_STAT_VALID

#define PMIC_CFG_WD_BAD_EVENT_STAT_VALID   (0U)

validParams value used to get status of Bad Event is detected or not

◆ PMIC_CFG_WD_GOOD_EVENT_STAT_VALID

#define PMIC_CFG_WD_GOOD_EVENT_STAT_VALID   (1U)

validParams value used to get status of Good Event is detected or not

◆ PMIC_CFG_WD_FAIL_CNT_VAL_VALID

#define PMIC_CFG_WD_FAIL_CNT_VAL_VALID   (2U)

validParams value used to get To get Watchdog Fail Count value

◆ PMIC_CFG_WD_LONGWIN_TIMEOUT_ERRSTAT_VALID_SHIFT

#define PMIC_CFG_WD_LONGWIN_TIMEOUT_ERRSTAT_VALID_SHIFT   (1U << PMIC_CFG_WD_LONGWIN_TIMEOUT_ERRSTAT_VALID)

◆ PMIC_CFG_WD_TIMEOUT_ERRSTAT_VALID_SHIFT

#define PMIC_CFG_WD_TIMEOUT_ERRSTAT_VALID_SHIFT   (1U << PMIC_CFG_WD_TIMEOUT_ERRSTAT_VALID)

◆ PMIC_CFG_WD_TRIG_EARLY_ERRSTAT_VALID_SHIFT

#define PMIC_CFG_WD_TRIG_EARLY_ERRSTAT_VALID_SHIFT   (1U << PMIC_CFG_WD_TRIG_EARLY_ERRSTAT_VALID)

◆ PMIC_CFG_WD_ANSW_EARLY_ERRSTAT_VALID_SHIFT

#define PMIC_CFG_WD_ANSW_EARLY_ERRSTAT_VALID_SHIFT   (1U << PMIC_CFG_WD_ANSW_EARLY_ERRSTAT_VALID)

◆ PMIC_CFG_WD_SEQ_ERR_ERRSTAT_VALID_SHIFT

#define PMIC_CFG_WD_SEQ_ERR_ERRSTAT_VALID_SHIFT   (1U << PMIC_CFG_WD_SEQ_ERR_ERRSTAT_VALID)

◆ PMIC_CFG_WD_ANSW_ERR_ERRSTAT_VALID_SHIFT

#define PMIC_CFG_WD_ANSW_ERR_ERRSTAT_VALID_SHIFT   (1U << PMIC_CFG_WD_ANSW_ERR_ERRSTAT_VALID)

◆ PMIC_CFG_WD_FAIL_INT_ERRSTAT_VALID_SHIFT

#define PMIC_CFG_WD_FAIL_INT_ERRSTAT_VALID_SHIFT   (1U << PMIC_CFG_WD_FAIL_INT_ERRSTAT_VALID)

◆ PMIC_CFG_WD_RST_INT_ERRSTAT_VALID_SHIFT

#define PMIC_CFG_WD_RST_INT_ERRSTAT_VALID_SHIFT   (1U << PMIC_CFG_WD_RST_INT_ERRSTAT_VALID)

◆ PMIC_CFG_WD_BAD_EVENT_STAT_VALID_SHIFT

#define PMIC_CFG_WD_BAD_EVENT_STAT_VALID_SHIFT   (1U << PMIC_CFG_WD_BAD_EVENT_STAT_VALID)

◆ PMIC_CFG_WD_GOOD_EVENT_STAT_VALID_SHIFT

#define PMIC_CFG_WD_GOOD_EVENT_STAT_VALID_SHIFT   (1U << PMIC_CFG_WD_GOOD_EVENT_STAT_VALID)

◆ PMIC_CFG_WD_FAIL_CNT_VAL_VALID_SHIFT

#define PMIC_CFG_WD_FAIL_CNT_VAL_VALID_SHIFT   (1U << PMIC_CFG_WD_FAIL_CNT_VAL_VALID)

◆ PMIC_WD_QA_INFINITE_SEQ

#define PMIC_WD_QA_INFINITE_SEQ   (0xFFFFFFFFU)

Macro for PMIC Watchdog QA infinite sequence.

◆ PMIC_WDG_ERR_LONG_WIN_TIMEOUT

#define PMIC_WDG_ERR_LONG_WIN_TIMEOUT   (0x0U)

◆ PMIC_WDG_ERR_TIMEOUT

#define PMIC_WDG_ERR_TIMEOUT   (0x1U)

◆ PMIC_WDG_ERR_TRIGGER_EARLY

#define PMIC_WDG_ERR_TRIGGER_EARLY   (0x2U)

◆ PMIC_WDG_ERR_ANSWER_EARLY

#define PMIC_WDG_ERR_ANSWER_EARLY   (0x3U)

◆ PMIC_WDG_ERR_SEQ_ERR

#define PMIC_WDG_ERR_SEQ_ERR   (0x4U)

◆ PMIC_WDG_ERR_ANS_ERR

#define PMIC_WDG_ERR_ANS_ERR   (0x5U)

◆ PMIC_WDG_ERR_FAIL_INT

#define PMIC_WDG_ERR_FAIL_INT   (0x6U)

◆ PMIC_WDG_ERR_RST_INT

#define PMIC_WDG_ERR_RST_INT   (0x7U)

◆ PMIC_WDG_ERR_ALL

#define PMIC_WDG_ERR_ALL   (0x8U)

Function Documentation

◆ Pmic_wdgEnable()

int32_t Pmic_wdgEnable ( Pmic_CoreHandle_t pPmicCoreHandle)

API to Enable Watchdog timer.

Requirement: REQ_TAG(PDK-5839), REQ_TAG(PDK-5854) Design: did_pmic_wdg_cfg_readback

     This function is used to Enable the PMIC watchdog. User ensure
     that, this function needs to be called to enable watchdog timer
     before configuring or starting watchdog trigger or QA mode.
Parameters
pPmicCoreHandle[IN] PMIC Interface Handle
Returns
PMIC_ST_SUCCESS in case of success or appropriate error code For valid values Pmic_ErrorCodes

◆ Pmic_wdgDisable()

int32_t Pmic_wdgDisable ( Pmic_CoreHandle_t pPmicCoreHandle)

API to Disable Watchdog timer.

Requirement: REQ_TAG(PDK-5839), REQ_TAG(PDK-5854) Design: did_pmic_wdg_cfg_readback

     This function is used to Disable the PMIC watchdog. User ensure
     that, after using this function, complete watchdog functionality
     and configuration will be deactivated.
Parameters
pPmicCoreHandle[IN] PMIC Interface Handle
Returns
PMIC_ST_SUCCESS in case of success or appropriate error code For valid values Pmic_ErrorCodes

◆ Pmic_wdgSetCfg()

int32_t Pmic_wdgSetCfg ( Pmic_CoreHandle_t pPmicCoreHandle,
const Pmic_WdgCfg_t  wdgCfg 
)

API to set PMIC watchdog configurations.

Requirement: REQ_TAG(PDK-5839), REQ_TAG(PDK-5854), REQ_TAG(PDK-9115), REQ_TAG(PDK-9116) Design: did_pmic_wdg_cfg_readback

     This function is used to configure the watchdog parameters
     in the PMIC for trigger mode or Q&A(question and answer) mode,
     when corresponding validParam bit fields are set in
     Pmic_WdgCfg_t structure.
     User has to call Pmic_wdgEnable() before set the configuration.
Parameters
pPmicCoreHandle[IN] PMIC Interface Handle
wdgCfg[IN] Watchdog configuration
Returns
PMIC_ST_SUCCESS in case of success or appropriate error code For valid values Pmic_ErrorCodes

◆ Pmic_wdgGetCfg()

int32_t Pmic_wdgGetCfg ( Pmic_CoreHandle_t pPmicCoreHandle,
Pmic_WdgCfg_t pWdgCfg 
)

API to get PMIC watchdog configurations.

Requirement: REQ_TAG(PDK-5839), REQ_TAG(PDK-5854), REQ_TAG(PDK-9115), REQ_TAG(PDK-9116) Design: did_pmic_wdg_cfg_readback

     This function is used to get configuration of the watchdog
     from the PMIC for trigger mode or Q&A(question and answer) mode,
     when corresponding validParam bit fields are set in
     Pmic_WdgCfg_t structure.
     User has to call Pmic_wdgEnable() before get the configuration.
Parameters
pPmicCoreHandle[IN] PMIC Interface Handle
pWdgCfg[IN/OUT] Watchdog configuration pointer
Returns
PMIC_ST_SUCCESS in case of success or appropriate error code For valid values Pmic_ErrorCodes

◆ Pmic_wdgStartQaSequence()

int32_t Pmic_wdgStartQaSequence ( Pmic_CoreHandle_t pPmicCoreHandle,
uint32_t  num_of_sequences,
uint32_t  maxCnt 
)

API to Start watchdog QA mode.

Requirement: REQ_TAG(PDK-5839) Design: did_pmic_wdg_cfg_readback

     This function is used to start watchdog sequence and continues
     till the given num_of_sequences. User has to ensure, configure
     all Watchdog QA parameters properly using Pmic_wdgSetCfg() API,
     before starting QA sequence using this API.

     Note: To perform QA sequences, user has to adjust Long window
           time interval, Window1 time interval and Window2 time
           inervals depends on errors given by API. If user gets
           PMIC_ST_ERR_INV_WDG_WINDOW, then user has to increase the
           Long window or window1 time interval. If user gets
           PMIC_ST_ERR_WDG_EARLY_ANSWER, then user has to reduce
           the Window1 time inerval.
Parameters
pPmicCoreHandle[IN] PMIC Interface Handle
num_of_sequences[IN] number of QA sequences If PMIC_WD_QA_INFINITE_SEQ is used, then API runs for infinite sequence.
maxCnt[IN] Number of iterations to wait for an Good/Bad event. The value should be greater than or equal to PMIC_WDG_WAIT_CNT_MIN_VAL.
Returns
PMIC_ST_SUCCESS in case of success or appropriate error code For valid values Pmic_ErrorCodes

◆ Pmic_wdgGetErrorStatus()

int32_t Pmic_wdgGetErrorStatus ( Pmic_CoreHandle_t pPmicCoreHandle,
Pmic_WdgErrStatus_t pErrStatus 
)

API to get PMIC watchdog error status.

Requirement: REQ_TAG(PDK-5839), REQ_TAG(PDK-5854) Design: did_pmic_wdg_cfg_readback

     This function is used to get the watchdog error status from the
     PMIC for trigger mode or Q&A(question and answer) mode,
     when corresponding validParam bit fields are set in
     Pmic_WdgErrStatus_t structure.
     User has to call Pmic_wdgEnable() before getting the error status.
Parameters
pPmicCoreHandle[IN] PMIC Interface Handle
pErrStatus[IN/OUT] Watchdog error status pointer
Returns
PMIC_ST_SUCCESS in case of success or appropriate error code For valid values Pmic_ErrorCodes

◆ Pmic_wdgGetFailCntStat()

int32_t Pmic_wdgGetFailCntStat ( Pmic_CoreHandle_t pPmicCoreHandle,
Pmic_WdgFailCntStat_t pFailCount 
)

API to get PMIC watchdog fail count status.

Requirement: REQ_TAG(PDK-5839), REQ_TAG(PDK-5854) Design: did_pmic_wdg_cfg_readback

     This function is used to get the watchdog fail count status from the
     PMIC for trigger mode or Q&A(question and answer) mode.
     User has to call Pmic_wdgEnable() before getting the fail count.
Parameters
pPmicCoreHandle[IN] PMIC Interface Handle
pFailCount[IN/OUT] Watchdog fail count pointer
Returns
PMIC_ST_SUCCESS in case of success or appropriate error code For valid values Pmic_ErrorCodes

◆ Pmic_wdgStartTriggerSequence()

int32_t Pmic_wdgStartTriggerSequence ( Pmic_CoreHandle_t pPmicCoreHandle)

API to Start watchdog Trigger mode.

Requirement: REQ_TAG(PDK-5854) Design: did_pmic_wdg_cfg_readback

     This function is used to start watchdog trigger mode.
     User has to ensure, configure all Watchdog trigger parameters
     properly using Pmic_wdgSetCfg() API, before starting watchdog
     trigger mode using this API. User can use Pmic_wdgSetCfg() API
     to stop watchdog trigger mode.

     Note: To perform watchdog trigger mode, user has to
           adjust Long window time interval, Window1 time interval
           and Window2 time inervals as below, depends on the
           time-period of the trigger pulse provided by other
           device.
           1. Longwindow time interval must be greater than Trigger
              pulse time period.
           2. Window1 time interval must be less than T-off time of
              the Trigger pulse time period.
           3. Window2 time interval must be greater than T-on time
              of the Trigger pulse time period.
           4. (Window1 time interval + Window2 time interval)
              approximately equal to the Trigger pulse time period.
Parameters
pPmicCoreHandle[IN] PMIC Interface Handle
Returns
PMIC_ST_SUCCESS in case of success or appropriate error code For valid values Pmic_ErrorCodes

◆ Pmic_wdgClrErrStatus()

int32_t Pmic_wdgClrErrStatus ( Pmic_CoreHandle_t pPmicCoreHandle,
const uint8_t  wdgErrType 
)

API to clear PMIC watchdog error status.

Requirement: REQ_TAG(PDK-5839), REQ_TAG(PDK-5854) Design: did_pmic_wdg_cfg_readback

     This function is used to clear the watchdog error status from the
     PMIC for trigger mode or Q&A(question and answer) mode,
     Note: User has to clear the WDG Error status only when Error status
     bit is set for the corresponding wdgErrType
Parameters
pPmicCoreHandle[IN] PMIC Interface Handle
wdgErrType[IN] Watchdog error type to clear the status For Valid values: Pmic_WdgErrType
Returns
PMIC_ST_SUCCESS in case of success or appropriate error code For valid values Pmic_ErrorCodes

◆ Pmic_wdgQaSequenceWriteAnswer()

int32_t Pmic_wdgQaSequenceWriteAnswer ( Pmic_CoreHandle_t pPmicCoreHandle)

API to Write Answers in Long Window/ Window1/ Window2 Interval for watchdog QA Sequence.

Requirement: REQ_TAG(PDK-5839), REQ_TAG(PDK-9115), REQ_TAG(PDK-9116) Design: did_pmic_wdg_cfg_readback

     This function is used to write Answers in Long Window/ Window1/
     Window2 Interval for the WDG QA Sequence
     User has to ensure, configure all Watchdog QA parameters properly
     using Pmic_wdgSetCfg() API, before writing Answers using this API
     for the QA Sequence

     Note: To perform QA sequences, user has to adjust Long window
           time interval, Window1 time interval and Window2 time
           intervals If the Pmic_wdgQaWriteAnswer API returns
           PMIC_ST_ERR_INV_WDG_ANSWER error
           If the Pmic_wdgQaWriteAnswer API returns
           PMIC_ST_ERR_INV_WDG_ANSWER error user has
           to call Pmic_wdgGetErrorStatus API to read the WDG error.
           If the WDG error is Long Window Timeout or Timeout, user has
           to increase the Long window or window1 time interval
           accordingly
           If the WDG error is Answer early, user has to reduce the
           Window1 time interval
           For other WDG errors, user has to take action accordingly
Parameters
pPmicCoreHandle[IN] PMIC Interface Handle
Returns
PMIC_ST_SUCCESS in case of success or appropriate error code For valid values Pmic_ErrorCodes