AllJoyn/Samples/BACnetAdapter/bacnet-stack-0.8.2/ports/xplained/ASF/xmega/drivers/twi/twis.c
void TWI_SlaveInitializeModule(TWI_Slave_t * twi,
    uint8_t address,
    TWI_SLAVE_INTLVL_t intLevel)
{
    twi->interface->SLAVE.CTRLA =
        intLevel | TWI_SLAVE_DIEN_bm | TWI_SLAVE_APIEN_bm |
        TWI_SLAVE_ENABLE_bm;
    twi->interface->SLAVE.ADDR = (address << 1);
}
/*! \brief Initialize the TWI module.
 *
 *  Enables interrupts on address recognition and data available.
 *  Remember to enable interrupts globally from the main application.
 *
 *  \param twi        The TWI_Slave_t struct instance.
 *  \param address    Slave address for this module.
 *  \param intLevel   Interrupt level for the TWI slave interrupt handler.
 */
\brief Initialize the TWI module.
Enables interrupts on address recognition and data available.
Remember to enable interrupts globally from the main application.

\param twi        The TWI_Slave_t struct instance.
\param address    Slave address for this module.
\param intLevel   Interrupt level for the TWI slave interrupt handler.
\ brief Initialize the TWI module . Enables interrupts on address recognition and data available . Remember to enable interrupts globally from the main application . \ param twi The TWI_Slave_t struct instance . \ param address Slave address for this module . \ param intLevel Interrupt level for the TWI slave interrupt handler .
void TWI_SlaveInitializeModule(TWI_Slave_t * twi,
    uint8_t address,
    TWI_SLAVE_INTLVL_t intLevel)
{
    twi->interface->SLAVE.CTRLA =
        intLevel | TWI_SLAVE_DIEN_bm | TWI_SLAVE_APIEN_bm |
        TWI_SLAVE_ENABLE_bm;
    twi->interface->SLAVE.ADDR = (address << 1);
}
void TWI_SlaveInitializeModule ( TWI_Slave_t * twi , uint8_t address , TWI_SLAVE_INTLVL_t intLevel ) { twi -> interface -> SLAVE . CTRLA = intLevel | TWI_SLAVE_DIEN_bm | TWI_SLAVE_APIEN_bm | TWI_SLAVE_ENABLE_bm ; twi -> interface -> SLAVE . ADDR = ( address << 1 ) ; }
\brief Initialize the TWI module.
\ brief Initialize the TWI module .