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

UM1725

HAL SAI Generic Driver

HAL_SAI_Transmit_IT()

HAL_SAI_Receive_IT()

HAL_SAI_DMAPause()

HAL_SAI_DMAResume()

HAL_SAI_DMAStop()

HAL_SAI_Abort()

HAL_SAI_Transmit_DMA()

HAL_SAI_Receive_DMA()

HAL_SAI_EnableTxMuteMode()

HAL_SAI_DisableTxMuteMode()

HAL_SAI_EnableRxMuteMode()

HAL_SAI_DisableRxMuteMode()

HAL_SAI_IRQHandler()

HAL_SAI_TxCpltCallback()

HAL_SAI_TxHalfCpltCallback()

HAL_SAI_RxCpltCallback()

HAL_SAI_RxHalfCpltCallback()

HAL_SAI_ErrorCallback()

50.2.4Peripheral State and Errors functions

This subsection permits to get in run-time the status of the peripheral and the data flow.

This section contains the following APIs:

HAL_SAI_GetState()

HAL_SAI_GetError()

50.2.5HAL_SAI_InitProtocol

 

Function Name

HAL_StatusTypeDef HAL_SAI_InitProtocol

 

 

 

(SAI_HandleTypeDef * hsai, uint32_t protocol, uint32_t

 

 

 

datasize, uint32_t nbslot)

 

 

Function Description

Initializes the structure FrameInit, SlotInit and the low part of Init

 

 

according to the specified parameters and call the function

 

 

 

HAL_SAI_Init to initialize the SAI block.

 

 

Parameters

 

hsai: : pointer to a SAI_HandleTypeDef structure that

 

 

 

contains the configuration information for SAI module.

 

 

 

 

protocol: : one of the supported protocol SAI Supported

 

 

 

protocol

 

 

 

datasize: : one of the supported datasize SAI protocol data

 

 

 

size the configuration information for SAI module.

 

 

 

 

nbslot: : Number of slot.

 

 

Return values

 

HAL status

 

50.2.6

HAL_SAI_Init

 

 

 

 

Function Name

HAL_StatusTypeDef HAL_SAI_Init (SAI_HandleTypeDef * hsai)

 

Function Description

Initializes the SAI according to the specified parameters in the

 

 

SAI_InitTypeDef and create the associated handle.

 

 

Parameters

 

hsai: pointer to a SAI_HandleTypeDef structure that contains

 

 

 

the configuration information for SAI module.

 

 

 

 

DOCID025834 Rev 2

673/900

HAL SAI Generic Driver

UM1725

Return values

HAL status

50.2.7HAL_SAI_DeInit

Function Name

HAL_StatusTypeDef HAL_SAI_DeInit (SAI_HandleTypeDef *

 

hsai)

Function Description

DeInitializes the SAI peripheral.

Parameters

 

hsai: pointer to a SAI_HandleTypeDef structure that contains

 

 

the configuration information for SAI module.

Return values

 

HAL status

50.2.8HAL_SAI_MspInit

Function Name

void HAL_SAI_MspInit (SAI_HandleTypeDef * hsai)

Function Description

SAI MSP Init.

Parameters

 

hsai: pointer to a SAI_HandleTypeDef structure that contains

 

 

the configuration information for SAI module.

Return values

 

None

50.2.9HAL_SAI_MspDeInit

Function Name

void HAL_SAI_MspDeInit (SAI_HandleTypeDef * hsai)

Function Description

SAI MSP DeInit.

Parameters

 

hsai: pointer to a SAI_HandleTypeDef structure that contains

 

 

the configuration information for SAI module.

Return values

 

None

50.2.10HAL_SAI_Transmit

Function Name

HAL_StatusTypeDef HAL_SAI_Transmit (SAI_HandleTypeDef

 

* hsai, uint8_t * pData, uint16_t Size, uint32_t Timeout)

Function Description

Transmits an amount of data in blocking mode.

Parameters

 

hsai: pointer to a SAI_HandleTypeDef structure that contains

 

 

the configuration information for SAI module.

 

 

pData: Pointer to data buffer

 

 

Size: Amount of data to be sent

 

 

Timeout: Timeout duration

Return values

 

HAL status

50.2.11HAL_SAI_Receive

Function Name

HAL_StatusTypeDef HAL_SAI_Receive (SAI_HandleTypeDef *

 

hsai, uint8_t * pData, uint16_t Size, uint32_t Timeout)

Function Description

Receives an amount of data in blocking mode.

Parameters

 

hsai: pointer to a SAI_HandleTypeDef structure that contains

 

 

the configuration information for SAI module.

 

 

