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

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

?? stm32f10x_i2c.c

?? 基于STM32的 模擬時序
?? C
?? 第 1 頁 / 共 3 頁
字號:
    I2Cx->CR1 |= CR1_SWRST_Set;
  }
  else
  {
    /* Peripheral not under reset */
    I2Cx->CR1 &= CR1_SWRST_Reset;
  }
}

/*******************************************************************************
* Function Name  : I2C_SMBusAlertConfig
* Description    : Drives the SMBusAlert pin high or low for the specified I2C.
* Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
*                  - I2C_SMBusAlert: specifies SMBAlert pin level. 
*                    This parameter can be one of the following values:
*                       - I2C_SMBusAlert_Low: SMBAlert pin driven low
*                       - I2C_SMBusAlert_High: SMBAlert pin driven high
* Output         : None
* Return         : None
*******************************************************************************/
void I2C_SMBusAlertConfig(I2C_TypeDef* I2Cx, u16 I2C_SMBusAlert)
{
  /* Check the parameters */
  assert_param(IS_I2C_ALL_PERIPH(I2Cx));
  assert_param(IS_I2C_SMBUS_ALERT(I2C_SMBusAlert));

  if (I2C_SMBusAlert == I2C_SMBusAlert_Low)
  {
    /* Drive the SMBusAlert pin Low */
    I2Cx->CR1 |= I2C_SMBusAlert_Low;
  }
  else
  {
    /* Drive the SMBusAlert pin High  */
    I2Cx->CR1 &= I2C_SMBusAlert_High;
  }
}

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

  if (NewState != DISABLE)
  {
    /* Enable the selected I2C PEC transmission */
    I2Cx->CR1 |= CR1_PEC_Set;
  }
  else
  {
    /* Disable the selected I2C PEC transmission */
    I2Cx->CR1 &= CR1_PEC_Reset;
  }
}

/*******************************************************************************
* Function Name  : I2C_PECPositionConfig
* Description    : Selects the specified I2C PEC position.
* Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
*                  - I2C_PECPosition: specifies the PEC position. 
*                    This parameter can be one of the following values:
*                       - I2C_PECPosition_Next: indicates that the next
*                         byte is PEC
*                       - I2C_PECPosition_Current: indicates that current
*                         byte is PEC
* Output         : None
* Return         : None
*******************************************************************************/
void I2C_PECPositionConfig(I2C_TypeDef* I2Cx, u16 I2C_PECPosition)
{
  /* Check the parameters */
  assert_param(IS_I2C_ALL_PERIPH(I2Cx));
  assert_param(IS_I2C_PEC_POSITION(I2C_PECPosition));

  if (I2C_PECPosition == I2C_PECPosition_Next)
  {
    /* Next byte in shift register is PEC */
    I2Cx->CR1 |= I2C_PECPosition_Next;
  }
  else
  {
    /* Current byte in shift register is PEC */
    I2Cx->CR1 &= I2C_PECPosition_Current;
  }
}

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

  if (NewState != DISABLE)
  {
    /* Enable the selected I2C PEC calculation */
    I2Cx->CR1 |= CR1_ENPEC_Set;
  }
  else
  {
    /* Disable the selected I2C PEC calculation */
    I2Cx->CR1 &= CR1_ENPEC_Reset;
  }
}

/*******************************************************************************
* Function Name  : I2C_GetPEC
* Description    : Returns the PEC value for the specified I2C.
* Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
* Output         : None
* Return         : The PEC value.
*******************************************************************************/
u8 I2C_GetPEC(I2C_TypeDef* I2Cx)
{
  /* Check the parameters */
  assert_param(IS_I2C_ALL_PERIPH(I2Cx));

  /* Return the selected I2C PEC value */
  return ((I2Cx->SR2) >> 8);
}

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

  if (NewState != DISABLE)
  {
    /* Enable the selected I2C ARP */
    I2Cx->CR1 |= CR1_ENARP_Set;
  }
  else
  {
    /* Disable the selected I2C ARP */
    I2Cx->CR1 &= CR1_ENARP_Reset;
  }
}

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

  if (NewState == DISABLE)
  {
    /* Enable the selected I2C Clock stretching */
    I2Cx->CR1 |= CR1_NOSTRETCH_Set;
  }
  else
  {
    /* Disable the selected I2C Clock stretching */
    I2Cx->CR1 &= CR1_NOSTRETCH_Reset;
  }
}

