SPI(4)
π SPI(4) β the Kernel Interfaces Manual page π
okay so this is spi(4) from the Kernel Interfaces Manual β literally the intro to machine-independent SPI bus support and drivers, bestie. π
πΈ NAME πΈ
spi β introduction to machine-independent SPI bus support and drivers. Yes, that's the whole vibe: the SPI bus framework plus its driver besties. π«Ά
β¨ SYNOPSIS β¨
spi* at mainbus?
Other attachments are machine-dependent and will depend on the bus topology of your system. See intro(4) for your system for more information. π¦
π₯ DESCRIPTION π₯
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. Consult 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 aconfig(1)file, theslavemust be provided, as SPI lacks any way to automatically probe devices. π
π IOCTLS π
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. Thesic_modedefines polarity and phase of the clock.sic_speedis the clock speed in Hz, a value of0means 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;
π HARDWARE π
NetBSD includes the following machine-independent SPI drivers:
bmx280thp(4)β Bosch BMP280 / BME280 sensor. π«Άm25p(4)β STMicroelectronics M25P family of NOR flash devices.mcp23s17gpio(4)β Microchip MCP23S17 16-bit GPIO chip.mcp3kadc(4)β Microchip MCP3x0x SAR analog to digital converter.mcp48x1dac(4)β Microchip MCP4801/MCP4811/MCP4821 digital to analog converter.tm121temp(4)β Texas Instruments TMP121 temperature sensor.scmdspi(4)β SPI frontend for the Sparkfun Serial Controlled Motor Driver.ssdfb(4)β OLED/PLED framebuffer modules. β¨
π FILES π
/dev/spiuβ SPI device unitufile.
β SEE ALSO β
spi(9)β go read this too, bestie. iykyk. π«
π¦ HISTORY π¦
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. π
okay that's the whole page, bestie β footer tea: this one's from Debian, dated February 27, 2021, and it's the SPI(4) page. bye, slay! πβ¨
π¦ where this page comes from
- nixpkgs unstable: netbsd-source 11.0
- Copyright (c) 2006 Urbana-Champaign Independent Media Center
- Copyright (c) 2006 Garrett D'Amore
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms