Uint16 IntSource; IntSource = I2caRegs.I2CISRC.all; if( IntSource == I2C_SCD_ISRC ) { if( *pStatus == I2C_MSGSTAT_WRITE_BUSY ) { *pStatus = I2C_MSGSTAT_INACTIVE; } else { if( *pStatus == I2C_MSGSTAT_SEND_NOSTOP_BUSY ) *pStatus = I2C_MSGSTAT_SEND_NOSTOP; else ...
IntSource=I2caRegs.I2CISRC.bit.INTCODE & 0x7;//I2CA中断源,读后3位 switch(IntSource){//依中断源而确定相关接收和发送策略 case I2C_NO_ISRC://=0 case I2C_ARB_ISRC://=1 case I2C_NACK_ISRC: //=2 case I2C_ARDY_ISRC: //=3 case I2C_SCD_ISRC://=6 case I2C_AAS_ISRC://=7 brea...
// Read interrupt source IntSource = I2caRegs.I2CISRC.all; // Interrupt source = stop condition detected if(IntSource == I2C_SCD_ISRC) { // If completed message was writing data, reset msg to inactive state if (CurrentMsgPtr->MsgStatus == I2C_MSGSTAT_WRITE_BUSY) { CurrentMsgPtr->Ms...
case I2C_ARDY_ISRC:break; // =3 case I2C_RX_ISRC: // =4 InData[I2cIndex++] = I2caRegs.I2CDRR; break; case I2C_TX_ISRC: break; // =5 case I2C_SCD_ISRC: break; // =6 case I2C_AAS_ISRC: break; // =7 default: //asm(" ESTOP0"); // Halt on invalid number. asm(" ...
SCD_INT检测到停止条件中断:在I2C总线上检测到停止条件AAS_INT被寻址中断:在I2C总线上的其他主设备把...
7.4.1I2C模块概述I2C总线是一种两线制串行总线,与其相连的外部器件可以 发送1至8位数据到DSP,或者从DSP接收1至8位数据。通过I2C模块传输或接收到的一个单位的数据可以少于8位,但为了方便起见,本节中一个单位的数据均被视为一个数据字节。I2C模块支持任何主或从I2C兼容设备。图7-38是多个I2C模块连接在总线...
When enabled, the I2C module clears the interrupt (SCD = 0) upon one of the following events: The CPU reads I2CISRC while it indicates a stop condition A reset of the I2C module Someone manually clears the interrupt This parameter corresponds to bit 5 (SCD) of the interrupt enable register...
When enabled, the I2C module clears the interrupt (SCD = 0) upon one of the following events: The CPU reads I2CISRC while it indicates a stop condition A reset of the I2C module Someone manually clears the interrupt This parameter corresponds to bit 5 (SCD) of the interrupt enable register...
停止信号位,当I2C发送或者接收到一个停止信号时,SCD位置位。 0:没有检测到停止信号; 1:在总线上检测到停止信号; 下列情况下该位会被置位: a.当I2CISRC的值为110B(检测到停止信号),CPU读取I2CISRC,仿真读不影响此位。 b.手动置1; c.I2C模块复位; 4 XRDY 数据发送寄存器空中断标志位(非FIFO模式) 在非FI...
IntSource = I2caRegs.I2CISRC.all; if( IntSource == I2C_SCD_ISRC ) { if( *pStatus == I2C_MSGSTAT_WRITE_BUSY ) { *pStatus = I2C_MSGSTAT_INACTIVE; } else { if( *pStatus == I2C_MSGSTAT_SEND_NOSTOP_BUSY ) *pStatus = I2C_MSGSTAT_SEND_NOSTOP; ...