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

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

?? stm32f10x_i2c.c

?? STM32F RFID通訊源代碼(支持雙向發(fā)送接收)
?? C
?? 第 1 頁 / 共 3 頁
字號(hào):
    I2Cx->CR2 |= CR2_DMAEN_Set;
  }
  else
  {
    /* 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(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(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(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(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(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(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(IS_FUNCTIONAL_STATE(NewState));
  assert(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(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(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(IS_FUNCTIONAL_STATE(NewState));

  if (NewState != DISABLE)
  {

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲线精品一区二区三区| 7777女厕盗摄久久久| 久久在线观看免费| 蜜臀精品一区二区三区在线观看| 日韩精品中文字幕一区二区三区 | 国产精品少妇自拍| 99这里只有精品| 一二三四社区欧美黄| 欧美日本国产视频| 久久国内精品视频| 欧美国产综合色视频| 97久久超碰精品国产| 亚洲综合久久久| 日韩女优制服丝袜电影| 国产91露脸合集magnet| 自拍偷自拍亚洲精品播放| 91搞黄在线观看| 日本午夜精品一区二区三区电影 | 国产视频一区在线观看| 95精品视频在线| 日本伊人色综合网| 国产欧美1区2区3区| 欧美怡红院视频| 黄一区二区三区| 亚洲精品国久久99热| 欧美一区二区三区思思人| 国产福利视频一区二区三区| 亚洲黄色av一区| 久久综合九色综合97婷婷女人 | 久久久99久久| 在线观看免费亚洲| 久久99久久99小草精品免视看| 中文字幕日韩一区二区| 91精品国产综合久久精品app | 欧美不卡一区二区三区四区| 成人免费视频国产在线观看| 天堂久久久久va久久久久| 久久久精品免费观看| 在线视频亚洲一区| 国产精品亚洲午夜一区二区三区| 亚洲影视在线播放| 国产日产欧美一区二区视频| 欧美久久免费观看| 99久久免费精品高清特色大片| 美女在线观看视频一区二区| 亚洲美腿欧美偷拍| 欧美—级在线免费片| 日韩一区二区三区免费看 | 亚洲成人免费电影| 亚洲国产精品精华液ab| 日韩西西人体444www| 日本道精品一区二区三区| 粉嫩蜜臀av国产精品网站| 久久99国产乱子伦精品免费| 亚洲午夜久久久| 亚洲视频在线观看三级| 国产亚洲制服色| 精品裸体舞一区二区三区| 欧美日韩精品一区二区三区| 91麻豆免费看| 成人午夜精品在线| 国产精品亚洲一区二区三区在线| 蜜桃一区二区三区在线观看| 午夜精品福利久久久| 亚洲综合区在线| 亚洲女人的天堂| 亚洲欧美日韩国产综合在线| 国产精品久久久99| 中文字幕第一区综合| 国产无遮挡一区二区三区毛片日本| 日韩免费看网站| 欧美一卡2卡三卡4卡5免费| 欧美伦理影视网| 91精品免费在线| 91精品国产麻豆| 欧美电影免费观看高清完整版在线观看 | 成人激情小说网站| 国产精品18久久久久久vr| 国内精品国产三级国产a久久| 久久成人精品无人区| 韩国视频一区二区| 国产乱码精品一品二品| 粉嫩嫩av羞羞动漫久久久| 成人深夜在线观看| 91免费视频网址| 色婷婷亚洲精品| 欧美精品 国产精品| 欧美一区三区二区| 精品国产亚洲在线| 国产日韩欧美电影| 亚洲视频一区二区在线观看| 伊人夜夜躁av伊人久久| 婷婷久久综合九色国产成人 | 欧美伊人精品成人久久综合97| 欧美综合色免费| 欧美电影在线免费观看| 日韩精品一区二区三区中文不卡| 久久久久久久性| 国产精品国产三级国产专播品爱网 | 久久久久久夜精品精品免费| 国产欧美一二三区| 亚洲免费看黄网站| 日韩激情中文字幕| 奇米色一区二区| 国产在线一区二区综合免费视频| 国产98色在线|日韩| 在线观看网站黄不卡| 日韩一区国产二区欧美三区| 国产三级三级三级精品8ⅰ区| 亚洲精品日产精品乱码不卡| 日韩精品久久久久久| 国产成人av福利| 在线视频综合导航| 2023国产精品视频| 一区二区三区四区不卡在线| 蜜桃一区二区三区在线| 成人黄动漫网站免费app| 欧美日韩免费视频| 国产网站一区二区| 亚洲成av人片一区二区三区| 国产综合久久久久久鬼色 | 欧洲生活片亚洲生活在线观看| 91精品国产色综合久久| 亚洲欧美在线aaa| 免费看日韩a级影片| 99精品国产热久久91蜜凸| 欧美日本在线看| 日韩码欧中文字| 九九国产精品视频| 欧美日韩另类一区| 国产精品嫩草久久久久| 久久精品国产在热久久| 91极品美女在线| 国产欧美日韩亚州综合| 日本中文在线一区| 在线视频中文字幕一区二区| 国产精品女同一区二区三区| 美女国产一区二区三区| 欧美视频在线播放| 欧美激情综合五月色丁香| 精品一区二区免费| 欧美人xxxx| 亚洲午夜精品在线| av男人天堂一区| 国产欧美日韩久久| 精品在线一区二区三区| 欧美日本在线一区| 亚洲午夜久久久久久久久电影网 | 欧美一区二区三区四区在线观看| 亚洲三级视频在线观看| 成人久久视频在线观看| 亚洲精品一区在线观看| 日韩黄色在线观看| 欧美丰满嫩嫩电影| 亚洲午夜国产一区99re久久| 色综合久久久网| 中文字幕中文字幕中文字幕亚洲无线| 国产伦精品一区二区三区免费迷| 欧美一区二区三区白人| 日韩高清不卡一区二区三区| 欧美视频三区在线播放| 亚洲精品国产第一综合99久久| 972aa.com艺术欧美| 亚洲欧美激情一区二区| 91免费在线视频观看| **欧美大码日韩| 91香蕉视频污在线| 日韩久久一区二区| 日本道色综合久久| 亚洲国产美女搞黄色| 欧美日韩精品福利| 日韩国产精品91| 精品日韩99亚洲| 国产美女主播视频一区| 国产喷白浆一区二区三区| 成人性视频免费网站| 亚洲色图视频网| 欧美自拍偷拍午夜视频| 午夜电影一区二区| 欧美电影免费观看高清完整版在线 | 夜夜亚洲天天久久| 在线视频中文字幕一区二区| 亚洲va欧美va人人爽午夜| 91精品国产aⅴ一区二区| 久久激情五月婷婷| 国产欧美日韩不卡| 色婷婷久久久久swag精品| 午夜精品一区二区三区三上悠亚| 88在线观看91蜜桃国自产| 精品无人区卡一卡二卡三乱码免费卡 | 成人在线视频一区二区| 亚洲日本一区二区| 欧美久久久久久蜜桃| 国产一区久久久| ●精品国产综合乱码久久久久| 欧美日韩在线免费视频| 久久成人久久爱| 亚洲日本在线天堂| 欧美一区二区三区免费视频| 成人免费三级在线|