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 #ifdef USE_OSAL
59 #include "osal.h"
60 #else
61 #include "app_rtos_cfg.h"
62 #endif
63 #include "graphics_sys_defs.h"
64
65 /**
66 * @defgroup APP_GRAPHICS_GPU_DRIVER_MACRO Defines
67 * @{
68 */
69 /** @defgroup GRAPHICS_GPU_BASEADDR The GPU registers memory base address
70 * @{
71 */
72 #define GRAPHICS_GPU_BASEADDR 0xA3FF0000 /**< GPU registers memory base address */
73 /** @} */
74
75 /** @defgroup GRAPHICS_GPU_IRQ_EVT IRQ callback events Define
76 * @{
77 */
78 #define GGPU_IRQ_EVT_CMD_LIST_END 0x01 /**< GPU CMD list end IRQ callback */
79 #define GGPU_IRQ_EVT_DRAW_CMD_END 0x02 /**< GPU draw CMD end IRQ callback */
80 #define GGPU_IRQ_EVT_IRQ_ID_CLEAR 0x03 /**< GPU IRQ ID clear callback */
81 #define GGPU_IRQ_EVT_OTHER 0x04 /**< GPU other IRQ callback */
82 /** @} */
83
84 /** @} */
85
86 /** @addtogroup APP_GRAPHICS_GPU_DRIVER_ENUM Enumerations
87 * @{
88 */
89
90 /**
91 * @brief GPU Power Mode Enumerations definition
92 */
93 typedef enum {
94 GPU_POWER_STATE_SLEEP = 0, /* sleep state */
95 GPU_POWER_STATE_ACTIVE = 1, /* active state */
96 } graphics_gpu_power_state_e;
97
98 /** @} */
99
100 /** @addtogroup APP_GRAPHICS_GPU_DRIVER_TYPEDEF Graphics GPU Type definitions
101 * @{
102 */
103 typedef void (* graphics_gpu_irq_event_notify )(uint32_t evt); /**< GPU IRQ callback definition */
104 /** @} */
105
106 /** @addtogroup APP_GRAPHICS_GPU_DRIVER_FUNCTIONS Functions
107 * @{
108 */
109 /**
110 *****************************************************************************************
111 * @brief GPU initialize.
112 *
113 * @param[in] evt_cb: Callback function
114 *
115 * @return 0 if no errors occurred
116 *****************************************************************************************
117 */
118 uint16_t graphics_gpu_init(graphics_gpu_irq_event_notify evt_cb);
119
120 /**
121 *****************************************************************************************
122 * @brief GPU de-initialize. just called when needed to reboot/reset
123 *
124 *****************************************************************************************
125 */
126 void graphics_gpu_deinit(void);
127
128 /**
129 *****************************************************************************************
130 * @brief Switch power state for GPU module
131 *
132 * @param[in] state: power state to switch
133 *
134 * @return none
135 *****************************************************************************************
136 */
137 void app_graphics_gpu_set_power_state(graphics_gpu_power_state_e state);
138
139 /** @} */
140
141 #endif /* __APP_GRAPHICS_GPU_H__ */
142
143 /** @} */
144 /** @} */
145 /** @} */
graphics_gpu_irq_event_notify
void(* graphics_gpu_irq_event_notify)(uint32_t evt)
Definition: app_graphics_gpu.h:103
GPU_POWER_STATE_SLEEP
@ GPU_POWER_STATE_SLEEP
Definition: app_graphics_gpu.h:94
GPU_POWER_STATE_ACTIVE
@ GPU_POWER_STATE_ACTIVE
Definition: app_graphics_gpu.h:95
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:93
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.