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

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

?? stm32f10x_i2c.c

?? 基于STM32的數碼相冊.rar
?? 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_ALL_PERIPH(I2Cx));
  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_I2C_ALL_PERIPH(I2Cx));
  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: indicates that the next
*                         byte is PEC
*                       - I2C_PECPosition_Current: indicates that current
*                         byte is PEC
* Output         : None
* Return         : None
*******************************************************************************/
void I2C_PECPositionConfig(I2C_TypeDef* I2Cx, u16 I2C_PECPosition)
{
  /* Check the parameters */
  assert_param(IS_I2C_ALL_PERIPH(I2Cx));
  assert_param(IS_I2C_PEC_POSITION(I2C_PECPosition));

  if (I2C_PECPosition == I2C_PECPosition_Next)
  {
    /* Next byte in shift register is PEC */
    I2Cx->CR1 |= I2C_PECPosition_Next;
  }
  else
  {
    /* 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_I2C_ALL_PERIPH(I2Cx));
  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)
{
  /* Check the parameters */
  assert_param(IS_I2C_ALL_PERIPH(I2Cx));

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

/*******************************************************************************
* 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_I2C_ALL_PERIPH(I2Cx));
  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_I2C_ALL_PERIPH(I2Cx));
  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_ALL_PERIPH(I2Cx));
  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;

  /* Check the parameters */
  assert_param(IS_I2C_ALL_PERIPH(I2Cx));

  /* Read the I2Cx status register */
  flag1 = I2Cx->SR1;
  flag2 = I2Cx->SR2;
  flag2 = flag2 << 16;

  /* Get the last event value from I2C status register */
  lastevent = (flag1 | flag2) & 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-2
*                       - 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_ALL_PERIPH(I2Cx));
  assert_param(IS_I2C_EVENT(I2C_EVENT));

  /* Read the I2Cx status register */
  flag1 = I2Cx->SR1;
  flag2 = I2Cx->SR2;
  flag2 = flag2 << 16;

  /* Get the last event value from I2C status register */
  lastevent = (flag1 | flag2) & 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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
狠狠色狠狠色综合系列| 91免费国产在线观看| 久久女同性恋中文字幕| 东方欧美亚洲色图在线| 亚洲综合免费观看高清完整版| 欧美色图免费看| 国产伦精品一区二区三区视频青涩| 国产欧美精品一区二区色综合| 在线观看国产91| 国产一区欧美一区| 亚洲国产日韩一级| 国产午夜精品福利| 正在播放亚洲一区| 成人精品一区二区三区中文字幕| 亚洲一级片在线观看| 国产精品久久久久天堂| 日韩欧美激情在线| 欧美三级视频在线播放| 高清国产一区二区| 欧美最猛黑人xxxxx猛交| 亚洲精品乱码久久久久久日本蜜臀| 亚洲一区在线视频观看| 成人污视频在线观看| 国产精品无码永久免费888| 亚洲国产精品一区二区www在线| 欧美日韩一级视频| 成人免费的视频| 精品一区二区三区在线观看国产 | 亚洲欧美日韩一区| 日本一区二区高清| 国产日韩欧美亚洲| 国产亚洲成av人在线观看导航| 丰满白嫩尤物一区二区| 国产精品美女www爽爽爽| 精品少妇一区二区三区在线视频| 欧美在线|欧美| 成人福利在线看| 99久久精品免费精品国产| 成人精品免费视频| 99国产精品一区| 91玉足脚交白嫩脚丫在线播放| 99在线热播精品免费| 在线看一区二区| 欧美日韩视频第一区| 日韩一区二区三区免费观看| 欧美电影免费观看高清完整版在线观看 | 一区二区三区免费看视频| 亚洲男女毛片无遮挡| 亚洲午夜av在线| 六月婷婷色综合| 成人免费观看男女羞羞视频| 欧美日韩日日骚| 国产精品私人影院| 天天色天天爱天天射综合| 国产精品一色哟哟哟| 91久久一区二区| 久久人人超碰精品| 国产精品女主播在线观看| 丝瓜av网站精品一区二区| 乱中年女人伦av一区二区| 不卡av在线免费观看| 日韩三级视频在线看| 中文字幕日韩精品一区| 久久国产精品99精品国产| www.日韩大片| 国产精品人成在线观看免费| 久久精品999| 日韩精品中文字幕在线不卡尤物| 亚洲人成在线观看一区二区| 丰满少妇久久久久久久| 国产日韩一级二级三级| 久久精品国产久精国产| 91精品久久久久久蜜臀| 欧美欧美欧美欧美首页| 久久欧美一区二区| 东方aⅴ免费观看久久av| 国产精品麻豆网站| 波多野结衣一区二区三区| 国产精品卡一卡二| 一本色道久久综合亚洲91| 亚洲美女区一区| 91精品在线麻豆| 久久99精品久久久久婷婷| 欧美激情中文字幕| 91福利在线观看| 免费在线观看成人| 日韩一区二区在线看| 国产成人在线电影| 亚洲综合色成人| 国产精品网站在线| 欧美日韩视频一区二区| 成人黄色a**站在线观看| 国产成人午夜视频| 中文字幕人成不卡一区| 国产成人av福利| 3d成人动漫网站| 国产精品久久久久影院亚瑟| 精品在线免费视频| 欧美日韩在线播| 精品99一区二区| 99久久精品国产观看| 一区二区在线电影| 91精品国产91热久久久做人人| 黄色日韩三级电影| 夜夜爽夜夜爽精品视频| 国产日产欧美一区二区视频| 欧美偷拍一区二区| 国产美女视频一区| 亚洲国产综合视频在线观看| 《视频一区视频二区| 日韩免费在线观看| 欧美色精品在线视频| 色哟哟精品一区| 一本一道综合狠狠老| av在线综合网| 成人影视亚洲图片在线| 国产高清无密码一区二区三区| 香蕉乱码成人久久天堂爱免费| 一区二区在线电影| 亚洲日本青草视频在线怡红院 | 欧美精品一区二区三区蜜桃视频| 欧美在线制服丝袜| 欧美伊人久久大香线蕉综合69| www.欧美.com| 色综合久久九月婷婷色综合| 粉嫩嫩av羞羞动漫久久久| 国产精品66部| 一本大道av一区二区在线播放| 9久草视频在线视频精品| 国产sm精品调教视频网站| 成人免费高清在线| 日本电影欧美片| 日韩精品中文字幕一区二区三区| 欧美精品一区二区高清在线观看| 精品成a人在线观看| 亚洲欧洲99久久| 视频精品一区二区| 国产成人精品免费一区二区| 欧美性色黄大片手机版| 久久伊人中文字幕| 亚洲美女视频在线| 免费观看一级欧美片| 不卡的av在线播放| 欧美一区二区三区在线| 综合在线观看色| 成人网男人的天堂| 日韩精品综合一本久道在线视频| 国产夜色精品一区二区av| 舔着乳尖日韩一区| 欧日韩精品视频| 亚洲一区二区三区激情| 成人av电影在线| 国产拍欧美日韩视频二区| 午夜不卡av免费| 91精品婷婷国产综合久久竹菊| 午夜亚洲国产au精品一区二区| 99视频超级精品| 欧美国产成人精品| 国产激情一区二区三区| 2024国产精品| caoporn国产精品| 亚洲人成在线播放网站岛国 | 亚洲免费色视频| 欧美亚洲丝袜传媒另类| 一区二区国产盗摄色噜噜| 色综合色综合色综合| 一区二区三区四区高清精品免费观看 | 五月天久久比比资源色| 欧美日韩国产一二三| 日韩精品一级二级 | 国产一区不卡精品| 国产情人综合久久777777| 国产成人一区二区精品非洲| 26uuu精品一区二区| 国产精品综合久久| 国产欧美精品一区aⅴ影院 | 欧美国产精品一区二区| 色欧美日韩亚洲| 久久国产剧场电影| 国产精品免费看片| 欧美精品乱码久久久久久按摩 | 久久激情五月激情| 日韩一区中文字幕| 精品国产免费久久| 欧美日韩一级片网站| 国内精品久久久久影院薰衣草| 成人免费在线视频| 欧美一二三四区在线| 欧美在线|欧美| www.激情成人| 国内精品伊人久久久久av影院| 亚洲人精品午夜| 亚洲日本一区二区三区| 最新国产の精品合集bt伙计| 久久久精品免费观看| 日韩视频免费观看高清完整版在线观看 | 中文字幕一区二区在线播放| 精品少妇一区二区三区视频免付费| 91麻豆swag| 风间由美一区二区av101|