//硬件SPI读写一体化函数 unsigned char SystemObj::SpiReadWrite(unsigned char cData) { SpiaRegs.SPITXBUF = cData; // Wait until data is received while(SpiaRegs.SPIFFRX.bit.RXFFST !=1) { // KickDog();//喂狗测试 } // Check against sent data return SpiaRegs.SPIRXBUF; }