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

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

?? stm32f10x_i2c.c

?? STM32F10x USB Library V1.0
?? C
?? 第 1 頁 / 共 3 頁
字號:
    I2Cx->CR1 |= CR1_SWRST_Set;
  }
  else
  {
    /* Peripheral not under reset */
    I2Cx->CR1 &= CR1_SWRST_Reset;
  }
}

/*******************************************************************************
* Function Name  : I2C_SMBusAlertConfig
* Description    : Drives the SMBusAlert pin high or low for the specified I2C.
* Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
*                  - I2C_SMBusAlert: specifies SMBAlert pin level. 
*                    This parameter can be one of the following values:
*                       - I2C_SMBusAlert_Low: SMBAlert pin driven low
*                       - I2C_SMBusAlert_High: SMBAlert pin driven high
* Output         : None
* Return         : None
*******************************************************************************/
void I2C_SMBusAlertConfig(I2C_TypeDef* I2Cx, u16 I2C_SMBusAlert)
{
  /* Check the parameters */
  assert_param(IS_I2C_SMBUS_ALERT(I2C_SMBusAlert));

  if (I2C_SMBusAlert == I2C_SMBusAlert_Low)
  {
    /* Drive the SMBusAlert pin Low */
    I2Cx->CR1 |= I2C_SMBusAlert_Low;
  }
  else
  {
    /* Drive the SMBusAlert pin High  */
    I2Cx->CR1 &= I2C_SMBusAlert_High;
  }
}

/*******************************************************************************
* Function Name  : I2C_TransmitPEC
* Description    : Enables or disables the specified I2C PEC transfer.
* Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
*                  - NewState: new state of the I2C PEC transmission.
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void I2C_TransmitPEC(I2C_TypeDef* I2Cx, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_FUNCTIONAL_STATE(NewState));

  if (NewState != DISABLE)
  {
    /* Enable the selected I2C PEC transmission */
    I2Cx->CR1 |= CR1_PEC_Set;
  }
  else
  {
    /* Disable the selected I2C PEC transmission */
    I2Cx->CR1 &= CR1_PEC_Reset;
  }
}

/*******************************************************************************
* Function Name  : I2C_PECPositionConfig
* Description    : Selects the specified I2C PEC position.
* Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
*                  - I2C_PECPosition: specifies the PEC position. 
*                    This parameter can be one of the following values:
*                       - I2C_PECPosition_Next: PEC bit indicates that current
*                         byte is PEC
*                       - I2C_PECPosition_Current: PEC bit indicates that the
*                         next byte is PEC
* Output         : None
* Return         : None
*******************************************************************************/
void I2C_PECPositionConfig(I2C_TypeDef* I2Cx, u16 I2C_PECPosition)
{
  /* Check the parameters */
  assert_param(IS_I2C_PEC_POSITION(I2C_PECPosition));

  if (I2C_PECPosition == I2C_PECPosition_Next)
  {
    /* PEC indicates that the next byte in shift register is PEC */
    I2Cx->CR1 |= I2C_PECPosition_Next;
  }
  else
  {
    /* PEC indicates that the current byte in shift register is PEC */
    I2Cx->CR1 &= I2C_PECPosition_Current;
  }
}

/*******************************************************************************
* Function Name  : I2C_CalculatePEC
* Description    : Enables or disables the PEC value calculation of the
*                  transfered bytes.
* Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
*                  - NewState: new state of the I2Cx PEC value calculation.
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void I2C_CalculatePEC(I2C_TypeDef* I2Cx, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_FUNCTIONAL_STATE(NewState));

  if (NewState != DISABLE)
  {
    /* Enable the selected I2C PEC calculation */
    I2Cx->CR1 |= CR1_ENPEC_Set;
  }
  else
  {
    /* Disable the selected I2C PEC calculation */
    I2Cx->CR1 &= CR1_ENPEC_Reset;
  }
}

/*******************************************************************************
* Function Name  : I2C_GetPEC
* Description    : Returns the PEC value for the specified I2C.
* Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
* Output         : None
* Return         : The PEC value.
*******************************************************************************/
u8 I2C_GetPEC(I2C_TypeDef* I2Cx)
{
  u8 pec;

  /* Get the PEC value */
  pec = (I2Cx->SR2) >> 8;
  /* Return the selected I2C PEC register value */
  return pec;
}

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

  if (NewState != DISABLE)
  {
    /* Enable the selected I2C ARP */
    I2Cx->CR1 |= CR1_ENARP_Set;
  }
  else
  {
    /* Disable the selected I2C ARP */
    I2Cx->CR1 &= CR1_ENARP_Reset;
  }
}

