AnsweredAssumed Answered


Question asked by Lesueur.Rick on Feb 2, 2014
Latest reply on Feb 3, 2014 by Clive One
Please provide guidance: I am attempting to configure i2c on STM32F0308-Discovery 
Like to use PIN 46/47 as PF6/PF7 i2c1_SCL and i2c1_SDA

Enable peripheral clock using RCC_APB1PeriphClockCmd(RCC_APB1Periph_I2Cx, ENABLE)
       function for I2C1 or I2C2.
   (#) Enable SDA, SCL  and SMBA (when used) GPIO clocks using 
       RCC_AHBPeriphClockCmd() function. 
   (#) Peripherals alternate function: 
       (++) Connect the pin to the desired peripherals' Alternate 
            Function (AF) using GPIO_PinAFConfig() function.
       (++) Configure the desired pin in alternate function by:
            GPIO_InitStruct->GPIO_Mode = GPIO_Mode_AF
       (++) Select the type, OpenDrain and speed via  
            GPIO_PuPd, GPIO_OType and GPIO_Speed members
       (++) Call GPIO_Init() function.
   (#) Program the Mode, Timing , Own address, Ack and Acknowledged Address 
       using the I2C_Init() function.

What is parameter to enter for RCC_AHBPeriphClockCmd(??????

Definition of function from xxxRCC.c  (no definition in xxxRCC.h )
void RCC_AHBPeriphClockCmd(uint32_t RCC_AHBPeriph, FunctionalState NewState)

RCC_AHBPeriph is undefined in project for I2C .. 

 RCC_APB1PeriphClockCmd(RCC_APB2Periph_I2C1, ENABLE);

 RCC_AHBPeriphClockCmd(RCC_APB2Periph_I2C1, ENABLE);

I have not found a similar thread in searching.
I thank you in advance for assistance.