PDK API Guide for J721E
pmic_irq.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright (c) 2020 Texas Instruments Incorporated - http://www.ti.com
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * distribution.
15  *
16  * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  *
32  *****************************************************************************/
33 
56 #ifndef PMIC_IRQ_H_
57 #define PMIC_IRQ_H_
58 
59 /* ==========================================================================*/
60 /* Include Files */
61 /* ==========================================================================*/
62 #include <pmic_core.h>
65 
66 #ifdef __cplusplus
67 extern "C" {
68 #endif
69 /* ========================================================================== */
70 /* Macros & Typedefs */
71 /* ========================================================================== */
78 #define PMIC_IRQ_GPIO_ALL_INT_MASK_NUM (12U)
79 /* @} */
80 
87 #define PMIC_IRQ_ALL (0xFFU)
88 /* @} */
89 
96 #define PMIC_IRQ_CLEAR_NONE (0U)
97 #define PMIC_IRQ_CLEAR (1U)
98 /* @} */
99 
106 #define PMIC_IRQ_UNMASK (bool)false
107 #define PMIC_IRQ_MASK (bool)true
108 /* @} */
109 
116 #define PMIC_IRQ_GPIO_FALL_INT_TYPE (0x0U)
117 #define PMIC_IRQ_GPIO_RISE_INT_TYPE (0x1U)
118 #define PMIC_IRQ_GPIO_RISE_FALL_INT_TYPE (0x2U)
119 /* @} */
120 
121 /*==========================================================================*/
122 /* Structures and Enums */
123 /*==========================================================================*/
130 typedef struct Pmic_IrqStatus_s
131 {
132  uint32_t intStatus[4];
134 
135 /*==========================================================================*/
136 /* Function Declarations */
137 /*==========================================================================*/
172 int32_t Pmic_irqGetErrStatus(Pmic_CoreHandle_t *pPmicCoreHandle,
173  Pmic_IrqStatus_t *pErrStat,
174  const bool clearIRQ);
175 
203 int32_t Pmic_irqClrErrStatus(Pmic_CoreHandle_t *pPmicCoreHandle,
204  const uint8_t irqNum);
205 
232 int32_t Pmic_irqMaskIntr(Pmic_CoreHandle_t *pPmicCoreHandle,
233  const uint8_t irqNum,
234  const bool mask);
235 
258 int32_t Pmic_getNextErrorStatus(const Pmic_CoreHandle_t *pPmicCoreHandle,
259  Pmic_IrqStatus_t *pErrStat,
260  uint8_t *pIrqNum);
261 
289 int32_t Pmic_irqGpioMaskIntr(Pmic_CoreHandle_t *pPmicCoreHandle,
290  const uint8_t irqGpioNum,
291  const bool mask,
292  const uint8_t gpioIntrType);
293 
321 int32_t Pmic_irqGetMaskIntrStatus(Pmic_CoreHandle_t *pPmicCoreHandle,
322  const uint8_t irqNum,
323  bool *pMaskStatus);
324 
362 int32_t Pmic_irqGetGpioMaskIntr(Pmic_CoreHandle_t *pPmicCoreHandle,
363  const uint8_t irqGpioNum,
364  const uint8_t gpioIntrType,
365  bool *pRiseIntrMaskStat,
366  bool *pFallIntrMaskStat);
367 
368 #ifdef __cplusplus
369 }
370 
371 #endif /* __cplusplus */
372 
373 #endif /* PMIC_IRQ_H_ */
374 
375 /* @} */
TPS6594x LEO PMIC IRQ Driver API/interface file.
int32_t Pmic_irqGetMaskIntrStatus(Pmic_CoreHandle_t *pPmicCoreHandle, const uint8_t irqNum, bool *pMaskStatus)
API to read the status of PMIC interrupts is masked or not.
int32_t Pmic_getNextErrorStatus(const Pmic_CoreHandle_t *pPmicCoreHandle, Pmic_IrqStatus_t *pErrStat, uint8_t *pIrqNum)
API to extract each Error status.
int32_t Pmic_irqGpioMaskIntr(Pmic_CoreHandle_t *pPmicCoreHandle, const uint8_t irqGpioNum, const bool mask, const uint8_t gpioIntrType)
API to mask/unmask GPIO interrupts.
int32_t Pmic_irqGetGpioMaskIntr(Pmic_CoreHandle_t *pPmicCoreHandle, const uint8_t irqGpioNum, const uint8_t gpioIntrType, bool *pRiseIntrMaskStat, bool *pFallIntrMaskStat)
API to read the status of PMIC GPIO interrupts is masked or not.
LP8764x Hera PMIC IRQ Driver API/interface file.
PMIC Interface Handle. Contains various PMIC driver instance specific information....
Definition: pmic_types.h:148
PMIC Driver Common API/interface file.
int32_t Pmic_irqGetErrStatus(Pmic_CoreHandle_t *pPmicCoreHandle, Pmic_IrqStatus_t *pErrStat, const bool clearIRQ)
API to read Error status.
int32_t Pmic_irqMaskIntr(Pmic_CoreHandle_t *pPmicCoreHandle, const uint8_t irqNum, const bool mask)
API to mask/unmask interrupts.
PMIC Interrupt status object structure.
Definition: pmic_irq.h:130
int32_t Pmic_irqClrErrStatus(Pmic_CoreHandle_t *pPmicCoreHandle, const uint8_t irqNum)
API to clear Error status.