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

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

?? stm32f10x_spi.c

?? 基于STM32的數碼相冊.rar
?? 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一区二区三区免费野_久草精品视频
欧美日韩精品欧美日韩精品| 99久久精品免费看| 一区二区三区欧美亚洲| 久久久亚洲国产美女国产盗摄| 国产精品一级黄| 精品一区二区三区免费播放| 婷婷久久综合九色综合伊人色| 日韩视频123| 欧美二区三区91| 粉嫩欧美一区二区三区高清影视| 亚洲精品免费在线| 国产精品毛片无遮挡高清| 国产性天天综合网| 欧美精品一区二区三区久久久| 欧美日韩成人一区| 欧美高清视频一二三区 | 最新日韩在线视频| 亚洲一区二区五区| 老鸭窝一区二区久久精品| 国产成人精品亚洲777人妖| 在线欧美一区二区| 精品国产免费久久| 日韩久久一区二区| 精品亚洲成a人| 欧美日韩的一区二区| 国产三级久久久| 丝袜美腿亚洲色图| 成人午夜免费视频| 91精品国产综合久久久久久久久久 | 久久精品国产99久久6| 91麻豆免费观看| 国产精品网友自拍| 国产高清不卡一区| 99re亚洲国产精品| 一区二区三区日韩在线观看| 亚洲欧美国产77777| 日韩久久久久久| 五月天亚洲婷婷| 欧美日本乱大交xxxxx| 韩国精品一区二区| 亚洲国产乱码最新视频| 日韩欧美国产三级| 亚洲午夜免费视频| 成人a区在线观看| 亚洲精品视频自拍| 一本久道久久综合中文字幕| 国产精品久久久一本精品| 成人一区二区三区中文字幕| 亚洲一区二区中文在线| 懂色中文一区二区在线播放| 欧美激情一区二区三区四区| 91在线看国产| 亚洲第一会所有码转帖| 成人国产精品免费观看视频| 精品免费日韩av| eeuss影院一区二区三区| 亚洲精品高清在线观看| 91精品国产综合久久福利软件| 国产综合色视频| 国产精品久久久久久久久动漫| 在线观看一区不卡| 国产精品18久久久久久vr| 欧美xfplay| 93久久精品日日躁夜夜躁欧美| 亚洲免费av高清| 日韩精品一区二区三区中文精品 | 日韩一区二区三区电影在线观看 | 欧美剧情片在线观看| 夜色激情一区二区| 欧美大片在线观看一区| 91小宝寻花一区二区三区| 亚洲一区二区中文在线| 精品国产电影一区二区| 91免费精品国自产拍在线不卡| 亚洲欧美日韩国产另类专区| 久久久99精品免费观看不卡| 欧美一区日本一区韩国一区| 亚洲一区二区黄色| 中文字幕综合网| 亚洲国产成人tv| 日日摸夜夜添夜夜添国产精品| 日韩精品电影在线| 久久爱另类一区二区小说| 国产一区二区免费看| 91一区二区三区在线观看| 欧美日韩精品三区| 亚洲国产精品黑人久久久| 亚洲va国产天堂va久久en| 国产精品中文字幕日韩精品| 欧美在线观看一二区| 久久久久久久久久久电影| 一区二区三区四区国产精品| 国产欧美一区二区三区在线看蜜臀| 91精品国产一区二区三区蜜臀| 日韩欧美亚洲另类制服综合在线| 欧美不卡一二三| 中文字幕在线不卡一区| 一区二区三区在线视频免费| 奇米一区二区三区| 91麻豆高清视频| 久久久91精品国产一区二区精品| 亚洲同性gay激情无套| 日韩电影一区二区三区| 不卡的av在线播放| 精品国产伦一区二区三区免费| 亚洲欧美欧美一区二区三区| 国产一区二区三区美女| 在线精品视频一区二区| 国产精品天天摸av网| 久久99热国产| 欧美另类z0zxhd电影| 亚洲精品中文在线影院| 国产精品66部| 久久久综合视频| 寂寞少妇一区二区三区| 欧美高清性hdvideosex| 亚洲午夜激情网页| 欧美日韩日日摸| 亚洲一二三四在线观看| 欧美午夜精品一区| 日本亚洲电影天堂| 69成人精品免费视频| 麻豆国产精品官网| 欧美精品一区在线观看| 国产成人免费在线观看| 国产精品福利一区二区三区| caoporm超碰国产精品| 亚洲视频资源在线| 色天使久久综合网天天| 亚洲成人激情综合网| 欧美日韩亚洲另类| 美女视频网站久久| 国产精品午夜春色av| 91久久线看在观草草青青| 首页亚洲欧美制服丝腿| 欧美xxxx在线观看| 波多野结衣亚洲一区| 亚洲超丰满肉感bbw| 日韩亚洲欧美综合| 北岛玲一区二区三区四区| 亚洲制服丝袜av| 久久久久国产精品厨房| 色八戒一区二区三区| 色综合一个色综合亚洲| 另类中文字幕网| 亚洲国产精品久久人人爱蜜臀| 精品国产成人系列| 欧美在线视频不卡| yourporn久久国产精品| 奇米四色…亚洲| 亚洲在线免费播放| 国产精品久久久久久久久免费樱桃| 欧美福利电影网| 欧美在线免费视屏| 99久免费精品视频在线观看| 久久国内精品自在自线400部| 一区二区三区高清| 亚洲精品第1页| 国产精品色在线| 国产欧美一区在线| 国产视频一区二区在线| 精品剧情v国产在线观看在线| 欧美日韩成人在线| 欧美亚洲尤物久久| 欧美最猛性xxxxx直播| 91捆绑美女网站| 91在线高清观看| 在线视频欧美区| 欧美三级视频在线| 欧美另类videos死尸| 91精品国产aⅴ一区二区| 欧美日韩一区二区三区在线 | 日韩一区二区中文字幕| 日韩欧美一区二区三区在线| 91精品91久久久中77777| 成人动漫一区二区| 99久久99久久精品免费看蜜桃| 丁香网亚洲国际| 欧美性做爰猛烈叫床潮| 欧美精品久久久久久久多人混战 | 日韩中文字幕区一区有砖一区| 免费在线观看一区二区三区| 国产在线不卡视频| 色婷婷精品大视频在线蜜桃视频| 色综合天天天天做夜夜夜夜做| 欧美在线观看一二区| 欧美电视剧在线观看完整版| 国产天堂亚洲国产碰碰| 亚洲一区二区三区激情| 狠狠色狠狠色综合系列| 99精品偷自拍| 欧美精品一区视频| 亚洲欧美精品午睡沙发| 麻豆91小视频| 欧美午夜精品一区| 中文字幕欧美一区| 国模无码大尺度一区二区三区| 成人激情黄色小说| 久久亚洲二区三区| 偷窥国产亚洲免费视频|