AM62Px MCU+ SDK  10.01.00
panel.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 
44 #ifndef PANEL_H_
45 #define PANEL_H_
46 
47 /* ========================================================================== */
48 /* Include Files */
49 /* ========================================================================== */
50 
51 #include <stdint.h>
52 #include <kernel/dpl/SystemP.h>
53 #include <drivers/hw_include/soc_config.h>
54 #include <kernel/dpl/SemaphoreP.h>
56 
57 #ifdef __cplusplus
58 extern "C"
59 {
60 #endif
61 
62 /* ========================================================================== */
63 /* Macros & Typedefs */
64 /* ========================================================================== */
65 
66 #define PANEL_INVALID_VALUE (0xFFFFFFFFU)
67 
72 #define CONFIG_PANEL_TYPE_I2C (0x00U)
73 #define CONFIG_PANEL_TYPE_DSI (0x01U)
74 #define CONFIG_PANEL_TYPE_INVALID (0xFFU)
75 
80 #define PANEL_MAX_NUM_PINS_CTRL (0xAU)
81 
85 typedef void *Panel_Handle;
86 
90 typedef struct Panel_Config_s Panel_Config;
91 
95 typedef struct Panel_Params_s Panel_Params;
96 
114 typedef int32_t (*Panel_OpenFxn)(Panel_Config *config, Panel_Params *params);
115 
128 typedef void (*Panel_CloseFxn)(Panel_Config *config, Panel_Params *params);
129 
143 typedef int32_t (*Panel_ControlFxn)(Panel_Config *config, Panel_Params *params,
144  uint32_t cmd, void *cmdArgs);
145 
158 typedef int32_t (*Panel_ResetFxn)(Panel_Config *config, Panel_Params *params);
159 
162 /* ========================================================================== */
163 /* Structure Declarations */
164 /* ========================================================================== */
165 
169 typedef struct
170 {
171  uint32_t deviceI2cInstId;
173  uint32_t deviceI2cAddr;
175  uint32_t inpClk;
179  uint32_t clkEdge;
183  uint32_t outputFormat;
185 
189 typedef struct
190 {
191  uint32_t standard;
193  uint32_t videoIfMode;
197  uint32_t videoIfWidth;
207  uint32_t videoDataFormat;
218 
222 typedef struct
223 {
224  uint32_t pinIoNum;
226  uint32_t pinType;
228  uint32_t pinVal;
231 
235 typedef struct
236 {
239  uint32_t pinCtrlI2cAddr;
241  uint32_t numPins;
247 } Panel_PinCtrl;
248 
252 typedef struct Panel_Params_s
253 {
256 } Panel_Params;
257 
261 typedef struct
262 {
271 } Panel_Fxns;
272 
277 typedef struct Panel_Config_s
278 {
279  uint32_t panelType;
283  void *object;
285  void *inputParams;
292 } Panel_Config;
293 
294 /* ========================================================================== */
295 /* Function Declarations */
296 /* ========================================================================== */
297 
312 Panel_Handle Panel_open(uint32_t instanceId, Panel_Params *params);
313 
320 
329 Panel_Handle Panel_getHandle(uint32_t instanceId);
330 
342 int32_t Panel_control(Panel_Handle handle, uint32_t cmd, void *cmdArgs);
343 
351 int32_t Panel_reset(Panel_Handle handle);
352 
361 uint32_t Panel_getPanelInterfaceIndex(uint32_t panelType);
362 
366 void Panel_init(void);
367 
371 void Panel_deinit(void);
372 
376 #ifdef __cplusplus
377 }
378 #endif
379 
380 #endif /* PANEL_H_ */
Panel_Config
struct Panel_Config_s Panel_Config
Forward declaration of Panel_Config.
Definition: panel.h:90
ioexp_tca6424.h
Panel_BridgeParams::deviceI2cInstId
uint32_t deviceI2cInstId
Definition: panel.h:171
Panel_CloseFxn
void(* Panel_CloseFxn)(Panel_Config *config, Panel_Params *params)
Driver implementation to close a specific panel driver.
Definition: panel.h:128
Panel_Params::vidOutParams
Panel_vidOutputParams vidOutParams
Definition: panel.h:255
Panel_control
int32_t Panel_control(Panel_Handle handle, uint32_t cmd, void *cmdArgs)
Control Panel operation using panel specific commands.
Panel_PinCtrl::pinCtrlI2cInstance
uint32_t pinCtrlI2cInstance
Definition: panel.h:237
SystemP.h
Panel_PinConfig::pinType
uint32_t pinType
Definition: panel.h:226
Panel_Config::object
void * object
Definition: panel.h:283
Panel_BridgeParams
Bridge configuration parameters.
Definition: panel.h:170
Panel_reset
int32_t Panel_reset(Panel_Handle handle)
Do a reset of the panel.
Panel_Fxns::closeFxn
Panel_CloseFxn closeFxn
Definition: panel.h:265
Panel_vidOutputParams::videoIfMode
uint32_t videoIfMode
Definition: panel.h:193
Panel_vidOutputParams::videoDataFormat
uint32_t videoDataFormat
Definition: panel.h:207
Panel_open
Panel_Handle Panel_open(uint32_t instanceId, Panel_Params *params)
Open panel driver.
Panel_PinCtrl::ioExpConfig
TCA6424_Config ioExpConfig
Definition: panel.h:245
Panel_init
void Panel_init(void)
This function initializes the Panel module.
PANEL_MAX_NUM_PINS_CTRL
#define PANEL_MAX_NUM_PINS_CTRL
Max number pins configured for panel pin control.
Definition: panel.h:80
SemaphoreP.h
Panel_BridgeParams::outputFormat
uint32_t outputFormat
Definition: panel.h:183
Panel_vidOutputParams
Configuration paramters for bridge encoder.
Definition: panel.h:190
Panel_BridgeParams::deviceI2cAddr
uint32_t deviceI2cAddr
Definition: panel.h:173
Panel_PinCtrl::numPins
uint32_t numPins
Definition: panel.h:241
Panel_PinConfig::pinVal
uint32_t pinVal
Definition: panel.h:228
Panel_Config::pinConfig
Panel_PinCtrl * pinConfig
Definition: panel.h:287
Panel_PinCtrl::pinCtrlI2cAddr
uint32_t pinCtrlI2cAddr
Definition: panel.h:239
Panel_vidOutputParams::standard
uint32_t standard
Definition: panel.h:191
Panel_deinit
void Panel_deinit(void)
This function de-initializes the Panel module.
Panel_Config::panelType
uint32_t panelType
Definition: panel.h:279
Panel_Config::inputParams
void * inputParams
Definition: panel.h:285
Panel_Params
struct Panel_Params_s Panel_Params
Forward declaration of Panel_Params.
Definition: panel.h:95
Panel_OpenFxn
int32_t(* Panel_OpenFxn)(Panel_Config *config, Panel_Params *params)
Driver implementation to open a specific panel driver.
Definition: panel.h:114
Panel_BridgeParams::hotPlugGpioIntrLine
uint32_t hotPlugGpioIntrLine
Definition: panel.h:177
Panel_Fxns
Driver implementation callbacks.
Definition: panel.h:262
Panel_getHandle
Panel_Handle Panel_getHandle(uint32_t instanceId)
Get handle to panel driver.
Panel_Params::bridgeParams
Panel_BridgeParams bridgeParams
Definition: panel.h:254
Panel_ResetFxn
int32_t(* Panel_ResetFxn)(Panel_Config *config, Panel_Params *params)
Driver implementation to soft reset the panel.
Definition: panel.h:158
Panel_vidOutputParams::videoIfWidth
uint32_t videoIfWidth
Definition: panel.h:197
Panel_BridgeParams::clkEdge
uint32_t clkEdge
Definition: panel.h:179
Panel_BridgeParams::inpClk
uint32_t inpClk
Definition: panel.h:175
Panel_getPanelInterfaceIndex
uint32_t Panel_getPanelInterfaceIndex(uint32_t panelType)
Return panel index based on type of panel.
Panel_Fxns::controlFxn
Panel_ControlFxn controlFxn
Definition: panel.h:267
Panel_Params
Parameters passed during Panel_open()
Definition: panel.h:253
Panel_close
void Panel_close(Panel_Handle handle)
Close panel driver.
Panel_PinCtrl
Configuration paramters for panel pin control.
Definition: panel.h:236
Panel_Config::fxns
Panel_Fxns * fxns
Definition: panel.h:281
SemaphoreP_Object
Opaque semaphore object used with the semaphore APIs.
Definition: SemaphoreP.h:59
Panel_Config::lockSem
SemaphoreP_Object lockSem
Definition: panel.h:289
Panel_PinConfig::pinIoNum
uint32_t pinIoNum
Definition: panel.h:224
TCA6424_Config
IO Expander driver configuration. This is the driver object used to store state variables.
Definition: ioexp_tca6424.h:115
Panel_ControlFxn
int32_t(* Panel_ControlFxn)(Panel_Config *config, Panel_Params *params, uint32_t cmd, void *cmdArgs)
Driver implementation to control panel using a specific panel driver.
Definition: panel.h:143
Panel_Handle
void * Panel_Handle
Handle to the FLash driver returned by Panel_open()
Definition: panel.h:85
Panel_Fxns::openFxn
Panel_OpenFxn openFxn
Definition: panel.h:263
Panel_Fxns::resetFxn
Panel_ResetFxn resetFxn
Definition: panel.h:269
Panel_Config
Panel driver configuration, these are filled by SysCfg based on the panel device that is selected.
Definition: panel.h:278
Panel_PinConfig
Panel pin control data.
Definition: panel.h:223