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

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

?? stm32l1xx_i2c.c

?? VS1003_MP3_SPI_SDHC_FAT32
?? C
?? 第 1 頁 / 共 4 頁
字號:
  }
  else
  {
    /* Disable the STOP condition generation */
    I2Cx->CR1 &= (uint16_t)~((uint16_t)I2C_CR1_STOP);
  }
}

/**
  * @brief  Enables or disables the specified I2C acknowledge feature.
  * @param  I2Cx: where x can be 1 or 2 to select the I2C peripheral.
  * @param  NewState: new state of the I2C Acknowledgement.
  *   This parameter can be: ENABLE or DISABLE.
  * @retval None.
  */
void I2C_AcknowledgeConfig(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 acknowledgement */
    I2Cx->CR1 |= I2C_CR1_ACK;
  }
  else
  {
    /* Disable the acknowledgement */
    I2Cx->CR1 &= (uint16_t)~((uint16_t)I2C_CR1_ACK);
  }
}

/**
  * @brief  Configures the specified I2C own address2.
  * @param  I2Cx: where x can be 1 or 2 to select the I2C peripheral.
  * @param  Address: specifies the 7bit I2C own address2.
  * @retval None.
  */
void I2C_OwnAddress2Config(I2C_TypeDef* I2Cx, uint8_t Address)
{
  uint16_t tmpreg = 0;

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

  /* Get the old register value */
  tmpreg = I2Cx->OAR2;

  /* Reset I2Cx Own address2 bit [7:1] */
  tmpreg &= (uint16_t)~((uint16_t)I2C_OAR2_ADD2);

  /* Set I2Cx Own address2 */
  tmpreg |= (uint16_t)((uint16_t)Address & (uint16_t)0x00FE);

  /* Store the new register value */
  I2Cx->OAR2 = tmpreg;
}

/**
  * @brief  Enables or disables the specified I2C dual addressing mode.
  * @param  I2Cx: where x can be 1 or 2 to select the I2C peripheral.
  * @param  NewState: new state of the I2C dual addressing mode.
  *   This parameter can be: ENABLE or DISABLE.
  * @retval None
  */
void I2C_DualAddressCmd(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 dual addressing mode */
    I2Cx->OAR2 |= I2C_OAR2_ENDUAL;
  }
  else
  {
    /* Disable dual addressing mode */
    I2Cx->OAR2 &= (uint16_t)~((uint16_t)I2C_OAR2_ENDUAL);
  }
}

/**
  * @brief  Enables or disables the specified I2C general call feature.
  * @param  I2Cx: where x can be 1 or 2 to select the I2C peripheral.
  * @param  NewState: new state of the I2C General call.
  *   This parameter can be: ENABLE or DISABLE.
  * @retval None
  */
void I2C_GeneralCallCmd(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 generall call */
    I2Cx->CR1 |= I2C_CR1_ENGC;
  }
  else
  {
    /* Disable generall call */
    I2Cx->CR1 &= (uint16_t)~((uint16_t)I2C_CR1_ENGC);
  }
}

/**
  * @brief  Enables or disables the specified I2C software reset.
  * @param  I2Cx: where x can be 1 or 2 to select the I2C peripheral.
  * @param  NewState: new state of the I2C software reset.
  *   This parameter can be: ENABLE or DISABLE.
  * @retval None
  */
void I2C_SoftwareResetCmd(I2C_TypeDef* I2Cx, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_I2C_ALL_PERIPH(I2Cx));
  assert_param(IS_FUNCTIONAL_STATE(NewState));
  if (NewState != DISABLE)
  {
    /* Peripheral under reset */
    I2Cx->CR1 |= I2C_CR1_SWRST;
  }
  else
  {
    /* Peripheral not under reset */
    I2Cx->CR1 &= (uint16_t)~((uint16_t)I2C_CR1_SWRST);
  }
}

/**
  * @brief  Drives the SMBusAlert pin high or low for the specified I2C.
  * @param  I2Cx: where x can be 1 or 2 to select the I2C peripheral.
  * @param  I2C_SMBusAlert: specifies SMBAlert pin level. 
  *   This parameter can be one of the following values:
  *     @arg I2C_SMBusAlert_Low: SMBAlert pin driven low
  *     @arg I2C_SMBusAlert_High: SMBAlert pin driven high
  * @retval None
  */
