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

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

?? stm32f10x_i2c.c

?? 萬利開發板上的lcd例程
?? C
?? 第 1 頁 / 共 3 頁
字號:
    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)
  {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本在线不卡视频| zzijzzij亚洲日本少妇熟睡| 国产一区二区三区| 在线观看av不卡| 久久久国际精品| 亚洲v日本v欧美v久久精品| 懂色av一区二区三区免费看| 91精品久久久久久久91蜜桃| 亚洲欧美乱综合| 国产成人免费在线视频| 欧美成人a视频| 日本中文字幕一区二区有限公司| 成人精品视频一区| 久久久精品黄色| 精品在线亚洲视频| 欧美一区二区视频在线观看2020| 亚洲激情校园春色| 91视频你懂的| 成人免费在线播放视频| 国产成人午夜精品影院观看视频| 精品日韩欧美一区二区| 人人狠狠综合久久亚洲| 91麻豆精品国产91久久久更新时间| 亚洲欧美激情一区二区| 91视频精品在这里| 亚洲黄色免费网站| 色欧美乱欧美15图片| 一区二区三区四区激情| 91久久国产最好的精华液| 亚洲欧美日韩小说| 欧美性xxxxxx少妇| 亚洲国产综合在线| 91精品一区二区三区在线观看| 亚洲va韩国va欧美va| 欧美日韩一区精品| 美女一区二区在线观看| 欧美成人高清电影在线| 国产成人欧美日韩在线电影| 国产精品伦理一区二区| 一本高清dvd不卡在线观看| 一区二区三区免费网站| 精品视频一区三区九区| 毛片av一区二区| 久久人人超碰精品| 成人精品视频一区二区三区| 一区二区三区不卡在线观看 | 91美女片黄在线观看91美女| 亚洲色图视频网| 欧美美女一区二区在线观看| 日本午夜精品视频在线观看| 久久青草欧美一区二区三区| 99久久精品国产精品久久| 一区二区久久久| 日韩一区二区中文字幕| 国产高清亚洲一区| 夜夜精品视频一区二区| 日韩欧美卡一卡二| 99精品久久99久久久久| 婷婷综合在线观看| 国产欧美日韩精品在线| 欧美私模裸体表演在线观看| 久热成人在线视频| ●精品国产综合乱码久久久久| 欧美日韩中文字幕一区| 国产福利一区在线| 亚洲成人激情自拍| 国产精品美女久久久久久久网站| 99国产精品视频免费观看| 天堂成人国产精品一区| 中文字幕欧美区| 欧美一卡二卡在线| av成人免费在线| 麻豆成人av在线| 一区二区三区四区在线| 国产色产综合产在线视频| 欧洲色大大久久| 风间由美一区二区三区在线观看 | 日韩毛片视频在线看| 日韩欧美一区在线观看| 色综合欧美在线视频区| 激情深爱一区二区| 亚洲高清视频在线| 亚洲三级电影网站| 久久久综合激的五月天| 6080yy午夜一二三区久久| 91啪亚洲精品| 国产成人午夜精品影院观看视频 | 成人黄页毛片网站| 男男成人高潮片免费网站| 一区在线观看视频| 久久久不卡网国产精品二区| 欧美日韩久久久一区| 91免费小视频| 成人综合婷婷国产精品久久| 麻豆国产欧美一区二区三区| 亚洲国产日韩一区二区| 亚洲天堂免费在线观看视频| 欧美韩国日本综合| 久久亚洲精精品中文字幕早川悠里 | 亚洲国产精品久久一线不卡| 成人免费一区二区三区在线观看| 久久久久久久网| 久久久久久久免费视频了| 日韩免费观看2025年上映的电影| 欧美中文字幕不卡| 欧洲生活片亚洲生活在线观看| 波多野结衣亚洲| 成人在线综合网| 国产白丝网站精品污在线入口| 国产综合色精品一区二区三区| 美女视频黄免费的久久 | 波多野结衣精品在线| 成人精品视频一区二区三区| 国产成人精品亚洲日本在线桃色| 国内外成人在线| 国内成人精品2018免费看| 国产一区二区精品在线观看| 国产精品1区2区3区在线观看| 国内精品第一页| 成人亚洲一区二区一| 成人看片黄a免费看在线| av电影在线观看完整版一区二区| 色综合久久久久久久久| 欧美日韩美女一区二区| 欧美一区二区三区四区视频| 欧美一级高清片| 2024国产精品视频| 国产精品美女久久久久aⅴ国产馆| 中文字幕欧美区| 亚洲曰韩产成在线| 日韩va欧美va亚洲va久久| 精品一区精品二区高清| 国产黑丝在线一区二区三区| 91在线国产福利| 欧美日本乱大交xxxxx| 精品久久久久久久一区二区蜜臀| 国产日韩欧美电影| 一区二区三区欧美在线观看| 日韩vs国产vs欧美| 丁香啪啪综合成人亚洲小说| 色婷婷av一区二区三区gif| 欧美一区二区三区视频免费| 久久久久国产成人精品亚洲午夜| 亚洲乱码日产精品bd| 午夜精品123| 粉嫩aⅴ一区二区三区四区| 欧美中文字幕一区| 久久精品这里都是精品| 一区二区三区四区激情 | 日韩国产一区二| 国产经典欧美精品| 欧美日韩一区不卡| 国产日韩v精品一区二区| 一区二区激情视频| 国产精品亚洲综合一区在线观看| 91久久一区二区| 久久久久久久综合狠狠综合| 亚洲一区二区欧美日韩| 成人午夜电影小说| 欧美一区二区在线观看| 亚洲精品成a人| 国产99久久久国产精品潘金网站| 欧美日韩黄色一区二区| 国产精品久久久一本精品 | 亚洲一二三四久久| 粉嫩av亚洲一区二区图片| 欧美一区二区网站| 伊人夜夜躁av伊人久久| 国产不卡视频在线观看| 欧美精品一区男女天堂| 亚洲gay无套男同| 91香蕉视频在线| 日本一区二区成人| 麻豆freexxxx性91精品| 欧美特级限制片免费在线观看| 国产精品女人毛片| 国产呦萝稀缺另类资源| 日韩视频在线一区二区| 亚洲va韩国va欧美va| 91福利视频网站| 日韩一区欧美一区| 成人免费毛片高清视频| 久久久www成人免费毛片麻豆| 婷婷成人综合网| 欧美日韩国产综合一区二区三区 | 国产成人精品亚洲日本在线桃色| 欧美一级欧美一级在线播放| 亚洲成av人片在线观看| 91黄视频在线| 一级日本不卡的影视| 色综合色狠狠天天综合色| 国产精品久久久久久久久搜平片| 国产伦精品一区二区三区免费迷| 日韩精品一区二区三区视频在线观看| 日韩av二区在线播放| 欧美一卡二卡在线| 精品制服美女丁香| 国产午夜精品久久久久久久| 国产乱码字幕精品高清av | 中文字幕的久久|