Functions
Functions
Peripheral Driver » APP DRIVER » DSPI
Collaboration diagram for Functions:

## Functions
uint16_t | app_dspi_init (app_dspi_params_t *p_params, app_dspi_evt_handler_t evt_handler)
| Initialize the APP DSPI DRIVER according to the specified parameters in the app_dspi_params_t and app_dspi_evt_handler_t. More...
uint16_t | app_dspi_deinit (void)
| De-initialize the APP DSPI DRIVER peripheral. More...
uint16_t | app_dspi_command_transmit_sync (app_dspi_command_t *p_cmd, uint8_t *p_data, uint32_t timeout)
| Receive an amount of data with the specified instruction in blocking mode. More...
uint16_t | app_dspi_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. More...
uint16_t | app_dspi_command_sync (app_dspi_command_t *p_cmd, uint32_t timeout)
| Transmit only instruction in blocking mode. More...
uint16_t | app_dspi_command_async (app_dspi_command_t *p_cmd)
| Transmit instruction in non-blocking mode with Interrupt. More...
uint16_t | app_dspi_transmit_sync (uint8_t *p_data, uint32_t length, uint32_t timeout)
| Transmit an amount of data in blocking mode. More...
uint16_t | app_dspi_transmit_async (uint8_t *p_data, uint32_t length)
| Transmit an amount of data in non-blocking mode with Interrupt. More...
dspi_handle_t * | app_dspi_get_handle (void)
| Return the DSPI handle. More...
uint16_t | app_dspi_config_mode (uint32_t mode)
| Set the DSPI transmission mode. More...
uint16_t | app_dspi_config_data_size (uint32_t data_size)
| Set the DSPI transmission data size. More...
uint16_t | app_dspi_abort (void)
| Abort the current transmission. More...
uint16_t | app_dspi_abort_it (void)
| Abort the current transmission (non-blocking function) More...
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_evt_handler_t. More...
uint16_t | app_dspi_dma_deinit (void)
| De-initialize the APP DSPI DRIVER peripheral. More...
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. More...
uint16_t | app_dspi_dma_command_async (app_dspi_command_t *p_cmd)
| Transmit instruction in non-blocking mode with Interrupt. More...
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. More...
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. More...

## Detailed Description

## Function Documentation

## ◆ app_dspi_abort()

uint16_t app_dspi_abort | ( | void |  | ) |

Abort the current transmission.

Returns
  Result of operation.

## ◆ app_dspi_abort_it()

uint16_t app_dspi_abort_it | ( | void |  | ) |

Abort the current transmission (non-blocking function)

Returns
  Result of operation.

## ◆ app_dspi_command_async()

uint16_t app_dspi_command_async | ( | app_dspi_command_t * | p_cmd | ) |

Transmit instruction in non-blocking mode with Interrupt.

Parameters

  [in] | p_cmd | Pointer to a app_dspi_command_t structure that contains the instruction for data transfer.

Returns
  Result of operation.

## ◆ app_dspi_command_sync()

uint16_t app_dspi_command_sync | ( | app_dspi_command_t * | p_cmd,
|  | uint32_t | timeout
| ) |  |

Transmit only instruction in blocking mode.

Parameters

  [in] | p_cmd | Pointer to a app_dspi_command_t structure that contains the instruction for data transfer.
  [in] | timeout | Timeout duration

Returns
  Result of operation.

## ◆ app_dspi_command_transmit_async()

uint16_t app_dspi_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.

Parameters

  [in] | p_cmd | Pointer to a app_dspi_command_t structure that contains the instruction, length, data_size for data transfer.
  [out] | p_data | Pointer to data buffer

Returns
  Result of operation.

## ◆ app_dspi_command_transmit_sync()

uint16_t app_dspi_command_transmit_sync | ( | app_dspi_command_t * | p_cmd,
|  | uint8_t * | p_data,
|  | uint32_t | timeout
| ) |  |

Receive an amount of data with the specified instruction in blocking mode.

Parameters

  [in] | p_cmd | Pointer to a app_dspi_command_t structure that contains the instruction, length, data_size for data transfer.
  [out] | p_data | Pointer to data buffer
  [in] | timeout | Timeout duration

Returns
  Result of operation.

## ◆ app_dspi_config_data_size()

uint16_t app_dspi_config_data_size | ( | uint32_t | data_size | ) |

Set the DSPI transmission data size.

