SC16IS752/RaspberryPi at master · nopnop2002/SC16IS752 · GitHub
while(1) {
/*
SC16IS750_write(&dev, SC16IS750_CHANNEL_A, 0x55); // 01010101
delay(10);
if (SC16IS750_available(&dev, SC16IS750_CHANNEL_B)==0) {
printf("serial communication error 1\n");
break;
}
if (SC16IS750_read(&dev, SC16IS750_CHANNEL_B)!=0x55) {
printf("serial communication error 2\n");
break;
}
delay(200);
*/
SC16IS750_write(&dev, SC16IS750_CHANNEL_B, 0xAA); // 10101010
delay(10);
if (SC16IS750_available(&dev, SC16IS750_CHANNEL_A)==0) {
printf("serial communication error 3\n");
break;
}
if (SC16IS750_read(&dev, SC16IS750_CHANNEL_A)!=0xAA) {
printf("serial communication error 4\n");
break;
}
delay(200);
}
return 0;
댓글 없음:
댓글 쓰기