Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
cubexHal.pdf
Скачиваний:
110
Добавлен:
10.02.2016
Размер:
16.16 Mб
Скачать

HAL I2S Generic Driver

 

UM1725

 

hi2s)

Function Description

DeInitializes the I2S peripheral.

Parameters

 

hi2s: pointer to a I2S_HandleTypeDef structure that contains

 

 

the configuration information for I2S module

Return values

 

HAL status

32.2.7HAL_I2S_MspInit

Function Name

void HAL_I2S_MspInit (I2S_HandleTypeDef * hi2s)

Function Description

I2S MSP Init.

Parameters

 

hi2s: pointer to a I2S_HandleTypeDef structure that contains

 

 

the configuration information for I2S module

Return values

 

None

32.2.8HAL_I2S_MspDeInit

Function Name

void HAL_I2S_MspDeInit (I2S_HandleTypeDef * hi2s)

Function Description

I2S MSP DeInit.

Parameters

 

hi2s: pointer to a I2S_HandleTypeDef structure that contains

 

 

the configuration information for I2S module

Return values

 

None

32.2.9HAL_I2S_Transmit

Function Name

HAL_StatusTypeDef HAL_I2S_Transmit (I2S_HandleTypeDef *

 

hi2s, uint16_t * pData, uint16_t Size, uint32_t Timeout)

Function Description

Transmit an amount of data in blocking mode.

Parameters

 

hi2s: pointer to a I2S_HandleTypeDef structure that contains

 

 

the configuration information for I2S module

 

 

pData: a 16-bit pointer to data buffer.

 

 

Size: number of data sample to be sent:

 

 

Timeout: Timeout duration

Return values

 

HAL status

Notes

 

When a 16-bit data frame or a 16-bit data frame extended is

 

 

selected during the I2S configuration phase, the Size

 

 

parameter means the number of 16-bit data length in the

 

 

transaction and when a 24-bit data frame or a 32-bit data

 

 

frame is selected the Size parameter means the number of

 

 

16-bit data length.

 

 

The I2S is kept enabled at the end of transaction to avoid the

 

 

clock de-synchronization between Master and Slave(example:

 

 

audio streaming).

32.2.10HAL_I2S_Receive

Function Name

HAL_StatusTypeDef HAL_I2S_Receive (I2S_HandleTypeDef *

 

hi2s, uint16_t * pData, uint16_t Size, uint32_t Timeout)

424/900

DOCID025834 Rev 2

UM1725

 

HAL I2S Generic Driver

Function Description

Receive an amount of data in blocking mode.

Parameters

 

hi2s: pointer to a I2S_HandleTypeDef structure that contains

 

 

the configuration information for I2S module

 

 

pData: a 16-bit pointer to data buffer.

 

 

Size: number of data sample to be sent:

 

 

Timeout: Timeout duration

Return values

 

HAL status

Notes

 

When a 16-bit data frame or a 16-bit data frame extended is

 

 

selected during the I2S configuration phase, the Size

 

 

parameter means the number of 16-bit data length in the

transaction and when a 24-bit data frame or a 32-bit data frame is selected the Size parameter means the number of 16-bit data length.

The I2S is kept enabled at the end of transaction to avoid the clock de-synchronization between Master and Slave(example: audio streaming).

In I2S Master Receiver mode, just after enabling the peripheral the clock will be generate in continuous way and as the I2S is not disabled at the end of the I2S transaction.

32.2.11HAL_I2S_Transmit_IT

Function Name

HAL_StatusTypeDef HAL_I2S_Transmit_IT

 

(I2S_HandleTypeDef * hi2s, uint16_t * pData, uint16_t Size)

Function Description

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

Parameters

 

hi2s: pointer to a I2S_HandleTypeDef structure that contains

 

 

the configuration information for I2S module

 

pData: a 16-bit pointer to data buffer.

 

 

Size: number of data sample to be sent:

Return values

 

HAL status

Notes

 

When a 16-bit data frame or a 16-bit data frame extended is

 

 

selected during the I2S configuration phase, the Size

 

 

parameter means the number of 16-bit data length in the

 

 

transaction and when a 24-bit data frame or a 32-bit data

frame is selected the Size parameter means the number of 16-bit data length.

The I2S is kept enabled at the end of transaction to avoid the clock de-synchronization between Master and Slave(example: audio streaming).

32.2.12HAL_I2S_Receive_IT

Function Name

HAL_StatusTypeDef HAL_I2S_Receive_IT

 

 

(I2S_HandleTypeDef * hi2s, uint16_t * pData, uint16_t Size)

Function Description

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

Parameters

 

hi2s: pointer to a I2S_HandleTypeDef structure that contains

 

 

the configuration information for I2S module

 

 

 

