PDK API Guide for J721E
pmic_power.h File Reference

Introduction

PMIC Power Resources Driver Interface file.

Go to the source code of this file.

Data Structures

struct  Pmic_PowerResourceCfg_t
 Pmic Power resources control and 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_PowerCommonCfg_t
 Power configuration The power control and config 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_PowerResourceStat_t
 PMIC power status. The PMIC power and thermal status structure. Note: validParams is input param for all Get APIs. other params except validParams is output param for Get APIs. More...
 
struct  Pmic_PowerThermalCfg_t
 PMIC Power Thermal 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_PowerThermalStat_t
 PMIC Power Thermal status structure Note: validParams is input param for all Get APIs. other params except validParams is output param for Get APIs. More...
 

Macros

PMIC Power Resources Config Structure Param Bits

PMIC Power Resources valid params configuration type for the structure member validParams of Pmic_PowerResourceCfg_t structure

#define PMIC_CFG_REGULATOR_VMON_RV_SEL_VALID   (0U)
 validParams value used to set/get to Enable/Disable residual voltage checking for regulator/VMON pin Valid only for VMON1/VMON2/BUCK/LDO More...
 
#define PMIC_CFG_REGULATOR_BUCK_PLDN_EN_VALID   (1U)
 validParams value used to set/get to Enable/Disable output pull-down resistor when BUCK is disabled. Valid only for BUCK regulator More...
 
#define PMIC_CFG_VMON_EN_VALID   (2U)
 validParams value used to set/get to Enable /Disable the Voltage monitor feature Valid only for VMON1/VMON2/VMON of BUCK/VMON of LDO/VMON of VCCA Power Resources More...
 
#define PMIC_CFG_REGULATOR_BUCK_VOUT_SEL_VALID   (3U)
 validParams value used to set/get to Select output voltage register for BUCK Valid only for BUCK regulator More...
 
#define PMIC_CFG_REGULATOR_BUCK_FPWM_VALID   (4U)
 validParams value used to set/get to Select PWM or Auto Mode for BUCK Valid only for BUCK regulator More...
 
#define PMIC_CFG_REGULATOR_BUCK_PWM_MP_VALID   (5U)
 validParams value used to set/get to Select between Multi phase with PWM OR AUTO mode with Automatic phase adding and shedding for BUCK Valid only for BUCK regulator More...
 
#define PMIC_CFG_REGULATOR_EN_VALID   (6U)
 validParams value used to set/get to Enable/Disable the power regulators Valid only for BUCK/LDO regulator More...
 
#define PMIC_CFG_REGULATOR_LDO_SLOW_RAMP_EN_VALID   (7U)
 validParams value used to set/get to Enable/Disable Slow Ramp for LDO Valid only for LDO regulator Valid only for TPS6594x Leo PMIC PG2.0 More...
 
#define PMIC_CFG_REGULATOR_LDO_BYPASS_MODE_EN_VALID   (8U)
 validParams value used to set/get to Select Bypass/Linear Regulator LDO mode Valid only for LDO regulator More...
 
#define PMIC_CFG_VCCA_PWR_GOOD_LVL_VALID   (9U)
 validParams value used to set/get Powergood level for VCCA pin Valid only for VCCA More...
 
#define PMIC_CFG_VMON_RANGE_VALID   (10U)
 validParams value used to set/get to Select OV/UV voltage monitoring range for VMON Valid only for VMON1/VMON2 More...
 
#define PMIC_CFG_REGULATOR_BUCK_ILIM_VALID   (12U)
 validParams value used to set/get Switch peak current limit for BUCK regulator Valid only for BUCK regulator More...
 
#define PMIC_CFG_REGULATOR_BUCK_VMON_SLEW_RATE_VALID   (13U)
 validParams value used to set/get Output voltage slew rate for BUCK/VMON Valid only for VMON1/VMON2/BUCK More...
 
