CP2112(4)

✨ CP2112(4) ✨

okay bestie, welcome to the Kernel Interfaces Manual πŸ’– this one's about the cp2112 driver β€” a driver for a USB GPIO and I2C peripheral device. yes, both. it's a multitasker. we love her for that. 🫢


🌸 NAME 🌸

cp2112 β€” driver for a USB GPIO and I2C peripheral device

literally what it says on the tin, no notes πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

so if you wanna bake this driver right into your kernel, you gotta put these lines in your kernel configuration file. all four. no skipping, bestie, this is a full fit not a two-piece πŸ¦‹

device cp2112
device usb
device gpio
device iicbus

orrr, if you'd rather load it as a module at boot time (iconic, low-commitment, we respect it), drop this single line into loader.conf(5):

cp2112_load="YES"

πŸ’… DESCRIPTION πŸ’…

The cp2112 driver provides support for Silicon Labs CP2112 device. πŸ’–

This little device has 8 general purpose I/O pins and an I2C controller that supports a subset of the I2C protocol. yeah, it does a lot. main character energy fr fr πŸ‘‘

okay so about the pins β€” all pins support both input and output modes. every single one. no pin left behind. 🌈

An output pin can be configured either for open-drain or push-pull operation. pick your fighter ✨

Now, pins 0, 1 and 7 support special functions β€” they're the overachievers of the group:

  • pin 0 β€” I2C transmit indication
  • pin 1 β€” I2C receive indication
  • pin 7 β€” clock output
😭 but here's the sad part: at the moment the cp2112 driver does not provide a way to enable and configure the special functions. so they're just sitting there, gifted and unconfigured. tragic. we're manifesting it for a future release tho πŸ™ˆ

Now the I2C controller tea, because this is the important part β€” it supports:

  • read transactions with up to 512 bytes of data
  • write transactions with up to 61 bytes of data
  • a write followed by the repeated start followed by a read transaction, where the write can be up to 16 bytes and the read can be up to 512 bytes

and, bestie, listen: zero length transfers are not supported. not a thing. don't try it. it's giving nothing and it will not work πŸ’€

The cp2112 driver creates a gpio(4) and iicbus(4) child buses to expose the respective functions β€” so both personalities get to shine ✨


πŸ”₯ SEE ALSO πŸ”₯

go read those too, iykyk πŸ“š


πŸ‘‘ HISTORY πŸ‘‘

The cp2112 driver and this manual page was written by Andriy Gapon <avg@FreeBSD.org>. thank you for your service, legend πŸ«‘πŸ’–


and that's the whole page, bestie! this one came to you courtesy of Debian, dated August 12, 2020, and it's filed under CP2112(4). go forth and blink some pins πŸŒΈπŸ’…βœ¨

πŸ“¦ where this page comes from