app_graphics_gpu.h
Go to the documentation of this file.
1 /**
2  ****************************************************************************************
3  *
4  * @file app_graphics_gpu.h
5  * @author BLE Driver Team
6  * @brief Header file containing functions prototypes of GPU app library.
7  *
8  ****************************************************************************************
9  * @attention
10  #####Copyright (c) 2019 GOODIX
11  All rights reserved.
12 
13  Redistribution and use in source and binary forms, with or without
14  modification, are permitted provided that the following conditions are met:
15  * Redistributions of source code must retain the above copyright
16  notice, this list of conditions and the following disclaimer.
17  * Redistributions in binary form must reproduce the above copyright
18  notice, this list of conditions and the following disclaimer in the
19  documentation and/or other materials provided with the distribution.
20  * Neither the name of GOODIX nor the names of its contributors may be used
21  to endorse or promote products derived from this software without
22  specific prior written permission.
23 
24  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27  ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
28  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  POSSIBILITY OF SUCH DAMAGE.
35  ****************************************************************************************
36  */
37 
38 /** @addtogroup PERIPHERAL Peripheral Driver
39  * @{
40  */
41 
42 /** @addtogroup APP_DRIVER APP DRIVER
43  * @{
44  */
45 
46 /** @defgroup APP_GRAPHICS_GPU GPU
47  * @brief GRAPHICS_GPU APP module driver.
48  * @{
49  */
50 
51 #ifndef __APP_GRAPHICS_GPU_H__
52 #define __APP_GRAPHICS_GPU_H__
53 
54 #include "gr55xx.h"
55 #include "app_io.h"
56 #include "hal_gfx_regs.h"
57 #include "hal_gfx_core.h"
58 #include "app_rtos_cfg.h"
59 #include "graphics_sys_defs.h"
60 
61 /**
62  * @defgroup APP_GRAPHICS_GPU_DRIVER_MACRO Defines
63  * @{
64  */
65 /** @defgroup GRAPHICS_GPU_BASEADDR The GPU registers memory base address
66  * @{
67  */
68 #define GRAPHICS_GPU_BASEADDR 0xA3FF0000 /**< GPU registers memory base address */
69 /** @} */
70 
71 /** @defgroup GRAPHICS_GPU_IRQ_EVT IRQ callback events Define
72  * @{
73  */
74 #define GGPU_IRQ_EVT_CMD_LIST_END 0x01 /**< GPU CMD list end IRQ callback */
75 #define GGPU_IRQ_EVT_DRAW_CMD_END 0x02 /**< GPU draw CMD end IRQ callback */
76 #define GGPU_IRQ_EVT_IRQ_ID_CLEAR 0x03 /**< GPU IRQ ID clear callback */
77 #define GGPU_IRQ_EVT_OTHER 0x04 /**< GPU other IRQ callback */
78 /** @} */
79 
80 /** @} */
81 
82 /** @addtogroup APP_GRAPHICS_GPU_DRIVER_ENUM Enumerations
83  * @{
84  */
85 
86 /**
87  * @brief GPU Power Mode Enumerations definition
88  */
89 typedef enum {
90  GPU_POWER_STATE_SLEEP = 0, /* sleep state */
91  GPU_POWER_STATE_ACTIVE = 1, /* active state */
93 
94 /** @} */
95 
96 /** @addtogroup APP_GRAPHICS_GPU_DRIVER_TYPEDEF Graphics GPU Type definitions
97  * @{
98  */
99 typedef void (* graphics_gpu_irq_event_notify )(uint32_t evt); /**< GPU IRQ callback definition */
100 /** @} */
101 
102 /** @addtogroup APP_GRAPHICS_GPU_DRIVER_FUNCTIONS Functions
103  * @{
104  */
105 /**
106  *****************************************************************************************
107  * @brief GPU initialize.
108  *
109  * @param[in] evt_cb: Callback function
110  *
111  * @return 0 if no errors occurred
112  *****************************************************************************************
113  */
115 
116 /**
117  *****************************************************************************************
118  * @brief GPU de-initialize. just called when needed to reboot/reset
119  *
120  *****************************************************************************************
121  */
123 
124 /**
125  *****************************************************************************************
126  * @brief Switch power state for GPU module
127  *
128  * @param[in] state: power state to switch
129  *
130  * @return none
131  *****************************************************************************************
132  */
134 
135 /** @} */
136 
137 #endif /* __APP_GRAPHICS_GPU_H__ */
138 
139 /** @} */
140 /** @} */
141 /** @} */
graphics_gpu_irq_event_notify
void(* graphics_gpu_irq_event_notify)(uint32_t evt)
Definition: app_graphics_gpu.h:99
GPU_POWER_STATE_SLEEP
@ GPU_POWER_STATE_SLEEP
Definition: app_graphics_gpu.h:90
GPU_POWER_STATE_ACTIVE
@ GPU_POWER_STATE_ACTIVE
Definition: app_graphics_gpu.h:91
app_io.h
Header file containing functions prototypes of GPIO app library.
app_graphics_gpu_set_power_state
void app_graphics_gpu_set_power_state(graphics_gpu_power_state_e state)
Switch power state for GPU module.
graphics_gpu_power_state_e
graphics_gpu_power_state_e
GPU Power Mode Enumerations definition.
Definition: app_graphics_gpu.h:89
graphics_gpu_deinit
void graphics_gpu_deinit(void)
GPU de-initialize. just called when needed to reboot/reset.
graphics_gpu_init
uint16_t graphics_gpu_init(graphics_gpu_irq_event_notify evt_cb)
GPU initialize.
app_rtos_cfg.h
Header file of app rtos config code.