i2c

Linux, ARM: Why is gpiochip<num> only created if I2C GPIO Expander is present at boot?

淺唱寂寞╮ 提交于 2019-12-23 15:50:38
问题 Using Linux 3.14.52 on a imx6sx hardware platform (NXP embedded ARM). The problem is that PCF8575 I2C GPIO expanders specified in the device tree are not instantiated as devices in the /sys/class/gpio structure unless they are present during kernel boot. The devices are listed in the /sys/bus/i2c/devices/i2c-1 (i2c bus 1) structures but are not given gpiochip 's in the /sys/class/gpio structure. Is there a way to have these devices assigned as gpiochip after boot once they are added to the

Is there a general I2C command to see if a device is still present on the bus?

半城伤御伤魂 提交于 2019-12-23 10:09:16
问题 Is there a general I2C command to see if a device is still present on the bus after it is initialized once? For example an OLED display. The reason I ask this is to avoid the main program will freeze (when a device is disconnected) because of infinite loops present in the library code, in for example, the Wire library. At startup of the MCU I want to check if a device is available or not, and initialize it when it is available. I do this with this function and works fine ..... bool MyClass:

I2C write acknowledge polling in Linux Kernel

允我心安 提交于 2019-12-23 08:44:53
问题 The lackluster response here made me wonder this. I've been saddled with a device (Analog Devices 525x) that (from the data sheet, pg 16): disables the I2C interface during the internal [EEPROM] write cycle. That doesn't seem fair, as in " I'm getting off the couch now, so don't use it for a while because I let one rip in the seat cushion ". Honestly, why should that be my problem? Anyway, the data sheet suggests that acknowledge polling is the answer - enter the Linux kernel... does the

Why am I only receiving the first address byte? (I2C Protocol)

白昼怎懂夜的黑 提交于 2019-12-20 03:52:43
问题 Expecting the slave to ACKnowledge and return data, but it does not. This is my protocol. This is my Datasheet The datasheet mentions "The slave will answer by sending bytes with MSB first. Byte0 and byte1 contain the prediction value. All bytes are acknowledged by the master." Edit: Source Library Also FYI I'm on an Arduino Fio but I am not inheriting the Arduino library. #include <avr/io.h> #include <util/delay.h> #include <stdlib.h> #include <uart.h> #include <i2c_master.h> #define LED PB5

How to emulate an i2c device on QEMU x86?

半腔热情 提交于 2019-12-20 03:50:31
问题 I am work on QEMU 1.5/1.6, but haven't seen any docs for adding an device on i2c bus. Can any one help? Thanks! 回答1: OK, nobody interested in this issue. I post my own solution. Cause QEMU does not support I2C bus level data transfer, it has delay when transfer multi-touch data from QEMU to guest Linux. So we create a shared memory on guest Linux kernel driver, and QEMU transfers the data directly through the shared memory, and it has a good speed. 来源: https://stackoverflow.com/questions

TIva C Series problems with I2C Interface

喜欢而已 提交于 2019-12-13 19:15:00
问题 I'm currently trying to interface my Tiva C Series with a Sparkfun Breakout Board, IMU Digital Combo Board - 6 Degrees of Freedom ITG3200/ADXL345 and I'm having trouble with the I2C interface. currently this is my code: #include <stdint.h> #include <stdbool.h> #include "inc/hw_memmap.h" #include "inc/hw_types.h" #include "driverlib/sysctl.h" #include "driverlib/gpio.h" #include "driverlib/i2c.h" uint8_t SLAVE_ADDRESS = 0x68; uint32_t first_byte, second_byte, temperature, result; void i2c

Configure Linux I2C Speed

让人想犯罪 __ 提交于 2019-12-13 15:37:25
问题 I am using I2C on the Snowball board, running at 400KHz by default and would like to reduce this to 100KHz. I use the api defined in and configure as follows m_fd = open(m_filename.c_str(), O_RDWR); if (ioctl(m_fd, I2C_SLAVE_FORCE, m_addr) < 0) { throw I2cError(DeviceConfigFail); } Does anyone know how I would go about changing the speed to standard mode. Thanks 回答1: You can change the I2C SCL frequency in your driver's 'struct i2c_gpio_platform_data'. static struct i2c_gpio_platform_data xyz

Building a i2c device controller

心不动则不痛 提交于 2019-12-13 14:45:25
问题 I am building a PCB that will communicate via a i2c bus with a UDOO x86 running ubuntu 18.04 with two accesible i2c buses and multiple GPIO the device has 3 i2c chips on it i2c-mux-pca954x PCA9543 - level shifting bus switch SC18IS602B - i2c to SPI Bus master SC16IS741A - i2c to uart each of which has a kernel driver module(i2c-mux-pca954x,spi-sc18is602,sc16is7xx) both the SC18IS602B and SC16IS741A are connected to one channel of the PCA9543 and corresponding interrupt. the second channel for

i2c set clock freq. Radxa rock pro

雨燕双飞 提交于 2019-12-13 08:24:56
问题 I am trying to change the clock freq. to 400 kHz (fastmode) but I cant find the file. The problem is, that read(file,buf,1) takes 0.3 ms read(file,buf,count) count > 1 returns the same buf[i] for i < count. It's the buf[0] value I would get if I would use read(file,buf,1). I think that's caused by the sensor as it wants the first bit of SUB to be 1 what the kernel doesnt provide. The oszy. says, f = 88kHz, it shows 18 peaks for one "duration" and the delay between two "durations" is 0.2 to 0

Johnny-Five, I2C, Controlling multiple temperature sensors using ESP8266

血红的双手。 提交于 2019-12-13 05:23:54
问题 I'm trying figure out how to control multiple temperature sensors. THE SETUP: 2 ESP8266 Micro Controllers 2 MCP9808 Temperature Sensors 1 Machine controlling both ESPs using Johnny-Five. NOTE: Each ESP8266 micro controller handles one MCP9808 Temperature Sensor. THE GOAL: The central machine (MacOS running Johnny-Five) handles both microcontrollers under one Node JS script. THE PROBLEM: I can control one Micro Controller / Temperature pairing, but not both under the same script. Apparently