高级会员
- 积分
- 776
- 金钱
- 776
- 注册时间
- 2015-2-28
- 在线时间
- 251 小时
|
发表于 2015-2-28 18:22:37
|
显示全部楼层
回复【4楼】月恨:
---------------------------------
STM8做从机,从机地址就是自身的地址
/**
* @brief Initializes the I2C according to the specified parameters in standard
* or fast mode.
* @param OutputClockFrequencyHz: Specifies the output clock frequency in Hz.
* @param OwnAddress: Specifies the own address.
* @param I2C_DutyCycle: Specifies the duty cycle to apply in fast mode.
* This parameter can be any of the @ref I2C_DutyCycle_TypeDef enumeration.
* @note This parameter don't have impact when the OutputClockFrequency lower
* than 100KHz.
* @param Ack: Specifies the acknowledge mode to apply.
* This parameter can be any of the @ref I2C_Ack_TypeDef enumeration.
* @param AddMode: Specifies the acknowledge address to apply.
* This parameter can be any of the @ref I2C_AddMode_TypeDef enumeration.
* @param InputClockFrequencyMHz: Specifies the input clock frequency in MHz.
* @retval None
*/
void I2C_Init(uint32_t OutputClockFrequencyHz, uint16_t OwnAddress,
I2C_DutyCycle_TypeDef I2C_DutyCycle, I2C_Ack_TypeDef Ack,
I2C_AddMode_TypeDef AddMode, uint8_t InputClockFrequencyMHz )
中的 OwnAddress |
|