Library to work with the LDC1000 from Texas Instruments

Dependencies:   FastPWM

Dependents:   LDC1000_test

LDC1000

This library was written to interface to Texas Instruments' LDC1000 in order to perform inductance measurement. This libary needs a SPI peripheral on your mbed device to talk to the LDC1000.

Clock

The LDC1000 needs a high speed clock for its internal frequency counter. In order to provide this clock, the FastPWM library is used. This may change the behaviour of other PWM channels, please be aware of that, and read the FastPWM documentation to understand the implications.

Unsupported

Not supported (yet):

  1. Setting the RpMAX and RpMIN values
  2. Setting the interrupt pin functionality
Revision:
12:312970050c8c
Parent:
11:0f53fbf73613
--- a/LDC1000.cpp	Fri May 29 13:45:48 2015 +0000
+++ b/LDC1000.cpp	Mon Jun 01 08:21:11 2015 +0000
@@ -41,7 +41,6 @@
     buffer &= 0xE7; //clear amplitude bits
     buffer |= (amplitude<<3) & 0x18;
     writeSPI(&buffer,0x04);
-
 }
 
 void LDC1000::setWatchdog(float frequency)
@@ -78,12 +77,11 @@
 };
 
 
-/* reads all 5 registers also after cable reconnect but het returns just one byte*/
 uint32_t LDC1000::readRawCounts(void)
 {
     uint8_t val[5];
     readSPI(val,0x21,5);
-    unsigned int combinedbytes = (val[4]<<16)| (val[3]<<8) | val[2];  // combine the 3 bytes from registers 23, 24 and 25 
+    uint32_t combinedbytes = (val[4]<<16)| (val[3]<<8) | val[2];  // combine the content of the 3 bytes from registers 23, 24 and 25 
     return combinedbytes;
 }
 
@@ -124,5 +122,4 @@
     float LDC1000::get_frequency()      {return _frequency;};    
     float LDC1000::get_responsetime()   {return _responsetime;};    
     float LDC1000::get_cap()            {return cap;};
-// END ***********************************************************
-
+// END ***********************************************************
\ No newline at end of file