app_dspi_dma.h
Go to the documentation of this file.
1 /**
2 ****************************************************************************************
3 *
4 * @file app_dspi_dma.h
5 * @author BLE Driver Team
6 * @brief Header file containing functions prototypes of DSPI 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_DSPI DSPI
47 * @brief DSPI APP module driver.
48 * @{
49 */
50
51
52 #ifndef _APP_DSPI_DMA_H_
53 #define _APP_DSPI_DMA_H_
54
55 #include "grx_hal.h"
56 #include "app_io.h"
57 #include "app_dspi.h"
58 #include "app_drv_error.h"
59 #include "app_drv_config.h"
60
61 #ifdef __cplusplus
62 extern "C" {
63 #endif
64
65 #ifdef HAL_DSPI_MODULE_ENABLED
66
67 /* Exported functions --------------------------------------------------------*/
68 /** @addtogroup APP_DSPI_DRIVER_FUNCTIONS Functions
69 * @{
70 */
71 /**
72 ****************************************************************************************
73 * @brief Initialize the APP DSPI DRIVER according to the specified parameters
74 * in the app_dspi_params_t and app_dspi_evt_handler_t.
75 * @note If interrupt mode is set, you can use blocking mode. Conversely, if blocking mode
76 * is set, you can't use interrupt mode.
77 *
78 * @param[in] p_params: Pointer to app_dspi_params_t parameter which contains the
79 * configuration information for the specified DSPI module.
80 *
81 * @return Result of initialization.
82 ****************************************************************************************
83 */
84 uint16_t app_dspi_dma_init(app_dspi_params_t *p_params);
85
86 /**
87 ****************************************************************************************
88 * @brief De-initialize the APP DSPI DRIVER peripheral.
89 *
90 * @return Result of De-initialization.
91 ****************************************************************************************
92 */
93 uint16_t app_dspi_dma_deinit(void);
94
95 /**
96 ****************************************************************************************
97 * @brief Receive an amount of data with the specified instruction in non-blocking mode with Interrupt.
98 *
99 * @param[in] p_cmd: Pointer to a app_dspi_command_t structure that contains the instruction, length, data_size for data transfer.
100 * @param[out] p_data: Pointer to data buffer
101 *
102 * @return Result of operation.
103 ****************************************************************************************
104 */
105 uint16_t app_dspi_dma_command_transmit_async(app_dspi_command_t *p_cmd, uint8_t *p_data);
106
107 /**
108 ****************************************************************************************
109 * @brief Transmit instruction in non-blocking mode with Interrupt.
110 *
111 * @param[in] p_cmd: Pointer to a app_dspi_command_t structure that contains the instruction for data transfer.
112 *
113 * @return Result of operation.
114 ****************************************************************************************
115 */
116 uint16_t app_dspi_dma_command_async(app_dspi_command_t *p_cmd);
117
118 /**
119 ****************************************************************************************
120 * @brief Transmit an amount of data in non-blocking mode with DMA.
121 *
122 * @param[in] p_data: Pointer to data buffer
123 * @param[in] length: Amount of data to be sent in bytes, ranging between 0 and 4095.
124 *
125 * @return Result of operation.
126 ****************************************************************************************
127 */
128 uint16_t app_dspi_dma_transmit_async(uint8_t *p_data, uint32_t length);
129
130 /**
131 ****************************************************************************************
132 * @brief Transmit an amount of data in non-blocking mode with DMA SG or LLP.
133 *
134 * @param[in] p_data: Pointer to data buffer
135 * @param[in] length: Amount of data to be sent in bytes, ranging between 0 and 4095.
136 * @param[in] sg_llp_config: The config of source and destination's SG and LLP.
137 *
138 * @return Result of operation.
139 ****************************************************************************************
140 */
141 uint16_t app_dspi_dma_sg_llp_transmit_async(uint8_t *p_data, uint32_t length, dma_sg_llp_config_t *sg_llp_config);
142
143 /** @} */
144
145 #endif
146
147 #ifdef __cplusplus
148 }
149 #endif
150
151 #endif
152 /** @} */
153
154 /** @} */
155
156 /** @} */
app_dspi_dma_command_async
uint16_t app_dspi_dma_command_async(app_dspi_command_t *p_cmd)
Transmit instruction in non-blocking mode with Interrupt.
app_dspi_dma_init
uint16_t app_dspi_dma_init(app_dspi_params_t *p_params)
Initialize the APP DSPI DRIVER according to the specified parameters in the app_dspi_params_t and app...
_dspi_command_t
DSPI command Structure definition.
Definition: gr55xx_hal_dspi.h:154
app_dspi_dma_sg_llp_transmit_async
uint16_t app_dspi_dma_sg_llp_transmit_async(uint8_t *p_data, uint32_t length, dma_sg_llp_config_t *sg_llp_config)
Transmit an amount of data in non-blocking mode with DMA SG or LLP.
dma_sg_llp_config
LL DMA sg and llp config definition.
Definition: gr55xx_hal_dma.h:219
app_dspi.h
Header file containing functions prototypes of DSPI app library.
app_dspi_dma_transmit_async
uint16_t app_dspi_dma_transmit_async(uint8_t *p_data, uint32_t length)
Transmit an amount of data in non-blocking mode with DMA.
app_io.h
Header file containing functions prototypes of GPIO app library.
grx_hal.h
This file contains all the functions prototypes for the HAL module driver.
app_dspi_dma_deinit
uint16_t app_dspi_dma_deinit(void)
De-initialize the APP DSPI DRIVER peripheral.
app_dspi_dma_command_transmit_async
uint16_t app_dspi_dma_command_transmit_async(app_dspi_command_t *p_cmd, uint8_t *p_data)
Receive an amount of data with the specified instruction in non-blocking mode with Interrupt.
app_dspi_params_t
DSPI parameters structure definition.
Definition: app_dspi.h:199
app_drv_error.h
Header file of app driver error code.
app_drv_config.h
Header file of app driver config code.