Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: DW1000.cpp
- Revision:
- 10:f1e3c04080d6
- Parent:
- 9:326bf149c8bc
- Child:
- 13:8718966cd81e
--- a/DW1000.cpp Wed Apr 20 11:03:41 2016 +0000
+++ b/DW1000.cpp Mon Aug 01 08:45:36 2016 +0000
@@ -588,6 +588,17 @@
writeRegister32(DW1000_TX_FCTRL,0,frameCtrlValue);
}
+void DW1000::getFullQualityMetrics(uint16_t *std_noise, uint16_t *fp_amp1, uint16_t *fp_amp2, uint16_t *fp_amp3,
+ uint16_t *cir_pwr, uint16_t *preAmbleAcc, uint16_t *preAmbleAcc_NoSat)
+{
+ *fp_amp1 = readRegister16(DW1000_RX_TIME,7);
+ *std_noise = readRegister16(DW1000_RX_FQUAL,0);
+ *fp_amp2 = readRegister16(DW1000_RX_FQUAL,2);
+ *fp_amp3 = readRegister16(DW1000_RX_FQUAL,4);
+ *cir_pwr = readRegister16(DW1000_RX_FQUAL,6);
+ *preAmbleAcc = readRegister16(DW1000_RX_FINFO,4) >> 4;
+ *preAmbleAcc_NoSat = readRegister16(DW1000_DRX_CONF,DWDRX_RXPAC_NOSAT);
+}
#define SQR(x) ((float)(x) * (float)(x))
@@ -633,21 +644,14 @@
}
-float DW1000::getRxQuality(uint16_t *sigAmp, uint16_t *noiseAmp)
+#undef SQR
+
+void DW1000::getFirstPath(uint16_t *fp_amp2,uint16_t *fp_amp3)
{
- uint16_t firstPathAmp2 = readRegister16(DW1000_RX_FQUAL,2);
- uint16_t noise = readRegister16(DW1000_RX_FQUAL,0);
- if (sigAmp)
- *sigAmp = firstPathAmp2;
- if (noiseAmp)
- *noiseAmp = noise;
+ *fp_amp2 = readRegister16(DW1000_RX_FQUAL,2);
+ *fp_amp3 = readRegister16(DW1000_RX_FQUAL,4);
+}
- if (noise > 0)
- return SQR(firstPathAmp2)/(noise*100000.0f);
- else
- return 100;
-}
-#undef SQR
void DW1000::setRxDelay(uint16_t ticks)