This repository has been archived on 2025-01-09. You can view files and clone it, but cannot push or open issues or pull requests.
cooler-controller/Board/lib/utils/TWI.h

23 lines
369 B
C++

#ifndef TWI_H
#define TWI_H
#include <avr/io.h>
#define TWI_OK 0x00
namespace TWI {
typedef uint8_t BusState;
typedef uint8_t Address;
void init(uint32_t busSpeed);
void close();
BusState startMessage(Address addr);
BusState sendByte(uint8_t byte);
BusState ack();
uint8_t readByte();
BusState nack();
void wait();
}
#endif