有关问题在程序后面的注释中,请大神解释详细点哦,本人小白一枚
//############################# SPI_XMIT_BYTE ################################
Uint16 spi_Rmit_byte()
while (!MCBSP_xrdy(mhMcbsp)) {};
MCBSP_write16(mhMcbsp,0xFFFF); //这个写地址该怎么确定????
while (!MCBSP_rrdy(mhMcbsp)) {}
/* Read sample from and write back to handset codec */
return (MCBSP_read16(mhMcbsp)<<8); //这个左移和下面的右移作用是什么?????
}
Uint16 spi_xmit_byte(Uint16 byte)
{
while (!MCBSP_xrdy(mhMcbsp)) {};
MCBSP_write16(mhMcbsp,byte>>8);
while (!MCBSP_rrdy(mhMcbsp)) {};
/* Read sample from and write back to handset codec */
return (MCBSP_read16(mhMcbsp)<<8); //为什么在发数据的时候还要读回????
}
|