]>
cvs.zerfleddert.de Git - rsbs2/blob - bmc/i2c.c
2 #include <avr/interrupt.h>
6 #define TWCR_ACK TWCR = (1<<TWEN)|(1<<TWIE)|(1<<TWINT)|(1<<TWEA)|(0<<TWSTA)|(0<<TWSTO)|(0<<TWWC);
7 #define TWCR_NACK TWCR = (1<<TWEN)|(1<<TWIE)|(1<<TWINT)|(0<<TWEA)|(0<<TWSTA)|(0<<TWSTO)|(0<<TWWC);
8 #define TWCR_RESET TWCR = (1<<TWEN)|(1<<TWIE)|(1<<TWINT)|(1<<TWEA)|(0<<TWSTA)|(1<<TWSTO)|(0<<TWWC);
13 TWCR
&= ~(1<<TWSTA
)|(1<<TWSTO
);
14 TWCR
|= (1<<TWEA
) | (1<<TWEN
)|(1<<TWIE
);
19 printf("Interrupt, Status: %02x!\n", TW_STATUS
);