DW1000 UWB driver based on work of Matthias Grob & Manuel Stalder - ETH Zürich - 2015
Diff: DW1000.h
- Revision:
- 10:f1e3c04080d6
- Parent:
- 9:326bf149c8bc
- Child:
- 12:da4b09aff6af
--- a/DW1000.h Wed Apr 20 11:03:41 2016 +0000 +++ b/DW1000.h Mon Aug 01 08:45:36 2016 +0000 @@ -45,7 +45,7 @@ /** Set the Extended Unique ID * @param EUI The EUID to use * - * Note - ID is only valid until the next power cycle and overrides the value in the OTP memory. + * @note ID is only valid until the next power cycle and overrides the value in the OTP memory. * To set a value that is automatically loaded on startup set OTP memory addresses 0 and 1. */ void setEUI(uint64_t EUI); // sets 64 bit Extended Unique Identifier according to IEEE standard @@ -112,9 +112,10 @@ * @return True if the write was sucessful. * * Writes the supplied data to the OTP memory and then reads it back to verify it was sucessfully programmed. - * WARNING - this is a one time operation for each memory address. + * @warning This is a one time operation for each memory address. * See Section 6.3.1 of the user manual for the memory map. - * It is recommened that the device is reset or power cycled after programing. + * + * @note It is recommened that the device is reset or power cycled after programing. */ bool writeOTP(uint16_t word_address,uint32_t data); // program a value in the OTP. It is recommended to reset afterwards. @@ -165,15 +166,10 @@ */ void getRxSignalPower(float *direct, float *total); - /** Get a metric of timestamp accuracy - * - * @param sigAmp Optional location to return the raw signal amplitude - * @param noiseAmp Optional location to return the raw channel noise level - * @return Timestamp quality metric - * - * The quality metric is a somewhat arbitary number based on channel noise and direct path strength - */ - float getRxQuality(uint16_t *sigAmp = NULL, uint16_t *noiseAmp = NULL); + + void 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); + protected: @@ -309,10 +305,19 @@ * * The setup object supplied is copied and can be disposed of after the call. * If the supplied setup fails DW1000Setup::check() then it is ignored and the function returns false. - * Note - this will reset the radio. You must re-enable interupts, receiver etc. after calling it. + * @note This will reset the radio. You must re-enable interupts, receiver etc. after calling it. */ bool applySetup(DW1000Setup *setup); + + /** Get the first path amplitude values + * @param fp_amp2 Will be set to first path second peak amplitude + * @param fp_amp3 Will be set to first path third peak amplitude + * + * Reads the two registers for the last packet recieved. Used for quality metrics. + */ + void getFirstPath(uint16_t *fp_amp2,uint16_t *fp_amp3); + private: void resetAll(); // soft reset the entire DW1000 (some registers stay as they were see User Manual)