PDK API Guide for J721E
PMIC GPIO Driver API

Introduction

These are PMIC GPIO driver parameters and API

Sub Modules

 PMIC GPIO TPS65941 Leo Driver API
 

Files

file  pmic_gpio.h
 PMIC Low Level Driver API/interface file for GPIO API.
 

Data Structures

struct  Pmic_GpioCfg_t
 PMIC GPIO pin configuration structure. More...
 

Functions

int32_t Pmic_gpioSetConfiguration (Pmic_CoreHandle_t *pPmicCoreHandle, uint8_t pin, Pmic_GpioCfg_t *pGpioCfg)
 PMIC GPIO set configuration function This function is used to set the required configuration for the specified GPIO pin when corresponding bit field is set. More...
 
int32_t Pmic_gpioGetConfiguration (Pmic_CoreHandle_t *pPmicCoreHandle, uint8_t pin, Pmic_GpioCfg_t *pGpioCfg)
 PMIC GPIO get configuration function This function is used to read the configuration for the specified GPIO pin when corresponding bit field is set. More...
 
int32_t Pmic_gpioSetValue (Pmic_CoreHandle_t *pPmicCoreHandle, uint8_t pin, uint8_t pinValue)
 PMIC GPIO set value function This function is used to configure the signal level of the specified GPIO pin. More...
 
int32_t Pmic_gpioGetValue (Pmic_CoreHandle_t *pPmicCoreHandle, uint8_t pin, uint8_t *pPinValue)
 PMIC GPIO get value function This function is used to read the signal level of the gpio pin. More...
 
int32_t Pmic_gpioSetIntr (Pmic_CoreHandle_t *pPmicCoreHandle, uint8_t pin, uint8_t intrType, uint8_t maskPol)
 PMIC GPIO interrupt configuration function This function is used to enable GPIO pin Interrupts. More...
 

PMIC GPIO Pin Configuration Structure Param Bit shift values

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

#define PMIC_GPIO_CFG_DIR_VALID_SHIFT
 
#define PMIC_GPIO_CFG_OD_VALID_SHIFT
 
#define PMIC_GPIO_CFG_PULL_VALID_SHIFT
 
#define PMIC_GPIO_CFG_DEGLITCH_VALID_SHIFT
 
#define PMIC_GPIO_CFG_PINFUNC_VALID_SHIFT
 

PMIC GPIO Deglitch Time Enable or Disable Configuration

#define PMIC_GPIO_DEGLITCH_DISABLE   (0U)
 
#define PMIC_GPIO_DEGLITCH_ENABLE   (1U)
 

PMIC GPIO signal direction

#define PMIC_GPIO_INPUT   (0U)
 
#define PMIC_GPIO_OUTPUT   (1U)
 

PMIC GPIO signal type when configured as output

#define PMIC_GPIO_PUSH_PULL_OUTPUT   (0U)
 
#define PMIC_GPIO_OPEN_DRAIN_OUTPUT   (1U)
 

PMIC GPIO signal level

#define PMIC_GPIO_LOW   (0U)
 
#define PMIC_GPIO_HIGH   (1U)
 

PMIC GPIO Pull-up/pull-down select

#define PMIC_GPIO_PD_SELECT   (0U)
 
#define PMIC_GPIO_PU_SELECT   (1U)
 

PMIC GPIO Pull-up/pull-down enable/disable

#define PMIC_GPIO_PU_PD_DISABLE   (0U)
 
#define PMIC_GPIO_PU_PD_ENABLE   (1U)
 

PMIC Pmic_GpioCfg_s member configuration type

#define PMIC_GPIO_CFG_DIR_VALID   (0x00U)
 
#define PMIC_GPIO_CFG_OD_VALID   (0x01U)
 
#define PMIC_GPIO_CFG_PULL_VALID   (0x02U)
 
#define PMIC_GPIO_CFG_DEGLITCH_VALID   (0x03U)
 
#define PMIC_GPIO_CFG_PINFUNC_VALID   (0x04U)
 

PMIC GPIO pull up/pull down selectionn

#define PMIC_GPIO_PULL_DISABLED   (0x0U)
 
#define PMIC_GPIO_PULL_DOWN   (0x1U)
 
#define PMIC_GPIO_PULL_UP   (0x2U)
 

PMIC GPIO Interrupt selection

#define PMIC_GPIO_FALL_INTERRUPT   (0U)
 
#define PMIC_GPIO_RISE_INTERRUPT   (1U)
 
#define PMIC_GPIO_DISABLE_INTERRUPT   (2U)
 

PMIC GPIO Interrupt Polarity selection

#define PMIC_GPIO_POL_LOW   (0U)
 
#define PMIC_GPIO_POL_HIGH   (1U)
 

PMIC GPIO Interrupt Mask selection

#define PMIC_GPIO_INT_ENABLE   (0U)
 
#define PMIC_GPIO_INT_MASK   (1U)
 

Macro Definition Documentation