/*******************************************************************************
* Function Name  : I2C_StretchClockCmd
* Description    : Enables or disables the specified I2C Clock stretching.
* Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
*                  - NewState: new state of the I2Cx Clock stretching.
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void I2C_StretchClockCmd(I2C_TypeDef* I2Cx, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_FUNCTIONAL_STATE(NewState));

  if (NewState == DISABLE)
  {
    /* Enable the selected I2C Clock stretching */
    I2Cx->CR1 |= CR1_NOSTRETCH_Set;
  }
  else
  {
    /* Disable the selected I2C Clock stretching */
    I2Cx->CR1 &= CR1_NOSTRETCH_Reset;
  }
}

/*******************************************************************************
* Function Name  : I2C_FastModeDutyCycleConfig
* Description    : Selects the specified I2C fast mode duty cycle.
* Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
*                  - I2C_DutyCycle: specifies the fast mode duty cycle.
*                    This parameter can be one of the following values:
*                       - I2C_DutyCycle_2: I2C fast mode Tlow/Thigh = 2
*                       - I2C_DutyCycle_16_9: I2C fast mode Tlow/Thigh = 16/9
* Output         : None
* Return         : None
*******************************************************************************/
void I2C_FastModeDutyCycleConfig(I2C_TypeDef* I2Cx, u16 I2C_DutyCycle)
{
  /* Check the parameters */
  assert_param(IS_I2C_DUTY_CYCLE(I2C_DutyCycle));

  if (I2C_DutyCycle != I2C_DutyCycle_16_9)
  {
    /* I2C fast mode Tlow/Thigh=2 */
    I2Cx->CCR &= I2C_DutyCycle_2;
  }
  else
  {
    /* I2C fast mode Tlow/Thigh=16/9 */
    I2Cx->CCR |= I2C_DutyCycle_16_9;
  }
}

/*******************************************************************************
* Function Name  : I2C_GetLastEvent
* Description    : Returns the last I2Cx Event.
* Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
* Output         : None
* Return         : The last event
*******************************************************************************/
u32 I2C_GetLastEvent(I2C_TypeDef* I2Cx)
{
  u32 LastEvent = 0;
  u32 Flag1 = 0, Flag2 = 0;

  Flag1 = I2Cx->SR1;
  Flag2 = I2Cx->SR2;
  Flag2 = Flag2 << 16;

  /* Get the last event value from I2C status register */
  LastEvent = (Flag1 | Flag2) & I2C_FLAG_Mask;

  /* Return status */
  return LastEvent;
}

/*******************************************************************************
* Function Name  : I2C_CheckEvent
* Description    : Checks whether the last I2Cx Event is equal to the one passed
*                  as parameter.
* Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
*                  - I2C_EVENT: specifies the event to be checked. 
*                    This parameter can be one of the following values:
*                       - I2C_EVENT_SLAVE_ADDRESS_MATCHED   : EV1
*                       - I2C_EVENT_SLAVE_BYTE_RECEIVED     : EV2
*                       - I2C_EVENT_SLAVE_BYTE_TRANSMITTED  : EV3
*                       - I2C_EVENT_SLAVE_ACK_FAILURE       : EV3-1
*                       - I2C_EVENT_MASTER_MODE_SELECT      : EV5
*                       - I2C_EVENT_MASTER_MODE_SELECTED    : EV6
*                       - I2C_EVENT_MASTER_BYTE_RECEIVED    : EV7
*                       - I2C_EVENT_MASTER_BYTE_TRANSMITTED : EV8
*                       - I2C_EVENT_MASTER_MODE_ADDRESS10   : EV9
*                       - I2C_EVENT_SLAVE_STOP_DETECTED     : EV4
* Output         : None
* Return         : An ErrorStatus enumuration value:
*                       - SUCCESS: Last event is equal to the I2C_Event
*                       - ERROR: Last event is different from the I2C_Event
*******************************************************************************/
ErrorStatus I2C_CheckEvent(I2C_TypeDef* I2Cx, u32 I2C_EVENT)
{
  u32 LastEvent = 0;
  u32 Flag1 = 0, Flag2 = 0;
  ErrorStatus status = ERROR;

  /* Check the parameters */
  assert_param(IS_I2C_EVENT(I2C_EVENT));

  Flag1 = I2Cx->SR1;
  Flag2 = I2Cx->SR2;
  Flag2 = Flag2 << 16;

  /* Get the last event value from I2C status register */
  LastEvent = (Flag1 | Flag2) & I2C_FLAG_Mask;

  /* Check whether the last event is equal to I2C_EVENT */
  if (LastEvent == I2C_EVENT )
  {
    /* SUCCESS: last event is equal to I2C_EVENT */
    status = SUCCESS;
  }
  else
  {
    /* ERROR: last event is different from I2C_EVENT */
    status = ERROR;
  }

  /* Return status */
  return status;
}

