As an alternate to the MRAA library you could use I2Ctools, you can get it if you type the following on your Edison:
opkg install http://repo.opkg.net/edison/repo/core2-32/i2c-tools_3.1.0-r0_core2-32.ipk
Also you might find this thread useful:
In it they suggest this git: edouardrosset/i2c-tools · GitHub, I believe it might also be helpful for you.
I wound up pulling the source of i2c-tools from github and building it. There were a couple of tweaks necessary to get it built and then to be able to import the library. I will share them for posterity:
-You must start by building i2c-tools before building the python module. It states in the README that you should be able to run the command 'make EXTRA="py-smbus"', but this fails. Instead, ran 'make' followed by 'make install', and then cd'ed into py-smbus and ran 'python setup.py build' and 'python setup.py install'.
-Once the module built successfully, could not just import smbus (results in ImportError: libi2c.so.0: cannot open shared...). I use bash as my shell, so in ~/.bashrc, include the line 'export LD_LIBRARY_PATH=/usr/local/lib'. This fixes it.
However, in looking through the code, it looks like everything is still hard-coded for a byte-wide command, as opposed to a 2-byte command. Am I mistaken? If not, it's easy enough to add code for longer command sequences.
I'm not sure I understand your question, if you want to read a 16bit you can use readWordReg for example. AFAIK all command bytes are 8bit but sometimes people shortand them and want the next one, that's why we have the read(2) which will do a read of two commands one after the other. You have to give your address in 7bit format not 8bit, mraa will do the flipping read/write of the LSB for you.
Thank you for responding. In reading the mraa documentation, I don't think that readWordReg applies, unless I'm missing something. The registers on the hardware that I'm trying to communicate with have commands that are 16 bits wide and data that is 8 bits wide. If I'm reading the documentation for readWordReg correctly, it sounds like to me that the command space is 8 bits, and the data coming back is 16 bits wide. Am I correct, or does readWordReg actually do what I'm looking for?
Ok, I figured out what my problem was. It wasn't with the mraa library, it was how I was using the Python bytearray function. arfoll, you are correct in everything that you said. For a device that uses a 16-bit command (like the one that I'm interfacing with), I'm able to treat it as if I'm writing a byte (the LSBs of the 16-bit command byte) to a command register (the MSBs of the 16-bit command byte).
Thank you for your help!