diff options
Diffstat (limited to 'include/twi.h')
-rw-r--r-- | include/twi.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/twi.h b/include/twi.h new file mode 100644 index 0000000..0763c4b --- /dev/null +++ b/include/twi.h @@ -0,0 +1,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_ */ |