TI LDC1000 library.

Committer:
jonebuckman
Date:
Wed Apr 05 20:34:42 2017 +0000
Revision:
0:b9daf55d7586
First release.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jonebuckman 0:b9daf55d7586 1 /**
jonebuckman 0:b9daf55d7586 2 * @file ldc1000.h
jonebuckman 0:b9daf55d7586 3 *
jonebuckman 0:b9daf55d7586 4 * @author Jon Buckman
jonebuckman 0:b9daf55d7586 5 *
jonebuckman 0:b9daf55d7586 6 * @section LICENSE
jonebuckman 0:b9daf55d7586 7 *
jonebuckman 0:b9daf55d7586 8 * Copyright (c) 2014 Jon Buckman
jonebuckman 0:b9daf55d7586 9 *
jonebuckman 0:b9daf55d7586 10 * This program is free software: you can redistribute it and/or modify
jonebuckman 0:b9daf55d7586 11 * it under the terms of the GNU General Public License as published by
jonebuckman 0:b9daf55d7586 12 * the Free Software Foundation, either version 3 of the License, or
jonebuckman 0:b9daf55d7586 13 * (at your option) any later version.
jonebuckman 0:b9daf55d7586 14 *
jonebuckman 0:b9daf55d7586 15 * This program is distributed in the hope that it will be useful,
jonebuckman 0:b9daf55d7586 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
jonebuckman 0:b9daf55d7586 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
jonebuckman 0:b9daf55d7586 18 * GNU General Public License for more details.
jonebuckman 0:b9daf55d7586 19 *
jonebuckman 0:b9daf55d7586 20 * You should have received a copy of the GNU General Public License
jonebuckman 0:b9daf55d7586 21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
jonebuckman 0:b9daf55d7586 22 *
jonebuckman 0:b9daf55d7586 23 * The above copyright notice and this permission notice shall be included in
jonebuckman 0:b9daf55d7586 24 * all copies or substantial portions of the Software.
jonebuckman 0:b9daf55d7586 25 *
jonebuckman 0:b9daf55d7586 26 * @section DESCRIPTION
jonebuckman 0:b9daf55d7586 27 *
jonebuckman 0:b9daf55d7586 28 * LDC1000 Inductance to Digital Converter from Texas Instruments.
jonebuckman 0:b9daf55d7586 29 *
jonebuckman 0:b9daf55d7586 30 * Datasheet:
jonebuckman 0:b9daf55d7586 31 *
jonebuckman 0:b9daf55d7586 32 * http://www.ti.com/lit/ds/symlink/ldc1000.pdf
jonebuckman 0:b9daf55d7586 33 *
jonebuckman 0:b9daf55d7586 34 * Example:
jonebuckman 0:b9daf55d7586 35 * @code
jonebuckman 0:b9daf55d7586 36 * #include "mbed.h"
jonebuckman 0:b9daf55d7586 37 * #include "ldc1000.h"
jonebuckman 0:b9daf55d7586 38 *
jonebuckman 0:b9daf55d7586 39 * Serial pc(USBTX, USBRX); // tx, rx
jonebuckman 0:b9daf55d7586 40 *
jonebuckman 0:b9daf55d7586 41 * LDC1000 ldc(D11, D12, D13, D10, D9); // mosi, miso, sck, cs, irq
jonebuckman 0:b9daf55d7586 42 *
jonebuckman 0:b9daf55d7586 43 * int main() {
jonebuckman 0:b9daf55d7586 44 * while(1) {
jonebuckman 0:b9daf55d7586 45 * pc.printf("The device revision ID is %d\n", ldc.getDeviceID());
jonebuckman 0:b9daf55d7586 46 * wait(1);
jonebuckman 0:b9daf55d7586 47 * }
jonebuckman 0:b9daf55d7586 48 * }
jonebuckman 0:b9daf55d7586 49 * @endcode
jonebuckman 0:b9daf55d7586 50 */
jonebuckman 0:b9daf55d7586 51
jonebuckman 0:b9daf55d7586 52 #ifndef __LDC1000_H__
jonebuckman 0:b9daf55d7586 53 #define __LDC1000_H__
jonebuckman 0:b9daf55d7586 54
jonebuckman 0:b9daf55d7586 55 /**
jonebuckman 0:b9daf55d7586 56 * Includes
jonebuckman 0:b9daf55d7586 57 */
jonebuckman 0:b9daf55d7586 58 #include "mbed.h"
jonebuckman 0:b9daf55d7586 59
jonebuckman 0:b9daf55d7586 60 /**
jonebuckman 0:b9daf55d7586 61 * Defines
jonebuckman 0:b9daf55d7586 62 */
jonebuckman 0:b9daf55d7586 63 #define LDC1000_MIN_SENSOR_FREQUENCY 27
jonebuckman 0:b9daf55d7586 64 #define LDC1000_MAX_SENSOR_FREQUENCY 234
jonebuckman 0:b9daf55d7586 65 #define LDC1000_AMP_1V 0x00
jonebuckman 0:b9daf55d7586 66 #define LDC1000_AMP_2V 0x08
jonebuckman 0:b9daf55d7586 67 #define LDC1000_AMP_4V 0x10
jonebuckman 0:b9daf55d7586 68 #define LDC1000_RESP_192 0x02
jonebuckman 0:b9daf55d7586 69 #define LDC1000_RESP_384 0x03
jonebuckman 0:b9daf55d7586 70 #define LDC1000_RESP_768 0x04
jonebuckman 0:b9daf55d7586 71 #define LDC1000_RESP_1536 0x05
jonebuckman 0:b9daf55d7586 72 #define LDC1000_RESP_3072 0x06
jonebuckman 0:b9daf55d7586 73 #define LDC1000_RESP_6144 0x07
jonebuckman 0:b9daf55d7586 74 #define LDC1000_CLK_SEL 0x02
jonebuckman 0:b9daf55d7586 75 #define LDC1000_CLK_PD 0x01
jonebuckman 0:b9daf55d7586 76 #define LDC1000_INTB_MODE_DRDYB_ENBL 0x04
jonebuckman 0:b9daf55d7586 77 #define LDC1000_INTB_MODE_CMP_STAT 0x03
jonebuckman 0:b9daf55d7586 78 #define LDC1000_INTB_MODE_WAKE_ENBL 0x01
jonebuckman 0:b9daf55d7586 79 #define LDC1000_INTB_MODE_DSBL 0x00
jonebuckman 0:b9daf55d7586 80 #define LDC1000_PWR_MODE_ACT 0x01
jonebuckman 0:b9daf55d7586 81 #define LDC1000_PWR_MODE_STDBY 0x00
jonebuckman 0:b9daf55d7586 82 #define LDC1000_STAT_OSC 0x80
jonebuckman 0:b9daf55d7586 83 #define LDC1000_STAT_DRDY 0x40
jonebuckman 0:b9daf55d7586 84 #define LDC1000_STAT_WAKE 0x20
jonebuckman 0:b9daf55d7586 85 #define LDC1000_STAT_CMP 0x10
jonebuckman 0:b9daf55d7586 86
jonebuckman 0:b9daf55d7586 87 /**
jonebuckman 0:b9daf55d7586 88 * LDC1000 Inductance to Digital Converter from Texas Instruments.
jonebuckman 0:b9daf55d7586 89 */
jonebuckman 0:b9daf55d7586 90 class LDC1000 {
jonebuckman 0:b9daf55d7586 91
jonebuckman 0:b9daf55d7586 92 public:
jonebuckman 0:b9daf55d7586 93
jonebuckman 0:b9daf55d7586 94 /**
jonebuckman 0:b9daf55d7586 95 * Constructor.
jonebuckman 0:b9daf55d7586 96 *
jonebuckman 0:b9daf55d7586 97 * @param mosi mbed pin to use for MOSI line of SPI interface.
jonebuckman 0:b9daf55d7586 98 * @param miso mbed pin to use for MISO line of SPI interface.
jonebuckman 0:b9daf55d7586 99 * @param sck mbed pin to use for SCK line of SPI interface.
jonebuckman 0:b9daf55d7586 100 * @param csn mbed pin to use for not chip select line of SPI interface.
jonebuckman 0:b9daf55d7586 101 * @param irq mbed pin to use for the interrupt request line.
jonebuckman 0:b9daf55d7586 102 */
jonebuckman 0:b9daf55d7586 103 LDC1000(PinName mosi, PinName miso, PinName sck, PinName csn, PinName irq = NC);
jonebuckman 0:b9daf55d7586 104
jonebuckman 0:b9daf55d7586 105 /**
jonebuckman 0:b9daf55d7586 106 * Get the device ID.
jonebuckman 0:b9daf55d7586 107 *
jonebuckman 0:b9daf55d7586 108 * @return The device ID (8).
jonebuckman 0:b9daf55d7586 109 */
jonebuckman 0:b9daf55d7586 110 int getDeviceID(void);
jonebuckman 0:b9daf55d7586 111
jonebuckman 0:b9daf55d7586 112 /**
jonebuckman 0:b9daf55d7586 113 * Set the Rp maximum.
jonebuckman 0:b9daf55d7586 114 *
jonebuckman 0:b9daf55d7586 115 * @param rp Rp maximum (0x00 - 0x1f).
jonebuckman 0:b9daf55d7586 116 */
jonebuckman 0:b9daf55d7586 117 void setRpMaximum(int rp);
jonebuckman 0:b9daf55d7586 118
jonebuckman 0:b9daf55d7586 119 /**
jonebuckman 0:b9daf55d7586 120 * Get the Rp maximum.
jonebuckman 0:b9daf55d7586 121 *
jonebuckman 0:b9daf55d7586 122 * @return The device ID (0x00 - 0x1f).
jonebuckman 0:b9daf55d7586 123 */
jonebuckman 0:b9daf55d7586 124 int getRpMaximum(void);
jonebuckman 0:b9daf55d7586 125
jonebuckman 0:b9daf55d7586 126 /**
jonebuckman 0:b9daf55d7586 127 * Set the Rp minimum.
jonebuckman 0:b9daf55d7586 128 *
jonebuckman 0:b9daf55d7586 129 * @param rp Rp maximum (0x20 - 0x3f).
jonebuckman 0:b9daf55d7586 130 */
jonebuckman 0:b9daf55d7586 131 void setRpMinimum(int rp);
jonebuckman 0:b9daf55d7586 132
jonebuckman 0:b9daf55d7586 133 /**
jonebuckman 0:b9daf55d7586 134 * Get the Rp minimum.
jonebuckman 0:b9daf55d7586 135 *
jonebuckman 0:b9daf55d7586 136 * @return The device ID (0x20 - 0x3f).
jonebuckman 0:b9daf55d7586 137 */
jonebuckman 0:b9daf55d7586 138 int getRpMinimum(void);
jonebuckman 0:b9daf55d7586 139
jonebuckman 0:b9daf55d7586 140 /**
jonebuckman 0:b9daf55d7586 141 * Set the sensor frequency.
jonebuckman 0:b9daf55d7586 142 *
jonebuckman 0:b9daf55d7586 143 * @param frequency sensor frequency (N = 68.94 * log10(F/2000)).
jonebuckman 0:b9daf55d7586 144 */
jonebuckman 0:b9daf55d7586 145 void setSensorFrequency(int frequency);
jonebuckman 0:b9daf55d7586 146
jonebuckman 0:b9daf55d7586 147 /**
jonebuckman 0:b9daf55d7586 148 * Get the sensor frequency.
jonebuckman 0:b9daf55d7586 149 *
jonebuckman 0:b9daf55d7586 150 * @return The sensor frequency (0 - 255).
jonebuckman 0:b9daf55d7586 151 */
jonebuckman 0:b9daf55d7586 152 int getSensorFrequency(void);
jonebuckman 0:b9daf55d7586 153
jonebuckman 0:b9daf55d7586 154 /**
jonebuckman 0:b9daf55d7586 155 * Set the oscillator amplitude.
jonebuckman 0:b9daf55d7586 156 *
jonebuckman 0:b9daf55d7586 157 * @param oscamp oscillator amplitude (0x00 - 1V, 0x01 - 2V, 0x10 - 4V).
jonebuckman 0:b9daf55d7586 158 */
jonebuckman 0:b9daf55d7586 159 void setOscAmplitude(int oscamp);
jonebuckman 0:b9daf55d7586 160
jonebuckman 0:b9daf55d7586 161 /**
jonebuckman 0:b9daf55d7586 162 * Get the oscillator amplitude.
jonebuckman 0:b9daf55d7586 163 *
jonebuckman 0:b9daf55d7586 164 * @return The oscillator amplitude (0x00 - 1V, 0x01 - 2V, 0x02 - 4V).
jonebuckman 0:b9daf55d7586 165 */
jonebuckman 0:b9daf55d7586 166 int getOscAmplitude(void);
jonebuckman 0:b9daf55d7586 167
jonebuckman 0:b9daf55d7586 168 /**
jonebuckman 0:b9daf55d7586 169 * Set the response time.
jonebuckman 0:b9daf55d7586 170 *
jonebuckman 0:b9daf55d7586 171 * @param resp response time (0x02 - 192, 0x03 - 384, 0x04 - 768, 0x05 - 1536, 0x06 - 3072, 0x07 - 6144).
jonebuckman 0:b9daf55d7586 172 */
jonebuckman 0:b9daf55d7586 173 void setResponseTime(int resp);
jonebuckman 0:b9daf55d7586 174
jonebuckman 0:b9daf55d7586 175 /**
jonebuckman 0:b9daf55d7586 176 * Get the response time.
jonebuckman 0:b9daf55d7586 177 *
jonebuckman 0:b9daf55d7586 178 * @return The response time (0x02 - 192, 0x03 - 384, 0x04 - 768, 0x05 - 1536, 0x06 - 3072, 0x07 - 6144).
jonebuckman 0:b9daf55d7586 179 */
jonebuckman 0:b9daf55d7586 180 int getResponseTime(void);
jonebuckman 0:b9daf55d7586 181
jonebuckman 0:b9daf55d7586 182 /**
jonebuckman 0:b9daf55d7586 183 * Set the clock select.
jonebuckman 0:b9daf55d7586 184 *
jonebuckman 0:b9daf55d7586 185 * @param sel clock select (0 - external time base, 1 - external crystal).
jonebuckman 0:b9daf55d7586 186 */
jonebuckman 0:b9daf55d7586 187 void setClockSelect(int sel);
jonebuckman 0:b9daf55d7586 188
jonebuckman 0:b9daf55d7586 189 /**
jonebuckman 0:b9daf55d7586 190 * Get the clock select.
jonebuckman 0:b9daf55d7586 191 *
jonebuckman 0:b9daf55d7586 192 * @return The clock select (0 - external time base, 1 - external crystal).
jonebuckman 0:b9daf55d7586 193 */
jonebuckman 0:b9daf55d7586 194 int getClockSelect(void);
jonebuckman 0:b9daf55d7586 195
jonebuckman 0:b9daf55d7586 196 /**
jonebuckman 0:b9daf55d7586 197 * Set the disable external time base clock.
jonebuckman 0:b9daf55d7586 198 *
jonebuckman 0:b9daf55d7586 199 * @param pd clock select (0 - enable external time base clock, 1 - disable external time base clock).
jonebuckman 0:b9daf55d7586 200 */
jonebuckman 0:b9daf55d7586 201 void setClockTimeBase(int pd);
jonebuckman 0:b9daf55d7586 202
jonebuckman 0:b9daf55d7586 203 /**
jonebuckman 0:b9daf55d7586 204 * Get the disable external time base clock.
jonebuckman 0:b9daf55d7586 205 *
jonebuckman 0:b9daf55d7586 206 * @return The clock select (0 - enable external time base clock, 1 - disable external time base clock).
jonebuckman 0:b9daf55d7586 207 */
jonebuckman 0:b9daf55d7586 208 int getClockTimeBase(void);
jonebuckman 0:b9daf55d7586 209
jonebuckman 0:b9daf55d7586 210 /**
jonebuckman 0:b9daf55d7586 211 * Set the least significant byte of comparator threshold high register.
jonebuckman 0:b9daf55d7586 212 *
jonebuckman 0:b9daf55d7586 213 * @param data data (0 - 255).
jonebuckman 0:b9daf55d7586 214 */
jonebuckman 0:b9daf55d7586 215 void setComparatorThresholdHighLSB(int data);
jonebuckman 0:b9daf55d7586 216
jonebuckman 0:b9daf55d7586 217 /**
jonebuckman 0:b9daf55d7586 218 * Get the least significant byte of comparator threshold high register.
jonebuckman 0:b9daf55d7586 219 *
jonebuckman 0:b9daf55d7586 220 * @return The register (0 - 255).
jonebuckman 0:b9daf55d7586 221 */
jonebuckman 0:b9daf55d7586 222 int getComparatorThresholdHighLSB(void);
jonebuckman 0:b9daf55d7586 223
jonebuckman 0:b9daf55d7586 224 /**
jonebuckman 0:b9daf55d7586 225 * Set the most significant byte of comparator threshold high register.
jonebuckman 0:b9daf55d7586 226 *
jonebuckman 0:b9daf55d7586 227 * @param data data (0 - 255).
jonebuckman 0:b9daf55d7586 228 */
jonebuckman 0:b9daf55d7586 229 void setComparatorThresholdHighMSB(int data);
jonebuckman 0:b9daf55d7586 230
jonebuckman 0:b9daf55d7586 231 /**
jonebuckman 0:b9daf55d7586 232 * Get the most significant byte of comparator threshold high register.
jonebuckman 0:b9daf55d7586 233 *
jonebuckman 0:b9daf55d7586 234 * @return The register (0 - 255).
jonebuckman 0:b9daf55d7586 235 */
jonebuckman 0:b9daf55d7586 236 int getComparatorThresholdHighMSB(void);
jonebuckman 0:b9daf55d7586 237
jonebuckman 0:b9daf55d7586 238 /**
jonebuckman 0:b9daf55d7586 239 * Set the least significant byte of comparator threshold low register.
jonebuckman 0:b9daf55d7586 240 *
jonebuckman 0:b9daf55d7586 241 * @param data data (0 - 255).
jonebuckman 0:b9daf55d7586 242 */
jonebuckman 0:b9daf55d7586 243 void setComparatorThresholdLowLSB(int data);
jonebuckman 0:b9daf55d7586 244
jonebuckman 0:b9daf55d7586 245 /**
jonebuckman 0:b9daf55d7586 246 * Get the least significant byte of comparator threshold low register.
jonebuckman 0:b9daf55d7586 247 *
jonebuckman 0:b9daf55d7586 248 * @return The register (0 - 255).
jonebuckman 0:b9daf55d7586 249 */
jonebuckman 0:b9daf55d7586 250 int getComparatorThresholdLowLSB(void);
jonebuckman 0:b9daf55d7586 251
jonebuckman 0:b9daf55d7586 252 /**
jonebuckman 0:b9daf55d7586 253 * Set the mode of the INTB pin.
jonebuckman 0:b9daf55d7586 254 *
jonebuckman 0:b9daf55d7586 255 * @param mode mode (0x00 - all modes disabled, 0x01 - wake up enable on INTB pin, 0x02 - INTB pin indicates status of comparator, 0x04 - DRDYB enable on INTB pin ).
jonebuckman 0:b9daf55d7586 256 */
jonebuckman 0:b9daf55d7586 257 void setINTBPin(int mode);
jonebuckman 0:b9daf55d7586 258
jonebuckman 0:b9daf55d7586 259 /**
jonebuckman 0:b9daf55d7586 260 * Get the mode of the INTB pin.
jonebuckman 0:b9daf55d7586 261 *
jonebuckman 0:b9daf55d7586 262 * @return The mode register (0x00 - all modes disabled, 0x01 - wake up enable on INTB pin, 0x02 - INTB pin indicates status of comparator, 0x04 - DRDYB enable on INTB pin ).
jonebuckman 0:b9daf55d7586 263 */
jonebuckman 0:b9daf55d7586 264 int getINTBPin(void);
jonebuckman 0:b9daf55d7586 265
jonebuckman 0:b9daf55d7586 266 /**
jonebuckman 0:b9daf55d7586 267 * Set the power mode configuraton.
jonebuckman 0:b9daf55d7586 268 *
jonebuckman 0:b9daf55d7586 269 * @param data power mode (0 - standby, 1 - active).
jonebuckman 0:b9daf55d7586 270 */
jonebuckman 0:b9daf55d7586 271 void setPower(int data);
jonebuckman 0:b9daf55d7586 272
jonebuckman 0:b9daf55d7586 273 /**
jonebuckman 0:b9daf55d7586 274 * Get the power mode configuration.
jonebuckman 0:b9daf55d7586 275 *
jonebuckman 0:b9daf55d7586 276 * @return The power mode (0 - standby, 1 - active).
jonebuckman 0:b9daf55d7586 277 */
jonebuckman 0:b9daf55d7586 278 int getPower(void);
jonebuckman 0:b9daf55d7586 279
jonebuckman 0:b9daf55d7586 280 /**
jonebuckman 0:b9daf55d7586 281 * Get the status.
jonebuckman 0:b9daf55d7586 282 *
jonebuckman 0:b9daf55d7586 283 * @return The status (0x10 - comparator, 0x20 - wake up, 0x40 - data ready, 0x80 - OSC status).
jonebuckman 0:b9daf55d7586 284 */
jonebuckman 0:b9daf55d7586 285 int getStatus(void);
jonebuckman 0:b9daf55d7586 286
jonebuckman 0:b9daf55d7586 287 /**
jonebuckman 0:b9daf55d7586 288 * Get the least significant byte of promiity data.
jonebuckman 0:b9daf55d7586 289 *
jonebuckman 0:b9daf55d7586 290 * @return The proximity data (0 - 255).
jonebuckman 0:b9daf55d7586 291 */
jonebuckman 0:b9daf55d7586 292 int getProximityDataLSB(void);
jonebuckman 0:b9daf55d7586 293
jonebuckman 0:b9daf55d7586 294 /**
jonebuckman 0:b9daf55d7586 295 * Get the most significant byte of promiity data.
jonebuckman 0:b9daf55d7586 296 *
jonebuckman 0:b9daf55d7586 297 * @return The proximity data (0 - 255).
jonebuckman 0:b9daf55d7586 298 */
jonebuckman 0:b9daf55d7586 299 int getProximityDataMSB(void);
jonebuckman 0:b9daf55d7586 300
jonebuckman 0:b9daf55d7586 301 /**
jonebuckman 0:b9daf55d7586 302 * Get the least significant byte of frequency counter data.
jonebuckman 0:b9daf55d7586 303 *
jonebuckman 0:b9daf55d7586 304 * @return The frequency counter data (0 - 255).
jonebuckman 0:b9daf55d7586 305 */
jonebuckman 0:b9daf55d7586 306 int getFrequencyCounterLSB(void);
jonebuckman 0:b9daf55d7586 307
jonebuckman 0:b9daf55d7586 308 /**
jonebuckman 0:b9daf55d7586 309 * Get the mid significant byte of frequency counter data.
jonebuckman 0:b9daf55d7586 310 *
jonebuckman 0:b9daf55d7586 311 * @return The frequency counter data (0 - 255).
jonebuckman 0:b9daf55d7586 312 */
jonebuckman 0:b9daf55d7586 313 int getFrequencyCounterMIDSB(void);
jonebuckman 0:b9daf55d7586 314
jonebuckman 0:b9daf55d7586 315 /**
jonebuckman 0:b9daf55d7586 316 * Get the most significant byte of frequency counter data.
jonebuckman 0:b9daf55d7586 317 *
jonebuckman 0:b9daf55d7586 318 * @return The frequency counter data (0 - 255).
jonebuckman 0:b9daf55d7586 319 */
jonebuckman 0:b9daf55d7586 320 int getFrequencyCounterMSB(void);
jonebuckman 0:b9daf55d7586 321
jonebuckman 0:b9daf55d7586 322 private:
jonebuckman 0:b9daf55d7586 323
jonebuckman 0:b9daf55d7586 324 /**
jonebuckman 0:b9daf55d7586 325 * Set the contents of an addressable register.
jonebuckman 0:b9daf55d7586 326 *
jonebuckman 0:b9daf55d7586 327 * @param regAddress address of the register
jonebuckman 0:b9daf55d7586 328 * @param regData data to write to the register
jonebuckman 0:b9daf55d7586 329 */
jonebuckman 0:b9daf55d7586 330 void setRegister(int regAddress, int regData);
jonebuckman 0:b9daf55d7586 331
jonebuckman 0:b9daf55d7586 332 /**
jonebuckman 0:b9daf55d7586 333 * Get the contents of an addressable register.
jonebuckman 0:b9daf55d7586 334 *
jonebuckman 0:b9daf55d7586 335 * @param regAddress address of the register
jonebuckman 0:b9daf55d7586 336 * @return The contents of the register
jonebuckman 0:b9daf55d7586 337 */
jonebuckman 0:b9daf55d7586 338 int getRegister(int regAddress);
jonebuckman 0:b9daf55d7586 339
jonebuckman 0:b9daf55d7586 340 SPI spi_;
jonebuckman 0:b9daf55d7586 341 DigitalOut nCS_;
jonebuckman 0:b9daf55d7586 342 InterruptIn nIRQ_;
jonebuckman 0:b9daf55d7586 343
jonebuckman 0:b9daf55d7586 344 int mode;
jonebuckman 0:b9daf55d7586 345
jonebuckman 0:b9daf55d7586 346 };
jonebuckman 0:b9daf55d7586 347
jonebuckman 0:b9daf55d7586 348 #endif /* __LDC1000_H__ */