pData: Pointer to data buffer

674/900

 

DOCID025834 Rev 2

UM1725

 

HAL SAI Generic Driver

 

Size: Amount of data to be received

 

 

Timeout: Timeout duration

Return values

 

HAL status

50.2.12HAL_SAI_Transmit_IT

Function Name

HAL_StatusTypeDef HAL_SAI_Transmit_IT

 

(SAI_HandleTypeDef * hsai, uint8_t * pData, uint16_t Size)

Function Description

Transmits an amount of data in no-blocking mode with Interrupt.

Parameters

 

hsai: pointer to a SAI_HandleTypeDef structure that contains

 

 

the configuration information for SAI module.

 

 

pData: Pointer to data buffer

 

 

Size: Amount of data to be sent

Return values

 

HAL status

50.2.13HAL_SAI_Receive_IT

Function Name

HAL_StatusTypeDef HAL_SAI_Receive_IT

 

(SAI_HandleTypeDef * hsai, uint8_t * pData, uint16_t Size)

Function Description

Receives an amount of data in no-blocking mode with Interrupt.

Parameters

 

hsai: pointer to a SAI_HandleTypeDef structure that contains

 

 

the configuration information for SAI module.

 

 

pData: Pointer to data buffer

 

 

Size: Amount of data to be received

Return values

 

HAL status

50.2.14HAL_SAI_DMAPause

Function Name

HAL_StatusTypeDef HAL_SAI_DMAPause

 

(SAI_HandleTypeDef * hsai)

Function Description

Pauses the audio stream playing from the Media.

Parameters

 

hsai: pointer to a SAI_HandleTypeDef structure that contains

 

 

the configuration information for SAI module.

Return values

 

HAL status

50.2.15HAL_SAI_DMAResume

Function Name

HAL_StatusTypeDef HAL_SAI_DMAResume

 

(SAI_HandleTypeDef * hsai)

Function Description

Resumes the audio stream playing from the Media.

Parameters

 

hsai: pointer to a SAI_HandleTypeDef structure that contains

 

 

the configuration information for SAI module.

Return values

 

HAL status

50.2.16HAL_SAI_DMAStop

Function Name

HAL_StatusTypeDef HAL_SAI_DMAStop (SAI_HandleTypeDef

 

DOCID025834 Rev 2

675/900

HAL SAI Generic Driver

 

UM1725

 

* hsai)

Function Description

Stops the audio stream playing from the Media.

Parameters

 

hsai: : pointer to a SAI_HandleTypeDef structure that

 

 

contains the configuration information for SAI module.

Return values

 

HAL status

50.2.17 HAL_SAI_Abort

Function Name

HAL_StatusTypeDef HAL_SAI_Abort (SAI_HandleTypeDef *

 

hsai)

Function Description

Abort the current transfer and disbaled the SAI.

Parameters

 

hsai: : pointer to a SAI_HandleTypeDef structure that

 

 

contains the configuration information for SAI module.

Return values

 

HAL status

50.2.18HAL_SAI_Transmit_DMA

Function Name

HAL_StatusTypeDef HAL_SAI_Transmit_DMA

 

(SAI_HandleTypeDef * hsai, uint8_t * pData, uint16_t Size)

Function Description

Transmits an amount of data in no-blocking mode with DMA.

Parameters

 

hsai: pointer to a SAI_HandleTypeDef structure that contains

 

 

the configuration information for SAI module.

 

 

pData: Pointer to data buffer

 

 

Size: Amount of data to be sent

Return values

 

HAL status

50.2.19HAL_SAI_Receive_DMA

Function Name

HAL_StatusTypeDef HAL_SAI_Receive_DMA

 

(SAI_HandleTypeDef * hsai, uint8_t * pData, uint16_t Size)

Function Description

Receives an amount of data in no-blocking mode with DMA.

Parameters

 

hsai: pointer to a SAI_HandleTypeDef structure that contains

 

 

the configuration information for SAI module.

 

 

pData: Pointer to data buffer

 

 

Size: Amount of data to be received

Return values

 

HAL status

50.2.20HAL_SAI_EnableTxMuteMode

Function Name

HAL_StatusTypeDef HAL_SAI_EnableTxMuteMode

 

(SAI_HandleTypeDef * hsai, uint16_t val)

Function Description

Enable the tx mute mode.

Parameters

 

hsai: : pointer to a SAI_HandleTypeDef structure that

 

 

contains the configuration information for SAI module.

 

val: : value sent during the mute SAI Block Mute Value

Return values

 

HAL status

676/900

 

DOCID025834 Rev 2

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