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

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

?? stm32f10x_i2c.c

?? STM32F RFID通訊源代碼(支持雙向發送接收)
?? C
?? 第 1 頁 / 共 3 頁
字號:
    /* Peripheral under reset */
    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(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(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: PEC bit indicates that current
*                         byte is PEC
*                       - I2C_PECPosition_Current: PEC bit indicates that the
*                         next byte is PEC
* Output         : None
* Return         : None
*******************************************************************************/
void I2C_PECPositionConfig(I2C_TypeDef* I2Cx, u16 I2C_PECPosition)
{
  /* Check the parameters */
  assert(IS_I2C_PEC_POSITION(I2C_PECPosition));

  if (I2C_PECPosition == I2C_PECPosition_Next)
  {
    /* PEC indicates that the next byte in shift register is PEC */
    I2Cx->CR1 |= I2C_PECPosition_Next;
  }
  else
  {
    /* PEC indicates that the 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(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)
{
  u8 pec;

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

/*******************************************************************************
* 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(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(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(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;

  Flag1 = I2Cx->SR1;
  Flag2 = I2Cx->SR2;
  Flag2 = Flag2 << 16;

  /* Get the last event value from I2C status register */
  LastEvent = (Flag1 | Flag2) & I2C_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-1
*                       - 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(IS_I2C_EVENT(I2C_EVENT));

  Flag1 = I2Cx->SR1;
  Flag2 = I2Cx->SR2;
  Flag2 = Flag2 << 16;

  /* Get the last event value from I2C status register */
  LastEvent = (Flag1 | Flag2) & I2C_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一区二区三区免费野_久草精品视频
欧美日韩国产123区| 欧美日韩中文字幕精品| 亚洲制服欧美中文字幕中文字幕| 777色狠狠一区二区三区| 国产成人综合网站| 日韩影视精彩在线| 国产精品色呦呦| 91精品国产综合久久精品| 99精品视频在线免费观看| 乱一区二区av| 亚洲一二三专区| 国产精品无人区| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 欧美日韩精品欧美日韩精品| 成人免费毛片app| 久久99国产精品免费| 亚洲成a人片在线观看中文| 国产精品网站在线播放| 亚洲精品一区二区三区香蕉| 欧美日韩国产高清一区二区| 91久久奴性调教| 成人久久18免费网站麻豆 | 色综合久久88色综合天天6 | av不卡免费在线观看| 精品写真视频在线观看| 日韩激情一二三区| 亚洲一区二区三区精品在线| 中文字幕一区二区在线观看| 国产蜜臀97一区二区三区| 精品蜜桃在线看| 日韩欧美高清dvd碟片| 欧美日韩精品是欧美日韩精品| 色系网站成人免费| 99精品久久99久久久久| 成人黄色在线视频| 国产a精品视频| 国产成人99久久亚洲综合精品| 精品一区二区三区免费毛片爱| 麻豆国产欧美日韩综合精品二区| 视频一区中文字幕国产| 水蜜桃久久夜色精品一区的特点| 亚洲成人先锋电影| 日日摸夜夜添夜夜添国产精品 | 国产麻豆精品视频| 国产呦精品一区二区三区网站| 久久99热这里只有精品| 蜜臀av亚洲一区中文字幕| 久久99久国产精品黄毛片色诱| 美女视频免费一区| 国产精品影视在线| 成人免费视频免费观看| 色婷婷狠狠综合| 日本精品一级二级| 欧美精品自拍偷拍| 精品美女一区二区三区| 国产无遮挡一区二区三区毛片日本| 国产日韩一级二级三级| 国产精品久久久久9999吃药| 亚洲精品视频一区二区| 亚洲国产成人精品视频| 美女视频黄 久久| 国产精品一区二区免费不卡| 成人免费高清视频在线观看| 91麻豆国产自产在线观看| 欧美性大战xxxxx久久久| 日韩欧美在线1卡| 国产精品无人区| 亚洲二区在线观看| 激情成人午夜视频| 色综合夜色一区| 欧美精品一区二区三区四区| 国产亚洲欧美中文| 一区二区在线观看不卡| 日本一道高清亚洲日美韩| 国产传媒久久文化传媒| 91成人免费在线| 精品欧美久久久| 亚洲视频精选在线| 蜜臀av性久久久久蜜臀av麻豆| 国产成人在线视频网站| 欧美性受xxxx| 久久综合久久综合亚洲| 亚洲美女淫视频| 久久国产精品第一页| av亚洲精华国产精华精| 4438x成人网最大色成网站| 国产欧美一区二区精品秋霞影院| 亚洲三级视频在线观看| 久久精品国产网站| 一本大道av一区二区在线播放| 在线不卡一区二区| 中文字幕在线一区二区三区| 美女高潮久久久| 一本色道亚洲精品aⅴ| 欧美精品一区二区在线观看| 亚洲精品国产无天堂网2021| 国产一区在线观看麻豆| 欧美影院午夜播放| 国产精品欧美久久久久无广告| 日韩精品91亚洲二区在线观看| 99国产精品视频免费观看| 精品伦理精品一区| 日韩精品一二三四| 99re热视频这里只精品| 久久久久久日产精品| 亚洲成av人片一区二区| 99精品欧美一区| 国产网站一区二区| 蜜桃一区二区三区在线| 欧美性猛片xxxx免费看久爱| 国产日产精品1区| 蜜桃视频在线观看一区| 欧美情侣在线播放| 亚洲综合成人网| 91视频在线观看| 国产精品乱码一区二三区小蝌蚪| 久久精品久久精品| 91精品久久久久久久久99蜜臂| 亚洲伦在线观看| 波多野结衣中文字幕一区| 亚洲精品在线三区| 免费xxxx性欧美18vr| 欧美精品18+| 亚瑟在线精品视频| 欧美午夜视频网站| 亚洲最新在线观看| 93久久精品日日躁夜夜躁欧美| 欧美激情一区不卡| 国产成人精品午夜视频免费| 久久亚洲影视婷婷| 国产高清亚洲一区| 国产视频一区不卡| 国产丶欧美丶日本不卡视频| 欧美精品一区二区三区很污很色的| 奇米综合一区二区三区精品视频 | 国产亚洲欧美日韩在线一区| 另类调教123区| 精品入口麻豆88视频| 国内精品在线播放| 久久综合九色欧美综合狠狠| 国产一区二区不卡在线| 久久久久一区二区三区四区| 国产成人av福利| 中文字幕在线不卡| 欧美性受xxxx| 免费看欧美女人艹b| 欧美成va人片在线观看| 国产呦萝稀缺另类资源| 日本一区二区三区免费乱视频 | 色哦色哦哦色天天综合| 亚洲综合图片区| 5858s免费视频成人| 蜜桃视频一区二区三区| 久久久久久免费毛片精品| 国产成人8x视频一区二区 | 国产亚洲精品bt天堂精选| 岛国精品在线播放| 亚洲另类中文字| 欧美军同video69gay| 国产在线视频一区二区| 欧美激情艳妇裸体舞| 91精彩视频在线观看| 亚洲v精品v日韩v欧美v专区 | 久久综合久久久久88| 成人精品高清在线| 一区二区三区欧美在线观看| 91精品国产美女浴室洗澡无遮挡| 久久99最新地址| 亚洲日本成人在线观看| 欧美日韩激情一区二区三区| 精品一区在线看| 国产欧美久久久精品影院| 色欧美乱欧美15图片| 久久精品国产免费| 最新热久久免费视频| 7777精品伊人久久久大香线蕉| 国产剧情av麻豆香蕉精品| 亚洲乱码日产精品bd| 欧美tk丨vk视频| 一本色道综合亚洲| 精品制服美女丁香| 亚洲最快最全在线视频| 久久影视一区二区| 欧美伊人久久久久久久久影院| 久久91精品国产91久久小草| 亚洲乱码国产乱码精品精的特点 | 色视频一区二区| 国产在线国偷精品产拍免费yy| 一区二区在线电影| 国产视频一区在线播放| 欧美美女bb生活片| 91亚洲男人天堂| 国产自产2019最新不卡| 亚洲综合久久久| 国产精品五月天| 久久网站热最新地址| 欧美巨大另类极品videosbest| av成人免费在线观看| 国产精品一区在线观看乱码| 天天射综合影视|