/*******************************************************************************
* Function Name  : I2C_GetFlagStatus
* Description    : Checks whether the specified I2C flag is set or not.
* Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
*                  - I2C_FLAG: specifies the flag to check. 
*                    This parameter can be one of the following values:
*                       - I2C_FLAG_DUALF: Dual flag (Slave mode)
*                       - I2C_FLAG_SMBHOST: SMBus host header (Slave mode)
*                       - I2C_FLAG_SMBDEFAULT: SMBus default header (Slave mode)
*                       - I2C_FLAG_GENCALL: General call header flag (Slave mode)
*                       - I2C_FLAG_TRA: Transmitter/Receiver flag
*                       - I2C_FLAG_BUSY: Bus busy flag
*                       - I2C_FLAG_MSL: Master/Slave flag
*                       - I2C_FLAG_SMBALERT: SMBus Alert flag
*                       - I2C_FLAG_TIMEOUT: Timeout or Tlow error flag
*                       - I2C_FLAG_PECERR: PEC error in reception flag
*                       - I2C_FLAG_OVR: Overrun/Underrun flag (Slave mode)
*                       - I2C_FLAG_AF: Acknowledge failure flag
*                       - I2C_FLAG_ARLO: Arbitration lost flag (Master mode)
*                       - I2C_FLAG_BERR: Bus error flag
*                       - I2C_FLAG_TXE: Data register empty flag (Transmitter)
*                       - I2C_FLAG_RXNE: Data register not empty (Receiver) flag
*                       - I2C_FLAG_STOPF: Stop detection flag (Slave mode)
*                       - I2C_FLAG_ADD10: 10-bit header sent flag (Master mode)
*                       - I2C_FLAG_BTF: Byte transfer finished flag
*                       - I2C_FLAG_ADDR: Address sent flag (Master mode) 揂DSL

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲综合在线免费观看| 国产精品系列在线播放| 久久精品噜噜噜成人av农村| 久久国产精品72免费观看| 欧美日韩国产一级| 精品国产区一区| 国产精品国产三级国产有无不卡| 亚洲国产精品欧美一二99| 国产尤物一区二区在线| 91免费在线视频观看| 欧美另类高清zo欧美| 国产婷婷色一区二区三区四区| 亚洲激情综合网| 国产一区在线视频| 久久综合狠狠综合久久激情 | 欧洲日韩一区二区三区| 精品国精品国产| 久久狠狠亚洲综合| 久久综合九色综合97婷婷女人| 国产在线乱码一区二区三区| 欧美三级三级三级爽爽爽| 欧美高清一级片在线观看| 麻豆传媒一区二区三区| 日本高清成人免费播放| 国产人久久人人人人爽| 另类人妖一区二区av| 精品久久久久久久久久久久久久久久久| 中文字幕视频一区| 国产精品自拍毛片| 国产精品美女久久久久久久久| 狠狠久久亚洲欧美| 欧美激情一区二区三区不卡| 99久久久国产精品| 欧美激情艳妇裸体舞| 成人毛片在线观看| 欧美大片顶级少妇| 亚洲18色成人| 91福利国产精品| 午夜a成v人精品| 精品视频999| 奇米精品一区二区三区在线观看一 | 大桥未久av一区二区三区中文| 亚洲欧美电影一区二区| 国产99久久久久久免费看农村| 日韩一区二区电影在线| 亚洲国产sm捆绑调教视频| 欧美一区二区三区四区久久| 亚洲制服丝袜av| 日韩一级欧美一级| 国产不卡视频在线观看| 亚洲精品ww久久久久久p站| 91精品国产高清一区二区三区蜜臀| 精品在线亚洲视频| 欧美哺乳videos| 成人av网站免费观看| 国产精品色在线| 欧美日韩在线三级| 国产一区二区在线观看免费| 综合激情成人伊人| 99国产欧美另类久久久精品| 午夜日韩在线观看| 国产亚洲综合色| 欧美色倩网站大全免费| 国产在线视频一区二区| 亚洲综合在线视频| 国产亚洲欧美在线| 欧美日韩国产欧美日美国产精品| 国产麻豆欧美日韩一区| 亚洲一区二区三区不卡国产欧美| 精品少妇一区二区三区视频免付费| 99re这里只有精品视频首页| 日韩电影免费在线看| 日韩精品一区二区三区在线观看 | 国产精品蜜臀av| 日韩一区二区三区视频在线| 成av人片一区二区| 免费看日韩a级影片| 亚洲天堂福利av| 精品日韩在线观看| 欧美综合亚洲图片综合区| 国产麻豆精品视频| 午夜欧美2019年伦理| 国产精品嫩草影院com| 欧美一级专区免费大片| 色一情一乱一乱一91av| 亚洲高清免费视频| 欧美国产一区在线| 日韩午夜在线观看| 在线观看视频一区二区| 国产suv精品一区二区883| 青青草国产精品亚洲专区无| 亚洲乱码国产乱码精品精可以看| 欧美精品一区二区三区蜜桃| 欧美日韩1234| 色综合久久久网| 成人久久久精品乱码一区二区三区| 蜜臀av一区二区在线免费观看| 一区二区在线观看视频在线观看| 国产欧美视频一区二区| 欧美大片在线观看一区二区| 欧美日韩另类一区| 91天堂素人约啪| 国产91高潮流白浆在线麻豆 | 欧美性猛交xxxx乱大交退制版 | 人人狠狠综合久久亚洲| 亚洲综合成人网| 自拍偷在线精品自拍偷无码专区| 久久人人爽爽爽人久久久| 在线观看www91| 99久久久久久99| 不卡的电影网站| 国产999精品久久久久久绿帽| 美脚の诱脚舐め脚责91| 青青草视频一区| 日av在线不卡| 美女一区二区视频| 日本欧美一区二区在线观看| 亚洲国产欧美日韩另类综合| 亚洲欧美成人一区二区三区| 亚洲人xxxx| 亚洲欧美在线高清| 中文字幕中文字幕一区| 国产精品欧美经典| 综合激情成人伊人| 亚洲精品久久7777| 一区二区三区四区高清精品免费观看| 亚洲欧洲99久久| 亚洲免费观看在线观看| 一区二区三区在线观看欧美| 亚洲乱码精品一二三四区日韩在线 | 国产欧美一区二区在线| 久久久久9999亚洲精品| 国产三级精品视频| 国产欧美精品国产国产专区| 久久免费视频一区| 久久综合一区二区| 国产亚洲制服色| 国产精品丝袜91| 亚洲欧洲韩国日本视频| 亚洲激情图片一区| 亚洲国产毛片aaaaa无费看 | jlzzjlzz亚洲日本少妇| 青椒成人免费视频| 美女视频黄久久| 国产精品一区久久久久| 成人涩涩免费视频| 91麻豆123| 欧美日韩一区二区在线视频| 欧美精品三级日韩久久| 欧美成人女星排名| 久久久91精品国产一区二区精品| 中文字幕欧美激情一区| 最新国产精品久久精品| 亚洲一区二区中文在线| 爽好久久久欧美精品| 一区二区成人在线| 午夜电影一区二区| 精品一区二区三区视频| 粉嫩绯色av一区二区在线观看| 成人精品高清在线| 欧美亚洲国产bt| 日韩一区和二区| 久久久不卡网国产精品二区| 亚洲欧洲日产国码二区| 亚洲一区二区三区四区在线 | 日本欧美在线看| 国产不卡一区视频| 欧美亚洲一区二区在线观看| 欧美一级欧美一级在线播放| 久久久久99精品一区| 一区二区三区在线播| 全国精品久久少妇| 丁香激情综合五月| 欧美亚洲日本国产| 久久久久久久性| 一区二区三区在线观看欧美| 麻豆国产一区二区| 99视频精品在线| 911国产精品| 91精品国产色综合久久不卡蜜臀| 亚洲精品一区二区三区影院| 成人欧美一区二区三区1314| 天堂成人免费av电影一区| 国产一区二区精品在线观看| 色综合激情久久| 精品国产一区二区三区不卡| 一区二区三区小说| 国内精品第一页| 欧美午夜精品一区二区蜜桃| 亚洲精品在线电影| 一区二区三区欧美久久| 国产在线不卡视频| 欧亚一区二区三区| 中文字幕久久午夜不卡| 亚洲一区二区欧美日韩| 国产成人高清在线| 波多野结衣91| 日韩午夜激情免费电影| 亚洲色图丝袜美腿| 国产毛片一区二区|