亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? stm32f10x_spi.c

?? 基于Cortex-M3的STM32的IAR EWARM的工程模塊
?? C
?? 第 1 頁 / 共 3 頁
字號:
* Function Name  : I2S_StructInit
* Description    : Fills each I2S_InitStruct member with its default value.
* Input          : - I2S_InitStruct : pointer to a I2S_InitTypeDef structure
*                    which will be initialized.
* Output         : None
* Return         : None
*******************************************************************************/
void I2S_StructInit(I2S_InitTypeDef* I2S_InitStruct)
{
/*--------------- Reset I2S init structure parameters values -----------------*/
  /* Initialize the I2S_Mode member */
  I2S_InitStruct->I2S_Mode = I2S_Mode_SlaveTx;
  
  /* Initialize the I2S_Standard member */
  I2S_InitStruct->I2S_Standard = I2S_Standard_Phillips;
  
  /* Initialize the I2S_DataFormat member */
  I2S_InitStruct->I2S_DataFormat = I2S_DataFormat_16b;
  
  /* Initialize the I2S_MCLKOutput member */
  I2S_InitStruct->I2S_MCLKOutput = I2S_MCLKOutput_Disable;
  
  /* Initialize the I2S_AudioFreq member */
  I2S_InitStruct->I2S_AudioFreq = I2S_AudioFreq_Default;
  
  /* Initialize the I2S_CPOL member */
  I2S_InitStruct->I2S_CPOL = I2S_CPOL_Low;
}

/*******************************************************************************
* Function Name  : SPI_Cmd
* Description    : Enables or disables the specified SPI peripheral.
* Input          : - SPIx: where x can be 1, 2 or 3 to select the SPI peripheral.
*                  - NewState: new state of the SPIx peripheral. 
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void SPI_Cmd(SPI_TypeDef* SPIx, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_SPI_ALL_PERIPH(SPIx));
  assert_param(IS_FUNCTIONAL_STATE(NewState));

  if (NewState != DISABLE)
  {
    /* Enable the selected SPI peripheral */
    SPIx->CR1 |= CR1_SPE_Set;
  }
  else
  {
    /* Disable the selected SPI peripheral */
    SPIx->CR1 &= CR1_SPE_Reset;
  }
}

/*******************************************************************************
* Function Name  : I2S_Cmd
* Description    : Enables or disables the specified SPI peripheral (in I2S mode).
* Input          : - SPIx: where x can be 2 or 3 to select the SPI peripheral.
*                  - NewState: new state of the SPIx peripheral. 
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void I2S_Cmd(SPI_TypeDef* SPIx, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_SPI_23_PERIPH(SPIx));
  assert_param(IS_FUNCTIONAL_STATE(NewState));

  if (NewState != DISABLE)
  {
    /* Enable the selected SPI peripheral (in I2S mode) */
    SPIx->I2SCFGR |= I2SCFGR_I2SE_Set;
  }
  else
  {
    /* Disable the selected SPI peripheral (in I2S mode) */
    SPIx->I2SCFGR &= I2SCFGR_I2SE_Reset;
  }
}

/*******************************************************************************
* Function Name  : SPI_I2S_ITConfig
* Description    : Enables or disables the specified SPI/I2S interrupts.
* Input          : - SPIx: where x can be :
*                         - 1, 2 or 3 in SPI mode 
*                         - 2 or 3 in I2S mode
*                  - SPI_I2S_IT: specifies the SPI/I2S interrupt source to be 
*                    enabled or disabled. 
*                    This parameter can be one of the following values:
*                       - SPI_I2S_IT_TXE: Tx buffer empty interrupt mask
*                       - SPI_I2S_IT_RXNE: Rx buffer not empty interrupt mask
*                       - SPI_I2S_IT_ERR: Error interrupt mask
*                  - NewState: new state of the specified SPI/I2S interrupt.
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void SPI_I2S_ITConfig(SPI_TypeDef* SPIx, u8 SPI_I2S_IT, FunctionalState NewState)
{
  u16 itpos = 0, itmask = 0 ;

  /* Check the parameters */
  assert_param(IS_SPI_ALL_PERIPH(SPIx));
  assert_param(IS_FUNCTIONAL_STATE(NewState));
  assert_param(IS_SPI_I2S_CONFIG_IT(SPI_I2S_IT));

  /* Get the SPI/I2S IT index */
  itpos = SPI_I2S_IT >> 4;
  /* Set the IT mask */
  itmask = (u16)((u16)1 << itpos);

  if (NewState != DISABLE)
  {
    /* Enable the selected SPI/I2S interrupt */
    SPIx->CR2 |= itmask;
  }
  else
  {
    /* Disable the selected SPI/I2S interrupt */
    SPIx->CR2 &= (u16)~itmask;
  }
}

/*******************************************************************************
* Function Name  : SPI_I2S_DMACmd
* Description    : Enables or disables the SPIx/I2Sx DMA interface.
* Input          : - SPIx: where x can be :
*                         - 1, 2 or 3 in SPI mode 
*                         - 2 or 3 in I2S mode
*                  - SPI_I2S_DMAReq: specifies the SPI/I2S DMA transfer request 
*                    to be enabled or disabled. 
*                    This parameter can be any combination of the following values:
*                       - SPI_I2S_DMAReq_Tx: Tx buffer DMA transfer request
*                       - SPI_I2S_DMAReq_Rx: Rx buffer DMA transfer request
*                  - NewState: new state of the selected SPI/I2S DMA transfer 
*                    request.
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void SPI_I2S_DMACmd(SPI_TypeDef* SPIx, u16 SPI_I2S_DMAReq, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_SPI_ALL_PERIPH(SPIx));
  assert_param(IS_FUNCTIONAL_STATE(NewState));
  assert_param(IS_SPI_I2S_DMAREQ(SPI_I2S_DMAReq));

  if (NewState != DISABLE)
  {
    /* Enable the selected SPI/I2S DMA requests */
    SPIx->CR2 |= SPI_I2S_DMAReq;
  }
  else
  {
    /* Disable the selected SPI/I2S DMA requests */
    SPIx->CR2 &= (u16)~SPI_I2S_DMAReq;
  }
}

/*******************************************************************************
* Function Name  : SPI_I2S_SendData
* Description    : Transmits a Data through the SPIx/I2Sx peripheral.
* Input          : - SPIx: where x can be :
*                         - 1, 2 or 3 in SPI mode 
*                         - 2 or 3 in I2S mode
*                  - Data : Data to be transmitted..
* Output         : None
* Return         : None
*******************************************************************************/
void SPI_I2S_SendData(SPI_TypeDef* SPIx, u16 Data)
{
  /* Check the parameters */
  assert_param(IS_SPI_ALL_PERIPH(SPIx));
  
  /* Write in the DR register the data to be sent */
  SPIx->DR = Data;
}

/*******************************************************************************
* Function Name  : SPI_I2S_ReceiveData
* Description    : Returns the most recent received data by the SPIx/I2Sx peripheral. 
* Input          : - SPIx: where x can be :
*                         - 1, 2 or 3 in SPI mode 
*                         - 2 or 3 in I2S mode
* Output         : None
* Return         : The value of the received data.
*******************************************************************************/
u16 SPI_I2S_ReceiveData(SPI_TypeDef* SPIx)
{
  /* Check the parameters */
  assert_param(IS_SPI_ALL_PERIPH(SPIx));
  
  /* Return the data in the DR register */
  return SPIx->DR;
}

/*******************************************************************************
* Function Name  : SPI_NSSInternalSoftwareConfig
* Description    : Configures internally by software the NSS pin for the selected 
*                  SPI.
* Input          : - SPIx: where x can be 1, 2 or 3 to select the SPI peripheral.
*                  - SPI_NSSInternalSoft: specifies the SPI NSS internal state.
*                    This parameter can be one of the following values:
*                       - SPI_NSSInternalSoft_Set: Set NSS pin internally
*                       - SPI_NSSInternalSoft_Reset: Reset NSS pin internally
* Output         : None
* Return         : None
*******************************************************************************/
void SPI_NSSInternalSoftwareConfig(SPI_TypeDef* SPIx, u16 SPI_NSSInternalSoft)
{
  /* Check the parameters */
  assert_param(IS_SPI_ALL_PERIPH(SPIx));
  assert_param(IS_SPI_NSS_INTERNAL(SPI_NSSInternalSoft));

  if (SPI_NSSInternalSoft != SPI_NSSInternalSoft_Reset)
  {
    /* Set NSS pin internally by software */
    SPIx->CR1 |= SPI_NSSInternalSoft_Set;
  }
  else
  {
    /* Reset NSS pin internally by software */
    SPIx->CR1 &= SPI_NSSInternalSoft_Reset;
  }
}

/*******************************************************************************
* Function Name  : SPI_SSOutputCmd
* Description    : Enables or disables the SS output for the selected SPI.
* Input          : - SPIx: where x can be 1, 2 or 3 to select the SPI peripheral.
*                  - NewState: new state of the SPIx SS output. 
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void SPI_SSOutputCmd(SPI_TypeDef* SPIx, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_SPI_ALL_PERIPH(SPIx));
  assert_param(IS_FUNCTIONAL_STATE(NewState));

  if (NewState != DISABLE)
  {
    /* Enable the selected SPI SS output */
    SPIx->CR2 |= CR2_SSOE_Set;
  }
  else
  {
    /* Disable the selected SPI SS output */
    SPIx->CR2 &= CR2_SSOE_Reset;
  }
}

/*******************************************************************************
* Function Name  : SPI_DataSizeConfig
* Description    : Configures the data size for the selected SPI.
* Input          : - SPIx: where x can be 1, 2 or 3 to select the SPI peripheral.
*                  - SPI_DataSize: specifies the SPI data size.
*                    This parameter can be one of the following values:
*                       - SPI_DataSize_16b: Set data frame format to 16bit
*                       - SPI_DataSize_8b: Set data frame format to 8bit
* Output         : None
* Return         : None
*******************************************************************************/
void SPI_DataSizeConfig(SPI_TypeDef* SPIx, u16 SPI_DataSize)
{
  /* Check the parameters */
  assert_param(IS_SPI_ALL_PERIPH(SPIx));
  assert_param(IS_SPI_DATASIZE(SPI_DataSize));

  /* Clear DFF bit */
  SPIx->CR1 &= (u16)~SPI_DataSize_16b;
  /* Set new DFF bit value */
  SPIx->CR1 |= SPI_DataSize;
}

/*******************************************************************************
* Function Name  : SPI_TransmitCRC
* Description    : Transmit the SPIx CRC value.
* Input          : - SPIx: where x can be 1, 2 or 3 to select the SPI peripheral.
* Output         : None
* Return         : None
*******************************************************************************/
void SPI_TransmitCRC(SPI_TypeDef* SPIx)
{
  /* Check the parameters */
  assert_param(IS_SPI_ALL_PERIPH(SPIx));
  
  /* Enable the selected SPI CRC transmission */
  SPIx->CR1 |= CR1_CRCNext_Set;
}

