app_uart_dma.h
Go to the documentation of this file.
1 /**
2  ****************************************************************************************
3  *
4  * @file app_uart_dma.h
5  * @author BLE Driver Team
6  * @brief Header file containing functions prototypes of UART 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_UART UART
47  * @brief UART APP module driver.
48  * @{
49  */
50 
51 
52 #ifndef _APP_UART_DMA_H_
53 #define _APP_UART_DMA_H_
54 
55 #include "app_uart.h"
56 #include "grx_hal.h"
57 #include "app_drv_config.h"
58 
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62 
63 #ifdef HAL_UART_MODULE_ENABLED
64 
65 /* Exported functions --------------------------------------------------------*/
66 /** @addtogroup APP_DMA_DRIVER_FUNCTIONS Functions
67  * @{
68  */
69 
70 /**
71  ****************************************************************************************
72  * @brief Initialize dma mode of the APP UART DRIVER according to the specified parameters
73  * in the app_uart_params_t.
74  *
75  * @param[in] p_params: Pointer to app_uart_params_t parameter which contains the
76  * configuration information for the specified UART module.
77  *
78  * @return Result of initialization.
79  ****************************************************************************************
80  */
82 
83 /**
84  ****************************************************************************************
85  * @brief De-initialize dma mode of the APP UART peripheral.
86  *
87  * @param[in] id: De-initialize for a specific ID.
88  *
89  * @return Result of De-initialization.
90  ****************************************************************************************
91  */
93 
94 /**
95  ****************************************************************************************
96  * @brief Receive an amount of data in dma mode.
97  *
98  * @param[in] id: which UART module want to receive.
99  * @param[in] p_data: Pointer to data buffer.
100  * @param[in] size: Amount of data to receive.
101  *
102  * @return Result of operation.
103  ****************************************************************************************
104  */
105 uint16_t app_uart_dma_receive_async(app_uart_id_t id, uint8_t *p_data, uint16_t size);
106 
107 /**
108  ****************************************************************************************
109  * @brief Send an amount of data in dma mode.
110  *
111  * @param[in] id: which UART module want to send.
112  * @param[in] p_data: Pointer to data buffer.
113  * @param[in] size: Amount of data to be sent.
114  *
115  * @return Result of operation.
116  ****************************************************************************************
117  */
118 uint16_t app_uart_dma_transmit_async(app_uart_id_t id, uint8_t *p_data, uint16_t size);
119 
120 #if (APP_DRIVER_CHIP_TYPE == APP_DRIVER_GR5526X) || (APP_DRIVER_CHIP_TYPE == APP_DRIVER_GR5525X)
121 /**
122  ****************************************************************************************
123  * @brief Send an amount of data in DMA mode with DMA sg and llp function.
124  *
125  * @param[in] id: which UART module want to receive.
126  * @param[in] p_data: Pointer to data buffer
127  * @param[in] size: Amount of data to be sent
128  * @param[in] sg_llp_config: The config of source and destination's sg and llp fuction.
129  *
130  * @return Result of operation.
131  ****************************************************************************************
132  */
133 uint16_t app_uart_transmit_dma_sg_llp(app_uart_id_t id, uint8_t *p_data, uint16_t size, dma_sg_llp_config_t *sg_llp_config);
134 
135 /**
136  ****************************************************************************************
137  * @brief Receive an amount of data in in dma_sg_llp mode.
138  *
139  * @param[in] id: which UART module want to transmit.
140  * @param[in] p_data: Pointer to data buffer
141  * @param[in] size: Amount of data to be sent
142  * @param[in] sg_llp_config: The config of source and destination's sg and llp fuction.
143  *
144  * @return Result of operation.
145  ****************************************************************************************
146  */
147 uint16_t app_uart_receive_dma_sg_llp(app_uart_id_t id, uint8_t *p_data, uint16_t size, dma_sg_llp_config_t *sg_llp_config);
148 #endif
149 
150 /** @} */
151 
152 #endif
153 
154 #ifdef __cplusplus
155 }
156 #endif
157 
158 #endif
159 
160 /** @} */
161 
162 /** @} */
163 
164 /** @} */
165 
app_uart_dma_deinit
uint16_t app_uart_dma_deinit(app_uart_id_t id)
De-initialize dma mode of the APP UART peripheral.
app_uart.h
Header file containing functions prototypes of UART app library.
app_uart_params_t
UART parameters structure definition.
Definition: app_uart.h:224
grx_hal.h
This file contains all the functions prototypes for the HAL module driver.
app_uart_dma_transmit_async
uint16_t app_uart_dma_transmit_async(app_uart_id_t id, uint8_t *p_data, uint16_t size)
Send an amount of data in dma mode.
app_uart_dma_receive_async
uint16_t app_uart_dma_receive_async(app_uart_id_t id, uint8_t *p_data, uint16_t size)
Receive an amount of data in dma mode.
app_uart_id_t
app_uart_id_t
UART module Enumerations definition.
Definition: app_uart.h:83
app_uart_dma_init
uint16_t app_uart_dma_init(app_uart_params_t *p_params)
Initialize dma mode of the APP UART DRIVER according to the specified parameters in the app_uart_para...
app_drv_config.h
Header file of app driver config code.