Quantcast
Channel: Intel Communities: Message List
Viewing all articles
Browse latest Browse all 18347

Re: I2C controllers

$
0
0

Turns out there's a hardcoded #define that points the I2C adapter to I2C6.

 

In hardware/arduino/edison/cores/arduino/i2c.c:

 

int i2c_getadapter(uint32_t i2c_bus_address)

{

        /* Single adapter supported for now.  */

#if 0

        char buf[MAX_BUF];

        DIR *d;

        struct dirent *dir;

        int adapter_nr = -1;

        snprintf(buf, sizeof(buf), "/sys/devices/ocp.2/%x.i2c",

                                                        i2c_bus_address);

        d = opendir(buf);

        if (d) {

                while ((dir = readdir(d)) != NULL) {

                        if (!strncmp("i2c", dir->d_name, 3)) {

                                sscanf(dir->d_name, "i2c-%d", &adapter_nr);

                                closedir(d);

                                return adapter_nr;

                        }

                }

                closedir(d);

        }

        return -1;

#endif

        return LINUX_I2C_ADAPTER;

}

Would be nice if the Edison version of Arduino supported both I2C buses, even if only I2C6 is broken out on the Arduino breakout board. Changing LINUX_I2C_ADAPTER to 1 worked for me to run a sample sketch on the Edison mini breakout adapter.


Viewing all articles
Browse latest Browse all 18347

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>