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

HAL SAI Generic Driver

UM1725

50 HAL SAI Generic Driver

50.1SAI Firmware driver registers structures

50.1.1SAI_InitTypeDef

Data Fields

uint32_t AudioMode

uint32_t Synchro

uint32_t SynchroExt

uint32_t OutputDrive

uint32_t NoDivider

uint32_t FIFOThreshold

uint32_t ClockSource

uint32_t AudioFrequency

uint32_t Mckdiv

uint32_t MonoStereoMode

uint32_t CompandingMode

uint32_t TriState

uint32_t Protocol

uint32_t DataSize

uint32_t FirstBit

uint32_t ClockStrobing

Field Documentation

uint32_t SAI_InitTypeDef::AudioMode

Specifies the SAI Block audio Mode. This parameter can be a value of

SAI_Block_Mode

uint32_t SAI_InitTypeDef::Synchro

Specifies SAI Block synchronization This parameter can be a value of

SAI_Block_Synchronization

uint32_t SAI_InitTypeDef::SynchroExt

Specifies SAI Block synchronization, this setup is common for BLOCKA and BLOCKB This parameter can be a value of SAI_Block_SyncExt

uint32_t SAI_InitTypeDef::OutputDrive

Specifies when SAI Block outputs are driven. This parameter can be a value of

SAI_Block_Output_Drive

Note:this value has to be set before enabling the audio block but after the audio block configuration.

uint32_t SAI_InitTypeDef::NoDivider

Specifies whether master clock will be divided or not. This parameter can be a value of SAI_Block_NoDivider

Note:: If bit NODIV in the SAI_xCR1 register is cleared, the frame length should be aligned to a number equal to a power of 2, from 8 to 256. If bit NODIV in the SAI_xCR1 register is set, the frame length can take any of the values without constraint since the input clock of the audio block should be equal to the bit clock. There is no MCLK_x clock which can be output.

666/900

DOCID025834 Rev 2

UM1725

HAL SAI Generic Driver

 

uint32_t SAI_InitTypeDef::FIFOThreshold

 

Specifies SAI Block FIFO threshold. This parameter can be a value of

 

SAI_Block_Fifo_Threshold

 

uint32_t SAI_InitTypeDef::ClockSource

 

Specifies the SAI Block x Clock source. This parameter is not used for STM32F446xx

 

devices.

 

uint32_t SAI_InitTypeDef::AudioFrequency

 

Specifies the audio frequency sampling. This parameter can be a value of

 

SAI_Audio_Frequency

 

uint32_t SAI_InitTypeDef::Mckdiv

 

Specifies the master clock divider, the parameter will be used if for AudioFrequency

 

the user choice This parameter must be a number between Min_Data = 0 and

 

Max_Data = 15

 

uint32_t SAI_InitTypeDef::MonoStereoMode

 

Specifies if the mono or stereo mode is selected. This parameter can be a value of

 

SAI_Mono_Stereo_Mode

 

uint32_t SAI_InitTypeDef::CompandingMode

 

Specifies the companding mode type. This parameter can be a value of

 

SAI_Block_Companding_Mode

 

uint32_t SAI_InitTypeDef::TriState

 

Specifies the companding mode type. This parameter can be a value of

 

SAI_TRIState_Management

 

uint32_t SAI_InitTypeDef::Protocol

Specifies the SAI Block protocol. This parameter can be a value of

SAI_Block_Protocol

uint32_t SAI_InitTypeDef::DataSize

Specifies the SAI Block data size. This parameter can be a value of

SAI_Block_Data_Size

uint32_t SAI_InitTypeDef::FirstBit

Specifies whether data transfers start from MSB or LSB bit. This parameter can be a value of SAI_Block_MSB_LSB_transmission

uint32_t SAI_InitTypeDef::ClockStrobing

Specifies the SAI Block clock strobing edge sensitivity. This parameter can be a value of SAI_Block_Clock_Strobing

50.1.2SAI_FrameInitTypeDef

Data Fields

uint32_t FrameLength

uint32_t ActiveFrameLength

uint32_t FSDefinition

uint32_t FSPolarity

uint32_t FSOffset

Field Documentation

uint32_t SAI_FrameInitTypeDef::FrameLength

Specifies the Frame length, the number of SCK clocks for each audio frame. This parameter must be a number between Min_Data = 8 and Max_Data = 256.

Note:: If master clock MCLK_x pin is declared as an output, the frame length should

DOCID025834 Rev 2

667/900

HAL SAI Generic Driver

UM1725

be aligned to a number equal to power of 2 in order to keep in an audio frame, an integer number of MCLK pulses by bit Clock.

uint32_t SAI_FrameInitTypeDef::ActiveFrameLength

Specifies the Frame synchronization active level length. This Parameter specifies the length in number of bit clock (SCK + 1) of the active level of FS signal in audio frame. This parameter must be a number between Min_Data = 1 and Max_Data = 128

uint32_t SAI_FrameInitTypeDef::FSDefinition

Specifies the Frame synchronization definition. This parameter can be a value of

SAI_Block_FS_Definition

uint32_t SAI_FrameInitTypeDef::FSPolarity

Specifies the Frame synchronization Polarity. This parameter can be a value of

SAI_Block_FS_Polarity

uint32_t SAI_FrameInitTypeDef::FSOffset

Specifies the Frame synchronization Offset. This parameter can be a value of

SAI_Block_FS_Offset

50.1.3SAI_SlotInitTypeDef

Data Fields

uint32_t FirstBitOffset

uint32_t SlotSize

uint32_t SlotNumber

uint32_t SlotActive

Field Documentation

uint32_t SAI_SlotInitTypeDef::FirstBitOffset

Specifies the position of first data transfer bit in the slot. This parameter must be a number between Min_Data = 0 and Max_Data = 24

uint32_t SAI_SlotInitTypeDef::SlotSize

Specifies the Slot Size. This parameter can be a value of SAI_Block_Slot_Size

uint32_t SAI_SlotInitTypeDef::SlotNumber

Specifies the number of slot in the audio frame. This parameter must be a number between Min_Data = 1 and Max_Data = 16

uint32_t SAI_SlotInitTypeDef::SlotActive

Specifies the slots in audio frame that will be activated. This parameter can be a value of SAI_Block_Slot_Active

50.1.4__SAI_HandleTypeDef

Data Fields

SAI_Block_TypeDef * Instance

SAI_InitTypeDef Init

SAI_FrameInitTypeDef FrameInit

SAI_SlotInitTypeDef SlotInit

uint8_t * pBuffPtr

uint16_t XferSize

uint16_t XferCount

668/900

DOCID025834 Rev 2

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