#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 | ) |
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().
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 twi_retrieve_message(), and twi_send_message().
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.
|
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} |