#define PMIC_CFG_REGULATOR_LDO_PLDN_SEL_VALID   (14U)
 validParams value used to set/get to Selects the resistor value for output pull-down resistor for LDO regulator Valid only for LDO regulator More...
 
#define PMIC_CFG_REGULATOR_LDO_RV_TIMEOUT_SEL_VALID   (15U)
 validParams value used to set/get LDO residual voltage check timeout select Valid only for LDO regulator More...
 
#define PMIC_CFG_PWR_RESOURCE_PG_UV_THRESHOLD_LVL_VALID   (16U)
 validParams value used to set/get Power good low threshold level for the power resources Valid for all power resources More...
 
#define PMIC_CFG_PWR_RESOURCE_PG_OV_THRESHOLD_LVL_VALID   (17U)
 validParams value used to set/get Power good high threshold level for the power resources Valid for all power resources More...
 
#define PMIC_CFG_PWR_RESOURCE_RAIL_GRP_SEL_VALID   (18U)
 validParams value used to set/get Rail group selection for the power resources Valid for all power resources More...
 
#define PMIC_CFG_REGULATOR_VMON_VOLTAGE_SET_VALID   (19U)
 validParams value used to set/get Voltage level (For LDO/BUCK)/ Powergood voltage level(For VMON1/VMON2) in mv Valid only for VMON1/VMMON2/BUCK/LDO More...
 
PMIC Power Resources valid param bit shift values

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

#define PMIC_CFG_REGULATOR_VMON_RV_SEL_VALID_SHIFT   (1U << PMIC_CFG_REGULATOR_VMON_RV_SEL_VALID)
 
#define PMIC_CFG_REGULATOR_BUCK_PLDN_EN_VALID_SHIFT   (1U << PMIC_CFG_REGULATOR_BUCK_PLDN_EN_VALID)
 
#define PMIC_CFG_VMON_EN_VALID_SHIFT   (1U << PMIC_CFG_VMON_EN_VALID)
 
#define PMIC_CFG_REGULATOR_BUCK_VOUT_SEL_VALID_SHIFT   (1U << PMIC_CFG_REGULATOR_BUCK_VOUT_SEL_VALID)
 
#define PMIC_CFG_REGULATOR_BUCK_FPWM_VALID_SHIFT   (1U << PMIC_CFG_REGULATOR_BUCK_FPWM_VALID)
 
#define PMIC_CFG_REGULATOR_BUCK_PWM_MP_VALID_SHIFT   (1U << PMIC_CFG_REGULATOR_BUCK_PWM_MP_VALID)
 
#define PMIC_CFG_REGULATOR_EN_VALID_SHIFT   (1U << PMIC_CFG_REGULATOR_EN_VALID)
 
#define PMIC_CFG_REGULATOR_LDO_SLOW_RAMP_EN_VALID_SHIFT   (1U << PMIC_CFG_REGULATOR_LDO_SLOW_RAMP_EN_VALID)
 
#define PMIC_CFG_REGULATOR_LDO_BYPASS_MODE_EN_VALID_SHIFT   (1U << PMIC_CFG_REGULATOR_LDO_BYPASS_MODE_EN_VALID)
 
#define PMIC_CFG_VCCA_PWR_GOOD_LVL_VALID_SHIFT   (1U << PMIC_CFG_VCCA_PWR_GOOD_LVL_VALID)
 
#define PMIC_CFG_VMON_RANGE_VALID_SHIFT   (1U << PMIC_CFG_VMON_RANGE_VALID)
 
#define PMIC_CFG_REGULATOR_BUCK_ILIM_VALID_SHIFT   (1U << PMIC_CFG_REGULATOR_BUCK_ILIM_VALID)
 
#define PMIC_CFG_REGULATOR_BUCK_VMON_SLEW_RATE_VALID_SHIFT   (1U << PMIC_CFG_REGULATOR_BUCK_VMON_SLEW_RATE_VALID)
 
