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

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

?? stm32f10x_i2c.c

?? 提供萬利的板子上能跑的在MDK下的UCOS源代碼
?? 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一区二区三区免费野_久草精品视频
国产精品视频一二| 欧美系列在线观看| 蜜臀91精品一区二区三区| 欧美成人免费网站| 青青草一区二区三区| 免费观看一级欧美片| 另类小说图片综合网| 日韩精品三区四区| 亚洲欧洲日产国码二区| 在线观看日韩精品| 777a∨成人精品桃花网| 欧美一区二区人人喊爽| 欧美男女性生活在线直播观看| 色久优优欧美色久优优| 精品国产乱码久久久久久1区2区| 欧美一二三在线| 91精品国产综合久久国产大片| 欧美天堂亚洲电影院在线播放| 在线精品视频一区二区| 99精品国产热久久91蜜凸| 91黄色在线观看| 欧美xingq一区二区| 精品国产一区二区三区四区四 | 国产精品网站在线观看| 亚洲狠狠丁香婷婷综合久久久| 欧美国产一区在线| 欧美日韩久久久一区| 在线播放91灌醉迷j高跟美女| 欧美不卡视频一区| 91精品黄色片免费大全| 综合久久综合久久| 亚洲综合一区二区| 久久er99热精品一区二区| 国产一区二区三区在线观看免费| 99久久婷婷国产综合精品电影 | 亚洲一区二区在线免费看| 日本vs亚洲vs韩国一区三区二区| 国内精品写真在线观看| 欧美在线制服丝袜| 国产欧美一区二区三区沐欲| 亚洲自拍偷拍综合| 91免费版在线| 久久精品亚洲精品国产欧美kt∨| 欧美在线免费视屏| 日韩欧美国产麻豆| 免费视频最近日韩| 色悠悠久久综合| 久久婷婷国产综合精品青草| 亚洲一区二区三区精品在线| 欧美精三区欧美精三区| 亚洲国产精品久久久久婷婷884| 91精彩视频在线| 一区在线中文字幕| 国产suv精品一区二区6| 亚洲黄网站在线观看| 欧美三级在线播放| 日韩在线卡一卡二| 一本色道久久综合亚洲91| 中文字幕欧美国产| 欧美视频精品在线| 精品在线你懂的| 国产精品欧美一区二区三区| 国产成人在线网站| 欧美成人bangbros| 久久久综合视频| 国产在线国偷精品产拍免费yy| 欧美电影在哪看比较好| 午夜精品久久久久影视| 日韩欧美成人午夜| 亚洲午夜一二三区视频| 日韩欧美一二区| 不卡的av电影| 亚洲伦在线观看| 日韩一区二区三区四区| 精品在线播放午夜| 亚洲小说春色综合另类电影| 欧美日韩在线不卡| 午夜精品福利一区二区蜜股av | 中文字幕一区二区三区四区不卡 | 精品国产电影一区二区| 日本丶国产丶欧美色综合| 久久免费美女视频| 国产毛片精品国产一区二区三区| 国产日产欧产精品推荐色 | 亚洲靠逼com| 日韩欧美自拍偷拍| 成+人+亚洲+综合天堂| 成人午夜激情视频| 成人欧美一区二区三区黑人麻豆| 日韩视频免费观看高清完整版 | 国产精品嫩草影院com| 久久久亚洲精品一区二区三区| 欧美视频在线不卡| 国产精品国产三级国产有无不卡 | 亚洲精品中文字幕乱码三区| 日韩欧美一二三四区| 不卡电影一区二区三区| 成人免费观看男女羞羞视频| 欧美日韩一区精品| 国产精一品亚洲二区在线视频| 怡红院av一区二区三区| 国产一区二区主播在线| 久久精品国产一区二区三| 视频一区在线播放| 国产女同互慰高潮91漫画| 欧美一级高清片| 精品日韩在线观看| 亚洲日本免费电影| 日韩国产欧美在线视频| 蜜臀a∨国产成人精品| 国产剧情一区在线| 欧美日韩精品一区视频| 欧美一二三区在线观看| 国产亚洲一二三区| 综合久久久久久| 一区二区三区欧美久久| 麻豆精品视频在线观看视频| 97精品久久久午夜一区二区三区| 一本到三区不卡视频| 精品免费国产一区二区三区四区| 色综合一个色综合| 91官网在线观看| 久久一二三国产| 日韩av一级片| 色网站国产精品| 久久婷婷国产综合精品青草| 国产精品白丝在线| 欧美日韩精品电影| 精品国产麻豆免费人成网站| 亚洲欧美国产77777| 国产高清视频一区| 精品1区2区在线观看| 一区在线观看免费| 奇米综合一区二区三区精品视频| 一区二区三区在线播放| 亚洲精品成a人| 麻豆久久久久久| 91蝌蚪国产九色| 久久婷婷综合激情| 成人午夜大片免费观看| 久久色视频免费观看| 精品在线免费视频| 欧美伦理电影网| 一区二区三区在线视频观看58| 亚洲国产精品尤物yw在线观看| 91在线精品一区二区三区| 亚洲日本乱码在线观看| 免费观看一级特黄欧美大片| 欧美精品丝袜久久久中文字幕| 欧美精品一级二级三级| 亚洲成在人线在线播放| 国产丶欧美丶日本不卡视频| 91精品国产欧美一区二区18 | av影院午夜一区| 日韩激情中文字幕| 国产精品久99| 日韩精品专区在线| 色哟哟国产精品| 国产麻豆精品久久一二三| 亚洲美女免费在线| 欧美日韩精品免费| 中文字幕一区二区三区四区不卡| 欧美性色综合网| 国产精品毛片大码女人| 欧美日韩国产免费| 福利91精品一区二区三区| 亚洲狠狠丁香婷婷综合久久久| 视频精品一区二区| 国产精品毛片久久久久久久| 91麻豆国产福利在线观看| www.在线欧美| 日本欧美久久久久免费播放网| 欧美经典一区二区| 日韩欧美中文字幕公布| 在线观看不卡一区| 成人动漫中文字幕| 3d成人h动漫网站入口| 91视频免费播放| 欧美日韩美女一区二区| 国产亚洲短视频| 欧洲一区二区三区在线| www.综合网.com| 国产成人精品亚洲日本在线桃色| 五月天婷婷综合| 国产精品毛片久久久久久| 日韩视频一区二区在线观看| 欧美日韩精品欧美日韩精品一综合| 亚洲一区二区三区在线播放 | 97国产精品videossex| 亚洲欧美日韩一区二区三区在线观看| 中文一区一区三区高中清不卡| 日本不卡一区二区三区高清视频| 午夜精品久久久久久久| 日本色综合中文字幕| 国产精品1024| 欧美中文字幕不卡| a亚洲天堂av| 91在线精品一区二区三区| 色天天综合色天天久久| 在线不卡一区二区|