• Home
  • Raw
  • Download

Lines Matching +full:spi +full:- +full:device

1 SPI devices have a limited userspace API, supporting basic half-duplex
2 read() and write() access to SPI slave devices. Using ioctl() requests,
3 full duplex transfers and device I/O configuration are also available.
9 #include <linux/spi/spidev.h>
13 * Prototyping in an environment that's not crash-prone; stray pointers
17 as SPI slaves, which you may need to change quite often.
24 DEVICE CREATION, DRIVER BINDING
27 spi_board_info for a device as the driver it should use: the "modalias"
29 Set up the other device characteristics (bits per word, SPI clocking,
36 When you do that, the sysfs node for the SPI device will include a child
37 device node with a "dev" attribute that will be understood by udev or mdev.
39 busybox; it's less featureful, but often enough.) For a SPI device with
42 /dev/spidevB.C ... character special device, major number 153 with
43 a dynamically chosen minor device number. This is the node
46 /sys/devices/.../spiB.C ... as usual, the SPI device node will
47 be a child of its SPI master controller.
50 binds to that device. (Directory or symlink, based on whether
53 Do not try to manage the /dev character device special file nodes by hand.
57 If you unbind the "spidev" driver from that device, those two "spidev" nodes
61 by having kernel code remove the SPI device, probably by removing the driver
62 for its SPI controller (so its spi_master vanishes).
64 Since this is a standard Linux device driver -- even though it just happens
65 to expose a low level API to userspace -- it can be associated with any number
67 SPI device, and you'll get a /dev device node for each device.
70 BASIC CHARACTER DEVICE API
75 Standard read() and write() operations are obviously only half-duplex, and
76 the chipselect is deactivated between those operations. Full-duplex access,
77 and composite operation without chipselect de-activation, is available using
80 Several ioctl() requests let your driver read or override the device's current
84 return (RD) or assign (WR) the SPI transfer mode. Use the constants
88 Note that this request is limited to SPI mode flags that fit in a
92 which will return (RD) or assign (WR) the full SPI transfer mode,
97 transfer SPI words. Zero indicates MSB-first; other values indicate
98 the less common LSB-first encoding. In both cases the specified value
99 is right-justified in each word, so that unused (TX) or undefined (RX)
104 each SPI transfer word. The value zero signifies eight bits.
107 u32 which will return (RD) or assign (WR) the maximum SPI transfer
113 - At this time there is no async I/O support; everything is purely
116 - There's currently no way to report the actual bit rate used to
117 shift data to/from a given device.
119 - From userspace, you can't currently change the chip select polarity;
120 that could corrupt transfers to other devices sharing the SPI bus.
121 Each SPI device is deselected when it's not in active use, allowing
124 - There's a limit on the number of bytes each I/O request can transfer
125 to the SPI device. It defaults to one page, but that can be changed
128 - Because SPI has no low-level transfer acknowledgement, you usually
129 won't see any I/O errors when talking to a non-existent device.
132 FULL DUPLEX CHARACTER DEVICE API
141 The example shows one half-duplex RPC-style request and response message.