Library for the MAX11300
Dependents: MAX_IOT_KIT MAX_IOT_KIT
Fork of MAX11300 by
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.
Include the generated MAX113XXHex.h file into your project and update the #include in MAX113XX_Pixi.h.
Diff: MAX113XX_Pixi.h
- Revision:
- 14:cc5349db13a3
- Parent:
- 13:546dd29b1c7a
- Child:
- 17:658202c79f33
--- a/MAX113XX_Pixi.h Tue May 09 22:06:19 2017 +0000 +++ b/MAX113XX_Pixi.h Tue May 09 22:26:16 2017 +0000 @@ -65,16 +65,20 @@ ///Pixi devices enum Device_e { + ///20 Port SPI MAX11300 = 0, + ///20 Port I2C MAX11301, + ///12 Port SPI MAX11311, + ///12 Port I2C MAX11312 }; ///MAX113XX Ports enum Ports_e { - PORT0, + PORT0 = 0, PORT1, PORT2, PORT3, @@ -100,7 +104,7 @@ enum PortModes_e { ///HIGH_Z - MODE_0, + MODE_0 = 0, ///Digital input with programmable threshold, GPI MODE_1, ///Bidirectional level translator terminal @@ -127,11 +131,42 @@ MODE_12 }; + ///ADC Conversion Modes + enum ADCConversionModes_e + { + ///The ADC does not perform any conversion + Idle = 0, + ///The ADC sweeps through all ADC converted ports once on cnvt + SingleSweep, + ///The ADC does a single conversion for the current port in the sequence + ///of ADC configured ports. Must keep track of which port was last and + ///how many ADC configured ports + SingleConversion, + ///ADC continuously sweeps through configured ports, cnvt isn't used + ContinuousSweep + }; + + ///DAC operational modes + enum DACModes_e + { + ///DAC configured ports are updated sequentially + SequentialUpdate = 0, + ///DAC with new data is updated, then DAC returns to sequence + ImmediateUpdate, + ///All DAC configured ports use the data in DACPRSTDAT1 + SameData1, + ///All DAC configured ports use the data in DACPRSTDAT2 + SameData2 + }; + ///Temperature sensors enum TempSensor_e { - Internal, + ///Internal Die Temp + Internal = 0, + ///Diode connected Q1 External1, + ///Diode connected Q2 External2 }; @@ -139,20 +174,22 @@ enum CmdResult_e { ///Failed operation - OpFailure, + OpFailure = 0, ///Successful operation Success }; MAX113XX_Pixi(Device_e device, PinName cnvt=NC); - ///@brief Read single ended ADC configured port + ///@brief Read single ended ADC configured port.\n + ///Library supports single sweep, or continuous sweep ADC modes only ///@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 + ///@brief Read differential ADC configured port\n + ///Library supports single sweep, or continuous sweep ADC modes only ///@param[in] posPort - positive port ///@param[out] data - contents of positive port ADC data register ///@return Result of operation @@ -164,7 +201,8 @@ ///@return Result of operation CmdResult_e dacWrite(Ports_e port, const uint16_t data); - ///@brief Write DAC configured port and read ADC for port + ///@brief Write DAC configured port and read ADC for port\n + ///Library supports single sweep, or continuous sweep ADC modes only ///@param[in] port - DAC w/ADC Monitor configured port ///@param[in] data - value to be written to DAC data register ///@param[out] adcData - value read from adc