#define PMIC_GPIO_CFG_DIR_VALID_SHIFT
Value:
(0x01U << \
#define PMIC_GPIO_CFG_DIR_VALID
Definition: pmic_gpio.h:151
#define PMIC_GPIO_CFG_OD_VALID_SHIFT
Value:
(0x01U << \
#define PMIC_GPIO_CFG_OD_VALID
Definition: pmic_gpio.h:152
#define PMIC_GPIO_CFG_PULL_VALID_SHIFT
Value:
(0x01U << \
#define PMIC_GPIO_CFG_PULL_VALID
Definition: pmic_gpio.h:153
#define PMIC_GPIO_CFG_DEGLITCH_VALID_SHIFT
Value:
(0x01U << \
#define PMIC_GPIO_CFG_DEGLITCH_VALID
Definition: pmic_gpio.h:154
#define PMIC_GPIO_CFG_PINFUNC_VALID_SHIFT
Value:
(0x01U << \
#define PMIC_GPIO_CFG_PINFUNC_VALID
Definition: pmic_gpio.h:155
#define PMIC_GPIO_DEGLITCH_DISABLE   (0U)
#define PMIC_GPIO_DEGLITCH_ENABLE   (1U)
#define PMIC_GPIO_INPUT   (0U)
#define PMIC_GPIO_OUTPUT   (1U)
#define PMIC_GPIO_PUSH_PULL_OUTPUT   (0U)
#define PMIC_GPIO_OPEN_DRAIN_OUTPUT   (1U)
#define PMIC_GPIO_LOW   (0U)
#define PMIC_GPIO_HIGH   (1U)
#define PMIC_GPIO_PD_SELECT   (0U)
#define PMIC_GPIO_PU_SELECT   (1U)
#define PMIC_GPIO_PU_PD_DISABLE   (0U)
#define PMIC_GPIO_PU_PD_ENABLE   (1U)
#define PMIC_GPIO_CFG_DIR_VALID   (0x00U)
#define PMIC_GPIO_CFG_OD_VALID   (0x01U)
#define PMIC_GPIO_CFG_PULL_VALID   (0x02U)
#define PMIC_GPIO_CFG_DEGLITCH_VALID   (0x03U)
#define PMIC_GPIO_CFG_PINFUNC_VALID   (0x04U)
#define PMIC_GPIO_PULL_DISABLED   (0x0U)
#define PMIC_GPIO_PULL_DOWN   (0x1U)
#define PMIC_GPIO_PULL_UP   (0x2U)
#define PMIC_GPIO_FALL_INTERRUPT   (0U)
#define PMIC_GPIO_RISE_INTERRUPT   (1U)
#define PMIC_GPIO_DISABLE_INTERRUPT   (2U)
#define PMIC_GPIO_POL_LOW   (0U)
#define PMIC_GPIO_POL_HIGH   (1U)
#define PMIC_GPIO_INT_ENABLE   (0U)
#define PMIC_GPIO_INT_MASK   (1U)

Function Documentation

int32_t Pmic_gpioSetConfiguration ( Pmic_CoreHandle_t pPmicCoreHandle,
uint8_t  pin,
Pmic_GpioCfg_t pGpioCfg 
)

PMIC GPIO set configuration function This function is used to set the required configuration for the specified GPIO pin when corresponding bit field is set.

Parameters
pPmicCoreHandle[IN] PMIC Interface Handle
pin[IN] PMIC GPIO pin number Valid values Pmic_GpioPin
pGpioCfg[IN] pointer to set required configuration for the specified GPIO pin
Returns
PMIC_ST_SUCCESS in case of success or appropriate error code For valid values Pmic_ErrorCodes
int32_t Pmic_gpioGetConfiguration ( Pmic_CoreHandle_t pPmicCoreHandle,
uint8_t  pin,
Pmic_GpioCfg_t pGpioCfg 
)

PMIC GPIO get configuration function This function is used to read the configuration for the specified GPIO pin when corresponding bit field is set.

Parameters
pPmicCoreHandle[IN] PMIC Interface Handle
pin[IN] PMIC GPIO pin number Valid values Pmic_GpioPin
pGpioCfg[OUT] Pointer to store specified GPIO pin configuration
Returns
PMIC_ST_SUCCESS in case of success or appropriate error code For valid values Pmic_ErrorCodes
int32_t Pmic_gpioSetValue ( Pmic_CoreHandle_t pPmicCoreHandle,
uint8_t  pin,
uint8_t  pinValue 
)

PMIC GPIO set value function This function is used to configure the signal level of the specified GPIO pin.

Parameters
pPmicCoreHandle[IN] PMIC Interface Handle
pin[IN] PMIC GPIO pin number Valid values Pmic_GpioPin
pinValue[IN] PMIC GPIO signal level High/Low to be configured Valid values Pmic_Gpio_SignalLvl
Returns
PMIC_ST_SUCCESS in case of success or appropriate error code For valid values Pmic_ErrorCodes
int32_t Pmic_gpioGetValue ( Pmic_CoreHandle_t pPmicCoreHandle,
uint8_t  pin,
uint8_t *  pPinValue 
)

PMIC GPIO get value function This function is used to read the signal level of the gpio pin.

Parameters
pPmicCoreHandle[IN] PMIC Interface Handle
pin[IN] PMIC GPIO pin number Valid values Pmic_GpioPin
pPinValue[OUT] To store PMIC GPIO signal level High/Low Valid values Pmic_Gpio_SignalLvl
Returns
PMIC_ST_SUCCESS in case of success or appropriate error code For valid values Pmic_ErrorCodes
int32_t Pmic_gpioSetIntr ( Pmic_CoreHandle_t pPmicCoreHandle,
uint8_t  pin,
uint8_t  intrType,
uint8_t  maskPol 
)

PMIC GPIO interrupt configuration function This function is used to enable GPIO pin Interrupts.

Parameters
pPmicCoreHandle[IN] PMIC Interface Handle
pin[IN] PMIC GPIO number Valid values Pmic_GpioPin
intrType[IN] Interrupt type Pmic_GpioInterruptCfg
maskPol[IN] FSM trigger masking polarity select for GPIO Valid values refer Pmic_GpioInterruptPolCfg
Returns
PMIC_ST_SUCCESS in case of success or appropriate error code For valid values Pmic_ErrorCodes