/*******************************************************************************
* Function Name  : I2C_FastModeDutyCycleConfig
* Description    : Selects the specified I2C fast mode duty cycle.
* Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
*                  - I2C_DutyCycle: specifies the fast mode duty cycle.
*                    This parameter can be one of the following values:
*                       - I2C_DutyCycle_2: I2C fast mode Tlow/Thigh = 2
*                       - I2C_DutyCycle_16_9: I2C fast mode Tlow/Thigh = 16/9
* Output         : None
* Return         : None
*******************************************************************************/
void I2C_FastModeDutyCycleConfig(I2C_TypeDef* I2Cx, u16 I2C_DutyCycle)
{
  /* Check the parameters */
  assert_param(IS_I2C_ALL_PERIPH(I2Cx));
  assert_param(IS_I2C_DUTY_CYCLE(I2C_DutyCycle));

  if (I2C_DutyCycle != I2C_DutyCycle_16_9)
  {
    /* I2C fast mode Tlow/Thigh=2 */
    I2Cx->CCR &= I2C_DutyCycle_2;
  }
  else
  {
    /* I2C fast mode Tlow/Thigh=16/9 */
    I2Cx->CCR |= I2C_DutyCycle_16_9;
  }
}

/*******************************************************************************
* Function Name  : I2C_GetLastEvent
* Description    : Returns the last I2Cx Event.
* Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
* Output         : None
* Return         : The last event
*******************************************************************************/
u32 I2C_GetLastEvent(I2C_TypeDef* I2Cx)
{
  u32 lastevent = 0;
  u32 flag1 = 0, flag2 = 0;

  /* Check the parameters */
  assert_param(IS_I2C_ALL_PERIPH(I2Cx));

  /* Read the I2Cx status register */
  flag1 = I2Cx->SR1;
  flag2 = I2Cx->SR2;
  flag2 = flag2 << 16;

  /* Get the last event value from I2C status register */
  lastevent = (flag1 | flag2) & FLAG_Mask;

  /* Return status */
  return lastevent;
}

/*******************************************************************************
* Function Name  : I2C_CheckEvent
* Description    : Checks whether the last I2Cx Event is equal to the one passed
*                  as parameter.
* Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
*                  - I2C_EVENT: specifies the event to be checked. 
*                    This parameter can be one of the following values:
*                       - I2C_EVENT_SLAVE_ADDRESS_MATCHED   : EV1
*                       - I2C_EVENT_SLAVE_BYTE_RECEIVED     : EV2
*                       - I2C_EVENT_SLAVE_BYTE_TRANSMITTED  : EV3
*                       - I2C_EVENT_SLAVE_ACK_FAILURE       : EV3-2
*                       - I2C_EVENT_MASTER_MODE_SELECT      : EV5
*                       - I2C_EVENT_MASTER_MODE_SELECTED    : EV6
*                       - I2C_EVENT_MASTER_BYTE_RECEIVED    : EV7
*                       - I2C_EVENT_MASTER_BYTE_TRANSMITTED : EV8
*                       - I2C_EVENT_MASTER_MODE_ADDRESS10   : EV9
*                       - I2C_EVENT_SLAVE_STOP_DETECTED     : EV4
* Output         : None
* Return         : An ErrorStatus enumuration value:
*                       - SUCCESS: Last event is equal to the I2C_EVENT
*                       - ERROR: Last event is different from the I2C_EVENT
*******************************************************************************/
ErrorStatus I2C_CheckEvent(I2C_TypeDef* I2Cx, u32 I2C_EVENT)
{
  u32 lastevent = 0;
  u32 flag1 = 0, flag2 = 0;
  ErrorStatus status = ERROR;

  /* Check the parameters */
  assert_param(IS_I2C_ALL_PERIPH(I2Cx));
  assert_param(IS_I2C_EVENT(I2C_EVENT));

  /* Read the I2Cx status register */
  flag1 = I2Cx->SR1;
  flag2 = I2Cx->SR2;
  flag2 = flag2 << 16;

  /* Get the last event value from I2C status register */
  lastevent = (flag1 | flag2) & FLAG_Mask;

  /* Check whether the last event is equal to I2C_EVENT */
  if (lastevent == I2C_EVENT )
  {
    /* SUCCESS: last event is equal to I2C_EVENT */
    status = SUCCESS;
  }
  else
  {
    /* ERROR: last event is different from I2C_EVENT */
    status = ERROR;
  }

  /* Return status */
  return status;
}

