app_qspi.h
Go to the documentation of this file.
1 /**
2  ****************************************************************************************
3  *
4  * @file app_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 /** @addtogroup PERIPHERAL Peripheral Driver
39  * @{
40  */
41 
42 /** @addtogroup APP_DRIVER APP DRIVER
43  * @{
44  */
45 
46 /** @defgroup APP_QSPI QSPI
47  * @brief QSPI APP module driver.
48  * @{
49  */
50 
51 
52 #ifndef _APP_QSPI_H_
53 #define _APP_QSPI_H_
54 
55 #include "gr55xx_hal.h"
56 #include "app_io.h"
57 #include "app_drv_error.h"
58 #include "app_rtos_cfg.h"
59 
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63 
64 #ifdef HAL_QSPI_MODULE_ENABLED
65 
66 /** @addtogroup APP_QSPI_DEFINE Defines
67  * @{
68  */
69 
70 #define APP_QSPI_PIN_ENABLE 1 /**< QSPI pin enable */
71 #define APP_QSPI_PIN_DISABLE 0 /**< QSPI pin disable */
72 
73 /** @} */
74 
75 /** @addtogroup APP_QSPI_ENUM Enumerations
76  * @{
77  */
78 
79 /**
80  * @brief QSPI module Enumerations definition
81  */
82 typedef enum
83 {
84  APP_QSPI_ID_0, /**< QSPI module 0 */
85  APP_QSPI_ID_1, /**< QSPI module 1 */
86  APP_QSPI_ID_MAX /**< Only for check parameter, not used as input parameters. */
88 
89 /**
90  * @brief QSPI operating mode Enumerations definition
91  */
92 typedef enum
93 {
94  APP_QSPI_TYPE_INTERRUPT, /**< Interrupt operation mode */
95  APP_QSPI_TYPE_POLLING, /**< Polling operation mode */
96  APP_QSPI_TYPE_DMA, /**< DMA operation mode */
97  APP_QSPI_TYPE_MAX, /**< Only for check parameter, not used as input parameters. */
99 
100 /**
101 * @brief APP QSPI Event Type
102 */
103 typedef enum
104 {
105  APP_QSPI_EVT_ERROR, /**< Error reported by UART peripheral. */
106  APP_QSPI_EVT_TX_CPLT, /**< Requested TX transfer completed. */
107  APP_QSPI_EVT_RX_DATA, /**< Requested RX transfer completed. */
109 /** @} */
110 
111 /** @addtogroup APP_QSPI_STRUCTURES Structures
112  * @{
113  */
114 
115 /**
116  * @brief QSPI IO configuration Structures
117  */
118 typedef struct
119 {
120  app_io_type_t type; /**< Specifies the type of QSPI IO. */
121  app_io_mux_t mux; /**< Specifies the Peripheral to be connected to the selected pins. */
122  uint32_t pin; /**< Specifies the IO pins to be configured.
123  This parameter can be any value of @ref GR551x_pins. */
124  app_io_pull_t pull; /**< Specifies the Pull-up or Pull-Down activation for the selected pins. */
125  uint8_t enable; /**< Enable or disable the pin. */
127 
128 /**
129  * @brief QSPI configuration Structures
130  */
131 typedef struct
132 {
133  app_qspi_pin_t cs; /**< Set the configuration of QSPI CS pin. */
134  app_qspi_pin_t clk; /**< Set the configuration of QSPI CLK pin. */
135  app_qspi_pin_t io_0; /**< Set the configuration of QSPI IO0 pin. */
136  app_qspi_pin_t io_1; /**< Set the configuration of QSPI IO1 pin. */
137  app_qspi_pin_t io_2; /**< Set the configuration of QSPI IO2 pin. */
138  app_qspi_pin_t io_3; /**< Set the configuration of QSPI IO3 pin. */
140 
141 /**
142  * @brief QSPI operate mode Enumerations definition
143  */
144 typedef struct
145 {
146  app_qspi_type_t type; /**< Specifies the operation mode of QSPI. */
147  dma_channel_t dma_channel; /**< Specifies the dma channel of QSPI. */
149 
150 /**
151  * @brief QSPI parameters structure definition
152  */
153 typedef struct
154 {
155  app_qspi_id_t id; /**< specified QSPI module ID. */
156  app_qspi_pin_cfg_t pin_cfg; /**< the pin configuration information for the specified QSPI module. */
157  app_qspi_mode_t use_mode; /**< QSPI operate mode. */
158  qspi_init_t init; /**< QSPI communication parameters. */
160 
161 /** @} */
162 
163 /** @addtogroup APP_QSPI_TYPEDEFS Typedefs
164  * @{
165  */
166 /**
167  * @brief QSPI command structure definition
168  */
170 /** @} */
171 
172 
173 /** @addtogroup APP_QSPI_STRUCTURES Structures
174  * @{
175  */
176 /**
177  * @brief QSPI event structure definition
178  */
179 typedef struct
180 {
181  app_qspi_evt_type_t type; /**< Type of event. */
182  union
183  {
184  uint32_t error_code; /**< QSPI Error code . */
185  uint16_t size; /**< QSPI transmitted/received counter. */
186  } data; /**< Event data. */
188 /** @} */
189 
190 /** @addtogroup APP_QSPI_TYPEDEFS Typedefs
191  * @{
192  */
193 /**
194  * @brief QSPI event callback definition
195  */
196 typedef void (*app_qspi_evt_handler_t)(app_qspi_evt_t *p_evt);
197 /** @} */
198 
199 
200 /* Exported functions --------------------------------------------------------*/
201 /** @addtogroup HAL_APP_QSPI_DRIVER_FUNCTIONS Functions
202  * @{
203  */
204 /**
205  ****************************************************************************************
206  * @brief Initialize the APP QSPI DRIVER according to the specified parameters
207  * in the app_qspi_params_t and app_qspi_evt_handler_t.
208  * @note If interrupt mode is set, you can use blocking mode. Conversely, if blocking mode
209  * is set, you can't use interrupt mode.
210  *
211  * @param[in] p_params: Pointer to app_qspi_params_t parameter which contains the
212  * configuration information for the specified QSPI module.
213  * @param[in] evt_handler: QSPI user callback function.
214  *
215  * @return Result of initialization.
216  ****************************************************************************************
217  */
218 uint16_t app_qspi_init(app_qspi_params_t *p_params, app_qspi_evt_handler_t evt_handler);
219 
220 /**
221  ****************************************************************************************
222  * @brief De-initialize the APP QSPI DRIVER peripheral.
223  *
224  * @param[in] id: De-initialize for a specific ID.
225  *
226  * @return Result of De-initialization.
227  ****************************************************************************************
228  */
230 
231 /**
232  ****************************************************************************************
233  * @brief Receive an amount of data with the specified instruction, address and dummy cycles in blocking mode.
234  * @note This function is used only in Indirect Read Mode.
235  * @param[in] id: which QSPI module want to receive.
236  * @param[in] p_cmd: Pointer to a app_qspi_command_t structure that contains the instruction and address for data transfer.
237  * @param[out] p_data: Pointer to data buffer
238  * @param[in] timeout: Timeout duration
239  *
240  * @return Result of operation.
241  ****************************************************************************************
242  */
243 uint16_t app_qspi_command_receive_sync(app_qspi_id_t id, app_qspi_command_t *p_cmd, uint8_t *p_data, uint32_t timeout);
244 
245 /**
246  ****************************************************************************************
247  * @brief Receive an amount of data with the specified instruction, address and dummy cycles in non-blocking mode with Interrupt.
248  * @note This function is used only in Indirect Read Mode.
249  * @param[in] id: which QSPI module want to receive.
250  * @param[in] p_cmd: Pointer to a app_qspi_command_t structure that contains the instruction and address for data transfer.
251  * @param[out] p_data: Pointer to data buffer
252  *
253  * @return Result of operation.
254  ****************************************************************************************
255  */
257 
258 /**
259  ****************************************************************************************
260  * @brief Receive an amount of data with the specified instruction, address and dummy cycles in blocking mode.
261  * @note This function is used only in Indirect Read Mode.
262  * @param[in] id: which QSPI module want to transmit.
263  * @param[in] p_cmd: Pointer to a app_qspi_command_t structure that contains the instruction and address for data transfer.
264  * @param[out] p_data: Pointer to data buffer
265  * @param[in] timeout: Timeout duration
266  *
267  * @return Result of operation.
268  ****************************************************************************************
269  */
270 uint16_t app_qspi_command_transmit_sync(app_qspi_id_t id, app_qspi_command_t *p_cmd, uint8_t *p_data, uint32_t timeout);
271 
272 /**
273  ****************************************************************************************
274  * @brief Receive an amount of data with the specified instruction, address and dummy cycles in non-blocking mode with Interrupt.
275  * @note This function is used only in Indirect Read Mode.
276  * @param[in] id: which QSPI module want to transmit.
277  * @param[in] p_cmd: Pointer to a app_qspi_command_t structure that contains the instruction and address for data transfer.
278  * @param[out] p_data: Pointer to data buffer
279  *
280  * @return Result of operation.
281  ****************************************************************************************
282  */
284 
285 /**
286  ****************************************************************************************
287  * @brief Transmit only instruction in blocking mode.
288  * @note This function is used only in Indirect Write Mode.
289  * @param[in] id: which QSPI module want to transmit command.
290  * @param[in] p_cmd: Pointer to a app_qspi_command_t structure that contains the instruction and address for data transfer.
291  * @param[in] timeout: Timeout duration
292  *
293  * @return Result of operation.
294  ****************************************************************************************
295  */
296 uint16_t app_qspi_command_sync(app_qspi_id_t id, app_qspi_command_t *p_cmd, uint32_t timeout);
297 
298 /**
299  ****************************************************************************************
300  * @brief Transmit instruction in non-blocking mode with Interrupt.
301  * @note This function is used only in Indirect Write Mode.
302  * @param[in] id: which QSPI module want to transmit command.
303  * @param[in] p_cmd: Pointer to a app_qspi_command_t structure that contains the instruction and address for data transfer.
304  *
305  * @return Result of operation.
306  ****************************************************************************************
307  */
309 
310 /**
311  ****************************************************************************************
312  * @brief Transmit an amount of data in blocking mode with standard SPI.
313  * @note This function is used only in Indirect Write Mode.
314  * @param[in] id: which QSPI module want to transmit.
315  * @param[in] p_data: Pointer to data buffer
316  * @param[in] length: Amount of data to be sent in bytes
317  * @param[in] timeout: Timeout duration
318  *
319  * @return Result of operation.
320  ****************************************************************************************
321  */
322 uint16_t app_qspi_transmit_sync(app_qspi_id_t id, uint8_t *p_data, uint32_t length, uint32_t timeout);
323 
324 /**
325  ****************************************************************************************
326  * @brief Transmit an amount of data in non-blocking mode at standard SPI with Interrupt.
327  * @note This function is used only in Indirect Write Mode.
328  * @param[in] id: which QSPI module want to transmit.
329  * @param[in] p_data: Pointer to data buffer
330  * @param[in] length: Amount of data to be sent in bytes
331  *
332  * @return Result of operation.
333  ****************************************************************************************
334  */
335 uint16_t app_qspi_transmit_async(app_qspi_id_t id, uint8_t *p_data, uint32_t length);
336 
337 /**
338  ****************************************************************************************
339  * @brief Receive an amount of data in blocking mode with standard SPI.
340  * @note This function is used only in Indirect Read Mode.
341  * @param[in] id: which QSPI module want to receive.
342  * @param[out] p_data: Pointer to data buffer
343  * @param[in] length: Amount of data to be received in bytes
344  * @param[in] timeout: Timeout duration
345  *
346  * @return Result of operation.
347  ****************************************************************************************
348  */
349 uint16_t app_qspi_receive_sync(app_qspi_id_t id, uint8_t *p_data, uint32_t length, uint32_t timeout);
350 
351 /**
352  ****************************************************************************************
353  * @brief Receive an amount of data in non-blocking mode at standard SPI with Interrupt.
354  * @note This function is used only in Indirect Read Mode.
355  * @param[in] id: which QSPI module want to receive.
356  * @param[out] p_data: Pointer to data buffer
357  * @param[in] length: Amount of data to be received in bytes
358  *
359  * @return Result of operation.
360  ****************************************************************************************
361  */
362 uint16_t app_qspi_receive_async(app_qspi_id_t id, uint8_t *p_data, uint32_t length);
363 
364 /**
365  ****************************************************************************************
366  * @brief Transmit an amount of data in QPI mode (Async Mode).
367  * @param[in] id: Which QSPI module want to Transmit.
368  * @param[in] data_width: Just support @ref QSPI_DATASIZE_08_BITS @ref QSPI_DATASIZE_16_BITS @ref QSPI_DATASIZE_32_BITS
369  * @param[in] p_data: Pointer to data buffer
370  * @param[in] length: Amount of data to be transmitted in bytes
371  *
372  * @return Result of operation.
373  ****************************************************************************************
374  */
375 uint16_t app_qspi_transmit_in_qpi_async(app_qspi_id_t id, uint32_t data_width, uint8_t *p_data, uint32_t length);
376 
377 /**
378  ****************************************************************************************
379  * @brief Return the QSPI handle.
380  *
381  * @param[in] id: QSPI Channel ID.
382  *
383  * @return Pointer to the specified ID's QSPI handle.
384  ****************************************************************************************
385  */
387 
388 #ifdef ENV_RTOS_USE_SEMP
389 
390 /**
391  ****************************************************************************************
392  * @brief [RTOS] Receive an amount of data with the specified instruction, address and dummy cycles in blocking mode.
393  * @note This function is used only in Indirect Read Mode.
394  * @param[in] id: which QSPI module want to receive.
395  * @param[in] p_cmd: Pointer to a app_qspi_command_t structure that contains the instruction and address for data transfer.
396  * @param[out] p_data: Pointer to data buffer
397  *
398  * @return Result of operation.
399  ****************************************************************************************
400  */
401 uint16_t app_qspi_command_receive_sem_sync(app_qspi_id_t id, app_qspi_command_t *p_cmd, uint8_t *p_data);
402 
403 /**
404  ****************************************************************************************
405  * @brief [RTOS] Receive an amount of data with the specified instruction, address and dummy cycles in blocking mode.
406  * @note This function is used only in Indirect Read Mode.
407  * @param[in] id: which QSPI module want to transmit.
408  * @param[in] p_cmd: Pointer to a app_qspi_command_t structure that contains the instruction and address for data transfer.
409  * @param[out] p_data: Pointer to data buffer
410  *
411  * @return Result of operation.
412  ****************************************************************************************
413  */
414 uint16_t app_qspi_command_transmit_sem_sync(app_qspi_id_t id, app_qspi_command_t *p_cmd, uint8_t *p_data);
415 
416 /**
417  ****************************************************************************************
418  * @brief [RTOS] Transmit only instruction in blocking mode.
419  * @note This function is used only in Indirect Write Mode.
420  * @param[in] id: which QSPI module want to transmit command.
421  * @param[in] p_cmd: Pointer to a app_qspi_command_t structure that contains the instruction and address for data transfer.
422  *
423  * @return Result of operation.
424  ****************************************************************************************
425  */
426 uint16_t app_qspi_command_sem_sync(app_qspi_id_t id, app_qspi_command_t *p_cmd);
427 
428 /**
429  ****************************************************************************************
430  * @brief [RTOS] Transmit an amount of data in blocking mode with standard SPI.
431  * @note This function is used only in Indirect Write Mode.
432  * @param[in] id: which QSPI module want to transmit.
433  * @param[in] p_data: Pointer to data buffer
434  * @param[in] length: Amount of data to be sent in bytes
435  *
436  * @return Result of operation.
437  ****************************************************************************************
438  */
439 uint16_t app_qspi_transmit_sem_sync(app_qspi_id_t id, uint8_t *p_data, uint32_t length);
440 
441 /**
442  ****************************************************************************************
443  * @brief [RTOS] Receive an amount of data in blocking mode with standard SPI.
444  * @note This function is used only in Indirect Read Mode.
445  * @param[in] id: which QSPI module want to receive.
446  * @param[out] p_data: Pointer to data buffer
447  * @param[in] length: Amount of data to be received in bytes
448  *
449  * @return Result of operation.
450  ****************************************************************************************
451  */
452 uint16_t app_qspi_receive_sem_sync(app_qspi_id_t id, uint8_t *p_data, uint32_t length);
453 
454 #endif
455 
456 /**
457  ****************************************************************************************
458  * @brief [High speed] Receive an amount of data with the specified instruction, address and dummy cycles in blocking mode.
459  * @note This function is used only in Indirect Read Mode.
460  * @param[in] id: which QSPI module want to receive.
461  * @param[in] p_cmd: Pointer to a app_qspi_command_t structure that contains the instruction and address for data transfer.
462  * @param[out] p_data: Pointer to data buffer
463  *
464  * @return Result of operation.
465  ****************************************************************************************
466  */
468 
469 /**
470  ****************************************************************************************
471  * @brief [High speed] Receive an amount of data with the specified instruction, address and dummy cycles in blocking mode.
472  * @note This function is used only in Indirect Read Mode.
473  * @param[in] id: which QSPI module want to transmit.
474  * @param[in] p_cmd: Pointer to a app_qspi_command_t structure that contains the instruction and address for data transfer.
475  * @param[out] p_data: Pointer to data buffer
476  *
477  * @return Result of operation.
478  ****************************************************************************************
479  */
481 
482 /**
483  ****************************************************************************************
484  * @brief [High speed] Transmit only instruction in blocking mode.
485  * @note This function is used only in Indirect Write Mode.
486  * @param[in] id: which QSPI module want to transmit command.
487  * @param[in] p_cmd: Pointer to a app_qspi_command_t structure that contains the instruction and address for data transfer.
488  *
489  * @return Result of operation.
490  ****************************************************************************************
491  */
493 
494 /**
495  ****************************************************************************************
496  * @brief [High speed] Transmit an amount of data in blocking mode with standard SPI.
497  * @note This function is used only in Indirect Write Mode.
498  * @param[in] id: which QSPI module want to transmit.
499  * @param[in] p_data: Pointer to data buffer
500  * @param[in] length: Amount of data to be sent in bytes
501  *
502  * @return Result of operation.
503  ****************************************************************************************
504  */
505 uint16_t app_qspi_transmit_high_speed_sync(app_qspi_id_t id, uint8_t *p_data, uint32_t length);
506 
507 /**
508  ****************************************************************************************
509  * @brief [High speed] Receive an amount of data in blocking mode with standard SPI.
510  * @note This function is used only in Indirect Read Mode.
511  * @param[in] id: which QSPI module want to receive.
512  * @param[out] p_data: Pointer to data buffer
513  * @param[in] length: Amount of data to be received in bytes
514  *
515  * @return Result of operation.
516  ****************************************************************************************
517  */
518 uint16_t app_qspi_receive_high_speed_sync(app_qspi_id_t id, uint8_t *p_data, uint32_t length);
519 
520 /** @} */
521 
522 #endif
523 
524 #ifdef __cplusplus
525 }
526 #endif
527 
528 #endif
529 
530 /** @} */
531 /** @} */
532 /** @} */
app_qspi_command_receive_sync
uint16_t app_qspi_command_receive_sync(app_qspi_id_t id, app_qspi_command_t *p_cmd, uint8_t *p_data, uint32_t timeout)
Receive an amount of data with the specified instruction, address and dummy cycles in blocking mode.
app_qspi_command_t
qspi_command_t app_qspi_command_t
QSPI command structure definition.
Definition: app_qspi.h:169
app_qspi_evt_t::size
uint16_t size
QSPI transmitted/received counter.
Definition: app_qspi.h:185
app_qspi_get_handle
qspi_handle_t * app_qspi_get_handle(app_qspi_id_t id)
Return the QSPI handle.
app_qspi_pin_t::pull
app_io_pull_t pull
Specifies the Pull-up or Pull-Down activation for the selected pins.
Definition: app_qspi.h:124
app_qspi_params_t::id
app_qspi_id_t id
specified QSPI module ID.
Definition: app_qspi.h:155
APP_QSPI_ID_1
@ APP_QSPI_ID_1
QSPI module 1.
Definition: app_qspi.h:85
APP_QSPI_TYPE_MAX
@ APP_QSPI_TYPE_MAX
Only for check parameter, not used as input parameters.
Definition: app_qspi.h:97
APP_QSPI_TYPE_DMA
@ APP_QSPI_TYPE_DMA
DMA operation mode
Definition: app_qspi.h:96
app_qspi_mode_t
QSPI operate mode Enumerations definition.
Definition: app_qspi.h:145
app_qspi_command_high_speed_sync
uint16_t app_qspi_command_high_speed_sync(app_qspi_id_t id, app_qspi_command_t *p_cmd)
[High speed] Transmit only instruction in blocking mode.
app_qspi_transmit_async
uint16_t app_qspi_transmit_async(app_qspi_id_t id, uint8_t *p_data, uint32_t length)
Transmit an amount of data in non-blocking mode at standard SPI with Interrupt.
app_qspi_pin_cfg_t::io_3
app_qspi_pin_t io_3
Set the configuration of QSPI IO3 pin.
Definition: app_qspi.h:138
app_qspi_pin_t
QSPI IO configuration Structures.
Definition: app_qspi.h:119
app_qspi_command_transmit_async
uint16_t app_qspi_command_transmit_async(app_qspi_id_t id, app_qspi_command_t *p_cmd, uint8_t *p_data)
Receive an amount of data with the specified instruction, address and dummy cycles in non-blocking mo...
app_qspi_type_t
app_qspi_type_t
QSPI operating mode Enumerations definition.
Definition: app_qspi.h:93
APP_QSPI_ID_0
@ APP_QSPI_ID_0
QSPI module 0.
Definition: app_qspi.h:84
app_qspi_command_transmit_high_speed_sync
uint16_t app_qspi_command_transmit_high_speed_sync(app_qspi_id_t id, app_qspi_command_t *p_cmd, uint8_t *p_data)
[High speed] Receive an amount of data with the specified instruction, address and dummy cycles in bl...
app_qspi_evt_t
QSPI event structure definition.
Definition: app_qspi.h:180
app_io_pull_t
app_io_pull_t
GPIO pull Enumerations definition.
Definition: app_io.h:187
app_io_type_t
app_io_type_t
GPIO type Enumerations definition.
Definition: app_io.h:141
app_qspi_deinit
uint16_t app_qspi_deinit(app_qspi_id_t id)
De-initialize the APP QSPI DRIVER peripheral.
app_qspi_receive_high_speed_sync
uint16_t app_qspi_receive_high_speed_sync(app_qspi_id_t id, uint8_t *p_data, uint32_t length)
[High speed] Receive an amount of data in blocking mode with standard SPI.
_qspi_init_t
QSPI init Structure definition.
Definition: gr55xx_hal_qspi.h:103
APP_QSPI_EVT_ERROR
@ APP_QSPI_EVT_ERROR
Error reported by UART peripheral.
Definition: app_qspi.h:105
APP_QSPI_TYPE_POLLING
@ APP_QSPI_TYPE_POLLING
Polling operation mode
Definition: app_qspi.h:95
app_qspi_pin_cfg_t::cs
app_qspi_pin_t cs
Set the configuration of QSPI CS pin.
Definition: app_qspi.h:133
app_qspi_evt_t::error_code
uint32_t error_code
QSPI Error code .
Definition: app_qspi.h:184
_qspi_command_t
QSPI command Structure definition.
Definition: gr55xx_hal_qspi.h:166
app_qspi_pin_t::mux
app_io_mux_t mux
Specifies the Peripheral to be connected to the selected pins.
Definition: app_qspi.h:121
APP_QSPI_EVT_RX_DATA
@ APP_QSPI_EVT_RX_DATA
Requested RX transfer completed.
Definition: app_qspi.h:107
app_qspi_id_t
app_qspi_id_t
QSPI module Enumerations definition.
Definition: app_qspi.h:83
app_io.h
Header file containing functions prototypes of GPIO app library.
app_qspi_pin_cfg_t
QSPI configuration Structures.
Definition: app_qspi.h:132
app_qspi_evt_handler_t
void(* app_qspi_evt_handler_t)(app_qspi_evt_t *p_evt)
QSPI event callback definition.
Definition: app_qspi.h:196
app_qspi_command_receive_async
uint16_t app_qspi_command_receive_async(app_qspi_id_t id, app_qspi_command_t *p_cmd, uint8_t *p_data)
Receive an amount of data with the specified instruction, address and dummy cycles in non-blocking mo...
app_qspi_command_sync
uint16_t app_qspi_command_sync(app_qspi_id_t id, app_qspi_command_t *p_cmd, uint32_t timeout)
Transmit only instruction in blocking mode.
app_qspi_pin_t::pin
uint32_t pin
Specifies the IO pins to be configured.
Definition: app_qspi.h:122
app_qspi_mode_t::type
app_qspi_type_t type
Specifies the operation mode of QSPI.
Definition: app_qspi.h:146
app_qspi_params_t::use_mode
app_qspi_mode_t use_mode
QSPI operate mode.
Definition: app_qspi.h:157
app_qspi_pin_t::enable
uint8_t enable
Enable or disable the pin.
Definition: app_qspi.h:125
app_qspi_receive_sync
uint16_t app_qspi_receive_sync(app_qspi_id_t id, uint8_t *p_data, uint32_t length, uint32_t timeout)
Receive an amount of data in blocking mode with standard SPI.
app_qspi_pin_cfg_t::io_1
app_qspi_pin_t io_1
Set the configuration of QSPI IO1 pin.
Definition: app_qspi.h:136
APP_QSPI_EVT_TX_CPLT
@ APP_QSPI_EVT_TX_CPLT
Requested TX transfer completed.
Definition: app_qspi.h:106
app_qspi_params_t::init
qspi_init_t init
QSPI communication parameters.
Definition: app_qspi.h:158
app_qspi_params_t::pin_cfg
app_qspi_pin_cfg_t pin_cfg
the pin configuration information for the specified QSPI module.
Definition: app_qspi.h:156
gr55xx_hal.h
This file contains all the functions prototypes for the HAL module driver.
app_qspi_command_async
uint16_t app_qspi_command_async(app_qspi_id_t id, app_qspi_command_t *p_cmd)
Transmit instruction in non-blocking mode with Interrupt.
app_qspi_receive_async
uint16_t app_qspi_receive_async(app_qspi_id_t id, uint8_t *p_data, uint32_t length)
Receive an amount of data in non-blocking mode at standard SPI with Interrupt.
app_qspi_transmit_in_qpi_async
uint16_t app_qspi_transmit_in_qpi_async(app_qspi_id_t id, uint32_t data_width, uint8_t *p_data, uint32_t length)
Transmit an amount of data in QPI mode (Async Mode).
app_qspi_command_receive_high_speed_sync
uint16_t app_qspi_command_receive_high_speed_sync(app_qspi_id_t id, app_qspi_command_t *p_cmd, uint8_t *p_data)
[High speed] Receive an amount of data with the specified instruction, address and dummy cycles in bl...
app_qspi_pin_cfg_t::clk
app_qspi_pin_t clk
Set the configuration of QSPI CLK pin.
Definition: app_qspi.h:134
APP_QSPI_ID_MAX
@ APP_QSPI_ID_MAX
Only for check parameter, not used as input parameters.
Definition: app_qspi.h:86
app_qspi_evt_type_t
app_qspi_evt_type_t
APP QSPI Event Type.
Definition: app_qspi.h:104
app_qspi_transmit_high_speed_sync
uint16_t app_qspi_transmit_high_speed_sync(app_qspi_id_t id, uint8_t *p_data, uint32_t length)
[High speed] Transmit an amount of data in blocking mode with standard SPI.
app_io_mux_t
app_io_mux_t
GPIO mux Enumerations definition.
Definition: app_io.h:198
app_qspi_evt_t::type
app_qspi_evt_type_t type
Type of event.
Definition: app_qspi.h:181
app_qspi_mode_t::dma_channel
dma_channel_t dma_channel
Specifies the dma channel of QSPI.
Definition: app_qspi.h:147
app_qspi_transmit_sync
uint16_t app_qspi_transmit_sync(app_qspi_id_t id, uint8_t *p_data, uint32_t length, uint32_t timeout)
Transmit an amount of data in blocking mode with standard SPI.
app_qspi_pin_cfg_t::io_2
app_qspi_pin_t io_2
Set the configuration of QSPI IO2 pin.
Definition: app_qspi.h:137
app_rtos_cfg.h
Header file of app rtos config code.
app_drv_error.h
Header file of app driver error code.
app_qspi_pin_t::type
app_io_type_t type
Specifies the type of QSPI IO.
Definition: app_qspi.h:120
app_qspi_init
uint16_t app_qspi_init(app_qspi_params_t *p_params, app_qspi_evt_handler_t evt_handler)
Initialize the APP QSPI DRIVER according to the specified parameters in the app_qspi_params_t and app...
_qspi_handle
QSPI handle Structure definition.
Definition: gr55xx_hal_qspi.h:123
app_qspi_command_transmit_sync
uint16_t app_qspi_command_transmit_sync(app_qspi_id_t id, app_qspi_command_t *p_cmd, uint8_t *p_data, uint32_t timeout)
Receive an amount of data with the specified instruction, address and dummy cycles in blocking mode.
app_qspi_params_t
QSPI parameters structure definition.
Definition: app_qspi.h:154
app_qspi_pin_cfg_t::io_0
app_qspi_pin_t io_0
Set the configuration of QSPI IO0 pin.
Definition: app_qspi.h:135
dma_channel_t
dma_channel_t
HAL DMA Channel Enumerations definition.
Definition: gr55xx_hal_dma.h:93
APP_QSPI_TYPE_INTERRUPT
@ APP_QSPI_TYPE_INTERRUPT
Interrupt operation mode.
Definition: app_qspi.h:94