- #include "E2_25AA020A.h"
- void E2_WriteByte(unsigned char addr,unsigned char dat)
- {
- unsigned char sta;
- SPI_CS = 0;
- spiWriteByte(WREN);
- SPI_CS = 1;
-
- SPI_CS = 0;
- spiWriteByte(WRITE);
- spiWriteByte(addr);
- spiWriteByte(dat);
- SPI_CS = 1;
- <b> while(1)
- {
- SPI_CS = 0;
- spiWriteByte(RDSR);
- sta = spiReadByte();
- SPI_CS = 1;
- if((sta & 0x01) == 0)
- {
- break;
- }
- }</b>
- }
复制代码
各位大佬们,我加粗部分代码是写入25AA020A这个器件时,需要等待这个状态,有啥办法不让他死等来查询这个状态位吗
|