This is the DW1000 driver and our self developed distance measurement application based on it. We do this as a semester thesis at ETH Zürich under the Automatic Control Laboratory in the Department of electrical engineering.

Dependencies:   mbed

Revision:
20:257d56530ae1
Parent:
18:bbc7ca7d3a95
Child:
24:6f25ba679490
--- a/DW1000/DW1000.h	Tue Nov 25 14:48:51 2014 +0000
+++ b/DW1000/DW1000.h	Tue Nov 25 15:22:53 2014 +0000
@@ -53,7 +53,7 @@
 
 class DW1000 {
     public:            
-        DW1000(PinName MOSI, PinName MISO, PinName SCLK, PinName CS, PinName IRQ);                           // constructor, uses SPI class
+        DW1000(PinName MOSI, PinName MISO, PinName SCLK, PinName CS, PinName IRQ);              // constructor, uses SPI class
 
         // Device API
         uint32_t getDeviceID();                                                                 // gets the Device ID which should be 0xDECA0130 (good for testing SPI!)
@@ -70,6 +70,7 @@
         
     //private:
         bool receiving;                                                                         // holds if we need to preserve a receiving state after sending
+        bool sending;                                                                           // holds if we are currently in a sending process so we can't receive at the moment
 
         void loadLDE();                                                                         // load the leading edge detection algorithm to RAM, [IMPORTANT because receiving malfunction may occur] see User Manual LDELOAD on p22 & p158
         void stopTRX();                                                                         // disable tranceiver go back to idle mode
@@ -78,7 +79,7 @@
 
         // Interrupt
         InterruptIn irq;                                                                        // Pin used to handle Events from DW1000 by an Interrupthandler
-        void (*callbackRX) (int framelength);                                                                  // function pointer to callback which is called when successfull RX took place
+        void (*callbackRX) (int framelength);                                                   // function pointer to callback which is called when successfull RX took place
         void (*callbackTX) ();                                                                  // function pointer to callback which is called when successfull TX took place
         void ISR();                                                                             // interrupt handling method (also calls according callback methods)
         uint16_t getFramelength();                                                              // to get the framelength of the received frame from the PHY header