Justin Rodenburg / Mbed 2 deprecated TCTF_Control_Main

Dependencies:   MODSERIAL mbed

Fork of TCTF_Control_Main by Rivian Irvine Team

Committer:
jrodenburg
Date:
Fri Jun 15 00:50:47 2018 +0000
Revision:
17:5098d8fbb298
Parent:
0:a28a1035c31b
Updated the LTC2487 library to write all the addresses for a row, wait for next clock cycle of chip (15Hz), and read all the channels. This significantly sped up the thermocouple read time. Both the LTC2487 library and the read functions were changed

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jrodenburg 0:a28a1035c31b 1 #include "mbed.h"
jrodenburg 0:a28a1035c31b 2
jrodenburg 0:a28a1035c31b 3 class LTC2487 {
jrodenburg 0:a28a1035c31b 4 public:
jrodenburg 0:a28a1035c31b 5
jrodenburg 0:a28a1035c31b 6 /** Constructor
jrodenburg 0:a28a1035c31b 7 *
jrodenburg 0:a28a1035c31b 8 * @param sda I2C sda pin
jrodenburg 0:a28a1035c31b 9 * @param scl I2C scl pin
jrodenburg 0:a28a1035c31b 10 * @param address The hardware address of the LTC2487. This is the 3-bit
jrodenburg 0:a28a1035c31b 11 * value that is physically set via A0, A1, and A2.
jrodenburg 0:a28a1035c31b 12 * @param freq The I2C frequency.
jrodenburg 0:a28a1035c31b 13 */
jrodenburg 0:a28a1035c31b 14
jrodenburg 0:a28a1035c31b 15 LTC2487(PinName sda, PinName scl, uint8_t address, int freq);
jrodenburg 0:a28a1035c31b 16
jrodenburg 0:a28a1035c31b 17
jrodenburg 17:5098d8fbb298 18 /** Write to LTC chip to select port to read from
jrodenburg 0:a28a1035c31b 19 *
jrodenburg 17:5098d8fbb298 20 * This function is used select the LTC2487 channel we would like to read from
jrodenburg 0:a28a1035c31b 21 *
jrodenburg 17:5098d8fbb298 22 * @param channel The channel we would like to read from
jrodenburg 0:a28a1035c31b 23 */
jrodenburg 0:a28a1035c31b 24
jrodenburg 17:5098d8fbb298 25 float writePort(int channel);
jrodenburg 17:5098d8fbb298 26
jrodenburg 17:5098d8fbb298 27 /** Read value from LTC2487
jrodenburg 17:5098d8fbb298 28 *
jrodenburg 17:5098d8fbb298 29 * This function is used to read data from LTC2487 from channel selected in writePort()
jrodenburg 17:5098d8fbb298 30 *
jrodenburg 17:5098d8fbb298 31 * @param N/A
jrodenburg 17:5098d8fbb298 32 */
jrodenburg 17:5098d8fbb298 33
jrodenburg 17:5098d8fbb298 34 float read();
jrodenburg 0:a28a1035c31b 35
jrodenburg 0:a28a1035c31b 36 /** Sets I2C address
jrodenburg 0:a28a1035c31b 37 *
jrodenburg 0:a28a1035c31b 38 * This function is used to set the I2C address
jrodenburg 0:a28a1035c31b 39 *
jrodenburg 0:a28a1035c31b 40 * @param address The I2C address
jrodenburg 0:a28a1035c31b 41 */
jrodenburg 0:a28a1035c31b 42
jrodenburg 0:a28a1035c31b 43 void setAddress(int address);
jrodenburg 0:a28a1035c31b 44
jrodenburg 0:a28a1035c31b 45
jrodenburg 0:a28a1035c31b 46 private:
jrodenburg 0:a28a1035c31b 47 I2C i2c;
jrodenburg 0:a28a1035c31b 48 uint8_t addrI2C;
jrodenburg 0:a28a1035c31b 49
jrodenburg 0:a28a1035c31b 50 };
jrodenburg 0:a28a1035c31b 51