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

UM1725

 

HAL I2S Generic Driver

Parameters

 

hi2s: pointer to a I2S_HandleTypeDef structure that contains

 

 

the configuration information for I2S module

Return values

 

I2S Error Code

32.2.26HAL_I2S_GetState

Function Name

HAL_I2S_StateTypeDef HAL_I2S_GetState

 

(I2S_HandleTypeDef * hi2s)

Function Description

Return the I2S state.

Parameters

 

hi2s: pointer to a I2S_HandleTypeDef structure that contains

 

 

the configuration information for I2S module

Return values

 

HAL state

32.2.27HAL_I2S_GetError

Function Name

uint32_t HAL_I2S_GetError (I2S_HandleTypeDef * hi2s)

Function Description

Return the I2S error code.

Parameters

 

hi2s: pointer to a I2S_HandleTypeDef structure that contains

 

 

the configuration information for I2S module

Return values

 

I2S Error Code

32.3I2S Firmware driver defines

32.3.1I2S

I2S Audio Frequency

I2S_AUDIOFREQ_192K

I2S_AUDIOFREQ_96K

I2S_AUDIOFREQ_48K

I2S_AUDIOFREQ_44K

I2S_AUDIOFREQ_32K

I2S_AUDIOFREQ_22K

I2S_AUDIOFREQ_16K

I2S_AUDIOFREQ_11K

I2S_AUDIOFREQ_8K

I2S_AUDIOFREQ_DEFAULT

I2S Clock Polarity

I2S_CPOL_LOW

I2S_CPOL_HIGH

I2S Clock Source

I2S_CLOCK_PLL

I2S_CLOCK_EXTERNAL

DOCID025834 Rev 2

429/900

HAL I2S Generic Driver

UM1725

I2S_CLOCK_PLLR

I2S_CLOCK_PLLSRC

I2S Data Format

I2S_DATAFORMAT_16B

I2S_DATAFORMAT_16B_EXTENDED

I2S_DATAFORMAT_24B

I2S_DATAFORMAT_32B

I2S Error Code

HAL_I2S_ERROR_NONE HAL_I2S_ERROR_UDR HAL_I2S_ERROR_OVR HAL_I2SEX_ERROR_UDR HAL_I2SEX_ERROR_OVR HAL_I2S_ERROR_FRE HAL_I2S_ERROR_DMA

I2S Exported Macros

No error

I2S Underrun error

I2S Overrun error

I2S extended Underrun error I2S extended Overrun error I2S Frame format error DMA transfer error

__HAL_I2S_RESET_HANDLE_STATE Description:

Reset I2S handle state.

Parameters:

__HANDLE__: specifies the I2S Handle.

Return value:

 

 

None

__HAL_I2S_ENABLE

Description:

 

Enable or disable the specified SPI

 

 

peripheral (in I2S mode).

 

Parameters:

 

__HANDLE__: specifies the I2S Handle.

 

Return value:

 

 

None

__HAL_I2S_DISABLE

 

 

__HAL_I2S_ENABLE_IT

Description:

 

Enable or disable the specified I2S

 

 

interrupts.

 

Parameters:

 

__HANDLE__: specifies the I2S Handle.

 

__INTERRUPT__: specifies the interrupt

 

 

source to enable or disable. This parameter

 

 

can be one of the following values:

430/900

DOCID025834 Rev 2

UM1725

HAL I2S Generic Driver

 

I2S_IT_TXE: Tx buffer empty interrupt

 

enable

 

I2S_IT_RXNE: RX buffer not empty

 

interrupt enable

 

I2S_IT_ERR: Error interrupt enable

Return value:

 

None

__HAL_I2S_DISABLE_IT __HAL_I2S_GET_IT_SOURCE Description:

Checks if the specified I2S interrupt source

 

is enabled or disabled.

 

 

Parameters:

 

 

__HANDLE__: specifies the I2S Handle.

 

This parameter can be I2S where x: 1, 2, or

 

3 to select the I2S peripheral.

 

 

__INTERRUPT__: specifies the I2S

 

 

interrupt source to check. This parameter

 

can be one of the following values:

 

 

I2S_IT_TXE: Tx buffer empty interrupt

 

enable

 

 

I2S_IT_RXNE: RX buffer not empty

 

interrupt enable

 

 

I2S_IT_ERR: Error interrupt enable

 

Return value:

 

 

The: new state of __IT__ (TRUE or FALSE).

__HAL_I2S_GET_FLAG

Description:

 

 

Checks whether the specified I2S flag is set

 

or not.

 

 

Parameters:

 

 

__HANDLE__: specifies the I2S Handle.

 

__FLAG__: specifies the flag to check. This

 

parameter can be one of the following

 

values:

 

 

I2S_FLAG_RXNE: Receive buffer not

 

empty flag

 

 

I2S_FLAG_TXE: Transmit buffer empty

 

flag

 

 

I2S_FLAG_UDR: Underrun flag

 

 

I2S_FLAG_OVR: Overrun flag

 

 

I2S_FLAG_FRE: Frame error flag

 

I2S_FLAG_CHSIDE: Channel Side flag

 

I2S_FLAG_BSY: Busy flag

 

 

Return value:

 

 

The: new state of __FLAG__ (TRUE or

 

FALSE).

 

 

DOCID025834 Rev 2

431/900

HAL I2S Generic Driver

 

UM1725

__HAL_I2S_CLEAR_OVRFLAG

Description:

 

Clears the I2S OVR pending flag.

 

Parameters:

 

__HANDLE__: specifies the I2S Handle.

 

Return value:

 

 

None

__HAL_I2S_CLEAR_UDRFLAG

Description:

 

Clears the I2S UDR pending flag.

 

Parameters:

 

__HANDLE__: specifies the I2S Handle.

 

Return value:

 

 

None

I2S Flags Definition

I2S_FLAG_TXE

I2S_FLAG_RXNE

I2S_FLAG_UDR

I2S_FLAG_OVR

I2S_FLAG_FRE

I2S_FLAG_CHSIDE

I2S_FLAG_BSY

I2S FullDuplex Mode

I2S_FULLDUPLEXMODE_DISABLE

I2S_FULLDUPLEXMODE_ENABLE

I2S Interrupts Definition

I2S_IT_TXE

I2S_IT_RXNE

I2S_IT_ERR

I2S Mclk Output

I2S_MCLKOUTPUT_ENABLE

I2S_MCLKOUTPUT_DISABLE

I2S Mode

I2S_MODE_SLAVE_TX

I2S_MODE_SLAVE_RX

I2S_MODE_MASTER_TX

I2S_MODE_MASTER_RX

I2S Private Macros

432/900

DOCID025834 Rev 2

UM1725 HAL I2S Generic Driver

IS_I2S_CLOCKSOURCE

IS_I2S_MODE

IS_I2S_STANDARD

IS_I2S_DATA_FORMAT

IS_I2S_MCLK_OUTPUT

IS_I2S_AUDIO_FREQ

IS_I2S_FULLDUPLEX_MODE

IS_I2S_CPOL

I2SxEXT

I2S Standard

I2S_STANDARD_PHILIPS

I2S_STANDARD_MSB

I2S_STANDARD_LSB

I2S_STANDARD_PCM_SHORT

I2S_STANDARD_PCM_LONG

DOCID025834 Rev 2

433/900

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