PDK API Guide for J721E
pmic_types.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 
46 #ifndef PMIC_TYPES_H_
47 #define PMIC_TYPES_H_
48 
49 /* ========================================================================= */
50 /* Include Files */
51 /* ========================================================================= */
52 #include <stdint.h>
53 #include <stdlib.h>
54 #include <stdbool.h>
55 
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59 /* ========================================================================= */
60 /* Macros & Typedefs */
61 /* ========================================================================= */
62 
69 #define PMIC_CRC_DISABLE (0U)
70 #define PMIC_CRC_ENABLE (1U)
71 /* @} */
72 
73 
74 /*==========================================================================*/
75 /* Structures and Enums */
76 /*==========================================================================*/
87 typedef struct Pmic_DevSubSysInfo_s
88 {
89  bool gpioEnable;
90  bool rtcEnable;
91  bool wdgEnable;
92  bool buckEnable;
93  bool ldoEnable;
94  bool esmEnable;
96 
148 typedef struct Pmic_CoreHandle_s {
150  uint32_t drvInitStatus;
151  uint8_t pmicDeviceType;
152  uint8_t pmicDevRev;
154  uint8_t commMode;
155  uint8_t slaveAddr;
156  uint8_t qaSlaveAddr;
157  uint8_t nvmSlaveAddr;
158  uint8_t i2c1Speed;
159  uint8_t i2c2Speed;
160  bool crcEnable;
161  void *pCommHandle;
163  int32_t (*pFnPmicCommIoRead)(struct Pmic_CoreHandle_s *pmicCorehandle,
164  uint8_t instType,
165  uint16_t regAddr,
166  uint8_t *pRxBuf,
167  uint8_t bufLen);
168  int32_t (*pFnPmicCommIoWrite)(struct Pmic_CoreHandle_s *pmicCorehandle,
169  uint8_t instType,
170  uint16_t regAddr,
171  uint8_t *pTxBuf,
172  uint8_t bufLen);
173  void (*pFnPmicCritSecStart)(void);
174  void (*pFnPmicCritSecStop)(void);
176 
177 /*==========================================================================*/
178 /* Function Declarations */
179 /*==========================================================================*/
180 
181 #ifdef __cplusplus
182 }
183 
184 #endif /* __cplusplus */
185 
186 #endif /* PMIC_TYPES_H_ */
187 
188 /* @} */
PMIC Subsystems.
Definition: pmic_types.h:87
bool rtcEnable
Definition: pmic_types.h:90
uint8_t nvmSlaveAddr
Definition: pmic_types.h:157
uint8_t commMode
Definition: pmic_types.h:154
uint8_t slaveAddr
Definition: pmic_types.h:155
const Pmic_DevSubSysInfo_t * pPmic_SubSysInfo
Definition: pmic_types.h:149
uint8_t qaSlaveAddr
Definition: pmic_types.h:156
uint8_t i2c2Speed
Definition: pmic_types.h:159
void * pQACommHandle
Definition: pmic_types.h:162
bool esmEnable
Definition: pmic_types.h:94
uint8_t pmicDevRev
Definition: pmic_types.h:152
uint32_t drvInitStatus
Definition: pmic_types.h:150
PMIC Interface Handle. Contains various PMIC driver instance specific information....
Definition: pmic_types.h:148
bool wdgEnable
Definition: pmic_types.h:91
void * pCommHandle
Definition: pmic_types.h:161
uint8_t pmicDevSiliconRev
Definition: pmic_types.h:153
bool gpioEnable
Definition: pmic_types.h:89
bool crcEnable
Definition: pmic_types.h:160
bool buckEnable
Definition: pmic_types.h:92
bool ldoEnable
Definition: pmic_types.h:93
uint8_t i2c1Speed
Definition: pmic_types.h:158
uint8_t pmicDeviceType
Definition: pmic_types.h:151