Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.


  Search this Thread
Old 07-28-2014, 05:33 PM   #1
Registered: Sep 2007
Posts: 293

Rep: Reputation: 23
Sending I2C msg from SMBus to MCU


I'm running vanilla 3.2.38 on Intel's ATOM.
After running sensors-detect I have /dev/i2c-0

One of the slave devices connected to the BUS is TI's microcontroller (MSP430F5529) that waits for I2C message.

It's slave address is 0x43.

I opened the controller with:

        int Handle = open ("/dev/i2c-0",O_RDWR);
	if (Handle < 0)
		printf ("Failed to open smbus\n");
		return -1;
Now I have to write a 16 bytes message to the slave.

How can I tell the kernel to write to slave address 0x43 ?

The message can be longer than 32 bytes.

should I use:
BytesWritten = write(Handle, WriteBuffer, sizeof(WriteBuffer));


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to forward IOCTL's from i2c-dev.c to adapter driver (i2c-rt3352.c) Linux - Kernel 2 08-23-2011 03:03 AM
Sending msg with smtp consty Linux - Networking 2 05-07-2006 01:11 PM
sending msg through linux theep Linux - Software 1 02-09-2006 03:22 AM
slooze error: validateInputs(); $msg = $mySlooze->renderPage($vars); echo $msg; ?> rioguia Linux - Software 0 01-26-2003 09:59 PM > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 01:47 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration