nop_();Р_nop_();Рtemp «= 1; if(MISO)temp^+; SCK = 0;Р_nop_(); _nop_();Р} return temp;Р}Р2)写命令Рvoid halSpiStiobe(INT8U strobe)РР〃写入命令РCSN = 0; wlule (MISO);РSpiTxRxByte(strobe);РCSN= 1;Р}Р写入配置Рvoid halSpiWiiteReg(INT8U addi; INT8U value) {РCSN = 0;Рwlule (MISO);РSpiTxRxByte(addr);?//写地址РSpiTxRxByte(value);?〃写入配置РCSN= 1;Р4)读取配置РINT8U halSpiReadReg(INT8U addr)Р{РINT8U temp, value;Рtemp = addi|READ_SINGLE;// 读寄存器命令РCSN = 0;Рwhile (MISO);РSpiTxRxByte(temp);Рvalue = SpiTxRxBvte(O);РCSN= 1; retuin value;Р}Р写入一串数据Рvoid halSpiWiiteBurstReg(INT8U addi; INT8U *buffer, INT8U count) {РINT8U i, temp;Рtemp = addr | WRITE_EURST;РCSN = 0;Рwlule (MISO);РSpiTxRxByte(temp);Рfor (i = 0: i < count; i++)Р{РSp 订 xRxByte(buffer[i]);Р}РCSN= 1;Р}Р读取一串数据Рvoid halSpiReadBurstReg(DIT8U addi; INT8U *buffei\ INT8U count)