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

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

?? stm32f10x_i2c.c

?? STM32不完全手冊 例程源碼 29個(gè)
?? C
?? 第 1 頁 / 共 3 頁
字號:
  }
  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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产亚洲视频系列| 国产精品一区二区在线看| 精品对白一区国产伦| 亚洲色图清纯唯美| 91美女视频网站| 国产精品美女久久久久av爽李琼| 成人福利在线看| 亚洲欧美另类在线| 欧美老年两性高潮| 久久精品国产77777蜜臀| 久久久99免费| 97久久人人超碰| 亚洲高清免费观看高清完整版在线观看| 欧洲国产伦久久久久久久| 欧美aaa在线| 中国色在线观看另类| 91国偷自产一区二区三区成为亚洲经典| 亚洲综合999| 精品欧美乱码久久久久久1区2区 | 成人性生交大片免费看中文| 亚洲欧洲www| 欧美日韩一区二区三区免费看| 日韩1区2区3区| 国产亚洲精品精华液| 欧美伊人久久大香线蕉综合69| 蜜臀久久久久久久| 中文乱码免费一区二区| 欧美精品久久久久久久久老牛影院| 久久99久久99| 亚洲激情图片一区| 欧美成人video| 欧美性猛片aaaaaaa做受| 国产在线精品一区二区三区不卡 | 综合在线观看色| 日韩精品在线网站| 欧洲精品中文字幕| 国产剧情av麻豆香蕉精品| 亚洲成人精品一区二区| 欧美韩日一区二区三区四区| 欧美日韩精品三区| 成人免费高清在线观看| 美女www一区二区| 亚洲一卡二卡三卡四卡无卡久久 | 久久久久久免费网| 欧美人与禽zozo性伦| 成人一区二区视频| 麻豆专区一区二区三区四区五区| 国产精品美女久久久久aⅴ国产馆| 欧美区在线观看| 91啪亚洲精品| 国产精品996| 蜜臀va亚洲va欧美va天堂| 亚洲欧美国产三级| 久久精品在线观看| 日韩一区二区在线观看| 色噜噜狠狠色综合中国| 丁香六月综合激情| 国内久久婷婷综合| 蜜臀av性久久久久蜜臀av麻豆| 一区二区三区免费看视频| 国产精品久久久久毛片软件| 欧美精品一区二区在线观看| 91 com成人网| 在线观看欧美日本| 色婷婷av一区二区三区大白胸 | 色婷婷久久久久swag精品 | 国产视频一区在线播放| 欧美精品一区二区三区在线播放| 欧美日韩精品三区| 欧美精品国产精品| 666欧美在线视频| 欧美日本不卡视频| 欧美精品一级二级三级| 欧美精品丝袜中出| 91精品国产手机| 欧美一级高清片在线观看| 欧美精选一区二区| 欧美一区二区啪啪| 日韩欧美高清一区| 久久综合网色—综合色88| 91精品欧美综合在线观看最新 | 亚洲国产精品自拍| 日本欧美一区二区三区乱码| 日本一不卡视频| 九九热在线视频观看这里只有精品| 日本欧美一区二区| 国产一区二区精品久久99| 韩国视频一区二区| 成人午夜在线播放| 91性感美女视频| 欧美综合一区二区| 欧美欧美午夜aⅴ在线观看| 欧美一区中文字幕| 欧美大胆一级视频| 欧美国产精品中文字幕| 亚洲天堂福利av| 亚洲国产成人va在线观看天堂| 五月天国产精品| 国产一区二区三区在线观看免费 | av中文字幕在线不卡| 欧美亚洲综合在线| 欧美一级欧美一级在线播放| 精品av久久707| 1区2区3区欧美| 亚洲r级在线视频| 国产综合一区二区| 色美美综合视频| 欧美一区二区免费视频| 久久久av毛片精品| 亚洲在线免费播放| 国内久久精品视频| 欧美在线不卡视频| 久久免费视频一区| 悠悠色在线精品| 韩国成人在线视频| 色琪琪一区二区三区亚洲区| 91精品国产色综合久久不卡蜜臀| 久久久久久久精| 一区二区成人在线观看| 精品一区二区三区在线观看国产| www.一区二区| 日韩三级在线免费观看| 中文字幕亚洲在| 奇米色777欧美一区二区| 99热99精品| 精品乱人伦一区二区三区| 亚洲女爱视频在线| 国产麻豆午夜三级精品| 在线视频国内自拍亚洲视频| 久久综合九色综合97婷婷女人 | 玖玖九九国产精品| 色乱码一区二区三区88| 国产欧美日韩综合精品一区二区| 性做久久久久久久免费看| 成人免费毛片片v| 日韩精品专区在线影院重磅| 亚洲最大的成人av| 不卡的av在线播放| 精品999久久久| 免费看日韩a级影片| 欧美性感一类影片在线播放| 国产清纯白嫩初高生在线观看91| 蜜桃精品在线观看| 欧美欧美欧美欧美首页| 亚洲精品成人精品456| 波多野结衣中文字幕一区二区三区| 日韩欧美精品在线| 五月婷婷久久综合| 在线看国产日韩| 亚洲视频一二三| av一区二区三区| 国产精品蜜臀在线观看| 国产精品一二三区在线| 精品久久久久久无| 久久99精品久久久久| 欧美一个色资源| 日韩av电影天堂| 在线不卡a资源高清| 亚洲bt欧美bt精品| 欧美在线一二三| 亚洲国产精品久久人人爱蜜臀| 99精品国产一区二区三区不卡| 国产精品素人视频| 成人精品视频一区二区三区尤物| 国产亚洲精品中文字幕| 国产精品 日产精品 欧美精品| 精品成a人在线观看| 国产精品白丝av| 中文字幕免费在线观看视频一区| 粉嫩一区二区三区性色av| 亚洲国产高清在线观看视频| 国产a久久麻豆| 国产日本亚洲高清| jizz一区二区| 亚洲男人天堂av网| 色先锋资源久久综合| 亚洲一区二区视频在线观看| 欧美日韩国产免费一区二区| 亚洲成av人在线观看| 欧美一区二区三区在线观看视频 | 一本一本大道香蕉久在线精品 | 激情综合网激情| 久久久久久免费网| 大陆成人av片| 亚洲女同ⅹxx女同tv| 欧美亚洲日本一区| 蜜桃视频免费观看一区| 国产视频一区在线观看| 一本色道久久综合亚洲91| 亚洲电影视频在线| 精品免费99久久| 成人国产视频在线观看| 一区二区高清视频在线观看| 欧美精品aⅴ在线视频| 久久99久久99| 亚洲天堂精品视频| 这里只有精品电影| 国产成人av电影| 亚洲国产一区在线观看| 精品国产乱码久久久久久1区2区 |