inline uint16_t DataFlash_APM1::PageSize() { if (!_spi_sem->take(5)) return 0; uint16_t ret = 528-((ReadStatusReg()&0x01) << 4); // if first bit 1 trhen 512 else 528 bytes _spi_sem->give(); return ret; }
byte RADIOClass::ReceiveData(byte *rxBuffer) { byte size; byte status[2]; if(ReadStatusReg(RADIO_RXBYTES) & BURST_BYTES_IN_TXFIFO) // 0x7F MULTIPLE TRY PRESENT BF { size=ReadSingleReg(RADIO_RXFIFO); ReadBurstReg(RADIO_RXFIFO,rxBuffer,size); ReadBurstReg(RADIO_RXFIFO,status,2); Strobe(RADIO_SFRX); return size; } else { Strobe(RADIO_SFRX); return 0; } }
// Read the status of the DataFlash // Assumes _spi_sem handled by caller. inline uint8_t DataFlash_APM1::ReadStatus() { return(ReadStatusReg()&0x80); // We only want to extract the READY/BUSY bit }
inline uint16_t DataFlash_APM1::PageSize() { return(528-((ReadStatusReg()&0x01)<<4)); // if first bit 1 trhen 512 else 528 bytes }
// Read the status of the DataFlash inline byte DataFlash_CRIUS_AIOP2::ReadStatus() { return(ReadStatusReg()&0x80); // We only want to extract the READY/BUSY bit }
bool FlashDev::isBusy (void) { StatDataReg dataStat; ReadStatusReg (dataStat); return dataStat.WIP; }