#define PMIC_CFG_REGULATOR_LDO_PLDN_SEL_VALID_SHIFT   (1U << PMIC_CFG_REGULATOR_LDO_PLDN_SEL_VALID)
 
#define PMIC_CFG_REGULATOR_LDO_RV_TIMEOUT_SEL_VALID_SHIFT   (1U << PMIC_CFG_REGULATOR_LDO_RV_TIMEOUT_SEL_VALID)
 
#define PMIC_CFG_PWR_RESOURCE_PG_UV_THRESHOLD_LVL_VALID_SHIFT   (1U << PMIC_CFG_PWR_RESOURCE_PG_UV_THRESHOLD_LVL_VALID)
 
#define PMIC_CFG_PWR_RESOURCE_PG_OV_THRESHOLD_LVL_VALID_SHIFT   (1U << PMIC_CFG_PWR_RESOURCE_PG_OV_THRESHOLD_LVL_VALID)
 
#define PMIC_CFG_PWR_RESOURCE_RAIL_GRP_SEL_VALID_SHIFT   (1U << PMIC_CFG_PWR_RESOURCE_RAIL_GRP_SEL_VALID)
 
#define PMIC_CFG_REGULATOR_VMON_VOLTAGE_SET_VALID_SHIFT   (1U << PMIC_CFG_REGULATOR_VMON_VOLTAGE_SET_VALID)
 
#define PMIC_POWER_REGULATOR_ILIM_STAT_VALID_SHIFT   (1U << PMIC_POWER_REGULATOR_ILIM_STAT_VALID)
 
#define PMIC_POWER_RESOURCE_UV_STAT_VALID_SHIFT   (1U << PMIC_POWER_RESOURCE_UV_STAT_VALID)
 
#define PMIC_POWER_RESOURCE_OV_STAT_VALID_SHIFT   (1U << PMIC_POWER_RESOURCE_OV_STAT_VALID)
 
#define PMIC_POWER_VCCA_OV_LVL_STAT_VALID_SHIFT   (1U << PMIC_POWER_VCCA_OV_LVL_STAT_VALID)
 
PMIC Pmic_PowerCommonCfg_s member configuration type.

#define PMIC_POWER_PGOOD_WINDOW_VALID   (0U)
 validParams value used to set/get to Select the type of voltage monitoring for PGOOD signal More...
 
#define PMIC_POWER_PGOOD_POL_VALID   (1U)
 validParams value used to set/get to Select the PGOOD signal polarity More...
 
#define PMIC_CFG_DEGLITCH_TIME_SEL_VALID   (2U)
 validParams value used to set/get Deglitch time select for all power resources Valid only for VMON1/VMON2/VCCA/VMON of LDO/VMON of BUCK power resources Valid only for TPS6594x Leo PMIC PG2.0 and LP8764x Hera PMIC PG1.0 and PG2.0 More...
 
#define PMIC_SEVERE_ERR_TRIG_VALID   (3U)
 validParams value used to set/get to Select the trigger selection for severe Error More...
 
#define PMIC_OTHER_RAIL_TRIG_VALID   (4U)
 validParams value used to set/get to Select the trigger selection for other rail group More...
 
#define PMIC_SOC_RAIL_TRIG_VALID   (5U)
 validParams value used to set/get to Select the trigger selection for soc rail group More...
 
#define PMIC_MCU_RAIL_TRIG_VALID   (6U)
 validParams value used to set/get to Select the trigger selection for mcu rail group More...
 
#define PMIC_MODERATE_ERR_TRIG_VALID   (7U)
 validParams value used to set/get Select the trigger selection for Moderate Error More...
 
PMIC valid params bit shift values

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

#define PMIC_POWER_PGOOD_WINDOW_VALID_SHIFT   (1U << PMIC_POWER_PGOOD_WINDOW_VALID)
 
#define PMIC_POWER_PGOOD_POL_VALID_SHIFT   (1U << PMIC_POWER_PGOOD_POL_VALID)
 
