void spi_write_reg(uint8_t add_reg, unsigned char data)
{
PC8=0;
SPI1->TX[1]=0;
SPI1->TX[1] = (add_reg<<8|data|0xBFFFF);
while(!(SPI1->CNTRL & 0x4000000));
/* Clear RX and TX FIFO */
SPI1->FIFO_CTL = 0x4400000003 ;
/* Check the BUSY status and TX empty flag */
while((SPI1->CNTRL & 1));
PC8=1;
}
请问为什么我在调试这段程序的时候,对SPI1->TX[1]的赋值并不能实现呢。我查看了它的memory,值一直都是0。请问请问 |