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

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

?? stm32f10x_i2c.c

?? STM32F10x USB Library V1.0
?? C
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
  {
    /* Disable the selected I2C DMA requests */
    I2Cx->CR2 &= CR2_DMAEN_Reset;
  }
}

/*******************************************************************************
* Function Name  : I2C_DMALastTransferCmd
* Description    : Specifies that the next DMA transfer is the last one.
* Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
*                  - NewState: new state of the I2C DMA last transfer.
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void I2C_DMALastTransferCmd(I2C_TypeDef* I2Cx, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_FUNCTIONAL_STATE(NewState));

  if (NewState != DISABLE)
  {
    /* Next DMA end of transfer is the last transfer */
    I2Cx->CR2 |= CR2_LAST_Set;
  }
  else
  {
    /* Next DMA end of transfer is not the last transfer */
    I2Cx->CR2 &= CR2_LAST_Reset;
  }
}

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

  if (NewState != DISABLE)
  {
    /* Generate a START condition */
    I2Cx->CR1 |= CR1_START_Set;
  }
  else
  {
    /* Disable the START condition generation */
    I2Cx->CR1 &= CR1_START_Reset;
  }
}

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

  if (NewState != DISABLE)
  {
    /* Generate a STOP condition */
    I2Cx->CR1 |= CR1_STOP_Set;
  }
  else
  {
    /* Disable the STOP condition generation */
    I2Cx->CR1 &= CR1_STOP_Reset;
  }
}

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

  if (NewState != DISABLE)
  {
    /* Enable the acknowledgement */
    I2Cx->CR1 |= CR1_ACK_Set;
  }
  else
  {
    /* Disable the acknowledgement */
    I2Cx->CR1 &= CR1_ACK_Reset;
  }
}

/*******************************************************************************
* Function Name  : I2C_OwnAddress2Config
* Description    : Configures the specified I2C own address2.
* Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
*                  - Address: specifies the 7bit I2C own address2.
* Output         : None
* Return         : None.
*******************************************************************************/
void I2C_OwnAddress2Config(I2C_TypeDef* I2Cx, u8 Address)
{
  u16 tmpreg = 0;

  /* Get the old register value */
  tmpreg = I2Cx->OAR2;
  /* Reset I2Cx Own address2 bit [7:1] */
  tmpreg &= OAR2_ADD2_Reset;
  /* Set I2Cx Own address2 */
  tmpreg |= (u16)(Address & (u16)0x00FE);
  /* Store the new register value */
  I2Cx->OAR2 = tmpreg;
}

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

  if (NewState != DISABLE)
  {
    /* Enable dual addressing mode */
    I2Cx->OAR2 |= OAR2_ENDUAL_Set;
  }
  else
  {
    /* Disable dual addressing mode */
    I2Cx->OAR2 &= OAR2_ENDUAL_Reset;
  }
}

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

  if (NewState != DISABLE)
  {
    /* Enable generall call */
    I2Cx->CR1 |= CR1_ENGC_Set;
  }
  else
  {
    /* Disable generall call */
    I2Cx->CR1 &= CR1_ENGC_Reset;
  }
}

/*******************************************************************************
* Function Name  : I2C_ITConfig
* Description    : Enables or disables the specified I2C interrupts.
* Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
*                  - I2C_IT: specifies the I2C interrupts sources to be enabled
*                    or disabled. 
*                    This parameter can be any combination of the following values:
*                       - I2C_IT_BUF: Buffer interrupt mask
*                       - I2C_IT_EVT: Event interrupt mask
*                       - I2C_IT_ERR: Error interrupt mask
*                  - NewState: new state of the specified I2C interrupts.
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void I2C_ITConfig(I2C_TypeDef* I2Cx, u16 I2C_IT, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_FUNCTIONAL_STATE(NewState));
  assert_param(IS_I2C_CONFIG_IT(I2C_IT));
  
  if (NewState != DISABLE)
  {
    /* Enable the selected I2C interrupts */
    I2Cx->CR2 |= I2C_IT;
  }
  else
  {
    /* Disable the selected I2C interrupts */
    I2Cx->CR2 &= (u16)~I2C_IT;
  }
}

/*******************************************************************************
* Function Name  : I2C_SendData
* Description    : Sends a data byte through the I2Cx peripheral.
* Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
*                  - Data: Byte to be transmitted..
* Output         : None
* Return         : None
*******************************************************************************/
void I2C_SendData(I2C_TypeDef* I2Cx, u8 Data)
{
  /* Write in the DR register the data to be sent */
  I2Cx->DR = Data;
}

