Is it possible to control the data/clock pins of i2c for bitbanging with /dev/i2c-%d? if no, What other options are available for controling those pins of i2c that are connected to the machine? I've tried SMBus but according to SMBus Protocol Summary:
plain I2C commands can not behandled at all on most pure SMBus
adapters
Related
I need to have i2c slave Linux kernel driver for TI AM335x.
I googled about and didn't find precise information.
Should I do everything from scratch, or maybe someone has some reference about it? or even a patch
Thanks
Avner
For new device which connected as slave to i2c bus, you should write neither "i2c driver" nor "driver for AM335x" (as far as the processor support already present in kernel).
i2c is a bus and there is kernel infrastructure for the bus, see documentation.
You should figure out what type your device is and then write driver for this type of device using i2c bus primitives.
For example, the driver for DS13xx and compatible IC is rtc driver.
A driver "for" PCF8574 i2c gpio expander can be GPIO driver as well as keypad driver.
I was using bluetooth device on UART interface, but for some reason, we changed BT device to USB interface. we used hciattach command:
./hciattach /dev/ttyS1 any 115200 flow
for BT device over UART.
Now we changed to USB interface. I searched in intern and found
./hciattach /dev/ttyUSB1 any 115200 flow
for BT device attach.
We don't want to use UART device, is there any way I can use directly USB devices instead of using USB device as ttyUSB.
Thanks.
I found for USB BT device case, i don't need to attach the device, as i used to do it in UART devices case (./hciattach /dev/ttyS1 any 115200).
hciconfig identifies, device without hciattach. we just need to do "./hciconfig up" to make BT device run.
Thanks.
I want to write i2c device driver for i2c sensor, I'm totally confusing with
what is:
i2c client driver
what is i2c host driver
what is i2c adapter driver
what is algorithm driver
how char driver access i2c device information
Get some information regarding for I2C Here. And This Documentation may help you to program it.
I have a program which uses data from serial port and the hardware has only I2C / SPI interfaces free. The program is run on Linux. Is it possible to create a virtual I2C/SPI - UART port ? (like the virtual USB - UART port.)
Situation 1:
I have an i2c chip driver as part of linux kernel. I can verify the i2c chip driver is in the kernel from kernel boot messages (my chip driver is mma8450)
dmesg:
mma8450 0-001c: uevent
I can also see this driver in (0x1c is i2c address of chip)
cat /sys/bus/i2c/devices/0-001c/name
mma8450
I can not see this driver node in /dev interface. My question is how can I create node of this device in /dev so that I can access this device in a user program ?
Situation 2:
I create the module of the same chip driver and does not make it a part of kernel. I can load this module using insmod mma8450, how can I create a node of this device as I don't have its major / minor numbers ? (I can not see major & minor numbers assigned to this driver in mma8450 source code)
Any help is appreciated
Regards
Load the kernel module:
modprobe i2c-dev
ls /dev/i2*
/dev/i2c-0
/dev/i2c-10
/dev/i2c-12
/dev/i2c-14
/dev/i2c-3
/dev/i2c-5
/dev/i2c-7
/dev/i2c-9
/dev/i2c-1
/dev/i2c-11
/dev/i2c-13
/dev/i2c-2
/dev/i2c-4
/dev/i2c-6
/dev/i2c-8
Find the major/minor numbers for your device:
cat /proc/devices
You should see a device for the i2c bus and one for the i2c device itself.
Create the device node for the i2c device driver:
mknod /dev/[device name] [type] [major] [minor]
This is 3-Axis Accelerometer. Linux registers it as a driver for input_polled_dev type.
You can uaccess it using /dev/i2c-x bus (controller) device node, but there is no much sense using it that way directly from userspace.
I2C clients are not meant to be used using /dev device nodes.
They should be registered to Kernel I2C framework and used through higher layers API.
There is sample program for reading similar MMA7455L x,y,z registers from userspace using /dev/i2c-X bus device node.
Reading the Accelerometer With I²C