#include #include #include "twi.h" static uint8_t TWI_buf[TWI_BUFFER_SIZE]; // Transceiver buffer. Set the size in the header file static uint8_t TWI_msgSize = 0; // Number of bytes to be transmitted. static uint8_t TWI_state = TWI_NO_STATE; // State byte. Default set to TWI_NO_STATE. // This is true when the TWI is in the middle of a transfer // and set to false when all bytes have been transmitted/received // Also used to determine how deep we can sleep. static volatile uint8_t TWI_busy = 0; union TWI_statusReg_t TWI_statusReg = {0}; // TWI_statusReg is defined in twi.h /**************************************************************************** Call this function to set up the TWI slave to its initial standby state. Remember to enable interrupts from the main application after initializing the TWI. Pass both the slave address and the requrements for triggering on a general call in the same byte. Use e.g. this notation when calling this function: TWI_Slave_Initialise((TWI_slaveAddress<