/*******************************************************************************
* Function Name  : I2C_ReceiveData
* Description    : Returns the most recent received data by the I2Cx peripheral.
* Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
* Output         : None
* Return         : The value of the received data.
*******************************************************************************/
u8 I2C_ReceiveData(I2C_TypeDef* I2Cx)
{
  /* Return the data in the DR register */
  return (u8)I2Cx->DR;
}

/*******************************************************************************
* Function Name  : I2C_Send7bitAddress
* Description    : Transmits the address byte to select the slave device.
* Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
*                  - Address: specifies the slave address which will be transmitted
*                  - I2C_Direction: specifies whether the I2C device will be a
*                    Transmitter or a Receiver. 
*                    This parameter can be one of the following values
*                       - I2C_Direction_Transmitter: Transmitter mode
*                       - I2C_Direction_Receiver: Receiver mode
* Output         : None
* Return         : None.
*******************************************************************************/
void I2C_Send7bitAddress(I2C_TypeDef* I2Cx, u8 Address, u8 I2C_Direction)
{
  /* Check the parameters */
  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 ADD0 bit0 for read */
    Address |= OAR1_ADD0_Set;
  }
  else
  {
    /* Reset the address bit0 for write */
    Address &= OAR1_ADD0_Reset;
  }
  /* Send the address */
  I2Cx->DR = Address;
}

