Esempio n. 1
0
/*******************************************************************************
* Function Name: I2C_1_Start
********************************************************************************
*
* Summary:
*  Invokes SCB_Init() and SCB_Enable().
*  After this function call, the component is enabled and ready for operation.
*  When configuration is set to "Unconfigured SCB", the component must first be
*  initialized to operate in one of the following configurations: I2C, SPI, UART
*  or EZ I2C. Otherwise this function does not enable the component.
*
* Parameters:
*  None
*
* Return:
*  None
*
* Global variables:
*  I2C_1_initVar - used to check initial configuration, modified
*  on first function call.
*
*******************************************************************************/
void I2C_1_Start(void)
{
    if(0u == I2C_1_initVar)
    {
        I2C_1_Init();
        I2C_1_initVar = 1u; /* Component was initialized */
    }

    I2C_1_Enable();
}
Esempio n. 2
0
File: I2C_1.c Progetto: Qmax/PT6
/*******************************************************************************
* Function Name: I2C_1_Start
********************************************************************************
*
* Summary:
*  Starts the I2C hardware. Enables Active mode power template bits or clock
*  gating as appropriate. It is required to be executed before I2C bus
*  operation.
*  The I2C interrupt remains disabled after this function call.
*
* Parameters:
*  None
*
* Return:
*  None
*
* Side Effects:
*  This component automatically enables it's interrupt.  If I2C is enabled
*  without the interrupt enabled, it could lock up the I2C bus.
*
* Global variables:
*  I2C_1_initVar - used to check initial configuration, modified
*  on first function call.
*
* Reentrant:
*  No
*
*******************************************************************************/
void I2C_1_Start(void)
{
    /* Initialize I2C registers, reset I2C buffer index and clears status */
    if(0u == I2C_1_initVar)
    {
        I2C_1_Init();
        I2C_1_initVar = 1u; /* Component initialized */
    }

    I2C_1_Enable();
    I2C_1_EnableInt();
}