Microchip® Advanced Software Framework

atmega128rfa1_avr477_remote/twi_master.c File Reference
#include <avr/io.h>
#include <avr/interrupt.h>
#include "twi_master.h"

Functions

 switch (TWSR)
 This function is the Interrupt Service Routine (ISR). More...
 
unsigned char twi_get_data_from_transceiver (unsigned char *msg, unsigned char msgSize)
 Call this function to read out the requested data from the TWI transceiver buffer. More...
 
unsigned char twi_get_state_info (void)
 Call this function to fetch the state information of the previous operation. More...
 
void twi_master_initialise (void)
 Call this function to set up the TWI master to its initial standby state. More...
 
void twi_start_transceiver (void)
 Call this function to resend the last message. More...
 
void twi_start_transceiver_with_data (unsigned char *msg, unsigned char msgSize, unsigned char direction, unsigned char index)
 Call this function to send a prepared message. More...
 
unsigned char twi_transceiver_busy (void)
 Call this function to test if the TWI_ISR is busy transmitting.e. More...
 

Variables

static unsigned char TWI_buf [TWI_BUFFER_SIZE]
 
static unsigned char TWI_msgSize
 
static unsigned char TWI_state = TWI_NO_STATE
 
union TWI_statusReg TWI_statusReg = {0}
 

switch ( TWSR  )

This function is the Interrupt Service Routine (ISR).

called when the TWI interrupt is triggered; that is whenever a TWI event has occurred. This function should not be called directly from the main application.

References TWI_statusReg::lastTransOK, TRUE, TWI_ARB_LOST, TWI_buf, TWI_BUS_ERROR, TWI_MRX_ADR_ACK, TWI_MRX_ADR_NACK, TWI_MRX_DATA_ACK, TWI_MRX_DATA_NACK, TWI_msgSize, TWI_MTX_ADR_ACK, TWI_MTX_ADR_NACK, TWI_MTX_DATA_ACK, TWI_MTX_DATA_NACK, TWI_REP_START, TWI_START, and TWI_state.

unsigned char TWI_msgSize
static