Parameters

  [in] | data_size | the DSPI transmission data size.This parameter can be one of the following values: DSPI_DATASIZE_04_BITS DSPI_DATASIZE_05_BITS DSPI_DATASIZE_06_BITS DSPI_DATASIZE_07_BITS DSPI_DATASIZE_08_BITS DSPI_DATASIZE_09_BITS DSPI_DATASIZE_10_BITS DSPI_DATASIZE_11_BITS DSPI_DATASIZE_12_BITS DSPI_DATASIZE_13_BITS DSPI_DATASIZE_14_BITS DSPI_DATASIZE_15_BITS DSPI_DATASIZE_16_BITS DSPI_DATASIZE_17_BITS DSPI_DATASIZE_18_BITS DSPI_DATASIZE_19_BITS DSPI_DATASIZE_20_BITS DSPI_DATASIZE_21_BITS DSPI_DATASIZE_22_BITS DSPI_DATASIZE_23_BITS DSPI_DATASIZE_24_BITS DSPI_DATASIZE_25_BITS DSPI_DATASIZE_26_BITS DSPI_DATASIZE_27_BITS DSPI_DATASIZE_28_BITS DSPI_DATASIZE_29_BITS DSPI_DATASIZE_30_BITS DSPI_DATASIZE_31_BITS DSPI_DATASIZE_32_BITS

Returns
  Result of operation.

## ◆ app_dspi_config_mode()

uint16_t app_dspi_config_mode | ( | uint32_t | mode | ) |

Set the DSPI transmission mode.

Parameters

  [in] | mode | the DSPI transmission mode.This parameter can be one of the following values: DSPI_PROT_MODE_3W1L DSPI_PROT_MODE_4W1L DSPI_PROT_MODE_4W2L

Returns
  Result of operation.

## ◆ app_dspi_deinit()

uint16_t app_dspi_deinit | ( | void |  | ) |

De-initialize the APP DSPI DRIVER peripheral.

Returns
  Result of De-initialization.

## ◆ 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.

Parameters

  [in] | p_cmd | Pointer to a app_dspi_command_t structure that contains the instruction for data transfer.

Returns
  Result of operation.

## ◆ 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.

Parameters

  [in] | p_cmd | Pointer to a app_dspi_command_t structure that contains the instruction, length, data_size for data transfer.
  [out] | p_data | Pointer to data buffer

Returns
  Result of operation.

## ◆ app_dspi_dma_deinit()

uint16_t app_dspi_dma_deinit | ( | void |  | ) |

De-initialize the APP DSPI DRIVER peripheral.

Returns
  Result of De-initialization.

## ◆ 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_evt_handler_t.

Note
  If interrupt mode is set, you can use blocking mode. Conversely, if blocking mode is set, you can't use interrupt mode.

Parameters

  [in] | p_params | Pointer to app_dspi_params_t parameter which contains the configuration information for the specified DSPI module.

Returns
  Result of initialization.

## ◆ 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.

Parameters

  [in] | p_data | Pointer to data buffer
  [in] | length | Amount of data to be sent in bytes, ranging between 0 and 4095.
  [in] | sg_llp_config | The config of source and destination's SG and LLP.

Returns
  Result of operation.

## ◆ 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.

Parameters

  [in] | p_data | Pointer to data buffer
  [in] | length | Amount of data to be sent in bytes, ranging between 0 and 4095.

Returns
  Result of operation.

## ◆ app_dspi_get_handle()

dspi_handle_t* app_dspi_get_handle | ( | void |  | ) |

Return the DSPI handle.

Returns
  Pointer to the DSPI handle.

## ◆ app_dspi_init()

uint16_t app_dspi_init | ( | app_dspi_params_t * | p_params,
|  | app_dspi_evt_handler_t | evt_handler
| ) |  |

Initialize the APP DSPI DRIVER according to the specified parameters in the app_dspi_params_t and app_dspi_evt_handler_t.

Note
  If interrupt mode is set, you can use blocking mode. Conversely, if blocking mode is set, you can't use interrupt mode.

Parameters

  [in] | p_params | Pointer to app_dspi_params_t parameter which contains the configuration information for the specified DSPI module.
  [in] | evt_handler | DSPI user callback function.

Returns
  Result of initialization.

## ◆ app_dspi_transmit_async()

uint16_t app_dspi_transmit_async | ( | uint8_t * | p_data,
|  | uint32_t | length
| ) |  |

Transmit an amount of data in non-blocking mode with Interrupt.

Parameters

  [in] | p_data | Pointer to data buffer
  [in] | length | Amount of data to be sent in bytes

Returns
  Result of operation.

## ◆ app_dspi_transmit_sync()

uint16_t app_dspi_transmit_sync | ( | uint8_t * | p_data,
|  | uint32_t | length,
|  | uint32_t | timeout
| ) |  |

Transmit an amount of data in blocking mode.

Parameters

  [in] | p_data | Pointer to data buffer
  [in] | length | Amount of data to be sent in bytes
  [in] | timeout | Timeout duration

Returns
  Result of operation.