app_spi.h
Go to the documentation of this file.
1 /**
2 ****************************************************************************************
3 *
4 * @file app_spi.h
5 * @author BLE Driver Team
6 * @brief Header file containing functions prototypes of SPI 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_SPI SPI
47 * @brief SPI APP module driver.
48 * @{
49 */
50
51
52 #ifndef _APP_SPI_H_
53 #define _APP_SPI_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_SPI_MODULE_ENABLED
65
66 #ifdef _APP_SPI_V2_H_
67 #error "NOT Support USING app_spi AND app_spi_v2 AT The Same Time !!!"
68 #endif
69
70 /** @addtogroup APP_SPI_DEFINE Defines
71 * @{
72 */
73
74 #define APP_SPI_PIN_ENABLE 1 /**< SPI pin enable */
75 #define APP_SPI_PIN_DISABLE 0 /**< SPI pin disable */
76
77 /** @} */
78
79 /** @addtogroup APP_SPI_ENUM Enumerations
80 * @{
81 */
82
83 /**
84 * @brief SPI module Enumerations definition
85 */
86 typedef enum
87 {
88 APP_SPI_ID_SLAVE, /**< SPI slave module. */
89 APP_SPI_ID_MASTER, /**< SPI master module. */
90 APP_SPI_ID_MAX, /**< Only for check parameter, not used as input parameters. */
91 } app_spi_id_t;
92
93 /**
94 * @brief SPI operating mode Enumerations definition
95 */
96 typedef enum
97 {
98 APP_SPI_TYPE_INTERRUPT, /**< Interrupt operation mode */
99 APP_SPI_TYPE_POLLING, /**< Polling operation mode */
100 APP_SPI_TYPE_DMA, /**< DMA operation mode */
101 APP_SPI_TYPE_MAX, /**< Only for check parameter, not used as input parameters. */
102 } app_spi_type_t;
103
104 /**
105 * @brief SPI event Enumerations definition
106 */
107 typedef enum
108 {
109 APP_SPI_EVT_ERROR, /**< Error reported by UART peripheral. */
110 APP_SPI_EVT_TX_CPLT, /**< Requested TX transfer completed. */
111 APP_SPI_EVT_RX_DATA, /**< Requested RX transfer completed. */
112 APP_SPI_EVT_TX_RX, /**< Requested TX/RX transfer completed. */
113 } app_spi_evt_type_t;
114 /** @} */
115
116 /** @addtogroup APP_SPI_STRUCTURES Structures
117 * @{
118 */
119 /**
120 * @brief SPI IO Structures
121 */
122 typedef struct
123 {
124 app_io_type_t type; /**< Specifies the type of SPI IO. */
125 app_io_mux_t mux; /**< Specifies the Peripheral to be connected to the selected pins. */
126 uint32_t pin; /**< Specifies the IO pins to be configured.
127 This parameter can be any value of @ref GR551x_pins. */
128 app_io_pull_t pull; /**< Specifies the Pull-up or Pull-Down activation for the selected pins. */
129 uint8_t enable; /**< Enable or disable the pin. */
130 } app_spi_pin_t;
131
132 /**
133 * @brief SPI IO configuration Structures
134 */
135 typedef struct
136 {
137 app_spi_pin_t cs; /**< Set the configuration of SPI CS pin. */
138 app_spi_pin_t clk; /**< Set the configuration of SPI CLK pin. */
139 app_spi_pin_t mosi; /**< Set the configuration of SPI MOSI pin. */
140 app_spi_pin_t miso; /**< Set the configuration of SPI MISO pin. */
141 } app_spi_pin_cfg_t;
142
143 /**
144 * @brief SPI operate mode Enumerations definition
145 */
146 typedef struct
147 {
148 app_spi_type_t type; /**< Specifies the operation mode of SPI. */
149 dma_channel_t tx_dma_channel; /**< Specifies the dma channel of SPI TX. */
150 dma_channel_t rx_dma_channel; /**< Specifies the dma channel of SPI RX. */
151 } app_spi_mode_t;
152
153 /**
154 * @brief SPI parameters structure definition
155 */
156 typedef struct
157 {
158 app_spi_id_t id; /**< specified SPI module ID. */
159 app_spi_pin_cfg_t pin_cfg; /**< the pin configuration information for the specified SPI module. */
160 app_spi_mode_t use_mode; /**< SPI operate mode. */
161 spi_init_t init; /**< SPI communication parameters. */
162 } app_spi_params_t;
163
164 /**
165 * @brief SPI event structure definition
166 */
167 typedef struct
168 {
169 app_spi_evt_type_t type; /**< Type of event. */
170 union
171 {
172 uint32_t error_code; /**< SPI Error code . */
173 uint16_t size; /**< SPI transmitted/received counter. */
174 } data; /**< SPI data. */
175 } app_spi_evt_t;
176
177 /**
178 * @brief SPI event callback definition
179 */
180 typedef void (*app_spi_evt_handler_t)(app_spi_evt_t *p_evt);
181
182 /** @} */
183
184 /* Exported functions --------------------------------------------------------*/
185 /** @addtogroup APP_SPI_DRIVER_FUNCTIONS Functions
186 * @{
187 */
188 /**
189 ****************************************************************************************
190 * @brief Initialize the APP SPI DRIVER according to the specified parameters
191 * in the app_spi_params_t and app_spi_evt_handler_t.
192 * @note If interrupt mode is set, you can use blocking mode. Conversely, if blocking mode
193 * is set, you can't use interrupt mode.
194 *
195 * @param[in] p_params: Pointer to app_spi_params_t parameter which contains the
196 * configuration information for the specified SPI module.
197 * @param[in] evt_handler: SPI user callback function.
198 *
199 *
200 * @return Result of initialization.
201 ****************************************************************************************
202 */
203 uint16_t app_spi_init(app_spi_params_t *p_params, app_spi_evt_handler_t evt_handler);
204
205 /**
206 ****************************************************************************************
207 * @brief De-initialize the APP SPI DRIVER peripheral.
208 *
209 * @param[in] id: De-initialize for a specific ID.
210 *
211 * @return Result of De-initialization.
212 ****************************************************************************************
213 */
214 uint16_t app_spi_deinit(app_spi_id_t id);
215
216 /**
217 ****************************************************************************************
218 * @brief Receive in master or slave mode an amount of data in blocking mode.
219 *
220 * @param[in] id: which SPI module want to receive.
221 * @param[in] p_data: Pointer to data buffer
222 * @param[in] size: Amount of data to be sent
223 * @param[in] timeout: Timeout duration
224 *
225 * @return Result of operation.
226 ****************************************************************************************
227 */
228 uint16_t app_spi_receive_sync(app_spi_id_t id, uint8_t *p_data, uint16_t size, uint32_t timeout);
229
230 /**
231 ****************************************************************************************
232 * @brief Receive in master or slave mode an amount of data in non-blocking mode with Interrupt
233 *
234 * @param[in] id: which SPI module want to receive.
235 * @param[in] p_data: Pointer to data buffer
236 * @param[in] size: Amount of data to be sent
237 *
238 * @return Result of operation.
239 ****************************************************************************************
240 */
241 uint16_t app_spi_receive_async(app_spi_id_t id, uint8_t *p_data, uint16_t size);
242
243 /**
244 ****************************************************************************************
245 * @brief Transmits in master or slave mode an amount of data in blocking mode.
246 *
247 * @param[in] id: which SPI module want to transmit.
248 * @param[in] p_data: Pointer to data buffer
249 * @param[in] size: Amount of data to be sent
250 * @param[in] timeout: Timeout duration
251 *
252 * @return Result of operation.
253 ****************************************************************************************
254 */
255 uint16_t app_spi_transmit_sync(app_spi_id_t id, uint8_t *p_data, uint16_t size, uint32_t timeout);
256
257 /**
258 ****************************************************************************************
259 * @brief Transmits in master or slave mode an amount of data in non-blocking mode with Interrupt
260 *
261 * @param[in] id: which SPI module want to transmit.
262 * @param[in] p_data: Pointer to data buffer
263 * @param[in] size: Amount of data to be sent
264 *
265 * @return Result of operation.
266 ****************************************************************************************
267 */
268 uint16_t app_spi_transmit_async(app_spi_id_t id, uint8_t *p_data, uint16_t size);
269
270 /**
271 ****************************************************************************************
272 * @brief Transmits and receive in master or slave mode an amount of data in blocking mode.
273 *
274 * @param[in] id: which SPI module want to transmit.
275 * @param[in] p_tx_data: Pointer to tx data buffer
276 * @param[in] p_rx_data: Pointer to rx data buffer
277 * @param[in] size: Amount of data to be sent and receive
278 * @param[in] timeout: Timeout duration
279 *
280 * @return Result of operation.
281 ****************************************************************************************
282 */
283 uint16_t app_spi_transmit_receive_sync(app_spi_id_t id, uint8_t *p_tx_data, uint8_t *p_rx_data, uint32_t size, uint32_t timeout);
284
285 /**
286 ****************************************************************************************
287 * @brief Transmits and receive in master or slave mode an amount of data in non-blocking mode with Interrupt
288 *
289 * @param[in] id: which SPI module want to transmit.
290 * @param[in] p_tx_data: Pointer to tx data buffer
291 * @param[in] p_rx_data: Pointer to rx data buffer
292 * @param[in] size: Amount of data to be sent and receive
293 *
294 * @return Result of operation.
295 ****************************************************************************************
296 */
297 uint16_t app_spi_transmit_receive_async(app_spi_id_t id, uint8_t *p_tx_data, uint8_t *p_rx_data, uint32_t size);
298
299 /**
300 ****************************************************************************************
301 * @brief Read an amount of data from EEPROM in blocking mode.
302 *
303 * @param[in] id: which SPI module want to transmit.
304 * @param[in] p_tx_data: Pointer to transmission data buffer
305 * @param[out] p_rx_data: Pointer to reception data buffer
306 * @param[in] tx_size: Amount of data to be sent in bytes
307 * @param[in] rx_size: Amount of data to be received in bytes
308 * @param[in] timeout: Timeout duration
309 *
310 * @return Result of operation.
311 ****************************************************************************************
312 */
313 uint16_t app_spi_read_eeprom_sync(app_spi_id_t id, uint8_t *p_tx_data, uint8_t *p_rx_data, uint32_t tx_size, uint32_t rx_size, uint32_t timeout);
314
315 /**
316 ****************************************************************************************
317 * @brief Read an amount of data from EEPROM in non-blocking mode with Interrupt.
318 *
319 * @param[in] id: which SPI module want to transmit.
320 * @param[in] p_tx_data: Pointer to transmission data buffer
321 * @param[out] p_rx_data: Pointer to reception data buffer
322 * @param[in] tx_size: Amount of data to be sent in bytes
323 * @param[in] rx_size: Amount of data to be received in bytes
324 *
325 * @return Result of operation.
326 ****************************************************************************************
327 */
328 uint16_t app_spi_read_eeprom_async(app_spi_id_t id, uint8_t *p_tx_data, uint8_t *p_rx_data, uint32_t tx_size, uint32_t rx_size);
329
330 /**
331 ****************************************************************************************
332 * @brief Transmits in master or slave mode an amount of data in non-blocking mode with DMA
333 *
334 * @param[in] id: which SPI module want to transmit.
335 * @param[in] p_cmd_data: Pointer to command data buffer
336 * @param[in] p_tx_data: Pointer to transmission data buffer
337 * @param[in] cmd_size: Amount of command data to be sent in bytes
338 * @param[in] tx_size: Amount of data to be sent in bytes
339 *
340 * @return Result of operation.
341 ****************************************************************************************
342 */
343 uint16_t app_spi_write_memory_async(app_spi_id_t id, uint8_t *p_cmd_data, uint8_t *p_tx_data, uint32_t cmd_size, uint32_t tx_size);
344
345 /**
346 ****************************************************************************************
347 * @brief Read an amount of data from EEPROM in non-blocking mode with DMA.
348 *
349 * @param[in] id: which SPI module want to transmit.
350 * @param[in] p_cmd_data: Pointer to command data buffer
351 * @param[out] p_rx_data: Pointer to reception data buffer
352 * @param[in] cmd_size: Amount of command data to be sent in bytes
353 * @param[in] rx_size: Amount of data to be received in bytes
354 *
355 * @return Result of operation.
356 ****************************************************************************************
357 */
358 uint16_t app_spi_read_memory_async(app_spi_id_t id, uint8_t *p_cmd_data, uint8_t *p_rx_data, uint32_t cmd_size, uint32_t rx_size);
359
360 /**
361 ****************************************************************************************
362 * @brief Return the SPI handle.
363 *
364 * @param[in] id: SPI Channel ID.
365 *
366 * @return Pointer to the specified ID's SPI handle.
367 ****************************************************************************************
368 */
369 spi_handle_t *app_spi_get_handle(app_spi_id_t id);
370
371
372 #ifdef ENV_RTOS_USE_SEMP
373 /**
374 ****************************************************************************************
375 * @brief [RTOS] Receive in master or slave mode an amount of data in blocking mode.
376 *
377 * @param[in] id: which SPI module want to receive.
378 * @param[in] p_data: Pointer to data buffer
379 * @param[in] size: Amount of data to be sent
380 *
381 * @return Result of operation.
382 ****************************************************************************************
383 */
384 uint16_t app_spi_receive_sem_sync(app_spi_id_t id, uint8_t *p_data, uint16_t size);
385
386 /**
387 ****************************************************************************************
388 * @brief [RTOS] Transmits in master or slave mode an amount of data in blocking mode.
389 *
390 * @param[in] id: which SPI module want to transmit.
391 * @param[in] p_data: Pointer to data buffer
392 * @param[in] size: Amount of data to be sent
393 *
394 * @return Result of operation.
395 ****************************************************************************************
396 */
397 uint16_t app_spi_transmit_sem_sync(app_spi_id_t id, uint8_t *p_data, uint16_t size);
398
399 /**
400 ****************************************************************************************
401 * @brief [RTOS] Transmits and receive in master or slave mode an amount of data in blocking mode.
402 *
403 * @param[in] id: which SPI module want to transmit.
404 * @param[in] p_tx_data: Pointer to tx data buffer
405 * @param[in] p_rx_data: Pointer to rx data buffer
406 * @param[in] size: Amount of data to be sent and receive
407 *
408 * @return Result of operation.
409 ****************************************************************************************
410 */
411 uint16_t app_spi_transmit_receive_sem_sync(app_spi_id_t id, uint8_t *p_tx_data, uint8_t *p_rx_data, uint32_t size);
412 #endif
413
414 /**
415 ****************************************************************************************
416 * @brief [High speed] Receive in master or slave mode an amount of data in blocking mode.
417 *
418 * @param[in] id: which SPI module want to receive.
419 * @param[in] p_data: Pointer to data buffer
420 * @param[in] size: Amount of data to be sent
421 *
422 * @return Result of operation.
423 ****************************************************************************************
424 */
425 uint16_t app_spi_receive_high_speed_sync(app_spi_id_t id, uint8_t *p_data, uint16_t size);
426
427 /**
428 ****************************************************************************************
429 * @brief [High speed] Transmit in master or slave mode an amount of data in blocking mode.
430 *
431 * @param[in] id: which SPI module want to receive.
432 * @param[in] p_data: Pointer to data buffer
433 * @param[in] size: Amount of data to be sent
434 *
435 * @return Result of operation.
436 ****************************************************************************************
437 */
438 uint16_t app_spi_transmit_high_speed_sync(app_spi_id_t id, uint8_t *p_data, uint16_t size);
439
440 /** @} */
441
442 #endif
443
444 #ifdef __cplusplus
445 }
446 #endif
447
448 #endif
449
450 /** @} */
451 /** @} */
452 /** @} */
453
454
app_spi_pin_cfg_t
SPI IO configuration Structures.
Definition: app_spi.h:136
_spi_handle
SPI handle Structure definition.
Definition: gr55xx_hal_spi.h:135
app_spi_params_t::use_mode
app_spi_mode_t use_mode
SPI operate mode.
Definition: app_spi.h:160
APP_SPI_TYPE_MAX
@ APP_SPI_TYPE_MAX
Only for check parameter, not used as input parameters.
Definition: app_spi.h:101
app_spi_deinit
uint16_t app_spi_deinit(app_spi_id_t id)
De-initialize the APP SPI DRIVER peripheral.
APP_SPI_ID_MAX
@ APP_SPI_ID_MAX
Only for check parameter, not used as input parameters.
Definition: app_spi.h:90
app_spi_params_t::pin_cfg
app_spi_pin_cfg_t pin_cfg
the pin configuration information for the specified SPI module.
Definition: app_spi.h:159
app_spi_receive_high_speed_sync
uint16_t app_spi_receive_high_speed_sync(app_spi_id_t id, uint8_t *p_data, uint16_t size)
[High speed] Receive in master or slave mode an amount of data in blocking mode.
app_spi_transmit_high_speed_sync
uint16_t app_spi_transmit_high_speed_sync(app_spi_id_t id, uint8_t *p_data, uint16_t size)
[High speed] Transmit in master or slave mode an amount of data in blocking mode.
app_spi_pin_cfg_t::mosi
app_spi_pin_t mosi
Set the configuration of SPI MOSI pin.
Definition: app_spi.h:139
APP_SPI_ID_SLAVE
@ APP_SPI_ID_SLAVE
SPI slave module.
Definition: app_spi.h:88
app_spi_read_memory_async
uint16_t app_spi_read_memory_async(app_spi_id_t id, uint8_t *p_cmd_data, uint8_t *p_rx_data, uint32_t cmd_size, uint32_t rx_size)
Read an amount of data from EEPROM in non-blocking mode with DMA.
APP_SPI_TYPE_DMA
@ APP_SPI_TYPE_DMA
DMA operation mode
Definition: app_spi.h:100
app_spi_evt_handler_t
void(* app_spi_evt_handler_t)(app_spi_evt_t *p_evt)
SPI event callback definition.
Definition: app_spi.h:180
app_spi_params_t
SPI parameters structure definition.
Definition: app_spi.h:157
_spi_init
SPI init Structure definition.
Definition: gr55xx_hal_spi.h:104
app_spi_evt_t
SPI event structure definition.
Definition: app_spi.h:168
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_spi_init
uint16_t app_spi_init(app_spi_params_t *p_params, app_spi_evt_handler_t evt_handler)
Initialize the APP SPI DRIVER according to the specified parameters in the app_spi_params_t and app_s...
app_spi_pin_cfg_t::clk
app_spi_pin_t clk
Set the configuration of SPI CLK pin.
Definition: app_spi.h:138
app_spi_evt_t::error_code
uint32_t error_code
SPI Error code .
Definition: app_spi.h:172
app_spi_transmit_receive_async
uint16_t app_spi_transmit_receive_async(app_spi_id_t id, uint8_t *p_tx_data, uint8_t *p_rx_data, uint32_t size)
Transmits and receive in master or slave mode an amount of data in non-blocking mode with Interrupt.
app_spi_write_memory_async
uint16_t app_spi_write_memory_async(app_spi_id_t id, uint8_t *p_cmd_data, uint8_t *p_tx_data, uint32_t cmd_size, uint32_t tx_size)
Transmits in master or slave mode an amount of data in non-blocking mode with DMA.
app_spi_pin_t::type
app_io_type_t type
Specifies the type of SPI IO.
Definition: app_spi.h:124
app_spi_pin_t::enable
uint8_t enable
Enable or disable the pin.
Definition: app_spi.h:129
APP_SPI_ID_MASTER
@ APP_SPI_ID_MASTER
SPI master module.
Definition: app_spi.h:89
app_spi_transmit_receive_sync
uint16_t app_spi_transmit_receive_sync(app_spi_id_t id, uint8_t *p_tx_data, uint8_t *p_rx_data, uint32_t size, uint32_t timeout)
Transmits and receive in master or slave mode an amount of data in blocking mode.
APP_SPI_TYPE_POLLING
@ APP_SPI_TYPE_POLLING
Polling operation mode
Definition: app_spi.h:99
app_io.h
Header file containing functions prototypes of GPIO app library.
APP_SPI_EVT_TX_RX
@ APP_SPI_EVT_TX_RX
Requested TX/RX transfer completed.
Definition: app_spi.h:112
app_spi_params_t::id
app_spi_id_t id
specified SPI module ID.
Definition: app_spi.h:158
app_spi_get_handle
spi_handle_t * app_spi_get_handle(app_spi_id_t id)
Return the SPI handle.
app_spi_id_t
app_spi_id_t
SPI module Enumerations definition.
Definition: app_spi.h:87
app_spi_transmit_sync
uint16_t app_spi_transmit_sync(app_spi_id_t id, uint8_t *p_data, uint16_t size, uint32_t timeout)
Transmits in master or slave mode an amount of data in blocking mode.
app_spi_pin_cfg_t::cs
app_spi_pin_t cs
Set the configuration of SPI CS pin.
Definition: app_spi.h:137
APP_SPI_TYPE_INTERRUPT
@ APP_SPI_TYPE_INTERRUPT
Interrupt operation mode.
Definition: app_spi.h:98
app_spi_receive_async
uint16_t app_spi_receive_async(app_spi_id_t id, uint8_t *p_data, uint16_t size)
Receive in master or slave mode an amount of data in non-blocking mode with Interrupt.
app_spi_evt_t::type
app_spi_evt_type_t type
Type of event.
Definition: app_spi.h:169
app_spi_pin_t
SPI IO Structures.
Definition: app_spi.h:123
app_spi_evt_type_t
app_spi_evt_type_t
SPI event Enumerations definition.
Definition: app_spi.h:108
app_spi_mode_t::rx_dma_channel
dma_channel_t rx_dma_channel
Specifies the dma channel of SPI RX.
Definition: app_spi.h:150
app_spi_type_t
app_spi_type_t
SPI operating mode Enumerations definition.
Definition: app_spi.h:97
APP_SPI_EVT_TX_CPLT
@ APP_SPI_EVT_TX_CPLT
Requested TX transfer completed.
Definition: app_spi.h:110
app_spi_receive_sync
uint16_t app_spi_receive_sync(app_spi_id_t id, uint8_t *p_data, uint16_t size, uint32_t timeout)
Receive in master or slave mode an amount of data in blocking mode.
APP_SPI_EVT_RX_DATA
@ APP_SPI_EVT_RX_DATA
Requested RX transfer completed.
Definition: app_spi.h:111
app_spi_pin_cfg_t::miso
app_spi_pin_t miso
Set the configuration of SPI MISO pin.
Definition: app_spi.h:140
gr55xx_hal.h
This file contains all the functions prototypes for the HAL module driver.
app_spi_mode_t::tx_dma_channel
dma_channel_t tx_dma_channel
Specifies the dma channel of SPI TX.
Definition: app_spi.h:149
app_spi_evt_t::size
uint16_t size
SPI transmitted/received counter.
Definition: app_spi.h:173
app_spi_mode_t::type
app_spi_type_t type
Specifies the operation mode of SPI.
Definition: app_spi.h:148
app_io_mux_t
app_io_mux_t
GPIO mux Enumerations definition.
Definition: app_io.h:198
app_spi_pin_t::pull
app_io_pull_t pull
Specifies the Pull-up or Pull-Down activation for the selected pins.
Definition: app_spi.h:128
app_spi_read_eeprom_async
uint16_t app_spi_read_eeprom_async(app_spi_id_t id, uint8_t *p_tx_data, uint8_t *p_rx_data, uint32_t tx_size, uint32_t rx_size)
Read an amount of data from EEPROM in non-blocking mode with Interrupt.
app_rtos_cfg.h
Header file of app rtos config code.
app_drv_error.h
Header file of app driver error code.
app_spi_params_t::init
spi_init_t init
SPI communication parameters.
Definition: app_spi.h:161
APP_SPI_EVT_ERROR
@ APP_SPI_EVT_ERROR
Error reported by UART peripheral.
Definition: app_spi.h:109
app_spi_pin_t::mux
app_io_mux_t mux
Specifies the Peripheral to be connected to the selected pins.
Definition: app_spi.h:125
app_spi_transmit_async
uint16_t app_spi_transmit_async(app_spi_id_t id, uint8_t *p_data, uint16_t size)
Transmits in master or slave mode an amount of data in non-blocking mode with Interrupt.
dma_channel_t
dma_channel_t
HAL DMA Channel Enumerations definition.
Definition: gr55xx_hal_dma.h:93
app_spi_read_eeprom_sync
uint16_t app_spi_read_eeprom_sync(app_spi_id_t id, uint8_t *p_tx_data, uint8_t *p_rx_data, uint32_t tx_size, uint32_t rx_size, uint32_t timeout)
Read an amount of data from EEPROM in blocking mode.
app_spi_pin_t::pin
uint32_t pin
Specifies the IO pins to be configured.
Definition: app_spi.h:126
app_spi_mode_t
SPI operate mode Enumerations definition.
Definition: app_spi.h:147