我用MSP430的spi口控制cc1100。数据已经写到spi口的缓冲区内。请问怎么知道数据应经通过cc1100发送出去?
void main(void)
{
INT8U txBuffer[4]; // declear a send buffer and init
*txBuffer=0x11;
*(txBuffer+1)=0xaa;
*(txBuffer+2)=0xdd;
*(txBuffer+3)=0x33;
INT8U value; // get the status of the buffer
INT8U rxBuffer[4]={0,0,0,0}; // declear a receive buffer
INT8U length;
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
Init_Spi(); // config spi
Power_Up_Reset_Cc1100();
Write_Rf_Settings();
Send_Packet(txBuffer,sizeof(txBuffer)); // send the packet
另Send_Packet代码:
void Send_Packet(BYTE *txBuffer, INT8U size)
{
Write_Spi_Reg(CCxxx0_TXFIFO, size);
Burst_Write_SPI_Reg(CCxxx0_TXFIFO, txBuffer, size); // write the data to be send
Spi_Strobe(CCxxx0_STX); // enter send mode and send data
while (!GDO0); // Wait for GDO0 to be set -> sync transmitted
while (GDO0); // Wait for GDO0 to be cleared -> end of packet
Spi_Strobe(CCxxx0_SFTX); // Clear the send buffer
}
ps:GDO0的状态好像不变,始终为低