MCPGPIO(4)
π MCPGPIO π
okay so this is the mcpgpio man page, straight out of the Kernel Interfaces Manual (that's section 4, driver town πβ¨). it's the driver for Microchip I/O Expanders on I2C and SPI bus, and bestie, it's lowkey iconic.
β¨ NAME β¨
mcpgpio β the Driver for Microchip I/O Expanders on I2C and SPI bus π¦
πΈ SYNOPSIS πΈ
π I2C
mcpgpio* at iic? addr ?
gpio* at gpiobus?
π SPI
mcpgpio0 at spi? slave 0 flags 0
mcpgpio1 at spi? slave 0 flags 1
mcpgpio2 at spi? slave 0 flags 2
mcpgpio3 at spi? slave 0 flags 3
gpio* at gpiobus?
π DESCRIPTION π
the mcpgpio driver is the main character for these Microchip I/O Expanders, no cap:
MCP23008β 8-bit I/O expander, I2C interfaceMCP23S08β 8-bit I/O expander, SPI interfaceMCP23017β 16-bit I/O expander, I2C interfaceMCP23S17β 16-bit I/O expander, SPI interfaceMCP23018β 16-bit I/O expander, open-drain outputs, I2C interfaceMCP23S18β 16-bit I/O expander, open-drain outputs, SPI interface
access to the pins? oh that's all handled by the gpio(4) interface. it's giving delegation, we love to see it π«Ά
the SPI version of these devices fr fr supports multiple chips per chip select signal. on the MCP23S08 and MCP23S17, you pull that off by tying the address select pins to VDD or GND to select an address β that's 0-3 on MCP23S08 or 0-7 on MCP23S17. the MCP23S18 has a similar capability but it's extra about it: it uses an analog voltage input on a single address select pin, plus an internal voltage divider ladder and a series of comparators, to generate the 3 address bits π§ββοΈ (see the data sheet for details, iykyk).
the flags argument in the configuration directive for SPI attachments selects the hardware address of the chip instance for that driver instance. periodt. π
π SEE ALSO π
gpio(4), iic(4), intro(4), spi(4)
π HISTORY π
the mcpgpio driver first appeared in NetBSD 7.0. then it got a whole glow-up in NetBSD 10.0 to support additional chip types and to add the I2C attachment. ate and left no crumbs π
π₯
π AUTHORS π
the mcpgpio driver was written by Frank Kardel <kardel@NetBSD.org> and Jason R. Thorpe <thorpej@NetBSD.org>. kings, literally π«Ά
π BUGS π
β οΈ bestie, listen: SPI instances of the mcpgpio driver do not utilize the Device Tree bindings for this device. π
β οΈ also, the mcpgpio driver does not currently act as a GPIO provider for the platform device tree. ngl, mildly tragic.
π and that's the whole page!! this one's from Debian, dated January 10, 2022, and it's MCPGPIO(4) β go forth and expand your I/O, bestie πβ¨π
π¦ where this page comes from
- nixpkgs unstable: netbsd-source 11.0
- Copyright (c) 2014 Frank Kardel
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms