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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? stm32f10x_spi.c

?? LCD液晶顯示驅(qū)動,芯片為ST7565,
?? 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****/

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
93久久精品日日躁夜夜躁欧美| 国产精一品亚洲二区在线视频| 337p日本欧洲亚洲大胆精品| 日本韩国一区二区三区视频| 九色综合国产一区二区三区| 亚洲自拍偷拍麻豆| 国产精品国产三级国产| 久久综合给合久久狠狠狠97色69| 色欧美88888久久久久久影院| 国产一区二区主播在线| 日本不卡一区二区三区高清视频| 亚洲精品视频在线观看网站| 国产午夜亚洲精品午夜鲁丝片 | 国产精品免费免费| 欧美精品一二三四| 欧美裸体bbwbbwbbw| 欧美羞羞免费网站| 欧美伊人久久大香线蕉综合69| 国产精品自在在线| 国产在线一区二区综合免费视频| 热久久国产精品| 蜜桃av一区二区| 久久99精品久久久久婷婷| 久久精品国产99久久6| 久久国产成人午夜av影院| 国产一区二区三区美女| a在线欧美一区| 亚洲欧美一区二区三区久本道91 | 91免费在线看| 不卡的电影网站| 成人av电影在线观看| 成人动漫视频在线| 国产大陆亚洲精品国产| 国内精品视频一区二区三区八戒| 天天爽夜夜爽夜夜爽精品视频| 午夜天堂影视香蕉久久| 国产乱子轮精品视频| jlzzjlzz亚洲日本少妇| 欧洲另类一二三四区| 精品欧美乱码久久久久久1区2区| 久久先锋影音av鲁色资源| 中文字幕一区三区| 日韩激情视频在线观看| 99久久精品国产毛片| 99re在线精品| 成人午夜视频网站| 国产亚洲综合av| 国产中文一区二区三区| 欧美无乱码久久久免费午夜一区 | 国产网红主播福利一区二区| 亚洲日本电影在线| 国产福利一区在线| 欧美日韩国产美| 亚洲精品高清在线| 色综合咪咪久久| 久久美女高清视频 | 美女视频黄 久久| 337p亚洲精品色噜噜| 亚洲久草在线视频| 国产精品88888| 91麻豆精品国产自产在线 | 91久久一区二区| 综合久久久久综合| av在线一区二区三区| 国产精品欧美一级免费| 成人黄页在线观看| 亚洲午夜国产一区99re久久| 99久久夜色精品国产网站| 26uuu国产电影一区二区| 久久99九九99精品| 精品免费日韩av| 国产精品一区二区你懂的| 久久久久久综合| 成人性视频免费网站| 国产精品乱人伦中文| 91黄色免费看| 亚洲福利一区二区三区| 555夜色666亚洲国产免| 免费看欧美女人艹b| 精品少妇一区二区三区在线播放 | 亚洲一区二区偷拍精品| 欧美日韩视频一区二区| 日本不卡一区二区三区高清视频| 日韩欧美资源站| 国产99久久久国产精品潘金| 中文字幕一区二区三区四区不卡| 一本到不卡精品视频在线观看| 亚洲国产精品欧美一二99| 69久久夜色精品国产69蝌蚪网| 精品在线观看免费| 亚洲欧美日韩一区| 日韩精品一区二区三区中文不卡 | 成人免费电影视频| 亚洲bdsm女犯bdsm网站| 久久综合成人精品亚洲另类欧美| 99在线精品观看| 美腿丝袜亚洲色图| 一区二区三区在线视频观看| 久久久久久亚洲综合| 欧美人体做爰大胆视频| 成人av影视在线观看| 久久精品国产精品亚洲红杏| 亚洲免费观看在线视频| 久久日韩粉嫩一区二区三区| 91精品国产综合久久久久久 | 99久久久精品| 国内精品国产成人| 青娱乐精品视频在线| 亚洲免费观看高清| 国产精品不卡一区| 国产欧美一区二区三区在线老狼 | 中文字幕一区二区三区精华液 | 中文字幕国产精品一区二区| 日韩精品中午字幕| 欧美一级一级性生活免费录像| 色94色欧美sute亚洲线路二| 91麻豆蜜桃一区二区三区| 国产呦萝稀缺另类资源| 国产一区二区0| 国产成人av一区二区三区在线 | 91麻豆精东视频| 色吊一区二区三区| 在线观看国产一区二区| 日本黄色一区二区| 欧美调教femdomvk| 欧美一级理论片| 2020日本不卡一区二区视频| 2021国产精品久久精品| 亚洲国产精品精华液ab| 国产精品久久久久永久免费观看| 中日韩av电影| 亚洲综合一区二区三区| 天堂一区二区在线| 精品一区二区日韩| eeuss国产一区二区三区| 欧美在线观看视频一区二区| 欧美精品视频www在线观看| 欧美大片一区二区三区| 中文字幕一区二区三区乱码在线| 亚洲欧美日韩综合aⅴ视频| 日韩国产精品91| 97久久超碰国产精品| 欧美精品久久天天躁| 久久综合av免费| 一区二区欧美精品| 久久精品国产99国产| 不卡的av网站| 精品久久久久一区| 亚洲久草在线视频| 国产精品白丝av| 欧美日韩国产三级| 国产精品第一页第二页第三页| 日韩一区精品字幕| 91亚洲国产成人精品一区二区三 | 亚洲精品成人天堂一二三| 蜜桃精品在线观看| 91精品福利视频| 国产精品三级在线观看| 韩国三级在线一区| 欧美日韩高清一区| 亚洲电影在线免费观看| 99re成人精品视频| 国产精品久久久久久户外露出| 国产最新精品精品你懂的| 久久女同性恋中文字幕| 中文字幕人成不卡一区| 国产精品一品二品| 久久综合九色综合欧美98 | 色婷婷久久久综合中文字幕| 国产欧美视频在线观看| 国产在线麻豆精品观看| 欧美一级在线免费| 麻豆国产精品777777在线| 亚洲精品一线二线三线| 日精品一区二区| 久久综合一区二区| 国产高清精品在线| 亚洲女厕所小便bbb| 欧美中文一区二区三区| 亚洲一区二区精品3399| 欧美日本一道本在线视频| 美女精品一区二区| 国产欧美一区二区三区在线看蜜臀| 国产成人8x视频一区二区 | 久久99精品久久久久久国产越南| 久久亚洲综合色| k8久久久一区二区三区| 亚洲成年人网站在线观看| 日韩精品最新网址| gogogo免费视频观看亚洲一| 亚洲乱码国产乱码精品精可以看| 欧美片网站yy| 国产成人午夜精品5599| 日韩一区在线看| 欧美一区二区三区四区视频| 福利电影一区二区三区| 爽好久久久欧美精品| 国产精品美女久久久久aⅴ| 欧美男男青年gay1069videost | 国产精品美女久久久久久久久久久 |