spi(4) - NetBSD Manual Pages

Command: Section: Arch: Collection:  
SPI(4)                  NetBSD Kernel Interfaces Manual                 SPI(4)

spi -- introduction to machine-independent SPI bus support and drivers
spi* at mainbus? Other attachments are machine-dependent and will depend on the bus topol- ogy of your system. See intro(4) for your system for more information.
NetBSD includes a machine dependent SPI (Serial Peripheral Interface) bus subsystem, and several different machine-independent SPI device drivers. Your system may support additional machine-dependent SPI devices. Con- sult your system's intro(4) for additional information. SPI is a 4-wire synchronous full-duplex serial bus. Some systems provide support for Microwire, which is Philips' name for a strict subset of SPI, with more rigidly defined signaling. Therefore, Microwire devices are also supported by the SPI framework. Note that when referencing SPI devices in a config(1) file, the `slave' must be provided, as SPI lacks any way to automatically probe devices.
The following ioctl(2) calls apply to SPI devices. They are defined in the header file <dev/spi/spi_io.h>: SPI_IOCTL_CONFIGURE (spi_ioctl_configure_t) Used to choose the operational mode and clock. The sic_mode defines polarity and phase of the clock. sic_speed is the clock speed in Hz, a value of 0 means to keep the default speed of the device. typedef struct spi_ioctl_configure { int sic_addr; int sic_mode; int sic_speed; } spi_ioctl_configure_t; SPI_IOCTL_TRANSFER (spi_ioctl_transfer_t) Used to handle an I/O transaction. typedef struct spi_ioctl_transfer { int sit_addr; const void *sit_send; size_t sit_sendlen; void *sit_recv; size_t sit_recvlen; } spi_ioctl_transfer_t;
NetBSD includes the following machine-independent SPI drivers: m25p STMicroelectronics M25P family of NOR flash devices. mcp23s17gpio Microchip MCP23S17 16-bit GPIO chip. mcp3kadc Microchip MCP3x0x SAR analog to digital converter. mcp48x1dac Microchip MCP4801/MCP4811/MCP4821 digital to analog con- verter. tm121temp Texas Instruments TMP121 temperature sensor. ssdfb OLED/PLED framebuffer modules.
/dev/spiu SPI device unit u file.
m25p(4), mcp23s17gpio(4), mcp3kadc(4), mcp48x1dac(4), ssdfb(4), tm121temp(4), spi(9)
The machine-independent SPI framework was written by Garrett D'Amore for the Champaign-Urbana Community Wireless Network Project (CUWiN), and appeared in NetBSD 4.0. The ioctl(2) interface allowing configuration from userspace appeared in NetBSD 9.0. NetBSD 9.2 February 27, 2021 NetBSD 9.2
Powered by man-cgi (2021-06-01). Maintained for NetBSD by Kimmo Suominen. Based on man-cgi by Panagiotis Christias.