/*******************************************************************************
* Function Name  : I2C_ReadRegister
* Description    : Reads the specified I2C register and returns its value.
* Input1         : - I2C_Register: specifies the register to read.
*                    This parameter can be one of the following values:
*                       - I2C_Register_CR1:  CR1 register.
*                       - I2C_Register_CR2:   CR2 register.
*                       - I2C_Register_OAR1:  OAR1 register.
*                       - I2C_Register_OAR2:  OAR2 register.
*                       - I2C_Register_DR:    DR register.
*                       - I2C_Register_SR1:   SR1 register.
*                       - I2C_Register_SR2:   SR2 register.
*                       - I2C_Register_CCR:   CCR register.
*                       - I2C_Register_TRISE: TRISE register.
* Output         : None
* Return         : The value of the read register.
*******************************************************************************/
u16 I2C_ReadRegister(I2C_TypeDef* I2Cx, u8 I2C_Register)
{
  /* Check the parameters */
  assert_param(IS_I2C_REGISTER(I2C_Register));

  /* Return the selected register value */
  return (*(u16 *)(*((u32 *)&I2Cx) + I2C_Register));
}

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

  if (NewState != DISABLE)
  {
    /* Peripheral under reset */

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本视频中文字幕一区二区三区| 大桥未久av一区二区三区中文| 日韩美女精品在线| 久久九九久久九九| 久久婷婷综合激情| 久久影院午夜论| 精品欧美一区二区在线观看 | 日韩女同互慰一区二区| 51精品久久久久久久蜜臀| 色婷婷香蕉在线一区二区| 91麻豆精品在线观看| 色综合久久天天| 欧美亚洲综合久久| 欧美日韩亚洲综合一区| 7777精品伊人久久久大香线蕉完整版| 欧美精品久久99| 欧美videos大乳护士334| 欧美精品一区二区不卡| 久久亚洲精品国产精品紫薇| 中文字幕欧美日韩一区| 亚洲人亚洲人成电影网站色| 亚洲一二三级电影| 日日夜夜免费精品| 黄色日韩三级电影| 国产成人亚洲精品狼色在线| 99热99精品| 欧美三级电影一区| 精品99999| 国产精品久久久久9999吃药| 一区二区三区自拍| 蓝色福利精品导航| 成人免费毛片a| 欧美日韩国产首页在线观看| 日韩一区二区三区在线视频| 中文子幕无线码一区tr | 丁香天五香天堂综合| 91在线观看免费视频| 欧美久久久久中文字幕| 精品国产乱码久久久久久免费 | 91麻豆精品国产91久久久久久久久| 欧美一区二区三区四区五区| 国产日韩精品一区二区三区| 亚洲精品国产一区二区精华液| 日本成人在线看| av在线不卡免费看| 在线不卡免费欧美| 欧美极品另类videosde| 天天综合网 天天综合色| 国产成人综合亚洲91猫咪| 欧美主播一区二区三区| 久久综合久久鬼色| 亚洲最大成人综合| 国产一区二区美女| 欧美网站一区二区| 久久精品人人做人人爽人人| 亚洲午夜精品一区二区三区他趣| 激情综合色综合久久| 91搞黄在线观看| 2020日本不卡一区二区视频| 亚洲大尺度视频在线观看| 国产精品乡下勾搭老头1| 欧美日韩精品一区二区| 中文在线一区二区| 九九在线精品视频| 在线精品视频免费观看| 国产精品嫩草99a| 精品一二线国产| 欧美日韩国产乱码电影| 国产精品对白交换视频| 久久国产精品无码网站| 欧美亚洲高清一区二区三区不卡| 国产日韩欧美麻豆| 男女激情视频一区| 欧美日韩国产免费| 亚洲久草在线视频| 不卡的电影网站| 精品久久国产97色综合| 亚洲第一激情av| 91啦中文在线观看| 国产精品九色蝌蚪自拍| 韩国v欧美v亚洲v日本v| 欧美一区日本一区韩国一区| 亚洲一区二三区| 色综合久久久久久久久久久| 国产三区在线成人av| 裸体一区二区三区| 欧美精品视频www在线观看| 亚洲另类一区二区| 99re免费视频精品全部| 国产精品久久久久国产精品日日| 国产精品18久久久久| www国产成人免费观看视频 深夜成人网 | 日韩美女视频19| 99久久精品99国产精品 | 波多野结衣亚洲| 国产麻豆欧美日韩一区| 日韩一区二区在线看片| 丝袜美腿亚洲色图| 欧美日本在线播放| 亚洲va欧美va人人爽| 欧美日本在线视频| 日韩国产欧美在线观看| 91精品啪在线观看国产60岁| 日韩在线a电影| 7777精品伊人久久久大香线蕉最新版| 舔着乳尖日韩一区| 欧美一区二区三区免费在线看| 图片区小说区国产精品视频| 666欧美在线视频| 免费三级欧美电影| 精品国产乱码久久久久久免费| 国产在线精品免费| 日本一区二区三区四区| 99精品视频中文字幕| 一区二区三区资源| 4438x亚洲最大成人网| 美日韩一级片在线观看| 欧美精品一区在线观看| 风间由美一区二区三区在线观看 | 国产人妖乱国产精品人妖| 国产成人日日夜夜| ●精品国产综合乱码久久久久| 91丝袜美腿高跟国产极品老师 | 国产91色综合久久免费分享| 国产精品丝袜91| 色av综合在线| 青娱乐精品视频| 久久蜜臀中文字幕| 色综合久久综合网97色综合 | 91视频免费看| 亚洲国产综合色| 日韩欧美在线网站| 粉嫩av一区二区三区| 一片黄亚洲嫩模| 日韩一区二区三区四区五区六区| 国产精品一区二区三区99| 国产精品久久影院| 欧美日本在线观看| 国产成人在线观看免费网站| 亚洲精品乱码久久久久久久久| 7777精品伊人久久久大香线蕉超级流畅| 九九**精品视频免费播放| 亚洲欧美综合色| 91精品一区二区三区在线观看| 国产成人免费在线观看| 亚洲综合在线免费观看| 久久综合成人精品亚洲另类欧美 | 麻豆国产精品一区二区三区| 国产精品美女久久久久久2018| 亚洲制服丝袜av| 日韩欧美国产综合一区| 91丨九色丨蝌蚪富婆spa| 日韩激情视频网站| 中文字幕一区二区不卡| 欧美一区二区三区在线电影| 99久久婷婷国产综合精品| 视频一区视频二区在线观看| 欧美国产日韩一二三区| 欧美精品日日鲁夜夜添| 成人免费视频播放| 久久激情五月婷婷| 亚洲精品水蜜桃| 久久久久久一二三区| 欧美亚洲高清一区二区三区不卡| 国产高清无密码一区二区三区| 亚洲va天堂va国产va久| 国产精品久久久久久久第一福利 | 精品成人a区在线观看| 欧美性大战xxxxx久久久| 国产福利91精品一区| 亚洲成av人影院| 亚洲欧美日韩在线| 久久品道一品道久久精品| 欧美精品丝袜中出| 91成人国产精品| 成人不卡免费av| 国产九九视频一区二区三区| 视频一区二区三区入口| 中文字幕一区三区| 久久综合精品国产一区二区三区 | 精品国产亚洲一区二区三区在线观看 | 欧美电影在哪看比较好| 色综合久久天天综合网| 成人免费黄色在线| 国产麻豆日韩欧美久久| 蜜桃视频在线一区| 午夜国产精品一区| 亚洲女人的天堂| 亚洲欧洲成人精品av97| 国产女人18毛片水真多成人如厕| 欧美成人a∨高清免费观看| 欧美久久久一区| 欧美久久久久免费| 欧美精品一卡两卡| 欧美人与性动xxxx| 欧美日韩精品免费| 欧洲亚洲精品在线| 在线视频综合导航| 欧美午夜一区二区三区| 色婷婷精品大在线视频|