i2c

Windows IoT and DS3231 RTC clock

与世无争的帅哥 提交于 2019-12-10 09:48:48
问题 For my project I need the current time & date. Unfortunately the RP2 loses everything when it's turned off. The next thing is, that I won't have an internet connection to use NTP. For this reasing I need to implement a DS3231 RTC module. The communication of all devices runs over I2C (Raspberry <-> Arduino <-> DS3231). At the moment my Arduino communicates with the module and stores the date and time in char-arrays. The RP2 communicates with the Arduino to get the date/time. That actually

How to write multiple slave i2c client device driver?

一笑奈何 提交于 2019-12-10 02:04:16
问题 I am trying to develop a driver for an embedded board. The driver is supposed to open up an interface for v4l2 and communicate with 2 devices using i2c . the driver will act as a master. I can't seem to understand how i2c_device_id array and i2c_add_driver functions work. I read documentation in kernel source but it won't help me on multiple slave clients. Do I have to have two seperate probe functions? Do i have to call i2c_add_driver two times? If not how am I going to be able to save two

Does i2c driver need to be implemented just like any other character device driver?

不问归期 提交于 2019-12-09 07:16:16
问题 I'm a noob to Linux device drivers so please bear with me. I'm trying to implement a i2c driver (client). It's at the point where I can insmod , .probe gets called (because of device-tree entries) and in the .probe I can read/write to the device. Great. However I need to be able to initiate read/writes from userspace to the driver. In order to do this, should an i2c driver be shaped like any other char device driver? Meaning having a file_operations struct so userspace can open , close , read

Connecting I2C Device to Labview using NI-845x

混江龙づ霸主 提交于 2019-12-08 08:23:11
问题 I'm trying to connect a mass flow sensor, SFM-3000 by sensorion, to labview on PC using USB device, NI-8452, which provide I2C interface. I followed the user manual of the sensor and used I2C example by labview but I cannot establish communication between them I get the error message: Error -301744 occurred at NI-845x I2C Run Script.vi:6110001, Possible reason(s): NI-845x: The I2C master lost arbitration and failed to seize the bus during transmission of an address+direction byte. I'm using

MCP23017 I2C Device driver probe function is not called

ε祈祈猫儿з 提交于 2019-12-08 02:58:18
问题 I am using the following I2C/GPIO Device driver to access the MCP23017 GPIOs. With the insmod command I am able to load the driver and its listed in /proc/modules. I have two MCP23017 chips connected to my Raspberry Pi. Both are detected at addresses 0x20 and 0x21 . The initcall to the driver registers the driver. I checked this by printing out a message. But the driver probe function is not called. The devices are not opened/ cannot be located elsewhere. How is the probe function called?

SMBUS on the RPI gives IOError: [Errno 121] Remote I/O error

与世无争的帅哥 提交于 2019-12-08 00:31:27
问题 I have tried communication between RPi3 and stm32 over I2C. First of all I have installed i2c-tools and python-smbus. All in All I have used python script on the RPI as below: import smbus bus = smbus.SMBus(1) address = 0x0A data = [1,2,3,4,5,6,7,8] bus.write_i2c_block_data(address, 0, data) When I run script, I can see following error: IOError: [Errno 121] Remote I/O error STM32 is configured as I2C slave, both device are connected correctly(SDA, SCL and GND). How do I know that? I have made

STM32F207 I2C test failing

邮差的信 提交于 2019-12-07 12:56:38
问题 I am learning embedded development on the STM3220G-EVAL board with the STM32F207 microcontroller. I have tried to test the I2C interface by interfacing the two I2C2 and I2C3 modules on the same chip and sending/receiving a character. Here is the code I have currently written (using mdk-arm 5): #include <stm32f2xx.h> volatile uint8_t data = 'a', recv = 'x'; void i2c_init(void); void I2C2_EV_IRQHandler(void) { volatile uint16_t stat, dummy; stat = I2C2->SR1; switch(stat) { // SB set; read SR1

Why are i2c_smbus function not available? (I2C – Embedded Linux)

廉价感情. 提交于 2019-12-06 22:41:37
问题 There are many references to using i2c_smbus_ functions when developing embedded Linux software to communicate on the I2C bus. When i2c_smbus functions such as i2c_smbus_read_word_data are referenced in software project for ARM8 processor errors such as ‘ i2c_smbus_read_word_data’ was not declared in this scope are generated at compile. Investigation of the following header files indicate the absence of most i2c_smbus function definition. /usr/arm-linux-gnueabi/include/linux/i2c.h /usr/arm

i2c probe not being called…not sure where to call i2c_register_board_info

半腔热情 提交于 2019-12-06 14:05:28
问题 I have an Intel systems. I am trying to load at24.ko and i2c-mux-pca9541.ko. both modules have probe functions which are not being called. according to the Documentation, i need to call i2c_registetr_board_info in the arch_init. but I am not sure where to do that for the Intel system (ie which files). I do not see any examples anywhere on the internet. can someone provide a pointer to the file that i add this call. if this is not the right approach, please let me know. thank you in advance.

SMBUS on the RPI gives IOError: [Errno 121] Remote I/O error

前提是你 提交于 2019-12-06 10:55:45
I have tried communication between RPi3 and stm32 over I2C. First of all I have installed i2c-tools and python-smbus. All in All I have used python script on the RPI as below: import smbus bus = smbus.SMBus(1) address = 0x0A data = [1,2,3,4,5,6,7,8] bus.write_i2c_block_data(address, 0, data) When I run script, I can see following error: IOError: [Errno 121] Remote I/O error STM32 is configured as I2C slave, both device are connected correctly(SDA, SCL and GND). How do I know that? I have made program using BCM2835 library. C program worked correctly. C program sent buffer without any errors.