//EX23 TWI master//author :dave//data:2018.4.23//EX23和EX24配合起来实现一主一从的通讯//主发一个数据从接受并显示出来//然后从将该数据反过来发送给主,主显示出来#include#include
#define uchar unsigned char
#define uint unsigned int
#define start 0x08
#define re_start 0x10
#define m_arbitration_lost 0x38
//MT
#define mt_sla_ack 0x18
#define mt_sla_nack 0x20
#define mt_data_ack 0x28
#define mt_data_nack 0x30
//MR
#define mr_sla_ack 0x40
#define mr_sla_nack 0x48
#define mr_data_ack 0x50
#define mr_data_nack 0x58
#define START(); {TWCR =(1<
网友评论