#define PMIC_CFG_DEGLITCH_TIME_SEL_VALID_SHIFT   (1U << PMIC_CFG_DEGLITCH_TIME_SEL_VALID)
 
#define PMIC_SEVERE_ERR_TRIG_VALID_SHIFT   (1U << PMIC_SEVERE_ERR_TRIG_VALID)
 
#define PMIC_OTHER_RAIL_TRIG_VALID_SHIFT   (1U << PMIC_OTHER_RAIL_TRIG_VALID)
 
#define PMIC_SOC_RAIL_TRIG_VALID_SHIFT   (1U << PMIC_SOC_RAIL_TRIG_VALID)
 
#define PMIC_MCU_RAIL_TRIG_VALID_SHIFT   (1U << PMIC_MCU_RAIL_TRIG_VALID)
 
#define PMIC_MODERATE_ERR_TRIG_VALID_SHIFT   (1U << PMIC_MODERATE_ERR_TRIG_VALID)
 
PMIC Power Status Config Structure Param Bits

PMIC Power Status valid params configuration type for the structure member validParams of Pmic_PowerResourceStat_t structure.

#define PMIC_POWER_REGULATOR_ILIM_STAT_VALID   (0U)
 validParams value used to get output current limit status for LDO and buck regulators More...
 
#define PMIC_POWER_RESOURCE_UV_STAT_VALID   (1U)
 validParams value used to get output under voltage status for LDO/ BUCK and input under voltage status for VCCA/VMON Valid for all power resources More...
 
#define PMIC_POWER_RESOURCE_OV_STAT_VALID   (2U)
 validParams value used to get output over voltage status for LDO/BUCK and input over voltage status for VCCA/VMON Valid for all power resources More...
 
#define PMIC_POWER_VCCA_OV_LVL_STAT_VALID   (3U)
 validParams value used to get voltage level status for VCCA Valid only for VCCA More...
 
PMIC Power Thermal threshold type

#define PMIC_THERMAL_WARN_VALID   (1U)
 validParams value used to set/get thermal Warning Threshold temperature value More...
 
#define PMIC_THERMAL_SHTDWN_VALID   (2U)
 validParams value used to set/get Thermal Shutdown Threshold temperature value valid only for TPS6594x Leo PMIC PG2.0 and LP8764x Hera PMIC PG1.0 and PG2.0 More...
 
PMIC Power Thermal threshold type structure Param Bits shift values

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

#define PMIC_THERMAL_WARN_VALID_SHIFT   (1U << PMIC_THERMAL_WARN_VALID)
 
#define PMIC_THERMAL_SHTDWN_VALID_SHIFT   (1U << PMIC_THERMAL_SHTDWN_VALID)
 
PMIC Power Thermal status type

#define PMIC_THERMAL_STAT_WARN_VALID   (1U)
 validParams value used to get Thermal warning status More...
 
#define PMIC_THERMAL_STAT_ORD_SHTDWN_VALID   (2U)
 validParams value used to get Orderly Shutdown status More...
 
#define PMIC_THERMAL_STAT_IMM_SHTDWN_VALID   (3U)
 validParams value used to get Immediate Shutdown status More...
 
PMIC Power Thermal status type structure Param Bits shift values

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

#define PMIC_THERMAL_STAT_WARN_VALID_SHIFT   (1U << PMIC_THERMAL_STAT_WARN_VALID)
 
#define PMIC_THERMAL_STAT_ORD_SHTDWN_VALID_SHIFT   (1U << PMIC_THERMAL_STAT_ORD_SHTDWN_VALID)
 
#define PMIC_THERMAL_STAT_IMM_SHTDWN_VALID_SHIFT   (1U << PMIC_THERMAL_STAT_IMM_SHTDWN_VALID)
 
PMIC Power Interrupt selection

#define PMIC_POWER_INTERRUPT_ENABLE   (0U)
 
#define PMIC_POWER_INTERRUPT_DISABLE   (1U)
 
Type of voltage monitoring for PGOOD signal:

#define PMIC_POWER_GOOD_UV_MONITOR_ENABLE   (0x0U)
 Only undervoltage is monitored. More...
 
#define PMIC_POWER_GOOD_UV_OV_MONITOR_ENABLE   (0x1U)
 Both undervoltage and overvoltage are monitored. More...
 
PGOOD signal polarity

#define PMIC_POWER_PGOOD_POL_HIGH   (0x0U)
 PGOOD signal is high when monitored inputs are valid. More...
 
#define PMIC_POWER_PGOOD_POL_LOW   (0x1U)
 PGOOD signal is low when monitored inputs are valid. More...
 
PMIC Power Trigger selection

#define PMIC_POWER_TRIG_IMM_SHUTDOWN   (0U)
 
#define PMIC_POWER_TRIG_ODERLY_SHUTDOWN   (1U)
 
#define PMIC_POWER_TRIG_MCU_PWR_ERR   (2U)
 
#define PMIC_POWER_TRIG_SOC_PWR_ERR   (3U)
 

Functions

int32_t Pmic_powerSetPwrResourceCfg (Pmic_CoreHandle_t *pPmicCoreHandle, const uint16_t pwrResource, const Pmic_PowerResourceCfg_t pwrResourceCfg)
 API to set power resources configurations. More...
 
int32_t Pmic_powerGetPwrResourceCfg (Pmic_CoreHandle_t *pPmicCoreHandle, const uint16_t pwrResource, Pmic_PowerResourceCfg_t *pPwrResourceCfg)
 API to get power resources configurations. More...
 
int32_t Pmic_powerSetCommonConfig (Pmic_CoreHandle_t *pPmicCoreHandle, const Pmic_PowerCommonCfg_t powerCommonCfg)
 API to Set Power configuration. More...
 
int32_t Pmic_powerGetCommonConfig (Pmic_CoreHandle_t *pPmicCoreHandle, Pmic_PowerCommonCfg_t *pPowerCommonCfg)
 API to Get Power configuration. More...
 
int32_t Pmic_powerSetConfigPowerGood (Pmic_CoreHandle_t *pPmicCoreHandle, const uint16_t pgoodSrcSel, const uint8_t pgoodSelType)
 API to Set Power good configuration. More...
 
int32_t Pmic_powerGetConfigPowerGood (Pmic_CoreHandle_t *pPmicCoreHandle, const uint16_t pgoodSrcSel, uint8_t *pPgoodSelType)
 Get Power good configuration. More...
 
int32_t Pmic_powerGetPwrRsrcStat (Pmic_CoreHandle_t *pPmicCoreHandle, const uint16_t pwrResource, Pmic_PowerResourceStat_t *pPwrRsrcStatCfg)
 API to get power resources status. More...
 
int32_t Pmic_powerGetPwrThermalStat (Pmic_CoreHandle_t *pPmicCoreHandle, Pmic_PowerThermalStat_t *pPwrThermalStatCfg)
 API to get PMIC die temperature thermal status. More...
 
int32_t Pmic_powerSetThermalConfig (Pmic_CoreHandle_t *pPmicCoreHandle, const Pmic_PowerThermalCfg_t thermalThreshold)
 API to configure the thermal temperature threshold level for PMIC. More...
 
int32_t Pmic_powerGetThermalConfig (Pmic_CoreHandle_t *pPmicCoreHandle, Pmic_PowerThermalCfg_t *pThermalThreshold)
 Get the PMIC thermal threshold value function. More...
 
int32_t Pmic_powerSetPwrRsrcIntr (Pmic_CoreHandle_t *pPmicCoreHandle, const uint16_t pwrResource, const uint8_t intrType, const bool intrEnable)
 API to enable/disable Power interrupt. More...
 
int32_t Pmic_powerSetIntr (Pmic_CoreHandle_t *pPmicCoreHandle, const uint8_t intrType, const bool intrEnable)
 API to enable/disable Power interrupt. More...