Justin Rodenburg / Mbed 2 deprecated TCTF_Control_Main

Dependencies:   MODSERIAL mbed

Fork of TCTF_Control_Main by Rivian Irvine Team

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers LTC2487.h Source File

LTC2487.h

00001 #include "mbed.h"
00002  
00003 class LTC2487 {
00004 public:
00005 
00006     /** Constructor
00007      *
00008      * @param sda I2C sda pin
00009      * @param scl I2C scl pin
00010      * @param address The hardware address of the LTC2487. This is the 3-bit
00011      * value that is physically set via A0, A1, and A2.
00012      * @param freq The I2C frequency.
00013      */
00014      
00015      LTC2487(PinName sda, PinName scl, uint8_t address, int freq);
00016      
00017     
00018     /** Write to LTC chip to select port to read from
00019      *
00020      * This function is used select the LTC2487 channel we would like to read from
00021      *
00022      * @param channel The channel we would like to read from
00023      */
00024      
00025      float writePort(int channel);
00026      
00027      /** Read value from LTC2487
00028      *
00029      * This function is used to read data from LTC2487 from channel selected in writePort()
00030      *
00031      * @param N/A
00032      */
00033      
00034      float read();
00035      
00036      /** Sets I2C address
00037      *
00038      * This function is used to set the I2C address
00039      *
00040      * @param address The I2C address
00041      */
00042      
00043      void setAddress(int address);
00044 
00045   
00046 private:
00047     I2C i2c;
00048     uint8_t addrI2C; 
00049     
00050 };
00051