AM261x MCU+ SDK: PMIC

| AM261x MCU+ SDK 26.00.00 |

PMIC

The PMIC driver provides API to control I2C/SPI based PMIC present in the board. It supports configuration of various features/modules in the PMIC. I2C/MCSPI controller is used to read/write to the PMIC registers. Refer to the corresponding PMIC datasheet for more details.

# Features Supported

- Support enable/disable watchdog
- Watchdog in Trigger and Q&A mode with interrupt/reset support upon failure
- GPIO configuration
- Thermal monitoring
- Voltage monitoring
- IRQ
- ESM

# SysConfig Features

Note
  It is strongly recommend to use SysConfig where it is available instead of using direct SW API calls. This will help simplify the SW application and also catch common mistakes early in the development cycle.

- Option to select the PMIC
- Supported PMIC's
  - TPS65386xx (Blackbird)
  - TPS65036xx (Derby)

# Features NOT Supported

- NA

# Important Usage Guidelines

- Power cycle the board to restore the PMIC register configurations.

# Example Usage

Include the below file to access the APIs

#include <board/pmic.h>

Instance Open Blackbird PMIC Example

PMIC_Params gPmicParams[CONFIG_PMIC_NUM_INSTANCES] =
{
{
.deviceType = PMIC_DEV_BB_TPS65386X,
.commMode = PMIC_INTF_SPI,
.instType = PMIC_MAIN_INST,
.instance = CONFIG_MCSPI0,
},
};
PMIC_Handle[CONFIG_PMIC0] = PMIC_open(CONFIG_PMIC0, &gPmicParams[CONFIG_PMIC0]);
/*gPmicHandle[CONFIG_PMIC0] return from PMIC_open*/
PMIC_configure(gPmicHandle[CONFIG_PMIC0]);

Instance Open Derby PMIC Example

PMIC_Params gPmicParams[CONFIG_PMIC_NUM_INSTANCES] =
{
{
.i2cAddr = 0x60,
.instance = CONFIG_MCSPI0,
},
};
PMIC_Handle[CONFIG_PMIC0] = PMIC_open(CONFIG_PMIC0, &gPmicParams[CONFIG_PMIC0]);
/*gPmicHandle[CONFIG_PMIC0] return from PMIC_open*/
PMIC_configure(gPmicHandle[CONFIG_PMIC0]);

Instance Close Example

PMIC_close(gPmicHandle[CONFIG_PMIC0]);

# API

APIs for I2C/MCSPI based PMIC driver

PMIC_close
void PMIC_close(PMIC_Handle handle)
Close PMIC driver.
pmic.h
PMIC_open
PMIC_Handle PMIC_open(uint32_t instanceId, const PMIC_Params *params)
Open PMIC driver.
PMIC_configure
int32_t PMIC_configure(PMIC_Handle handle)
Configure PMIC driver.
PMIC_Handle
void * PMIC_Handle
Handle to the PMIC driver returned by PMIC_open()
Definition: pmic.h:73