LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 07-28-2014, 04:33 PM   #1
zvivered
Member
 
Registered: Sep 2007
Posts: 294

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


Hello,

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:

Code:
        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:
Code:
BytesWritten = write(Handle, WriteBuffer, sizeof(WriteBuffer));
Thanks,
Zvika
 
  


Reply



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) elonica.pl Linux - Kernel 2 08-23-2011 02:03 AM
Sending msg with smtp consty Linux - Networking 2 05-07-2006 12:11 PM
sending msg through linux theep Linux - Software 1 02-09-2006 02:22 AM
slooze error: validateInputs(); $msg = $mySlooze->renderPage($vars); echo $msg; ?> rioguia Linux - Software 0 01-26-2003 08:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 06:49 AM.

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