/*******************************************************************************
* Function Name  : SPI_CalculateCRC

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲1区2区3区视频| 91在线免费播放| 99re6这里只有精品视频在线观看| 色噜噜狠狠色综合欧洲selulu| 日韩欧美国产综合| 夜夜精品视频一区二区| 国产电影精品久久禁18| 91精品在线一区二区| 亚洲三级电影网站| 国产一区二区视频在线播放| 欧美福利电影网| 日韩美女视频一区| 成人小视频免费在线观看| 日韩三级精品电影久久久| 一区二区三区在线视频观看58| 成人在线一区二区三区| 久久综合九色欧美综合狠狠| 日av在线不卡| 日韩一区二区免费视频| 日本aⅴ亚洲精品中文乱码| 欧美日韩午夜精品| 亚洲一线二线三线久久久| 色综合久久99| 成人免费一区二区三区在线观看| 欧美色区777第一页| 亚洲免费av观看| 91小视频免费看| 亚洲人123区| 色哟哟一区二区在线观看| 国产精品的网站| 99麻豆久久久国产精品免费优播| 中文字幕va一区二区三区| 国产成人啪午夜精品网站男同| 欧美精品一区二区精品网| 国产一区二区三区美女| 久久嫩草精品久久久精品一| 久久精品理论片| 精品国产1区二区| 国产一区二区毛片| 欧美激情一区二区三区蜜桃视频 | 亚洲午夜免费福利视频| 欧美三区在线观看| 日韩二区三区四区| 26uuu精品一区二区在线观看| 看电影不卡的网站| 久久久久99精品一区| 国产激情一区二区三区桃花岛亚洲| 久久久一区二区三区捆绑**| 成人美女在线视频| 1024成人网| 欧美一区二区视频观看视频| 狠狠色2019综合网| 中文字幕一区二区三区四区不卡| 亚洲精品一区二区三区四区高清| 激情综合色播五月| 国产精品久久久久久久第一福利| 91福利在线导航| 精品伊人久久久久7777人| 国产精品美女久久久久久2018| 色综合天天做天天爱| 蜜臀av一区二区在线免费观看 | 激情欧美一区二区| 国产精品二区一区二区aⅴ污介绍| 在线视频你懂得一区| 免费视频一区二区| 日韩一区欧美一区| 日韩一区二区三| 91网站最新地址| 日本sm残虐另类| 亚洲美女一区二区三区| 欧美mv和日韩mv国产网站| 99久久伊人精品| 美国十次综合导航| 亚洲精品乱码久久久久久日本蜜臀| 在线播放一区二区三区| 99精品黄色片免费大全| 久久av中文字幕片| 一区二区三区不卡视频在线观看 | 国产在线视频一区二区| 亚洲毛片av在线| 久久久久久久综合狠狠综合| 欧美亚洲动漫精品| 99久久婷婷国产综合精品| 精品一区在线看| 午夜精品福利一区二区蜜股av| 中文字幕中文字幕一区| 精品99999| 欧美精品三级在线观看| 在线观看精品一区| 国产不卡在线播放| 经典三级一区二区| 丝袜诱惑亚洲看片| 亚洲激情五月婷婷| 国产精品福利一区二区三区| 久久网站最新地址| 欧美一区二区三区爱爱| 欧美日韩国产一级片| 91国产福利在线| 久久久久久影视| 久久免费的精品国产v∧| 日韩一区二区影院| 欧美一区二区三区男人的天堂| 一本久久精品一区二区| 成人爱爱电影网址| 成人自拍视频在线观看| 国产不卡高清在线观看视频| 韩国理伦片一区二区三区在线播放| 三级精品在线观看| 日韩—二三区免费观看av| 亚洲1区2区3区4区| 日韩精品视频网站| 日本欧美一区二区三区| 免费人成网站在线观看欧美高清| 亚洲成人av电影在线| 午夜精品在线看| 日韩福利视频网| 久久国产精品第一页| 国产真实乱对白精彩久久| 国产成人免费视频网站高清观看视频| 国产一区三区三区| 国产盗摄女厕一区二区三区| 成人夜色视频网站在线观看| 国产suv精品一区二区6| 9i看片成人免费高清| 色综合欧美在线| 717成人午夜免费福利电影| 欧美一区二区女人| 久久久高清一区二区三区| 国产精品久久久久婷婷| 亚洲一区二区三区四区在线免费观看 | 亚洲第一综合色| 欧美aaaaaa午夜精品| 国产精品香蕉一区二区三区| av一区二区三区在线| 欧美日韩免费观看一区二区三区| 91精品国产91久久久久久最新毛片| 日韩欧美一区二区在线视频| 久久人人超碰精品| 最新热久久免费视频| 日韩国产一二三区| 国产精品影视网| 欧美性色欧美a在线播放| 日韩欧美国产一区在线观看| 国产三级精品视频| 香蕉影视欧美成人| 成人亚洲一区二区一| 欧美日韩激情一区| 欧美激情综合网| 亚洲第一福利一区| 国产不卡在线视频| 国产亚洲精品免费| 午夜久久久久久电影| 国产精品资源站在线| 欧美伊人久久久久久午夜久久久久| 日韩午夜精品视频| 亚洲美女在线国产| 国产精品一区久久久久| 欧美日韩成人综合| 国产精品久久久久四虎| 久久精品99久久久| 在线观看日韩精品| 国产精品女同一区二区三区| 日日骚欧美日韩| 色悠悠亚洲一区二区| 国产亚洲欧美激情| 蜜桃av一区二区| 在线中文字幕不卡| 国产精品网站一区| 激情深爱一区二区| 欧美一区二区三区喷汁尤物| 亚洲乱码国产乱码精品精可以看| 国产一区福利在线| 欧美一三区三区四区免费在线看| 国产精品毛片无遮挡高清| 精品一区二区综合| 欧美一区二区在线不卡| 亚洲曰韩产成在线| 色综合 综合色| ㊣最新国产の精品bt伙计久久| 国产精品自拍网站| 欧美大片国产精品| 免费欧美高清视频| 欧美精品欧美精品系列| 亚洲午夜成aⅴ人片| 色综合天天综合在线视频| 国产精品久久久久久久久搜平片| 国产美女在线观看一区| 26uuu国产日韩综合| 精品影视av免费| 欧美精品一区在线观看| 国内一区二区视频| 久久人人爽人人爽| 国产精品一卡二| 国产亚洲欧美日韩俺去了| 国产精品亚洲综合一区在线观看| 日韩免费视频一区二区| 奇米精品一区二区三区四区| 91麻豆精品国产91久久久资源速度 | 日韩欧美一级二级| 精品一区免费av|