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

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

?? stm32f10x_spi.c

?? 基于STM32的 模擬時序
?? C
?? 第 1 頁 / 共 3 頁
字號:
* 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
* Description    : Enables or disables the CRC value calculation of the
*                  transfered bytes.
* Input          : - SPIx: where x can be 1, 2 or 3 to select the SPI peripheral.
*                  - NewState: new state of the SPIx CRC value calculation.
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void SPI_CalculateCRC(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 CRC calculation */
    SPIx->CR1 |= CR1_CRCEN_Set;
  }
  else
  {
    /* Disable the selected SPI CRC calculation */
    SPIx->CR1 &= CR1_CRCEN_Reset;
  }
}

/*******************************************************************************
* Function Name  : SPI_GetCRC
* Description    : Returns the transmit or the receive CRC register value for
*                  the specified SPI.
* Input          : - SPIx: where x can be 1, 2 or 3 to select the SPI peripheral.
*                  - SPI_CRC: specifies the CRC register to be read.
*                    This parameter can be one of the following values:
*                       - SPI_CRC_Tx: Selects Tx CRC register
*                       - SPI_CRC_Rx: Selects Rx CRC register
* Output         : None
* Return         : The selected CRC register value..
*******************************************************************************/
u16 SPI_GetCRC(SPI_TypeDef* SPIx, u8 SPI_CRC)
{
  u16 crcreg = 0;

  /* Check the parameters */
  assert_param(IS_SPI_ALL_PERIPH(SPIx));
  assert_param(IS_SPI_CRC(SPI_CRC));

  if (SPI_CRC != SPI_CRC_Rx)
  {
    /* Get the Tx CRC register */
    crcreg = SPIx->TXCRCR;
  }
  else
  {
    /* Get the Rx CRC register */
    crcreg = SPIx->RXCRCR;
  }

  /* Return the selected CRC register */
  return crcreg;
}

/*******************************************************************************
* Function Name  : SPI_GetCRCPolynomial
* Description    : Returns the CRC Polynomial register value for the specified SPI.
* Input          : - SPIx: where x can be 1, 2 or 3 to select the SPI peripheral.
* Output         : None
* Return         : The CRC Polynomial register value.
*******************************************************************************/
u16 SPI_GetCRCPolynomial(SPI_TypeDef* SPIx)
{
  /* Check the parameters */
  assert_param(IS_SPI_ALL_PERIPH(SPIx));
  
  /* Return the CRC polynomial register */
  return SPIx->CRCPR;
}

/*******************************************************************************
* Function Name  : SPI_BiDirectionalLineConfig
* Description    : Selects the data transfer direction in bi-directional mode
*                  for the specified SPI.
* Input          : - SPIx: where x can be 1, 2 or 3 to select the SPI peripheral.
*                  - SPI_Direction: specifies the data transfer direction in
*                    bi-directional mode. 
*                    This parameter can be one of the following values:
*                       - SPI_Direction_Tx: Selects Tx transmission direction
*                       - SPI_Direction_Rx: Selects Rx receive direction
* Output         : None
* Return         : None
*******************************************************************************/
void SPI_BiDirectionalLineConfig(SPI_TypeDef* SPIx, u16 SPI_Direction)
{
  /* Check the parameters */
  assert_param(IS_SPI_ALL_PERIPH(SPIx));
  assert_param(IS_SPI_DIRECTION(SPI_Direction));

  if (SPI_Direction == SPI_Direction_Tx)
  {
    /* Set the Tx only mode */
    SPIx->CR1 |= SPI_Direction_Tx;
  }
  else
  {
    /* Set the Rx only mode */
    SPIx->CR1 &= SPI_Direction_Rx;
  }
}

/*******************************************************************************
* Function Name  : SPI_I2S_GetFlagStatus
* Description    : Checks whether the specified SPI/I2S flag is set or not.
* Input          : - SPIx: where x can be :
*                         - 1, 2 or 3 in SPI mode 
*                         - 2 or 3 in I2S mode
*                  - SPI_I2S_FLAG: specifies the SPI/I2S flag to check. 
*                    This parameter can be one of the following values:
*                       - SPI_I2S_FLAG_TXE: Transmit buffer empty flag.
*                       - SPI_I2S_FLAG_RXNE: Receive buffer not empty flag.
*                       - SPI_I2S_FLAG_BSY: Busy flag.
*                       - SPI_I2S_FLAG_OVR: Overrun flag.
*                       - SPI_FLAG_MODF: Mode Fault flag.
*                       - SPI_FLAG_CRCERR: CRC Error flag.
*                       - I2S_FLAG_UDR: Underrun Error flag.
*                       - I2S_FLAG_CHSIDE: Channel Side flag.
* Output         : None
* Return         : The new state of SPI_I2S_FLAG (SET or RESET).
*******************************************************************************/
FlagStatus SPI_I2S_GetFlagStatus(SPI_TypeDef* SPIx, u16 SPI_I2S_FLAG)
{
  FlagStatus bitstatus = RESET;

  /* Check the parameters */
  assert_param(IS_SPI_ALL_PERIPH(SPIx));
  assert_param(IS_SPI_I2S_GET_FLAG(SPI_I2S_FLAG));

  /* Check the status of the specified SPI/I2S flag */
  if ((SPIx->SR & SPI_I2S_FLAG) != (u16)RESET)
  {
    /* SPI_I2S_FLAG is set */
    bitstatus = SET;
  }
  else
  {
    /* SPI_I2S_FLAG is reset */
    bitstatus = RESET;
  }
  /* Return the SPI_I2S_FLAG status */
  return  bitstatus;
}

/*******************************************************************************
* Function Name  : SPI_I2S_ClearFlag
* Description    : Clears the SPIx CRC Error (CRCERR) flag.
* Input          : - SPIx: where x can be :
*                         - 1, 2 or 3 in SPI mode 
*                  - SPI_I2S_FLAG: specifies the SPI flag to clear. 
*                    This function clears only CRCERR flag.                                           
*                  Notes:
*                       - OVR (OverRun error) flag is cleared by software 
*                         sequence: a read operation to SPI_DR register 
*                         (SPI_I2S_ReceiveData()) followed by a read operation 
*                         to SPI_SR register (SPI_I2S_GetFlagStatus()).                           
*                       - UDR (UnderRun error) flag is cleared by a read 
*                         operation to SPI_SR register (SPI_I2S_GetFlagStatus()).                             
*                       - MODF (Mode Fault) flag is cleared by software sequence: 
*                         a read/write operation to SPI_SR register 
*                         (SPI_I2S_GetFlagStatus()) followed by a write 
*                         operation to SPI_CR1 register (SPI_Cmd() to enable 
*                         the SPI).   
* Output         : None
* Return         : None
*******************************************************************************/
void SPI_I2S_ClearFlag(SPI_TypeDef* SPIx, u16 SPI_I2S_FLAG)
{
  /* Check the parameters */
  assert_param(IS_SPI_ALL_PERIPH(SPIx));
  assert_param(IS_SPI_I2S_CLEAR_FLAG(SPI_I2S_FLAG));
    
    /* Clear the selected SPI CRC Error (CRCERR) flag */
    SPIx->SR = (u16)~SPI_I2S_FLAG;
}

/*******************************************************************************
* Function Name  : SPI_I2S_GetITStatus
* Description    : Checks whether the specified SPI/I2S interrupt has occurred or not.
* 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 check. 
*                    This parameter can be one of the following values:
*                       - SPI_I2S_IT_TXE: Transmit buffer empty interrupt.
*                       - SPI_I2S_IT_RXNE: Receive buffer not empty interrupt.
*                       - SPI_I2S_IT_OVR: Overrun interrupt.
*                       - SPI_IT_MODF: Mode Fault interrupt.
*                       - SPI_IT_CRCERR: CRC Error interrupt.
*                       - I2S_IT_UDR: Underrun Error interrupt.
* Output         : None
* Return         : The new state of SPI_I2S_IT (SET or RESET).
*******************************************************************************/
ITStatus SPI_I2S_GetITStatus(SPI_TypeDef* SPIx, u8 SPI_I2S_IT)
{
  ITStatus bitstatus = RESET;
  u16 itpos = 0, itmask = 0, enablestatus = 0;

  /* Check the parameters */
  assert_param(IS_SPI_ALL_PERIPH(SPIx));
  assert_param(IS_SPI_I2S_GET_IT(SPI_I2S_IT));

  /* Get the SPI/I2S IT index */
  itpos = (u16)((u16)0x01 << (SPI_I2S_IT & (u8)0x0F));

  /* Get the SPI/I2S IT mask */
  itmask = SPI_I2S_IT >> 4;
  /* Set the IT mask */
  itmask = (u16)((u16)0x01 << itmask);
  /* Get the SPI_I2S_IT enable bit status */
  enablestatus = (SPIx->CR2 & itmask) ;

  /* Check the status of the specified SPI/I2S interrupt */
  if (((SPIx->SR & itpos) != (u16)RESET) && enablestatus)
  {
    /* SPI_I2S_IT is set */
    bitstatus = SET;
  }
  else
  {
    /* SPI_I2S_IT is reset */
    bitstatus = RESET;
  }
  /* Return the SPI_I2S_IT status */
  return bitstatus;
}

