periph / host

Go·Hardware·Lean - Host drivers
https://periph.io
Apache License 2.0
53 stars 27 forks source link

MCP23xxx Direct Register Access #8

Closed gsexton closed 2 years ago

gsexton commented 2 years ago

What kind of new feature are you looking for?

I'm trying to figure out how to get direct access to the MCP23008 GPIO register using the MCP23xxx package. The only interface I see exposed is via pins. I'm writing a driver for the Adafruit I2c/SPI backpack, and it uses the MCP23008.

The need is because to send a character to the backpack you have to:

Set the reset pin on the GPIO Write A value to pins 3-6 (data), and pin 2 low (enable) Toggle Pin 2 High Wait a period Toggle Pin 2 Low Write A value to pins 3-6 (data), and pin 2 low (enable) Toggle Pin 2 High Wait a period Toggle Pin 2 Low

If I have to set each pin individually, that stacks up to a fair number of I2c transactions.

Do you plan to: If there's not a method, I could contribute a patch.

Thanks

George

gsexton commented 2 years ago

Sorry, closing and opening under devices.