LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 04-29-2018, 11:53 AM   #1
Jim232
Member
 
Registered: Apr 2018
Posts: 53

Rep: Reputation: Disabled
Using ioctl SPI_IOC_MESSAGE function


Is there documentation / source code explaining how this ioctl "parameter" actually works?
For example - the return positive value indicates number of "characters" processed - transmitted or received?
Does the "function" sends true 4 wire SPI data ( chip select , clock mosi miso ?)

Can it work with interface requiring usage of "register / command" selection?
For example popular "chip " ILI9341 does not truly support standard 4 wire SPI protocol - it requires usage of "C/D".
 
Old 04-30-2018, 06:11 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,156

Rep: Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266
All ioctls are driver-specific. Check the device documentation or the driver source code.
 
Old 04-30-2018, 07:31 AM   #3
Jim232
Member
 
Registered: Apr 2018
Posts: 53

Original Poster
Rep: Reputation: Disabled
That is part of my confusion - ioctl is "native kernel module" , driver is something external , build specifically as hardware interface, usually.
I am using ioctl(*spi_cs_fd, SPI_IOC_MESSAGE(length), &spi); to transfer data to a device which requires selection of command or data "mode".

BTW ioctl works fine interfacing with I2C protocol.

The ioctl SPI function I am using does not provide for switching of C/D signal.
I have choices - the crude one - switch the C/D to proper mode BEFORE using the ioctl, or hard one - analyse the SPI_IOC_MESSAGE macro together with the transfer struct it uses to add switching C/D.

And yes, the ioctl(*spi_cs_fd, SPI_IOC_MESSAGE(length), &spi); "talks" standard SPI , the ILI9341 does not.
 
Old 05-02-2018, 11:20 AM   #4
Jim232
Member
 
Registered: Apr 2018
Posts: 53

Original Poster
Rep: Reputation: Disabled
Would anybody be interested in discussion about SPI_IOC_MESSAGE in detail?
I can "trace" few steps from the initial macro, but still cannot get to actual implementation.
For example - how does ioctl interacts with Raspberry Pi as far as setting SPI pins to input / output?
 
  


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
Server socket with SSL Issue in ioctl function srinietrx Programming 7 03-13-2018 07:36 AM
IOCTL function call to access the Secure Digital(SD) cards ranju* Programming 0 06-13-2009 01:04 AM
is the function ioctl ok for I_SENDFD wangjinyi Fedora 0 11-29-2005 03:02 AM
ioctl function maldini1010 Linux - Software 0 01-02-2005 06:28 PM
how to mute the mic by ioctl function derekzxcv Programming 0 07-12-2004 06:26 AM

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

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