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

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

?? stm32f10x_i2c.c

?? STM32_TIM1_Example
?? C
?? 第 1 頁 / 共 3 頁
字號:
  {
    /* 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 */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
激情亚洲综合在线| 日本中文一区二区三区| 久久久精品tv| 精品美女被调教视频大全网站| 欧美日韩国产a| 欧美网站一区二区| 在线观看国产一区二区| 欧亚一区二区三区| 欧美性猛交xxxx黑人交| 欧美日韩在线不卡| 91精品国产综合久久精品| 日韩一区二区精品葵司在线| 欧美大度的电影原声| 久久综合狠狠综合久久综合88| 精品电影一区二区三区| 欧美精品一区在线观看| 久久午夜国产精品| 国产精品嫩草影院com| 国产精品久久久久久久第一福利| ...xxx性欧美| 亚洲第一会所有码转帖| 久久精品国产精品青草| 高清在线观看日韩| 91免费看片在线观看| 欧美狂野另类xxxxoooo| 日韩色视频在线观看| 国产日韩av一区二区| 亚洲最新视频在线播放| 日本特黄久久久高潮| 国产成人综合精品三级| 一本大道av一区二区在线播放 | 欧美肥大bbwbbw高潮| 日韩欧美国产系列| 欧美激情综合在线| 亚洲一区免费观看| 国产精品一区专区| 欧美亚洲国产一区二区三区| 精品区一区二区| 亚洲黄一区二区三区| 久久99精品久久只有精品| 成人av资源在线观看| 欧美高清dvd| 最新国产の精品合集bt伙计| 日韩中文字幕一区二区三区| 成人看片黄a免费看在线| 欧美日本在线播放| 国产精品视频yy9299一区| 日韩av在线播放中文字幕| 成人免费高清视频在线观看| 日韩免费看网站| 一区二区三区四区中文字幕| 极品美女销魂一区二区三区| 在线精品国精品国产尤物884a| 亚洲精品一区在线观看| 亚洲福中文字幕伊人影院| 国产成a人亚洲精品| 日韩欧美国产系列| 午夜电影网一区| 91在线视频播放地址| 久久欧美一区二区| 日韩中文字幕亚洲一区二区va在线 | 亚洲视频资源在线| 国产精品一区二区三区乱码| 日韩三级av在线播放| 午夜私人影院久久久久| 色一情一伦一子一伦一区| 国产精品久久久久久久久动漫| 九一九一国产精品| 日韩亚洲欧美高清| 三级影片在线观看欧美日韩一区二区| av福利精品导航| 欧美国产一区二区在线观看 | 国产色综合一区| 极品少妇xxxx精品少妇偷拍| 欧美一区二区三区在线电影| 亚洲高清视频的网址| 欧美丝袜第三区| 午夜欧美在线一二页| 欧美肥妇free| 男人的天堂久久精品| 欧美大片在线观看一区| 久久丁香综合五月国产三级网站| 日韩欧美一区二区在线视频| 久久精品免费看| 久久女同互慰一区二区三区| 国产精品99久久久久久久vr | av在线不卡电影| 国产欧美一区二区精品忘忧草 | 色哟哟在线观看一区二区三区| 国产精品人妖ts系列视频| eeuss鲁一区二区三区| 亚洲特黄一级片| 欧美三级韩国三级日本三斤| 亚洲va欧美va国产va天堂影院| 欧美日韩一级大片网址| 免费在线观看视频一区| 26uuu亚洲| www.在线成人| 亚洲午夜免费视频| 欧美一区二区三区免费视频| 麻豆国产精品官网| 欧美激情一区二区在线| 欧美在线999| 精品一区二区三区不卡| 中文字幕乱码一区二区免费| 91网站在线观看视频| 亚洲chinese男男1069| 欧美成人一级视频| av在线不卡电影| 日韩福利视频导航| 国产网站一区二区三区| 在线观看日韩精品| 狠狠色丁香婷婷综合| 亚洲美女在线国产| 欧美tk丨vk视频| 欧洲精品中文字幕| 国产综合色精品一区二区三区| 亚洲欧美日韩成人高清在线一区| 欧美日韩一级二级| 99久久婷婷国产| 精品亚洲成a人| 亚洲综合在线电影| 国产日本欧美一区二区| 欧美日韩在线免费视频| 99久久精品免费看| 国内外成人在线| 亚洲成人资源网| 亚洲天堂成人在线观看| 国产亚洲婷婷免费| 在线播放国产精品二区一二区四区 | 欧美三级韩国三级日本一级| 成人三级伦理片| 精品亚洲国产成人av制服丝袜| 亚洲一卡二卡三卡四卡五卡| 国产欧美日韩久久| 欧美一级理论片| 欧美喷潮久久久xxxxx| 99re热视频这里只精品| 国产真实乱子伦精品视频| 日韩精品亚洲专区| 亚洲一区二区三区四区不卡| 亚洲欧美国产毛片在线| 国产精品久久久久影院| 久久色.com| 精品国产一区二区三区久久久蜜月 | 欧美电影免费观看高清完整版在| 91麻豆6部合集magnet| 福利一区二区在线| 国产精品中文字幕欧美| 免费成人深夜小野草| 日韩在线一区二区| 天天操天天干天天综合网| 亚洲狠狠丁香婷婷综合久久久| 国产精品免费网站在线观看| 欧美国产日韩在线观看| 中文字幕av一区 二区| 国产丝袜在线精品| 国产拍欧美日韩视频二区| 国产亚洲欧美一级| 中文字幕av不卡| 亚洲欧美在线视频观看| 亚洲欧美国产三级| 亚洲成年人影院| 免费欧美在线视频| 麻豆国产精品官网| 国产精品一区专区| 成人av在线电影| 一本大道久久精品懂色aⅴ| 欧美影视一区二区三区| 精品视频在线视频| 欧美成人一区二区| 国产欧美日韩亚州综合| 一区二区三区在线免费播放| 亚洲成人激情av| 激情综合一区二区三区| 国产a视频精品免费观看| 一本久久综合亚洲鲁鲁五月天| 欧美体内she精视频| 日韩精品一区二区三区三区免费| 欧美精品一区二区三区四区| 亚洲国产电影在线观看| 一区二区三区在线免费| 日韩黄色片在线观看| 国产99久久久国产精品免费看| 97se亚洲国产综合在线| 欧美日本在线视频| 精品国产百合女同互慰| 亚洲三级免费电影| 日本在线观看不卡视频| 丰满放荡岳乱妇91ww| 欧美亚洲国产怡红院影院| 久久久久久99精品| 亚洲一区二区三区四区在线免费观看| 免费视频一区二区| 99久久婷婷国产综合精品| 91精品国产入口| 日韩毛片精品高清免费| 久久激情五月激情| 色一情一乱一乱一91av| 久久久久久久综合日本|