Functions
Functions
Peripheral Driver » APP DRIVER » I2S

## Functions
uint16_t | app_i2s_init (app_i2s_params_t *p_params, app_i2s_evt_handler_t evt_handler)
| Initialize the APP I2S DRIVER according to the specified parameters in the app_i2s_params_t and app_i2s_evt_handler_t. More...
uint16_t | app_i2s_deinit (app_i2s_id_t id)
| De-initialize the APP I2S DRIVER peripheral. More...
uint16_t | app_i2s_receive_sync (app_i2s_id_t id, uint16_t *p_data, uint16_t size, uint32_t timeout)
| Receive in master or slave mode an amount of data in blocking mode. More...
uint16_t | app_i2s_receive_async (app_i2s_id_t id, uint16_t *p_data, uint16_t size)
| Receive in master or slave mode an amount of data in non-blocking mode with Interrupt. More...
uint16_t | app_i2s_transmit_sync (app_i2s_id_t id, uint16_t *p_data, uint16_t size, uint32_t timeout)
| Transmits in master or slave mode an amount of data in blocking mode. More...
uint16_t | app_i2s_transmit_async (app_i2s_id_t id, uint16_t *p_data, uint16_t size)
| Transmits in master or slave mode an amount of data in non-blocking mode with Interrupt. More...
uint16_t | app_i2s_enable (app_i2s_id_t id)
| Enable the I2S moudle. More...
uint16_t | app_i2s_disable (app_i2s_id_t id)
| Disable the I2S moudle. More...
uint16_t | app_i2s_enable_clock (app_i2s_id_t id)
| Enable the master I2S clock. More...
uint16_t | app_i2s_disable_clock (app_i2s_id_t id)
| Disable the master I2S clock. More...
uint16_t | app_i2s_flush_tx_fifo (app_i2s_id_t id)
| Flush the I2S transmitter FIFO. More...
uint16_t | app_i2s_flush_rx_fifo (app_i2s_id_t id)
| Flush the I2S receiver FIFO. More...
i2s_handle_t * | app_i2s_get_handle (app_i2s_id_t id)
| Return the I2S handle. More...

## Detailed Description

## Function Documentation

## ◆ app_i2s_deinit()

uint16_t app_i2s_deinit | ( | app_i2s_id_t | id | ) |

De-initialize the APP I2S DRIVER peripheral.

Parameters

  [in] | id | De-initialize for a specific ID.

Returns
  Result of De-initialization.

## ◆ app_i2s_disable()

uint16_t app_i2s_disable | ( | app_i2s_id_t | id | ) |

Disable the I2S moudle.

Parameters

  [in] | id | The I2S module id.

Returns
  Result of operation.

## ◆ app_i2s_disable_clock()

uint16_t app_i2s_disable_clock | ( | app_i2s_id_t | id | ) |

Disable the master I2S clock.

Parameters

  [in] | id | The I2S master module id.

Returns
  Result of operation.

## ◆ app_i2s_enable()

uint16_t app_i2s_enable | ( | app_i2s_id_t | id | ) |

Enable the I2S moudle.

Parameters

  [in] | id | The I2S module id.

Returns
  Result of operation.

## ◆ app_i2s_enable_clock()

uint16_t app_i2s_enable_clock | ( | app_i2s_id_t | id | ) |

Enable the master I2S clock.

Parameters

  [in] | id | The I2S master module id.

Returns
  Result of operation.

## ◆ app_i2s_flush_rx_fifo()

uint16_t app_i2s_flush_rx_fifo | ( | app_i2s_id_t | id | ) |

Flush the I2S receiver FIFO.

Parameters

  [in] | id | which I2S module want to flush.

Returns
  Result of operation.

## ◆ app_i2s_flush_tx_fifo()

uint16_t app_i2s_flush_tx_fifo | ( | app_i2s_id_t | id | ) |

Flush the I2S transmitter FIFO.

Parameters

  [in] | id | which I2S module want to flush.

Returns
  Result of operation.

## ◆ app_i2s_get_handle()

i2s_handle_t* app_i2s_get_handle | ( | app_i2s_id_t | id | ) |

Return the I2S handle.

Parameters

  [in] | id | I2S Channel ID.

Returns
  Pointer to the specified ID's I2S handle.

## ◆ app_i2s_init()

uint16_t app_i2s_init | ( | app_i2s_params_t * | p_params,
|  | app_i2s_evt_handler_t | evt_handler
| ) |  |

Initialize the APP I2S DRIVER according to the specified parameters in the app_i2s_params_t and app_i2s_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_i2s_params_t parameter which contains the configuration information for the specified I2S module.
  [in] | evt_handler | I2S user callback function.

Returns
  Result of initialization.

## ◆ app_i2s_receive_async()

uint16_t app_i2s_receive_async | ( | app_i2s_id_t | id,
|  | uint16_t * | p_data,
|  | uint16_t | size
| ) |  |

Receive in master or slave mode an amount of data in non-blocking mode with Interrupt.

Parameters

  [in] | id | which I2S module want to receive.
  [in] | p_data | Pointer to data buffer
  [in] | size | Amount of data to be sent

Returns
  Result of operation.

## ◆ app_i2s_receive_sync()

uint16_t app_i2s_receive_sync | ( | app_i2s_id_t | id,
|  | uint16_t * | p_data,
|  | uint16_t | size,
|  | uint32_t | timeout
| ) |  |

Receive in master or slave mode an amount of data in blocking mode.

Parameters

  [in] | id | which I2S module want to receive.
  [in] | p_data | Pointer to data buffer
  [in] | size | Amount of data to be sent
  [in] | timeout | Timeout duration

Returns
  Result of operation.

## ◆ app_i2s_transmit_async()

uint16_t app_i2s_transmit_async | ( | app_i2s_id_t | id,
|  | uint16_t * | p_data,
|  | uint16_t | size
| ) |  |

Transmits in master or slave mode an amount of data in non-blocking mode with Interrupt.

Parameters

  [in] | id | which I2S module want to transmit.
  [in] | p_data | Pointer to data buffer
  [in] | size | Amount of data to be sent

Returns
  Result of operation.

## ◆ app_i2s_transmit_sync()

uint16_t app_i2s_transmit_sync | ( | app_i2s_id_t | id,
|  | uint16_t * | p_data,
|  | uint16_t | size,
|  | uint32_t | timeout
| ) |  |

Transmits in master or slave mode an amount of data in blocking mode.

Parameters

  [in] | id | which I2S module want to transmit.
  [in] | p_data | Pointer to data buffer
  [in] | size | Amount of data to be sent
  [in] | timeout | Timeout duration

Returns
  Result of operation.