Atmel Software Framework

twis.h File Reference

XMEGA TWI slave driver header file.

 This file contains the function prototypes and enumerator definitions
 for various configuration parameters for the XMEGA TWI slave driver.

 The driver is not intended for size and/or speed critical code, since
 most functions are just a few lines of code, and the function call
 overhead would decrease code performance. The driver is intended for
 rapid prototyping and documentation purposes for getting started with
 the XMEGA TWI slave module.

 For size and/or speed critical code, it is recommended to copy the
 function contents directly into your application instead of making
 a function call.
Application note:
AVR1307: Using the XMEGA TWI
For comprehensive code documentation, supported compilers, compiler settings and supported devices see readme.html

Atmel Corporation:

2008-04-22 13:03:43 +0200 (Tue, 22 Apr 2008)

Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.

#include "compiler.h"
#include "twi_common.h"

Data Structures

struct  TWI_Slave
 TWI slave driver struct. More...


#define TWI_BAUD(F_SYS, F_TWI)   ((F_SYS / (2 * F_TWI)) - 5)
#define TWIS_STATUS_BUSY   1


typedef struct TWI_Slave TWI_Slave_t
 TWI slave driver struct. More...
typedef enum TWIS_RESULT_enum TWIS_RESULT_t


enum  TWIS_RESULT_enum {
  TWIS_RESULT_UNKNOWN = (0x00<<0),
  TWIS_RESULT_OK = (0x01<<0),
  TWIS_RESULT_BUS_ERROR = (0x04<<0),
  TWIS_RESULT_FAIL = (0x05<<0),


static void twi_slave_disable (TWI_t *twi)
 Disable Slave Mode of the TWI. More...
static void twi_slave_enable (TWI_t *twi)
 Enable Slave Mode of the TWI. More...
void TWI_SlaveAddressMatchHandler (TWI_Slave_t *twi)
 TWI address match interrupt handler. More...
void TWI_SlaveDataHandler (TWI_Slave_t *twi)
 TWI data interrupt handler. More...
void TWI_SlaveInitializeDriver (TWI_Slave_t *twi, TWI_t *module, void(*processDataFunction)(void))
 Initalizes TWI slave driver structure. More...
void TWI_SlaveInitializeModule (TWI_Slave_t *twi, uint8_t address, TWI_SLAVE_INTLVL_t intLevel)
 Initialize the TWI module. More...
void TWI_SlaveInterruptHandler (TWI_Slave_t *twi)
 Common TWI slave interrupt service routine. More...
void TWI_SlaveReadHandler (TWI_Slave_t *twi)
 TWI slave read interrupt handler. More...
void TWI_SlaveStopHandler (TWI_Slave_t *twi)
 TWI stop condition interrupt handler. More...
void TWI_SlaveTransactionFinished (TWI_Slave_t *twi, uint8_t result)
 TWI transaction finished function. More...
void TWI_SlaveWriteHandler (TWI_Slave_t *twi)
 TWI slave write interrupt handler. More...