/*******************************************************************************
* Function Name  : SPI_I2S_ClearITPendingBit
* Description    : Clears the SPIx CRC Error (CRCERR) interrupt pending bit.
* Input          : - SPIx: where x can be :
*                         - 1, 2 or 3 in SPI mode 
*                  - SPI_I2S_IT: specifies the SPI interrupt pending bit to clear.
*                    This function clears only CRCERR intetrrupt pending bit.   
*                  Notes:
*                       - OVR (OverRun Error) interrupt pending bit is cleared 
*                         by software sequence: a read operation to SPI_DR 
*                         register (SPI_I2S_ReceiveData()) followed by a read 
*                         operation to SPI_SR register (SPI_I2S_GetITStatus()).
*                       - UDR (UnderRun Error) interrupt pending bit is cleared 
*                         by a read operation to SPI_SR register 
*                         (SPI_I2S_GetITStatus()).                           
*                       - MODF (Mode Fault) interrupt pending bit is cleared by 
*                         software sequence: a read/write operation to SPI_SR 
*                         register (SPI_I2S_GetITStatus()) followed by a write 
*                         operation to SPI_CR1 register (SPI_Cmd() to enable the 
*                         SPI).   
* Output         : None
* Return         : None
*******************************************************************************/
void SPI_I2S_ClearITPendingBit(SPI_TypeDef* SPIx, u8 SPI_I2S_IT)
{
  u16 itpos = 0;

  /* Check the parameters */
  assert_param(IS_SPI_ALL_PERIPH(SPIx));
  assert_param(IS_SPI_I2S_CLEAR_IT(SPI_I2S_IT));

  /* Get the SPI IT index */
  itpos = (u16)((u16)0x01 << (SPI_I2S_IT & (u8)0x0F));
  /* Clear the selected SPI CRC Error (CRCERR) interrupt pending bit */
  SPIx->SR = (u16)~itpos;
}

/******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE****/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
婷婷夜色潮精品综合在线| 樱花影视一区二区| 国产精品进线69影院| 亚洲成人高清在线| 免费av网站大全久久| 国产成人午夜高潮毛片| 欧美日韩综合在线| 久久久亚洲欧洲日产国码αv| 亚洲视频一二区| 久久国内精品视频| 97久久精品人人做人人爽| 日韩一区二区三区免费看| 久久久久久亚洲综合| 日韩高清在线一区| 成人av片在线观看| 欧美精品粉嫩高潮一区二区| 综合欧美一区二区三区| av电影天堂一区二区在线观看| 欧美午夜片在线看| 国产丝袜美腿一区二区三区| xfplay精品久久| 亚洲影视资源网| 国产成人精品三级| 91精品国产综合久久福利 | 日韩和的一区二区| 色婷婷久久综合| 中文文精品字幕一区二区| 裸体一区二区三区| 欧美视频一区二区三区四区| 国产日韩欧美a| 国产99久久久国产精品潘金| 日韩一区二区免费在线电影| 日本特黄久久久高潮| 国产成人精品影院| 91免费版pro下载短视频| 久久精品一区二区三区av| 亚洲欧美一区二区久久| 暴力调教一区二区三区| 欧美日韩电影在线播放| 亚洲国产成人精品视频| 91原创在线视频| 亚洲黄色在线视频| 91在线国内视频| 亚洲综合偷拍欧美一区色| 99精品视频一区二区三区| 欧美电影影音先锋| 一区二区三区欧美日韩| 91麻豆福利精品推荐| 亚洲乱码国产乱码精品精的特点| 波波电影院一区二区三区| 亚洲男人的天堂在线aⅴ视频| 91在线丨porny丨国产| 亚洲精品视频观看| 欧美午夜理伦三级在线观看| 亚洲一区二区黄色| 精品精品欲导航| 国产一区二区按摩在线观看| 国产精品久久毛片| 91社区在线播放| 视频一区在线播放| 成人性生交大片免费看中文网站| 国产福利视频一区二区三区| 日韩欧美激情一区| 久久99久久99| 日韩一区在线免费观看| 91日韩在线专区| 石原莉奈在线亚洲三区| 日韩欧美在线1卡| 国产精品一二三区| 国产精品青草综合久久久久99| 在线观看日韩高清av| 日韩专区欧美专区| 国产亚洲精品超碰| 91捆绑美女网站| 亚洲欧美另类图片小说| 欧美不卡123| 成人免费av资源| 天堂成人免费av电影一区| 精品久久久影院| 在线观看免费成人| 久久99久久久欧美国产| 一区二区三区蜜桃| 精品免费99久久| 日本久久精品电影| 久久国产尿小便嘘嘘| 欧美变态凌虐bdsm| 欧美精品丝袜中出| 丰满少妇在线播放bd日韩电影| 日韩高清在线不卡| 中文在线一区二区| 91在线视频免费91| 欧美经典一区二区| 日本久久一区二区| 国产精品原创巨作av| 久久99久久精品| 国产三级一区二区三区| 色呦呦日韩精品| 成人精品视频一区二区三区| 午夜伦欧美伦电影理论片| 中文字幕色av一区二区三区| 日韩三区在线观看| 欧美日韩精品高清| 99久久综合国产精品| 国产不卡高清在线观看视频| 天堂久久一区二区三区| 亚洲一区二区免费视频| 国产精品福利av| 日韩一区二区免费在线电影 | 欧美乱熟臀69xxxxxx| 国产一区二区三区黄视频 | 奇米影视一区二区三区小说| 亚洲欧美日韩国产成人精品影院| 欧美一区二区三区免费在线看 | 精品一区二区三区视频在线观看| 国产精品久久久久久久第一福利 | 欧美极品另类videosde| 欧美大片在线观看一区二区| 欧美一级免费大片| 欧美美女一区二区在线观看| 中文字幕中文字幕一区| 亚洲精品一区二区三区香蕉| 亚洲精品一区二区在线观看| 日韩一级视频免费观看在线| 欧美成人福利视频| 在线视频国内自拍亚洲视频| a级高清视频欧美日韩| 国产成人精品免费视频网站| 午夜精品免费在线观看| 亚洲亚洲人成综合网络| 亚洲精选视频在线| 天天做天天摸天天爽国产一区 | 色婷婷一区二区三区四区| a4yy欧美一区二区三区| 在线视频欧美精品| 欧美中文字幕一区二区三区| 7777精品伊人久久久大香线蕉超级流畅| 一本一道久久a久久精品| 从欧美一区二区三区| 成人免费高清视频| 成人福利视频网站| 色网站国产精品| 色94色欧美sute亚洲线路一ni| 欧美日韩国产成人在线91| 欧美男生操女生| 久久精品视频免费| 中文字幕一区二区三区色视频| 亚洲午夜日本在线观看| 视频一区国产视频| 国产a久久麻豆| av电影天堂一区二区在线 | 性感美女极品91精品| 午夜精品福利一区二区蜜股av| 激情综合色综合久久| 国精产品一区一区三区mba视频| 成人一级视频在线观看| 日本高清视频一区二区| 欧美xxxx在线观看| 国产精品三级久久久久三级| 亚洲欧洲另类国产综合| 亚洲超碰精品一区二区| 国内精品免费**视频| 成人免费看视频| 91在线国内视频| 91精品国产综合久久小美女| 精品中文字幕一区二区小辣椒| 久久久亚洲精品石原莉奈| 久久久国产精品不卡| 国产精品视频在线看| 亚洲欧美色一区| 精品在线免费视频| av亚洲精华国产精华精华| 精品国产成人在线影院| 国产精品久久久久7777按摩 | 久久精品999| 91蜜桃网址入口| 91精品国产乱| 有坂深雪av一区二区精品| 精品一区中文字幕| 91精选在线观看| 中文字幕中文乱码欧美一区二区| 久久91精品国产91久久小草| 99久久久久免费精品国产| 综合色天天鬼久久鬼色| 国产一区二区三区精品视频| 9191精品国产综合久久久久久| 国产喂奶挤奶一区二区三区 | 555www色欧美视频| 亚洲一区二区三区在线播放| 国产乱淫av一区二区三区| 91精品国产91久久久久久最新毛片| 亚洲欧洲www| 激情成人综合网| 99re热这里只有精品免费视频| 久久综合国产精品| 日韩中文字幕1| 欧美日韩亚洲国产综合| 亚洲欧洲精品一区二区精品久久久| 国产一区二区美女| 久久精品夜色噜噜亚洲a∨| 日本免费新一区视频|