pData: a 16-bit pointer to the Receive data buffer.

 

 

 

Size: number of data sample to be sent:

 

 

 

DOCID025834 Rev 2

425/900

HAL I2S Generic Driver

UM1725

Return values

HAL status

Notes

When a 16-bit data frame or a 16-bit data frame extended is

 

selected during the I2S configuration phase, the Size

 

parameter means the number of 16-bit data length in the

 

transaction and when a 24-bit data frame or a 32-bit data

 

frame is selected the Size parameter means the number of

 

16-bit data length.

The I2S is kept enabled at the end of transaction to avoid the clock de-synchronization between Master and Slave(example: audio streaming).

It is recommended to use DMA for the I2S receiver to avoid de-synchronisation between Master and Slave otherwise the I2S interrupt should be optimized.

32.2.13HAL_I2S_Transmit_DMA

Function Name

HAL_StatusTypeDef HAL_I2S_Transmit_DMA

 

(I2S_HandleTypeDef * hi2s, uint16_t * pData, uint16_t Size)

Function Description

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

Parameters

 

hi2s: pointer to a I2S_HandleTypeDef structure that contains

 

 

the configuration information for I2S module

 

 

pData: a 16-bit pointer to the Transmit data buffer.

 

 

Size: number of data sample to be sent:

Return values

 

HAL status

Notes

 

When a 16-bit data frame or a 16-bit data frame extended is

 

 

selected during the I2S configuration phase, the Size

parameter means the number of 16-bit data length in the transaction and when a 24-bit data frame or a 32-bit data frame is selected the Size parameter means the number of 16-bit data length.

The I2S is kept enabled at the end of transaction to avoid the clock de-synchronization between Master and Slave(example: audio streaming).

32.2.14HAL_I2S_Receive_DMA

Function Name

HAL_StatusTypeDef HAL_I2S_Receive_DMA

 

(I2S_HandleTypeDef * hi2s, uint16_t * pData, uint16_t Size)

Function Description

Receive an amount of data in non-blocking mode with DMA.

Parameters

 

hi2s: pointer to a I2S_HandleTypeDef structure that contains

 

 

the configuration information for I2S module

 

 

pData: a 16-bit pointer to the Receive data buffer.

 

 

Size: number of data sample to be sent:

Return values

 

HAL status

Notes

 

When a 16-bit data frame or a 16-bit data frame extended is

 

 

selected during the I2S configuration phase, the Size

 

 

parameter means the number of 16-bit data length in the

 

 

transaction and when a 24-bit data frame or a 32-bit data

 

 

frame is selected the Size parameter means the number of

 

 

16-bit data length.

426/900

 

DOCID025834 Rev 2

UM1725

HAL I2S Generic Driver

The I2S is kept enabled at the end of transaction to avoid the clock de-synchronization between Master and Slave(example: audio streaming).

32.2.15HAL_I2S_DMAPause

Function Name

HAL_StatusTypeDef HAL_I2S_DMAPause

 

(I2S_HandleTypeDef * hi2s)

Function Description

Pauses the audio stream playing from the Media.

Parameters

 

hi2s: pointer to a I2S_HandleTypeDef structure that contains

 

 

the configuration information for I2S module

Return values

 

HAL status

32.2.16HAL_I2S_DMAResume

Function Name

HAL_StatusTypeDef HAL_I2S_DMAResume

 

(I2S_HandleTypeDef * hi2s)

Function Description

Resumes the audio stream playing from the Media.

Parameters

 

hi2s: pointer to a I2S_HandleTypeDef structure that contains

 

 

the configuration information for I2S module

Return values

 

HAL status

32.2.17HAL_I2S_DMAStop

Function Name

HAL_StatusTypeDef HAL_I2S_DMAStop (I2S_HandleTypeDef

 

* hi2s)

Function Description

Resumes the audio stream playing from the Media.

Parameters

 

hi2s: pointer to a I2S_HandleTypeDef structure that contains

 

 

the configuration information for I2S module

Return values

 

HAL status

32.2.18HAL_I2S_IRQHandler

Function Name

void HAL_I2S_IRQHandler (I2S_HandleTypeDef * hi2s)

Function Description

This function handles I2S interrupt request.

Parameters

 

hi2s: pointer to a I2S_HandleTypeDef structure that contains

 

 

the configuration information for I2S module

Return values

 

None

32.2.19HAL_I2S_TxHalfCpltCallback

Function Name

void HAL_I2S_TxHalfCpltCallback (I2S_HandleTypeDef * hi2s)

Function Description

Tx Transfer Half completed callbacks.

 

Parameters

 

hi2s: pointer to a I2S_HandleTypeDef structure that contains

 

 

the configuration information for I2S module

 

Return values

 

None

 

 

 

DOCID025834 Rev 2

427/900

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]