embedded/projects/osp-steval-mki109v2/sources/app/i2c_slavecomm_t.c
static void I2C_Slave_Initialise(void)
{
    I2C_InitTypeDef   I2C_InitStructure;

    /* Enable the bus */
    I2C_Cmd(I2C_SLAVE_BUS, ENABLE);

    /* Configure the I2C interface */
    I2C_InitStructure.I2C_Mode = I2C_Mode_I2C;
    I2C_InitStructure.I2C_DutyCycle = I2C_DutyCycle_2;
    I2C_InitStructure.I2C_OwnAddress1 = I2C_SLAVE_ADDR_8BIT;
    I2C_InitStructure.I2C_Ack = I2C_Ack_Enable;
    I2C_InitStructure.I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit;
    I2C_InitStructure.I2C_ClockSpeed = I2C_SLAVE_BUS_CLOCK;
    I2C_Init(I2C_SLAVE_BUS, &I2C_InitStructure);

    /* Enable interrupts and clear flags */
    I2C_ITConfig( I2C_SLAVE_BUS, (I2C_IT_EVT | I2C_IT_BUF | I2C_IT_ERR), ENABLE );
    I2C_ClearITPendingBit( I2C_SLAVE_BUS, I2C_IT_SMBALERT | I2C_IT_TIMEOUT | I2C_IT_PECERR | I2C_IT_OVR
        | I2C_IT_AF | I2C_IT_ARLO | I2C_IT_BERR );
}
/****************************************************************************************************
 * @fn      I2C_Slave_Initialise
 *          Call this function to set up the I2C slave to its initial standby state.
 *
 ***************************************************************************************************/
@fn      I2C_Slave_Initialise
Call this function to set up the I2C slave to its initial standby state.
@fn I2C_Slave_Initialise Call this function to set up the I2C slave to its initial standby state .
static void I2C_Slave_Initialise(void)
{
    I2C_InitTypeDef   I2C_InitStructure;
    I2C_Cmd(I2C_SLAVE_BUS, ENABLE);
    I2C_InitStructure.I2C_Mode = I2C_Mode_I2C;
    I2C_InitStructure.I2C_DutyCycle = I2C_DutyCycle_2;
    I2C_InitStructure.I2C_OwnAddress1 = I2C_SLAVE_ADDR_8BIT;
    I2C_InitStructure.I2C_Ack = I2C_Ack_Enable;
    I2C_InitStructure.I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit;
    I2C_InitStructure.I2C_ClockSpeed = I2C_SLAVE_BUS_CLOCK;
    I2C_Init(I2C_SLAVE_BUS, &I2C_InitStructure);
    I2C_ITConfig( I2C_SLAVE_BUS, (I2C_IT_EVT | I2C_IT_BUF | I2C_IT_ERR), ENABLE );
    I2C_ClearITPendingBit( I2C_SLAVE_BUS, I2C_IT_SMBALERT | I2C_IT_TIMEOUT | I2C_IT_PECERR | I2C_IT_OVR
        | I2C_IT_AF | I2C_IT_ARLO | I2C_IT_BERR );
}
static void I2C_Slave_Initialise ( void ) { I2C_InitTypeDef I2C_InitStructure ; I2C_Cmd ( I2C_SLAVE_BUS , ENABLE ) ; I2C_InitStructure . I2C_Mode = I2C_Mode_I2C ; I2C_InitStructure . I2C_DutyCycle = I2C_DutyCycle_2 ; I2C_InitStructure . I2C_OwnAddress1 = I2C_SLAVE_ADDR_8BIT ; I2C_InitStructure . I2C_Ack = I2C_Ack_Enable ; I2C_InitStructure . I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit ; I2C_InitStructure . I2C_ClockSpeed = I2C_SLAVE_BUS_CLOCK ; I2C_Init ( I2C_SLAVE_BUS , & I2C_InitStructure ) ; I2C_ITConfig ( I2C_SLAVE_BUS , ( I2C_IT_EVT | I2C_IT_BUF | I2C_IT_ERR ) , ENABLE ) ; I2C_ClearITPendingBit ( I2C_SLAVE_BUS , I2C_IT_SMBALERT | I2C_IT_TIMEOUT | I2C_IT_PECERR | I2C_IT_OVR | I2C_IT_AF | I2C_IT_ARLO | I2C_IT_BERR ) ; }
@fn      I2C_Slave_Initialise
          Call this function to set up the I2C slave to its initial standby state.
@fn I2C_Slave_Initialise Call this function to set up the I2C slave to its initial standby state .
/* Enable the bus */ /* Configure the I2C interface */ /* Enable interrupts and clear flags */