コード例 #1
0
ファイル: I2C_1.c プロジェクト: ksoneda/AQM-Firmware
/*******************************************************************************
* 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();
}
コード例 #2
0
ファイル: I2C_1.c プロジェクト: 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();
}
コード例 #3
0
 /*******************************************************************************
 * Function Name: I2C_1_I2CMasterDisableEcAm
 ********************************************************************************
 *
 * Summary:
 *  Disables externally clocked address match to enable master operation
 *  in active mode.
 *
 * Parameters:
 *  None
 *
 * Return:
 *  None
 *
 *******************************************************************************/
 static void I2C_1_I2CMasterDisableEcAm(void)
 {
     /* Disables externally clocked address match to enable master operation in active mode.
     * This applicable only for Multi-Master-Slave with wakeup enabled. Ticket ID#192742 */
     if (0u != (I2C_1_CTRL_REG & I2C_1_CTRL_EC_AM_MODE))
     {
         /* Enable external address match logic */
         I2C_1_Stop();
         I2C_1_CTRL_REG &= (uint32) ~I2C_1_CTRL_EC_AM_MODE;
         I2C_1_Enable();
     }
 }