Macros | Functions | Variables
twi.c File Reference
#include <math.h>
#include <stdlib.h>
#include <inttypes.h>
#include <avr/io.h>
#include <avr/interrupt.h>
#include <compat/twi.h>
#include "Arduino.h"
#include "pins_arduino.h"
#include "twi.h"
Include dependency graph for twi.c:

Go to the source code of this file.

Macros

#define cbi(sfr, bit)   (_SFR_BYTE(sfr) &= ~_BV(bit))
 
#define sbi(sfr, bit)   (_SFR_BYTE(sfr) |= _BV(bit))
 

Functions

 ISR (TWI_vect)
 
void twi_attachSlaveRxEvent (void(*function)(uint8_t *, int))
 
void twi_attachSlaveTxEvent (void(*function)(void))
 
void twi_disable (void)
 
void twi_init (void)
 
uint8_t twi_readFrom (uint8_t address, uint8_t *data, uint8_t length, uint8_t sendStop)
 
void twi_releaseBus (void)
 
void twi_reply (uint8_t ack)
 
void twi_setAddress (uint8_t address)
 
void twi_setFrequency (uint32_t frequency)
 
void twi_stop (void)
 
uint8_t twi_transmit (const uint8_t *data, uint8_t length)
 
uint8_t twi_writeTo (uint8_t address, uint8_t *data, uint8_t length, uint8_t wait, uint8_t sendStop)
 

Variables

static volatile uint8_t twi_error
 
static volatile uint8_t twi_inRepStart
 
static uint8_t twi_masterBuffer [TWI_BUFFER_LENGTH]
 
static volatile uint8_t twi_masterBufferIndex
 
static volatile uint8_t twi_masterBufferLength
 
static void(* twi_onSlaveReceive )(uint8_t *, int)
 
static void(* twi_onSlaveTransmit )(void)
 
static uint8_t twi_rxBuffer [TWI_BUFFER_LENGTH]
 
static volatile uint8_t twi_rxBufferIndex
 
static volatile uint8_t twi_sendStop
 
static volatile uint8_t twi_slarw
 
static volatile uint8_t twi_state
 
static uint8_t twi_txBuffer [TWI_BUFFER_LENGTH]
 
static volatile uint8_t twi_txBufferIndex
 
static volatile uint8_t twi_txBufferLength
 

Macro Definition Documentation

#define cbi (   sfr,
  bit 
)    (_SFR_BYTE(sfr) &= ~_BV(bit))

Definition at line 31 of file twi.c.

#define sbi (   sfr,
  bit 
)    (_SFR_BYTE(sfr) |= _BV(bit))

Definition at line 35 of file twi.c.

Function Documentation

ISR ( TWI_vect  )

Definition at line 399 of file twi.c.

void twi_attachSlaveRxEvent ( void(*)(uint8_t *, int function)

Definition at line 331 of file twi.c.

void twi_attachSlaveTxEvent ( void(*)(void function)

Definition at line 342 of file twi.c.

void twi_disable ( void  )

Definition at line 99 of file twi.c.

void twi_init ( void  )

Definition at line 68 of file twi.c.

uint8_t twi_readFrom ( uint8_t  address,
uint8_t *  data,
uint8_t  length,
uint8_t  sendStop 
)

Definition at line 147 of file twi.c.

void twi_releaseBus ( void  )

Definition at line 390 of file twi.c.

void twi_reply ( uint8_t  ack)

Definition at line 353 of file twi.c.

void twi_setAddress ( uint8_t  address)

Definition at line 115 of file twi.c.

void twi_setFrequency ( uint32_t  frequency)

Definition at line 127 of file twi.c.

void twi_stop ( void  )

Definition at line 369 of file twi.c.

uint8_t twi_transmit ( const uint8_t *  data,
uint8_t  length 
)

Definition at line 302 of file twi.c.

uint8_t twi_writeTo ( uint8_t  address,
uint8_t *  data,
uint8_t  length,
uint8_t  wait,
uint8_t  sendStop 
)

Definition at line 226 of file twi.c.

Variable Documentation

volatile uint8_t twi_error
static

Definition at line 60 of file twi.c.

volatile uint8_t twi_inRepStart
static

Definition at line 44 of file twi.c.

uint8_t twi_masterBuffer[TWI_BUFFER_LENGTH]
static

Definition at line 49 of file twi.c.

volatile uint8_t twi_masterBufferIndex
static

Definition at line 50 of file twi.c.

volatile uint8_t twi_masterBufferLength
static

Definition at line 51 of file twi.c.

void(* twi_onSlaveReceive) (uint8_t *, int)
static

Definition at line 47 of file twi.c.

void(* twi_onSlaveTransmit) (void)
static

Definition at line 46 of file twi.c.

uint8_t twi_rxBuffer[TWI_BUFFER_LENGTH]
static

Definition at line 57 of file twi.c.

volatile uint8_t twi_rxBufferIndex
static

Definition at line 58 of file twi.c.

volatile uint8_t twi_sendStop
static

Definition at line 43 of file twi.c.

volatile uint8_t twi_slarw
static

Definition at line 42 of file twi.c.

volatile uint8_t twi_state
static

Definition at line 41 of file twi.c.

uint8_t twi_txBuffer[TWI_BUFFER_LENGTH]
static

Definition at line 53 of file twi.c.

volatile uint8_t twi_txBufferIndex
static

Definition at line 54 of file twi.c.

volatile uint8_t twi_txBufferLength
static

Definition at line 55 of file twi.c.



arduino_daq
Author(s):
autogenerated on Mon Jun 10 2019 12:46:03