Started following some tutorial on att85 usi. Downloaded example code from make avr book.

This commit is contained in:
Dan
2022-09-20 01:08:01 -04:00
parent d0cbc0000e
commit 361a828c46
295 changed files with 68746 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
// Functions for i2c communication
#include <avr/io.h>
#include "pinDefines.h"
void initI2C(void);
/* Sets pullups and initializes bus speed to 100kHz (at FCPU=8MHz) */
void i2cWaitForComplete(void);
/* Waits until the hardware sets the TWINT flag */
void i2cStart(void);
/* Sends a start condition (sets TWSTA) */
void i2cStop(void);
/* Sends a stop condition (sets TWSTO) */
void i2cSend(uint8_t data);
/* Loads data, sends it out, waiting for completion */
uint8_t i2cReadAck(void);
/* Read in from slave, sending ACK when done (sets TWEA) */
uint8_t i2cReadNoAck(void);
/* Read in from slave, sending NOACK when done (no TWEA) */