Samp_I2Cのソース変更部分
EEPROM24FC256-I/P対応の変更は思いのほか苦労しました!!
void vSMBusInit(void)
{
//vAHI_SiMasterConfigure(TRUE, FALSE, 47);
vAHI_SiMasterConfigure(TRUE, FALSE, 100);//47→100に変更しないと動作しませんでした!!
}
static void vHandleSerialInput(void)
case 'm':
vfPrintf(&sSerStream, "24F256-TEST\r\n");
vAHI_SiMasterWriteSlaveAddr(0x50, FALSE);
START_WRITE_ACK();
while(bAHI_SiMasterPollTransferInProgress()); /* busy wait */
vfPrintf(&sSerStream, "%d %d ", bAHI_SiMasterPollArbitrationLost(),bAHI_SiMasterCheckRxNack());
vAHI_SiMasterWriteData8(0x00);
WRITE_ACK();
while(bAHI_SiMasterPollTransferInProgress()); /* busy wait */
vfPrintf(&sSerStream, "%d %d ", bAHI_SiMasterPollArbitrationLost(),bAHI_SiMasterCheckRxNack());
vAHI_SiMasterWriteData8(0x00);
WRITE_ACK();
while(bAHI_SiMasterPollTransferInProgress()); /* busy wait */
vfPrintf(&sSerStream, "%d %d ", bAHI_SiMasterPollArbitrationLost(),bAHI_SiMasterCheckRxNack());
vAHI_SiMasterWriteData8(0xaa);
WRITE_ACK();
while(bAHI_SiMasterPollTransferInProgress()); /* busy wait */
vfPrintf(&sSerStream, "%d %d ", bAHI_SiMasterPollArbitrationLost(),bAHI_SiMasterCheckRxNack());
vAHI_SiMasterWriteData8(0xbb);
WRITE_ACK();
while(bAHI_SiMasterPollTransferInProgress()); /* busy wait */
vfPrintf(&sSerStream, "%d %d ", bAHI_SiMasterPollArbitrationLost(),bAHI_SiMasterCheckRxNack());
STOP_WRITE_NACK();
for(x = 0; x < 16000; x++){;}
vAHI_SiMasterWriteSlaveAddr(0x50, FALSE);
START_WRITE_ACK();
while(bAHI_SiMasterPollTransferInProgress()); /* busy wait */
vfPrintf(&sSerStream, "%d %d ", bAHI_SiMasterPollArbitrationLost(),bAHI_SiMasterCheckRxNack());
vAHI_SiMasterWriteData8(0x00);
WRITE_ACK();
while(bAHI_SiMasterPollTransferInProgress()); /* busy wait */
vfPrintf(&sSerStream, "%d %d ", bAHI_SiMasterPollArbitrationLost(),bAHI_SiMasterCheckRxNack());
vAHI_SiMasterWriteData8(0x00);
WRITE_ACK();
while(bAHI_SiMasterPollTransferInProgress()); /* busy wait */
vfPrintf(&sSerStream, "%d %d ", bAHI_SiMasterPollArbitrationLost(),bAHI_SiMasterCheckRxNack());
vAHI_SiMasterWriteSlaveAddr(0x50, TRUE);
START_WRITE_ACK();
while(bAHI_SiMasterPollTransferInProgress()); /* busy wait */
vfPrintf(&sSerStream, "%d %d ", bAHI_SiMasterPollArbitrationLost(),bAHI_SiMasterCheckRxNack());
READ_ACK();
while(bAHI_SiMasterPollTransferInProgress()); /* busy wait */
vfPrintf(&sSerStream, "%d %d ", bAHI_SiMasterPollArbitrationLost(),bAHI_SiMasterCheckRxNack());
pu8Dest[0]=u8AHI_SiMasterReadData8();
vfPrintf(&sSerStream, "%x \r\n",pu8Dest[0]);
READ_ACK();
while(bAHI_SiMasterPollTransferInProgress()); /* busy wait */
vfPrintf(&sSerStream, "%d %d ", bAHI_SiMasterPollArbitrationLost(),bAHI_SiMasterCheckRxNack());
pu8Dest[0]=u8AHI_SiMasterReadData8();
vfPrintf(&sSerStream, "%x \r\n",pu8Dest[0]);
STOP_READ_NACK();
while(bAHI_SiMasterPollTransferInProgress()); /* busy wait */
break;