#include <avr/io.h>
#include <avr/interrupt.h>
#include "qdebug_transport.h"
#include "twi_master.h"
Functions | |
switch (TWSR) | |
void | twi_master_init (void) |
Call this function to set up the TWI master to its initial standby state. More... | |
void | twi_retrieve_message (void) |
To Receive data over TWI. More... | |
void | twi_send_message (void) |
To Transmit data over TWI. More... | |
unsigned char | twi_transceiver_busy (void) |
Call this function to test if the TWI_ISR is busy transmitting. More... | |
Variables | |
volatile unsigned char | FrameInProgress |
This Interrupt Service Routine (ISR)is called when the TWI interrupt is triggered; Whenever a TWI event has occurred. More... | |
static unsigned char | TWI_addr |
static unsigned int | TWI_msgSize |
union TWI_statusReg | TWI_statusReg = {0} |
switch | ( | TWSR | ) |
References TWI_statusReg::lastTransOK, RxHandler(), TRUE, TWI_addr, TWI_ARB_LOST, 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 TX_Buffer.
Referenced by send_peer_req().
void twi_master_init | ( | void | ) |
Call this function to set up the TWI master to its initial standby state.
Remember to enable interrupts from the main application after initializing the TWI.
References TWI_BAUDSETTING.
Referenced by main(), run_twi_master_recv_test(), run_twi_master_send_test(), and twi_master_setup().
void twi_retrieve_message | ( | void | ) |
To Receive data over TWI.
References TWI_statusReg::all, TWI_statusReg::lastTransOK, RX_Buffer, TRUE, TWI_addr, TWI_ADR_BITS, TWI_msgSize, TWI_READ_BIT, twi_transceiver_busy(), and TWISLAVE_ADDR.
Referenced by Receive_Message().
void twi_send_message | ( | void | ) |
To Transmit data over TWI.
References TWI_statusReg::all, FALSE, TWI_addr, TWI_ADR_BITS, TWI_msgSize, TWI_READ_BIT, twi_transceiver_busy(), TWISLAVE_ADDR, and TX_Buffer.
Referenced by main(), and Send_Message().
unsigned char twi_transceiver_busy | ( | void | ) |
Call this function to test if the TWI_ISR is busy transmitting.
Referenced by accelero_read(), twi_get_data_from_transceiver(), twi_get_state_info(), twi_retrieve_message(), twi_send_message(), twi_start_transceiver(), and twi_start_transceiver_with_data().
volatile unsigned char FrameInProgress |
This Interrupt Service Routine (ISR)is called when the TWI interrupt is triggered; Whenever a TWI event has occurred.
TWINT is not cleared automatically, but must be cleared manually in the ISR.
Referenced by BitBangSPI_Send_Message().
|
static |
Referenced by switch(), twi_retrieve_message(), and twi_send_message().
|
static |
Referenced by switch(), twi_retrieve_message(), and twi_send_message().
union TWI_statusReg TWI_statusReg = {0} |