Lines Matching +full:spi +full:- +full:device
2 SPI userspace API
5 SPI devices have a limited userspace API, supporting basic half-duplex
6 read() and write() access to SPI slave devices. Using ioctl() requests,
7 full duplex transfers and device I/O configuration are also available.
15 #include <linux/spi/spidev.h>
19 * Prototyping in an environment that's not crash-prone; stray pointers
23 as SPI slaves, which you may need to change quite often.
30 DEVICE CREATION, DRIVER BINDING
33 spi_board_info for a device as the driver it should use: the "modalias"
35 Set up the other device characteristics (bits per word, SPI clocking,
42 When you do that, the sysfs node for the SPI device will include a child
43 device node with a "dev" attribute that will be understood by udev or mdev.
45 busybox; it's less featureful, but often enough.) For a SPI device with
49 character special device, major number 153 with
50 a dynamically chosen minor device number. This is the node
54 as usual, the SPI device node will
55 be a child of its SPI master controller.
59 binds to that device. (Directory or symlink, based on whether
62 Do not try to manage the /dev character device special file nodes by hand.
66 If you unbind the "spidev" driver from that device, those two "spidev" nodes
70 by having kernel code remove the SPI device, probably by removing the driver
71 for its SPI controller (so its spi_master vanishes).
73 Since this is a standard Linux device driver -- even though it just happens
74 to expose a low level API to userspace -- it can be associated with any number
76 SPI device, and you'll get a /dev device node for each device.
79 BASIC CHARACTER DEVICE API
84 Standard read() and write() operations are obviously only half-duplex, and
85 the chipselect is deactivated between those operations. Full-duplex access,
86 and composite operation without chipselect de-activation, is available using
89 Several ioctl() requests let your driver read or override the device's current
94 return (RD) or assign (WR) the SPI transfer mode. Use the constants
98 Note that this request is limited to SPI mode flags that fit in a
103 which will return (RD) or assign (WR) the full SPI transfer mode,
109 transfer SPI words. Zero indicates MSB-first; other values indicate
110 the less common LSB-first encoding. In both cases the specified value
111 is right-justified in each word, so that unused (TX) or undefined (RX)
117 each SPI transfer word. The value zero signifies eight bits.
121 u32 which will return (RD) or assign (WR) the maximum SPI transfer
127 - At this time there is no async I/O support; everything is purely
130 - There's currently no way to report the actual bit rate used to
131 shift data to/from a given device.
133 - From userspace, you can't currently change the chip select polarity;
134 that could corrupt transfers to other devices sharing the SPI bus.
135 Each SPI device is deselected when it's not in active use, allowing
138 - There's a limit on the number of bytes each I/O request can transfer
139 to the SPI device. It defaults to one page, but that can be changed
142 - Because SPI has no low-level transfer acknowledgement, you usually
143 won't see any I/O errors when talking to a non-existent device.
146 FULL DUPLEX CHARACTER DEVICE API
155 The example shows one half-duplex RPC-style request and response message.