app_graphics_qspi.h
Go to the documentation of this file.
1 /**
2  ****************************************************************************************
3  *
4  * @file app_graphics_qspi.h
5  * @author BLE Driver Team
6  * @brief Header file containing functions prototypes of QSPI 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 #ifndef __APP_GRAPHICS_QSPI_H__
39 #define __APP_GRAPHICS_QSPI_H__
40 
41 
42 /** @addtogroup PERIPHERAL Peripheral Driver
43  * @{
44  */
45 
46 /** @addtogroup APP_DRIVER APP DRIVER
47  * @{
48  */
49 
50 /** @defgroup APP_QSPI QSPI
51  * @brief QSPI APP module driver.
52  * @{
53  */
54 
55 
56 #include <stdbool.h>
57 #include "grx_hal.h"
58 #include "app_io.h"
59 #include "app_qspi.h"
60 #include "app_drv_error.h"
61 #include "app_drv_config.h"
62 #if (APP_DRIVER_CHIP_TYPE == APP_DRIVER_GR5526X)
63 #include "app_qspi_user_config.h"
64 #ifdef __cplusplus
65 extern "C" {
66 #endif
67 
68 #ifdef HAL_QSPI_MODULE_ENABLED
69 /* Exported functions --------------------------------------------------------*/
70 /** @addtogroup APP_GRAPHICS_QSPI_DRIVER_FUNCTIONS Functions
71  * @{
72  */
73 /**
74  ****************************************************************************************
75  * @brief Read data block in Memory mapped Mode(XIP Mode), The Data is ordered by the order in flash/psram device
76  *
77  * @param[in] id : QSPI module ID.
78  * @param[in] address : the address of device connected to QSPI, start from 0x000000
79  * @param[in] buffer : memory pointer to save the read data
80  * @param[in] length : the read length in byte
81  * @return true/false
82  ****************************************************************************************
83  */
84 bool app_qspi_dma_mmap_read_block(app_qspi_id_t id, uint32_t address, uint8_t * buffer, uint32_t length);
85 
86 /**
87  ****************************************************************************************
88  * @brief Special Async API to write QuadSPI Screen from memory mapped device(flash or psram)
89  * Must enable the two micro-defines to enable this API:
90  * QSPI_ASYNC_SCROLL_DRAW_SCREEN_SUPPORT
91  *
92  * @param[in] screen_id: QSPI module ID for screen, MUST config screen qspi to register mode.
93  * @param[in] storage_id: QSPI module ID for storage, MUST config storage qspi to mmap(xip) mode.
94  * @param[in] p_screen_cmd: pointer to the screen control command
95  * @param[in] p_screen_info: pointer to the screen information
96  * @param[in] p_scroll_config: pointer to the scrolling-config
97  * @param[in] is_first_call: When called in foreground task, please set true
98  * @return true/false
99  ****************************************************************************************
100  */
102  app_qspi_id_t storage_id,
103  const app_qspi_screen_command_t * const p_screen_cmd,
104  const app_qspi_screen_info_t * const p_screen_info,
105  app_qspi_screen_scroll_t * p_scroll_config,
106  bool is_first_call);
107 
108 /**
109  ****************************************************************************************
110  * @brief Special Async API to write Screen in vertical direction, and veritical lines are organized in linked list.
111  * Must enable the two micro-defines to enable this API:
112  * QSPI_ASYNC_VERI_LINK_DRAW_SCREEN_SUPPORT
113  *
114  * @param[in] screen_id: QSPI module ID for screen, MUST config screen qspi to register mode.
115  * @param[in] storage_id: QSPI module ID for storage, MUST config storage qspi to mmap(xip) mode.
116  * @param[in] p_screen_cmd: pointer to the screen control command
117  * @param[in] p_screen_info: pointer to the screen information
118  * @param[in] p_link_scroll: pointer to the linked list structure
119  * @param[in] is_first_call: When called in foreground task, please set true
120  * @return true/false
121  ****************************************************************************************
122  */
124  app_qspi_id_t storage_id,
125  const app_qspi_screen_command_t * const p_screen_cmd,
126  const app_qspi_screen_info_t * const p_screen_info,
127  app_qspi_screen_veri_link_scroll_t * p_link_scroll,
128  bool is_first_call);
129 
130 /**
131  ****************************************************************************************
132  * @brief Special Async API to write one block of the Screen by DMA-LLP, every line of the block is organized in linked list.
133  * Must enable the micro-defines to enable this API:
134  * QSPI_ASYNC_VERI_LINK_DRAW_SCREEN_SUPPORT
135  *
136  * @param[in] screen_id: QSPI module ID for screen, MUST config screen qspi to register mode.
137  * @param[in] storage_id: QSPI module ID for storage, MUST config storage qspi to mmap(xip) mode.
138  * @param[in] p_screen_cmd: pointer to the screen control command
139  * @param[in] p_screen_info: pointer to the screen information
140  * @param[in] p_block_info: pointer to the block information structure
141  * @param[in] is_first_call: When first call, please set true(used this flag to decide whether send cmd or not)
142  * @return true/false
143  * @NOTE You need to control the CS outsize if (is_one_take_cs) is set true
144  * @NOTE It will generate APP_QSPI_EVT_TX_CPLT event when finish transmission.
145  ****************************************************************************************
146  */
148  app_qspi_id_t storage_id,
149  const app_qspi_screen_command_t *const p_screen_cmd,
150  const app_qspi_screen_info_t *const p_screen_info,
151  app_qspi_screen_block_t *p_block_info,
152  bool is_first_call);
153 /**
154  ****************************************************************************************
155  * @brief Special API to Blit Image from memory mapped device to RAM Buffer
156  * Must enable the two micro-defines to enable this API:
157  * QSPI_BLIT_RECT_IMAGE_SUPPORT
158  *
159  * @param[in] storage_id : QSPI module ID for storage, MUST config storage qspi to mmap(xip) mode.
160  * @param[in] p_blit_config : pointer to blit config
161  * @param[in] xfer_type : pointer to the scrolling-config
162  * @return true/false
163  ****************************************************************************************
164  */
165 bool app_qspi_mmap_blit_image(app_qspi_id_t storage_id, blit_image_config_t * p_blit_config, blit_xfer_type_e xfer_type);
166 /** @} */
167 
168 #ifdef __cplusplus
169 }
170 #endif
171 #endif
172 #endif
173 #endif
174 /** @} */
175 /** @} */
176 /** @} */
app_qspi_screen_command_t
Definition: app_qspi.h:309
app_qspi_async_veri_draw_screen
bool app_qspi_async_veri_draw_screen(app_qspi_id_t screen_id, app_qspi_id_t storage_id, const app_qspi_screen_command_t *const p_screen_cmd, const app_qspi_screen_info_t *const p_screen_info, app_qspi_screen_veri_link_scroll_t *p_link_scroll, bool is_first_call)
Special Async API to write Screen in vertical direction, and veritical lines are organized in linked ...
blit_xfer_type_e
blit_xfer_type_e
Define BLIT Mode By DMA.
Definition: app_qspi.h:228
app_qspi_screen_scroll_t
Scroll-Screen structure definition.
Definition: app_qspi.h:373
app_qspi_async_llp_draw_block
bool app_qspi_async_llp_draw_block(app_qspi_id_t screen_id, app_qspi_id_t storage_id, const app_qspi_screen_command_t *const p_screen_cmd, const app_qspi_screen_info_t *const p_screen_info, app_qspi_screen_block_t *p_block_info, bool is_first_call)
Special Async API to write one block of the Screen by DMA-LLP, every line of the block is organized i...
app_qspi_id_t
app_qspi_id_t
QSPI module Enumerations definition.
Definition: app_qspi.h:110
app_io.h
Header file containing functions prototypes of GPIO app library.
app_qspi_screen_block_t
One block of screen Structure.
Definition: app_qspi.h:393
app_qspi_user_config.h
grx_hal.h
This file contains all the functions prototypes for the HAL module driver.
app_qspi_screen_info_t
Screen Info. structure definition.
Definition: app_qspi.h:363
app_qspi_mmap_blit_image
bool app_qspi_mmap_blit_image(app_qspi_id_t storage_id, blit_image_config_t *p_blit_config, blit_xfer_type_e xfer_type)
Special API to Blit Image from memory mapped device to RAM Buffer Must enable the two micro-defines t...
app_qspi_dma_mmap_read_block
bool app_qspi_dma_mmap_read_block(app_qspi_id_t id, uint32_t address, uint8_t *buffer, uint32_t length)
Read data block in Memory mapped Mode(XIP Mode), The Data is ordered by the order in flash/psram devi...
app_qspi.h
Header file containing functions prototypes of QSPI app library.
blit_image_config_t
Blit Image structure definition.
Definition: app_qspi.h:441
app_drv_error.h
Header file of app driver error code.
app_drv_config.h
Header file of app driver config code.
app_qspi_async_draw_screen
bool app_qspi_async_draw_screen(app_qspi_id_t screen_id, app_qspi_id_t storage_id, const app_qspi_screen_command_t *const p_screen_cmd, const app_qspi_screen_info_t *const p_screen_info, app_qspi_screen_scroll_t *p_scroll_config, bool is_first_call)
Special Async API to write QuadSPI Screen from memory mapped device(flash or psram) Must enable the t...