void I2C_SMBusAlertConfig(I2C_TypeDef* I2Cx, uint16_t 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;
  }
}

/**
  * @brief  Enables or disables the specified I2C ARP.
  * @param  I2Cx: where x can be 1 or 2 to select the I2C peripheral.
  * @param  NewState: new state of the I2Cx ARP. 
  *   This parameter can be: ENABLE or DISABLE.
  * @retval 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 |= I2C_CR1_ENARP;
  }
  else
  {
    /* Disable the selected I2C ARP */
    I2Cx->CR1 &= (uint16_t)~((uint16_t)I2C_CR1_ENARP);
  }
}

/**
  * @brief  Enables or disables the specified I2C Clock stretching.
  * @param  I2Cx: where x can be 1 or 2 to select the I2C peripheral.
  * @param  NewState: new state of the I2Cx Clock stretching.
  *   This parameter can be: ENABLE or DISABLE.
  * @retval 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 |= I2C_CR1_NOSTRETCH;
  }
  else
  {
    /* Disable the selected I2C Clock stretching */
    I2Cx->CR1 &= (uint16_t)~((uint16_t)I2C_CR1_NOSTRETCH);
  }
}

/**
  * @brief  Selects the specified I2C fast mode duty cycle.
  * @param  I2Cx: where x can be 1 or 2 to select the I2C peripheral.
  * @param  I2C_DutyCycle: specifies the fast mode duty cycle.
  *   This parameter can be one of the following values:
  *     @arg I2C_DutyCycle_2: I2C fast mode Tlow/Thigh = 2
  *     @arg I2C_DutyCycle_16_9: I2C fast mode Tlow/Thigh = 16/9
  * @retval None
  */
void I2C_FastModeDutyCycleConfig(I2C_TypeDef* I2Cx, uint16_t 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;
  }
}

/**
  * @brief  Transmits the address byte to select the slave device.
  * @param  I2Cx: where x can be 1 or 2 to select the I2C peripheral.
  * @param  Address: specifies the slave address which will be transmitted.
  * @param  I2C_Direction: specifies whether the I2C device will be a
  *   Transmitter or a Receiver. This parameter can be one of the following values:
  *     @arg I2C_Direction_Transmitter: Transmitter mode
  *     @arg I2C_Direction_Receiver: Receiver mode
  * @retval None.
  */
void I2C_Send7bitAddress(I2C_TypeDef* I2Cx, uint8_t Address, uint8_t I2C_Direction)
{
  /* Check the parameters */
  assert_param(IS_I2C_ALL_PERIPH(I2Cx));
  assert_param(IS_I2C_DIRECTION(I2C_Direction));
  /* Test on the direction to set/reset the read/write bit */
  if (I2C_Direction != I2C_Direction_Transmitter)
  {
    /* Set the address bit0 for read */
    Address |= I2C_OAR1_ADD0;
  }
  else
  {
    /* Reset the address bit0 for write */
    Address &= (uint8_t)~((uint8_t)I2C_OAR1_ADD0);
  }
  /* Send the address */
  I2Cx->DR = Address;
}

/**
  * @}
  */

/** @defgroup I2C_Group2 Data transfers functions
 *  @brief   Data transfers functions 
 *
@verbatim
 ===============================================================================
                    ##### Data transfers functions #####
 ===============================================================================

@endverbatim
  * @{
  */

/**
  * @brief  Sends a data byte through the I2Cx peripheral.
  * @param  I2Cx: where x can be 1 or 2 to select the I2C peripheral.
  * @param  Data: Byte to be transmitted.
  * @retval None
  */
void I2C_SendData(I2C_TypeDef* I2Cx, uint8_t Data)
{
  /* Check the parameters */
  assert_param(IS_I2C_ALL_PERIPH(I2Cx));
  /* Write in the DR register the data to be sent */
  I2Cx->DR = Data;
}

/**
  * @brief  Returns the most recent received data by the I2Cx peripheral.
  * @param  I2Cx: where x can be 1 or 2 to select the I2C peripheral.
  * @retval The value of the received data.
  */
uint8_t I2C_ReceiveData(I2C_TypeDef* I2Cx)
{
  /* Check the parameters */
  assert_param(IS_I2C_ALL_PERIPH(I2Cx));
  /* Return the data in the DR register */
  return (uint8_t)I2Cx->DR;
}