/*******************************************************************************
* Function Name  : I2C_GetFlagStatus
* Description    : Checks whether the specified I2C flag is set or not.
* Input          : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
*                  - I2C_FLAG: specifies the flag to check. 
*                    This parameter can be one of the following values:
*                       - I2C_FLAG_DUALF: Dual flag (Slave mode)
*                       - I2C_FLAG_SMBHOST: SMBus host header (Slave mode)
*                       - I2C_FLAG_SMBDEFAULT: SMBus default header (Slave mode)
*                       - I2C_FLAG_GENCALL: General call header flag (Slave mode)
*                       - I2C_FLAG_TRA: Transmitter/Receiver flag
*                       - I2C_FLAG_BUSY: Bus busy flag
*                       - I2C_FLAG_MSL: Master/Slave flag
*                       - I2C_FLAG_SMBALERT: SMBus Alert flag
*                       - I2C_FLAG_TIMEOUT: Timeout or Tlow error flag
*                       - I2C_FLAG_PECERR: PEC error in reception flag
*                       - I2C_FLAG_OVR: Overrun/Underrun flag (Slave mode)
*                       - I2C_FLAG_AF: Acknowledge failure flag
*                       - I2C_FLAG_ARLO: Arbitration lost flag (Master mode)
*                       - I2C_FLAG_BERR: Bus error flag
*                       - I2C_FLAG_TXE: Data register empty flag (Transmitter)
*                       - I2C_FLAG_RXNE: Data register not empty (Receiver) flag
*                       - I2C_FLAG_STOPF: Stop detection flag (Slave mode)
*                       - I2C_FLAG_ADD10: 10-bit header sent flag (Master mode)
*                       - I2C_FLAG_BTF: Byte transfer finished flag
*                       - I2C_FLAG_ADDR: Address sent flag (Master mode) 揂DSL

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色婷婷国产精品久久包臀| 中文字幕不卡的av| 国产精品久久久久毛片软件| 亚洲激情欧美激情| 国产成人精品三级| 欧美大胆人体bbbb| 亚洲福利一区二区三区| 成人av动漫在线| 国产亚洲欧美一级| 美腿丝袜亚洲色图| 欧美精品123区| 一区二区久久久久| 91网页版在线| 中文字幕精品三区| 国产呦萝稀缺另类资源| 欧美一区二区国产| 首页国产欧美日韩丝袜| 欧美在线视频全部完| 国产精品久久久久天堂| 国产91露脸合集magnet | 成人av网址在线观看| 久久日一线二线三线suv| 蜜臀久久99精品久久久久久9| 欧美喷潮久久久xxxxx| 亚洲最大成人网4388xx| 欧美性受极品xxxx喷水| 亚洲人成网站色在线观看| 97精品久久久午夜一区二区三区 | 欧美特级限制片免费在线观看| 国产精品视频九色porn| 国产精品99久久久久久似苏梦涵 | 欧美成人性福生活免费看| 午夜激情综合网| 欧美丰满美乳xxx高潮www| 亚洲国产视频网站| 欧美三级在线播放| 日韩综合在线视频| 精品日韩成人av| 国产在线播放一区二区三区 | 日韩三级在线观看| 精品午夜久久福利影院 | 亚洲精品第一国产综合野| 在线一区二区视频| 日韩av电影天堂| 91精品国产91久久久久久最新毛片 | 精品国产a毛片| 国产盗摄精品一区二区三区在线| 国产精品乱码人人做人人爱 | 日韩午夜激情av| 韩国三级电影一区二区| 国产亚洲美州欧州综合国| 波多野结衣在线一区| 一区二区三区欧美久久| 91麻豆精品国产无毒不卡在线观看| 另类的小说在线视频另类成人小视频在线| 日韩欧美电影一区| 成人成人成人在线视频| 亚洲午夜久久久久久久久电影院| 欧美日韩大陆一区二区| 韩国精品主播一区二区在线观看| 国产精品国产精品国产专区不片| 日本高清成人免费播放| 麻豆精品视频在线观看免费| 中文字幕乱码日本亚洲一区二区 | 午夜精品福利一区二区蜜股av| 欧美电影免费观看高清完整版在| 丰满放荡岳乱妇91ww| 亚洲国产裸拍裸体视频在线观看乱了 | 欧美在线视频你懂得| 国产真实精品久久二三区| 中文字幕在线视频一区| 制服视频三区第一页精品| 国产成人午夜精品5599| 五月激情六月综合| 国产精品不卡视频| 精品国产精品一区二区夜夜嗨| 99久久精品情趣| 老鸭窝一区二区久久精品| 亚洲欧洲中文日韩久久av乱码| 日韩视频免费观看高清完整版 | 99精品国产热久久91蜜凸| 免费的成人av| 亚洲国产婷婷综合在线精品| 国产亚洲精品中文字幕| 欧美一区二区三区婷婷月色| 99久久免费视频.com| 久久电影国产免费久久电影 | 欧美久久久久免费| 一本色道久久加勒比精品| 国产一区欧美日韩| 青娱乐精品视频在线| 亚洲最大的成人av| 亚洲女同女同女同女同女同69| 国产欧美日韩麻豆91| 日韩你懂的在线播放| 在线91免费看| 欧美日韩亚洲综合在线 欧美亚洲特黄一级 | 中文av字幕一区| 国产欧美日韩在线视频| 日韩一区二区不卡| 4438亚洲最大| 精品视频在线看| 欧美日产国产精品| 欧美亚洲国产怡红院影院| 色欲综合视频天天天| 色综合久久久久久久久| 色综合天天做天天爱| 99精品久久99久久久久| 91影视在线播放| 91玉足脚交白嫩脚丫在线播放| 99久久综合国产精品| av欧美精品.com| 一本一道综合狠狠老| 91久久精品网| 欧美嫩在线观看| 欧美一级理论性理论a| 日韩欧美国产精品| 精品国产3级a| 国产人妖乱国产精品人妖| 久久久不卡影院| 国产精品三级av在线播放| 国产无人区一区二区三区| 国产欧美1区2区3区| 国产精品久久午夜夜伦鲁鲁| 中文字幕中文字幕中文字幕亚洲无线| 中文字幕乱码一区二区免费| 中文字幕在线播放不卡一区| 亚洲日本在线天堂| 亚洲一二三四区不卡| 日韩成人一区二区| 国产在线日韩欧美| 成人黄色软件下载| 在线观看www91| 日韩欧美在线1卡| 欧美韩国日本不卡| 亚洲图片欧美色图| 久久99精品国产91久久来源| 国产成人精品免费在线| 色av一区二区| 日韩欧美国产三级电影视频| 国产精品网曝门| 亚洲一区二区在线视频| 蜜桃视频在线一区| 成人自拍视频在线| 欧美日韩在线不卡| 国产亚洲视频系列| 亚洲在线成人精品| 国产在线精品免费| 91成人国产精品| 久久久久久亚洲综合| 一区二区三区欧美日| 精品亚洲国内自在自线福利| 91麻豆福利精品推荐| 日韩欧美123| 亚洲一区二区视频在线观看| 激情综合亚洲精品| 欧美日韩中文字幕一区二区| 国产拍欧美日韩视频二区| 五月综合激情日本mⅴ| 成人手机在线视频| 欧美一区日本一区韩国一区| 国产精品久久久久久久久动漫| 日韩av中文在线观看| av成人免费在线观看| 久久综合色婷婷| 日韩成人午夜精品| 色综合天天性综合| 国产三级精品在线| 奇米影视一区二区三区| 在线观看视频91| 国产精品你懂的在线欣赏| 韩国一区二区视频| 欧美精品久久99| 一区二区三区精品久久久| 国产成人h网站| 日韩欧美一区二区久久婷婷| 亚洲香肠在线观看| 91老司机福利 在线| 国产精品三级在线观看| 国产精品18久久久久| 日韩三级免费观看| 石原莉奈在线亚洲三区| 色呦呦日韩精品| 亚洲欧美在线另类| jvid福利写真一区二区三区| 国产亚洲精品中文字幕| 国内久久精品视频| 欧美一区二区黄色| 日本成人在线不卡视频| 51精品视频一区二区三区| 亚洲成人www| 欧美另类久久久品| 亚洲综合免费观看高清完整版 | 成人在线综合网站| 国产午夜精品一区二区三区四区 | 欧美日本免费一区二区三区| 一区二区三区日韩精品视频| 一本在线高清不卡dvd| 亚洲激情成人在线| 欧美视频在线一区二区三区 |