Library for the MAX11300

Dependents:   MAX_IOT_KIT MAX_IOT_KIT

Fork of MAX11300 by Maxim Integrated

The MAX11300/01/11/12 are configurable mixed signal integrated circuits. The MAX11300/11 offer a SPI interface while the MAX11301/12 offer an I2C interface. The MAX11300/01 are 20 port devices while the MAX11311/12 are 12 port devices.

This library supports the family of parts by providing member functions that can manipulate the GPIO, ADC, DAC, and analog switches of the device, after it has been configured. For configuration of the device, this library requires a header file that can be generated by the MAX11300/01/11/12 Configuration Software. The configuration software can be found at the following link.

https://www.maximintegrated.com/en/products/analog/data-converters/analog-to-digital-converters/MAX11300.html/tb_tab2

Include the generated MAX113XXHex.h file into your project and update the #include in MAX113XX_Pixi.h.

Revision:
12:8054ee101bad
Parent:
10:6efe114ef882
Child:
13:546dd29b1c7a
--- a/MAX113XX_Pixi.h	Mon May 08 19:24:55 2017 +0000
+++ b/MAX113XX_Pixi.h	Tue May 09 19:04:38 2017 +0000
@@ -36,7 +36,7 @@
 
 
 #include "mbed.h"
-#include "MAX11301Hex.h"
+#include "MAX11300Hex.h"
 
 
 /**
@@ -138,11 +138,25 @@
     
     MAX113XX_Pixi(Device_e device, PinName cnvt);
     
-    ///@brief Writes gpo configured port with lsb of state
-    ///@param[in] port - gpo congigured port to be written
-    ///@param[in] state - lsb of state is written to port
-    ///@return Result of operation 
-    CmdResult_e gpioWrite(Ports_e port, const uint8_t state);
+    ///@brief Read single ended ADC configured port
+    ///@param[in] port - single ended ADC configured port
+    ///@param[out] data - contents of ADC data register
+    ///@return Result of operation
+    CmdResult_e singleEndedADCRead(Ports_e port, uint16_t &data);
+    
+    ///@brief Read differential ADC configured port
+    ///@param[in] posPort - positive port
+    ///@param[in] negPort - negative Port
+    ///@param[out] data - contents of ADC data register
+    ///@return Result of operation
+    CmdResult_e differentialADCRead(Ports_e posPort, Ports_e negPort, 
+                                    uint16_t &data);
+    
+    ///@brief Write DAC configured port
+    ///@param[in] port - DAC configured port
+    ///@param[in] data - value to be written to DAC data register
+    ///@return Result of operation
+    CmdResult_e dacWrite(Ports_e port, const uint16_t data);
     
     ///@brief Reads gpi configured port
     ///@param[in] port - gpi congigured port to be read
@@ -150,23 +164,23 @@
     ///@return Result of operation 
     CmdResult_e gpioRead(Ports_e port, uint8_t &state);
     
-    ///@brief Read single ended ADC configured port
-    ///@param[in] port - single ended ADC configured port
-    ///@param[out] data - contents of ADC data register
-    ///@return Result of operation
-    CmdResult_e singleEndedADCRead(Ports_e port, uint16_t &data);
+    ///@brief Writes gpo configured port with lsb of state
+    ///@param[in] port - gpo congigured port to be written
+    ///@param[in] state - lsb of state is written to port
+    ///@return Result of operation 
+    CmdResult_e gpioWrite(Ports_e port, const uint8_t state);
     
-    ///@brief Write single ended DAC configured port
-    ///@param[in] port - single ended DAC configured port
-    ///@param[in] data - value to be written to DAC data register
-    ///@return Result of operation
-    CmdResult_e singleEndedDACWrite(Ports_e port, const uint16_t data);
+    ///@brief Sets the state of a software controlled analog switch
+    ///@param[in] portA - One side of analog switch
+    ///@param[in] portB - The ther side of the analog switch
+    ///@param[in] state - True for closed, false for open
+    ///@return Result of operation 
+    CmdResult_e setAnalogSwitchState(Ports_e portA, Ports_e portB, bool state);
     
     ///@brief Dumps pixi memory to provided Serial object
     ///@param[in] ser - output device
-    ///@param[in] pixi - pixi device 
     ///@return None
-    void dumpPixiMemory(Serial &ser, MAX113XX_Pixi &pixi);
+    void dumpMemory(Serial &ser);
 
 protected: