Пример #1
0
/*******************************************************************************
* Function Name: I2C_1_Enable
********************************************************************************
*
* Summary:
*  Enables the SCB component operation.
*  The SCB configuration should be not changed when the component is enabled.
*  Any configuration changes should be made after disabling the component.
*
* Parameters:
*  None
*
* Return:
*  None
*
*******************************************************************************/
void I2C_1_Enable(void)
{
#if(I2C_1_SCB_MODE_UNCONFIG_CONST_CFG)
    /* Enable SCB block, only if it is already configured */
    if(!I2C_1_SCB_MODE_UNCONFIG_RUNTM_CFG)
    {
        I2C_1_CTRL_REG |= I2C_1_CTRL_ENABLED;

        I2C_1_ScbEnableIntr();
    }
#else
    I2C_1_CTRL_REG |= I2C_1_CTRL_ENABLED;

    I2C_1_ScbEnableIntr();
#endif /* (I2C_1_SCB_MODE_UNCONFIG_CONST_CFG) */
}
Пример #2
0
/*******************************************************************************
* Function Name: I2C_1_Enable
********************************************************************************
*
* Summary:
*  Enables the SCB component operation.
*  The SCB configuration should be not changed when the component is enabled.
*  Any configuration changes should be made after disabling the component.
*
* Parameters:
*  None
*
* Return:
*  None
*
*******************************************************************************/
void I2C_1_Enable(void)
{
#if (I2C_1_SCB_MODE_UNCONFIG_CONST_CFG)
    /* Enable SCB block, only if it is already configured */
    if (!I2C_1_SCB_MODE_UNCONFIG_RUNTM_CFG)
    {
        I2C_1_CTRL_REG |= I2C_1_CTRL_ENABLED;

        I2C_1_ScbEnableIntr();

        /* Call PostEnable function specific to current operation mode */
        I2C_1_ScbModePostEnable();
    }
#else
    I2C_1_CTRL_REG |= I2C_1_CTRL_ENABLED;

    I2C_1_ScbEnableIntr();

    /* Call PostEnable function specific to current operation mode */
    I2C_1_ScbModePostEnable();
#endif /* (I2C_1_SCB_MODE_UNCONFIG_CONST_CFG) */
}