Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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.cpp
- Revision:
- 18:8ee1928ffe6c
- Parent:
- 17:658202c79f33
--- a/MAX113XX_Pixi.cpp Sat May 13 00:11:38 2017 +0000
+++ b/MAX113XX_Pixi.cpp Wed Sep 06 12:38:11 2017 -0700
@@ -378,7 +378,7 @@
float &data)
{
MAX113XX_Pixi::CmdResult_e result = MAX113XX_Pixi::OpFailure;
- int16_t temp;
+ int16_t temp = 0;
if(m_device == MAX11300 || m_device == MAX11301) //20 port device
{
@@ -587,7 +587,8 @@
const uint8_t num_reg)
{
uint16_t numBytes = ((num_reg * 2) + 1);
- char localData[numBytes];
+ //No variable length array
+ char localData[MAX113XX_Pixi::MAX_REGISTER_ADRS];
uint8_t idx(0), dataIdx(0);
localData[idx++] = reg;
@@ -598,15 +599,15 @@
}
while(idx < numBytes);
- m_i2cBus.write(m_w_adrs, localData, numBytes);
+ m_i2cBus.write(m_w_adrs, localData, numBytes);
}
//*********************************************************************
void MAX113XX_I2C::blockRead(uint8_t reg, uint16_t *data, const uint8_t num_reg)
{
uint16_t numBytes = (num_reg * 2);
- char localData[numBytes];
-
+ //No variable length array
+ char localData[MAX113XX_Pixi::MAX_REGISTER_ADRS];
localData[0] = reg;
if(m_i2cBus.write(m_w_adrs, localData, 1, true) == 0)
