LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-11-2018, 10:12 AM   #1
Jim232
Member
 
Registered: Apr 2018
Posts: 53

Rep: Reputation: Disabled
accessing ioctl - address shift ?


After device file is opened for read / write the
ioctl is accessed this way

ioctl(FileDescriptor, I2C_SLAVE, address);

The I2C spec calls for 8 bits format where the actual I2C device address could be shifted to MSByte and "write" bit of zero value thus becomes LSBit.

It is not clear if ioctl should be modified to follow the spec for write

ioctl(FileDescriptor, I2C_SLAVE, address << 1 );
 
Old 04-11-2018, 11:59 AM   #2
Jim232
Member
 
Registered: Apr 2018
Posts: 53

Original Poster
Rep: Reputation: Disabled
When I shift the address in ioctl call the subsequent write(...) will fail.
Not sure how, but it does answer this question.
 
  


Reply

Tags
ioctl



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 get IPv6 address using ioctl() SIOCGIFADDR ashok449 Linux - Networking 6 01-03-2012 11:39 PM
Assigning ipv6 address using ioctl madhurjf Linux - Networking 2 12-07-2011 08:40 PM
assign ipv6 address using ioctl manishtiwari_1987 Linux - Newbie 1 07-23-2011 05:41 PM
ioctl -> Bad address keros Programming 4 02-19-2009 02:51 AM
ioctl: LOOP_CLR_FD: No such device or address newbie2007 Linux - Newbie 1 01-27-2008 11:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:48 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