/**
  * @brief  Selects the specified I2C NACK position in master receiver mode.
  *         This function is useful in I2C Master Receiver mode when the number
  *         of data to be received is equal to 2. In this case, this function 
  *         should be called (with parameter I2C_NACKPosition_Next) before data 
  *         reception starts,as described in the 2-byte reception procedure 
  *         recommended in Reference Manual in Section: Master receiver.
  * @param  I2Cx: where x can be 1 or 2 to select the I2C peripheral.
  * @param  I2C_NACKPosition: specifies the NACK position. 
  *   This parameter can be one of the following values:
  *     @arg I2C_NACKPosition_Next: indicates that the next byte will be the last
  *          received byte.
  *     @arg I2C_NACKPosition_Current: indicates that current byte is the last 
  *          received byte.
  * @note    This function configures the same bit (POS) as I2C_PECPositionConfig() 
  *          but is intended to be used in I2C mode while I2C_PECPositionConfig() 
  *          is intended to used in SMBUS mode.
  *            
  * @retval None
  */
void I2C_NACKPositionConfig(I2C_TypeDef* I2Cx, uint16_t I2C_NACKPosition)
{
  /* Check the parameters */
  assert_param(IS_I2C_ALL_PERIPH(I2Cx));
  assert_param(IS_I2C_NACK_POSITION(I2C_NACKPosition));
  
  /* Check the input parameter */
  if (I2C_NACKPosition == I2C_NACKPosition_Next)
  {
    /* Next byte in shift register is the last received byte */
    I2Cx->CR1 |= I2C_NACKPosition_Next;
  }
  else
  {
    /* Current byte in shift register is the last received byte */
    I2Cx->CR1 &= I2C_NACKPosition_Current;
  }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧洲一区二区三区在线| 久久精品一区蜜桃臀影院| 91超碰这里只有精品国产| 亚洲精品在线三区| 一区二区三区鲁丝不卡| 国产91综合网| 91精品久久久久久久91蜜桃| 欧美国产日韩在线观看| 免费在线观看视频一区| 在线免费一区三区| 中国色在线观看另类| 欧美aⅴ一区二区三区视频| 91九色02白丝porn| 中文字幕在线播放不卡一区| 久久国产欧美日韩精品| 在线观看不卡视频| 依依成人精品视频| 99在线视频精品| 国产欧美精品一区二区三区四区| 免费精品视频最新在线| 欧美日韩国产综合草草| 亚洲欧美成aⅴ人在线观看| www..com久久爱| 国产嫩草影院久久久久| 国产成人免费视频网站 | 91小视频在线免费看| 欧美激情在线一区二区| 国产九九视频一区二区三区| 精品国产乱码久久久久久免费 | 国产99久久精品| 久久久久久久久久看片| 韩国女主播一区二区三区| 日韩女同互慰一区二区| 久草精品在线观看| 久久网站最新地址| 国产在线精品一区二区三区不卡| 精品国产一区二区三区久久影院 | 欧美三级日本三级少妇99| 一区二区三区欧美在线观看| 91免费看视频| 亚洲国产精品久久一线不卡| 色吧成人激情小说| 视频一区视频二区中文| 精品久久一区二区| 国产剧情一区二区三区| 中文字幕在线一区| 96av麻豆蜜桃一区二区| 亚洲香蕉伊在人在线观| 日韩一区和二区| 国产激情一区二区三区桃花岛亚洲| 久久精品亚洲乱码伦伦中文| 成人av网在线| 午夜激情久久久| 精品乱码亚洲一区二区不卡| 成人a免费在线看| 一区二区三区.www| 日韩一区二区电影网| 国产福利一区在线| 亚洲精品成人悠悠色影视| 欧美精品一卡两卡| 国产精品一区免费视频| 亚洲自拍另类综合| 精品久久一区二区| 色综合中文字幕国产| 夜夜精品视频一区二区| 日韩一级高清毛片| av在线不卡观看免费观看| 亚洲国产成人porn| 国产日韩欧美精品一区| 欧美午夜精品一区二区三区| 黄色日韩网站视频| 一区二区不卡在线视频 午夜欧美不卡在| 678五月天丁香亚洲综合网| 国产传媒日韩欧美成人| 日韩电影在线看| 亚洲欧洲一区二区三区| 在线成人午夜影院| 91浏览器打开| 久久精品72免费观看| 尤物在线观看一区| 中文字幕成人av| 欧美一卡在线观看| 欧洲精品在线观看| 成人黄色大片在线观看| 麻豆一区二区99久久久久| 亚洲最大成人网4388xx| 国产欧美一区视频| 日韩免费观看2025年上映的电影| 97久久久精品综合88久久| 国产一区视频网站| 蜜臀精品一区二区三区在线观看| 亚洲精品欧美二区三区中文字幕| 久久久一区二区三区捆绑**| 欧美精品在线一区二区三区| 在线免费观看日韩欧美| gogogo免费视频观看亚洲一| 国产福利精品一区二区| 看电视剧不卡顿的网站| 日韩电影在线免费观看| 亚洲国产精品久久久久婷婷884 | 国产一区二区在线免费观看| 日本最新不卡在线| 亚洲电影在线免费观看| 一区二区三区在线免费观看| 国产精品色婷婷久久58| 久久精品亚洲精品国产欧美| 久久亚洲免费视频| 日韩久久精品一区| 日韩欧美中文一区二区| 欧美伦理电影网| 欧美精品久久99| 91精品国产91综合久久蜜臀| 欧美久久久一区| 制服丝袜亚洲精品中文字幕| 欧美精品一级二级三级| 欧美电影在线免费观看| 日韩天堂在线观看| 日韩视频一区在线观看| 日韩欧美高清dvd碟片| 欧美大片在线观看| 久久先锋影音av| 中文av一区二区| 亚洲免费观看高清完整版在线观看 | 蜜桃视频第一区免费观看| 日韩黄色在线观看| 伦理电影国产精品| 国产资源在线一区| www.爱久久.com| 欧美性色欧美a在线播放| 3d成人h动漫网站入口| 欧美一区二区精品久久911| 欧美大片免费久久精品三p | 日韩欧美一级特黄在线播放| 欧美哺乳videos| 久久久不卡网国产精品二区| 国产精品麻豆一区二区| 亚洲制服丝袜在线| 老汉av免费一区二区三区| 国产白丝精品91爽爽久久| 91美女视频网站| 91精品免费观看| 国产女人18毛片水真多成人如厕 | 亚瑟在线精品视频| 裸体一区二区三区| 99在线视频精品| 51精品视频一区二区三区| 久久久www成人免费毛片麻豆| 亚洲欧美综合在线精品| 日韩av不卡一区二区| 懂色av一区二区夜夜嗨| 欧美精三区欧美精三区| 欧美经典一区二区三区| 亚洲二区在线视频| 国产精品一区二区三区网站| 在线免费观看日韩欧美| 国产亚洲污的网站| 五月婷婷久久综合| 成人激情av网| 日韩三级视频在线看| 中文字幕欧美一| 国产在线国偷精品免费看| 欧洲一区二区三区在线| 国产日韩视频一区二区三区| 亚洲电影你懂得| 成人app在线观看| 欧美一个色资源| 亚洲国产欧美一区二区三区丁香婷 | 91美女片黄在线观看| 精品国产一区二区三区忘忧草| 亚洲精品亚洲人成人网 | 中文字幕乱码日本亚洲一区二区| 无码av中文一区二区三区桃花岛| 国产91精品在线观看| 欧美大片一区二区三区| 午夜婷婷国产麻豆精品| av亚洲精华国产精华精| 欧美激情资源网| 国产盗摄一区二区| 26uuu国产电影一区二区| 亚洲第一会所有码转帖| 91无套直看片红桃| 综合久久久久久| 成人av电影在线播放| 中文av一区二区| 不卡一区在线观看| 国产欧美日韩在线视频| 国产一区二区三区四区五区入口 | 欧美激情综合五月色丁香| 极品少妇xxxx精品少妇| 日韩欧美精品三级| 日本不卡高清视频| 欧美日本一区二区| 亚洲大片免费看| 国产精品一区二区三区乱码| 欧美福利视频导航| 一区二区三区日韩欧美精品| 成人国产精品免费| 亚洲国产高清aⅴ视频| 成人免费高清在线观看| 国产日韩亚洲欧美综合|