uStepper S-lite
Classes | Macros
i2cMaster.h File Reference

This file contains the implementation of the class methods, used to communicate over the I2C bus. More...

#include <inttypes.h>
#include <avr/io.h>
#include <stdlib.h>

Go to the source code of this file.

Classes

class  i2cMaster
 Prototype of class for accessing the TWI (I2C) interface of the AVR (master mode only). More...
 

Macros

#define I2CFREE   0
 
#define READ   1
 
#define WRITE   0
 
#define START   0x08
 
#define REPSTART   0x10
 
#define TXADDRACK   0x18
 
#define TXDATAACK   0x28
 
#define RXADDRACK   0x40
 
#define ACK   1
 
#define NACK   0
 

Detailed Description

This file contains the implementation of the class methods, used to communicate over the I2C bus.

Author
Thomas Hørring Olsen (thoma.nosp@m.s@us.nosp@m.teppe.nosp@m.r.co.nosp@m.m)

Definition in file i2cMaster.h.

Macro Definition Documentation

◆ ACK

#define ACK   1

value to indicate ACK for i2c transmission

Definition at line 68 of file i2cMaster.h.

◆ I2CFREE

#define I2CFREE   0

I2C bus is not currently in use

Definition at line 44 of file i2cMaster.h.

◆ NACK

#define NACK   0

value to indicate NACK for i2c transmission

Definition at line 71 of file i2cMaster.h.

◆ READ

#define READ   1

Value for RW bit in address field, to request a read

Definition at line 47 of file i2cMaster.h.

◆ REPSTART

#define REPSTART   0x10

repeated start condition transmitted

Definition at line 56 of file i2cMaster.h.

◆ RXADDRACK

#define RXADDRACK   0x40

slave address plus read bit transmitted, ACK received

Definition at line 65 of file i2cMaster.h.

◆ START

#define START   0x08

start condition transmitted

Definition at line 53 of file i2cMaster.h.

◆ TXADDRACK

#define TXADDRACK   0x18

slave address plus write bit transmitted, ACK received

Definition at line 59 of file i2cMaster.h.

◆ TXDATAACK

#define TXDATAACK   0x28

data transmitted, ACK received

Definition at line 62 of file i2cMaster.h.

◆ WRITE

#define WRITE   0

Value for RW bit in address field, to request a write

Definition at line 50 of file i2cMaster.h.