| Electronic Components Datasheet Search |
|
AN2776 Datasheet(PDF) 12 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN2776 Datasheet(HTML) 12 Page - STMicroelectronics |
|
12 / 20 page ![]() FWLib V1.0 to V2.0 migration steps AN2776 12/20 Common functions and configuration parameters for SPI and I2S Some SPI driver functions were updated to support the I2S protocol: 1. “I2S” was added in the function name to indicate that it can be used for SPI and I2S 2. “I2S” was added in the configuration parameter to indicate that it can be used for SPI and I2S 3. The function format is updated as follows: SPI_ I2S_FunctionName(SPIx, param1, param2,...) e.g.: SPI_ I2S_ITConfig(SPI_TypeDef* SPIx, u8 SPI_I2S_IT, FunctionalState NewState) Table 3 provides the list of the impacted functions. If you are using any function listed in the first column of Table 3, update the prototypes and parameter name to the new names given in the second column of the table. Example: Typical code for SPI interrupt and DMA configuration based on FWLib V1.0: SPI_ITConfig(SPI2, SPI_IT_TXE, ENABLE) SPI_DMACmd(SPI2, SPI_DMAReq_Rx, ENABLE) Using FWLib V2.0, this code becomes: SPI_I2S_ITConfig (SPI2, SPI_I2S_IT_TXE, ENABLE) SPI_I2S_DMACmd(SPI2, SPI_I2S_DMAReq_Rx, ENABLE) Note: In addition to these functions, a new structure is added to this driver to configure only the I2S peripheral. SPI-specific functions The functions not listed in Table 3 where not modified and are specific to the SPI protocol. New functions for I2S Three functions were added to cover I2S protocol-specific configuration: 1. I2S_Init(SPI_TypeDef* SPIx, I2S_InitTypeDef* I2S_InitStruct) 2. I2S_StructInit(I2S_InitTypeDef* I2S_InitStruct) 3. I2S_Cmd(SPI_TypeDef* SPIx, FunctionalState NewState) Table 3. Common functions for SPI and I2S(1) FWLib V1.0 FWLib V2.0 SPI_DeInit (SPI_TypeDef* SPIx) SPI_I2S_DeInit (SPI_TypeDef* SPIx) SPI_ITConfig (SPI_TypeDef* SPIx, u8 SPI_IT, FunctionalState NewState) SPI_I2S_ITConfig (SPI_TypeDef* SPIx, u8 SPI_I2S_IT, FunctionalState NewState) SPI_DMACmd (SPI_TypeDef* SPIx, u16 SPI_DMAReq, FunctionalState NewState) SPI_I2S_DMACmd (SPI_TypeDef* SPIx, u16 SPI_I2S_DMAReq, FunctionalState NewState) SPI_SendData (SPI_TypeDef* SPIx, u16 Data) SPI_I2S_SendData (SPI_TypeDef* SPIx, u16 Data) SPI_ReceiveData (SPI_TypeDef* SPIx) SPI_I2S_ReceiveData (SPI_TypeDef* SPIx) SPI_GetFlagStatus (SPI_TypeDef* SPIx, u16 SPI_FLAG) SPI_I2S_GetFlagStatus (SPI_TypeDef* SPIx, u16 SPI_I2S_FLAG) SPI_ClearFlag (SPI_TypeDef* SPIx, u16 SPI_FLAG) SPI_I2S_ClearFlag (SPI_TypeDef* SPIx, u16 SPI_I2S_FLAG) SPI_GetITStatus (SPI_TypeDef* SPIx, u8 SPI_IT) SPI_I2S_GetITStatus (SPI_TypeDef* SPIx, u8 SPI_I2S_IT) SPI_ClearITPendingBit (SPI_TypeDef* SPIx, u8 SPI_IT) SPI_I2S_ClearITPendingBit (SPI_TypeDef* SPIx, u8 SPI_I2S_IT) 1. Some parameters are specific for SPI (e.g.: SPI_FLAG_CRCERR) or I2S (e.g.: I2S_FLAG_CHSIDE). |
|
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |