aboutsummaryrefslogtreecommitdiff
path: root/include/twi.h
blob: 0763c4ba7bfb850cc658398406044409cfd4406d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <avr/io.h>
#include <avr/interrupt.h>
#include <stdint.h>

#include "mcu/mcu_def.h"

#ifndef _IOE_TWI_H_
#define _IOE_TWI_H_

#ifndef MCUSUPPORT_TWI
#error "No TWI interface is known on your mcu."
#endif

enum twiMode {
    TWI_MODE_MASTER,
    TWI_MODE_SLAVE
};

void twi_init(enum twiMode);
int8_t twi_busy(void);
void twi_join(void);
void twi_send(uint8_t data);

#endif /* _IOE_TWI_H_ */