AM62Px MCU+ SDK  10.01.00
pmic.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2024 Texas Instruments Incorporated
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 
45 #ifndef PMIC_BOARD_H_
46 #define PMIC_BOARD_H_
47 
48 /* ========================================================================== */
49 /* Include Files */
50 /* ========================================================================== */
51 
52 #include <stdint.h>
53 #include <kernel/dpl/SystemP.h>
54 #include <board/pmic/pmic_lld/pmic.h>
55 
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59 
60 /* ========================================================================== */
61 /* Macros & Typedefs */
62 /* ========================================================================== */
63 
65 typedef void *PMIC_Handle;
66 
68 typedef struct PMIC_Config_s PMIC_Config;
69 
71 typedef struct PMIC_Params_s PMIC_Params;
72 
73 /* ========================================================================== */
74 /* Structure Declarations */
75 /* ========================================================================== */
76 
81 typedef struct PMIC_Config_s {
82  Pmic_CoreCfg_t *pmicConfigData;
84  Pmic_CoreHandle_t *pmicCoreHandle;
86  uint8_t wdogMode;
88  uint8_t trigWdogPin;
90  uint8_t trigWdogPinFunc;
92  uint8_t qaWdogpin1;
94  uint8_t qaWdogpin2;
96  uint8_t qaWdogpin1Func;
98  uint8_t qaWdogpin2Func;
100 } PMIC_Config;
101 
106 typedef struct PMIC_Params_s {
107  uint32_t mainDrvinstance;
114 } PMIC_Params;
115 
116 /* ========================================================================== */
117 /* Global Variables */
118 /* ========================================================================== */
119 
120 /* None */
121 
122 /* ========================================================================== */
123 /* Function Declarations */
124 /* ========================================================================== */
125 
129 void PMIC_init(void);
130 
134 void PMIC_deinit(void);
135 
154 PMIC_Handle PMIC_open(uint32_t instanceId, const PMIC_Params *params);
155 
164 PMIC_Handle PMIC_getHandle(uint32_t instanceId);
165 
171 void PMIC_close(PMIC_Handle handle);
172 
180 
189 
190 /* ========================================================================== */
191 /* Static Function Definitions */
192 /* ========================================================================== */
193 
194 /* None */
195 
196 /* ========================================================================== */
197 /* Internal/Private Structure Declarations */
198 /* ========================================================================== */
199 
200 /* None */
201 
202 #ifdef __cplusplus
203 }
204 #endif
205 
206 #endif /* #ifndef PMIC_BOARD_H_ */
207 
PMIC_Params
struct PMIC_Params_s PMIC_Params
Forward declaration of PMIC_Params.
Definition: pmic.h:71
PMIC_Config::qaWdogpin2
uint8_t qaWdogpin2
Definition: pmic.h:94
PMIC_critSecStartFn
void PMIC_critSecStartFn(void)
Initiates the start of a critical section for PMIC operations. This function attempts to acquire a se...
PMIC_init
void PMIC_init(void)
This function initializes the PMIC module.
PMIC_Config::qaWdogpin1Func
uint8_t qaWdogpin1Func
Definition: pmic.h:96
SystemP.h
PMIC_close
void PMIC_close(PMIC_Handle handle)
Close PMIC driver.
PMIC_critSecStopFn
void PMIC_critSecStopFn(void)
Concludes a critical section for PMIC operations. This function releases the semaphore,...
PMIC_Params
Parameters passed during PMIC_open()
Definition: pmic.h:106
PMIC_getHandle
PMIC_Handle PMIC_getHandle(uint32_t instanceId)
Get handle to PMIC driver.
PMIC_Config::pmicCoreHandle
Pmic_CoreHandle_t * pmicCoreHandle
Definition: pmic.h:84
PMIC_Config::pmicConfigData
Pmic_CoreCfg_t * pmicConfigData
Definition: pmic.h:82
PMIC_Params::qaWdogDrvinstance
uint32_t qaWdogDrvinstance
Definition: pmic.h:110
PMIC_Config::qaWdogpin1
uint8_t qaWdogpin1
Definition: pmic.h:92
PMIC_Params::mainDrvinstance
uint32_t mainDrvinstance
Definition: pmic.h:107
PMIC_deinit
void PMIC_deinit(void)
This function de-initializes the PMIC module.
PMIC_open
PMIC_Handle PMIC_open(uint32_t instanceId, const PMIC_Params *params)
Open PMIC driver.
PMIC_Config::trigWdogPinFunc
uint8_t trigWdogPinFunc
Definition: pmic.h:90
PMIC_Config
PMIC driver configuration, these are filled by SysCfg based on the device that is selected.
Definition: pmic.h:81
PMIC_Config
struct PMIC_Config_s PMIC_Config
Forward declaration of PMIC_Config.
Definition: pmic.h:68
PMIC_Config::qaWdogpin2Func
uint8_t qaWdogpin2Func
Definition: pmic.h:98
PMIC_Config::wdogMode
uint8_t wdogMode
Definition: pmic.h:86
PMIC_Config::trigWdogPin
uint8_t trigWdogPin
Definition: pmic.h:88
PMIC_Handle
void * PMIC_Handle
Handle to the PMIC driver returned by PMIC_open()
Definition: pmic.h:65