mikrokontrollersystemer-pro.../prosjekt.X/i2c.h
Sebastian H. Gabrielli 8e3607cbda Store and hold I2C data
I2C data is now stored until stop is sent, then printed.
2024-03-20 13:24:55 +01:00

35 lines
471 B
C

/*
* File: i2c.h
* Author: sebgab
*
* Created on March 6, 2024, 1:53 PM
*/
#ifndef I2C_H
#define I2C_H
#ifdef __cplusplus
extern "C" {
#endif
// Include the IO for I2C
#include <avr/io.h>
#include <avr/interrupt.h>
#include "uart.h"
#include <util/twi.h>
// Received data info
#define I2C_RECV_BUF_SIZE 64
// Reset recv to initial state
void i2c_reset_recv();
// Initialize the I2C bus
void init_i2c(void);
#ifdef __cplusplus
}
#endif
#endif /* I2C_H */