---
name: "gpioiic"
section: "4"
platform: "openbsd"
package: "man"
version: "8.0-current-20261101"
release: "OpenBSD 8.0-current (2026-11-01)"
platforms: ["freebsd", "openbsd"]
url: "https://new.carta.tech/gpioiic"
---

# gpioiic(4)

GPIO I2C controller

## NAME

**gpioiic** – GPIO I2C controller

## SYNOPSIS

**gpioiic\* at gpio? offset 0 mask 0x3 flag 0x0** **gpioiic\* at gpio?** **iic\* at gpioiic?**

## DESCRIPTION

The **gpioiic** driver allows bit-banging an I2C bus as a master using two GPIO pins. By default the first pin is used as a serial data (SDA) signal and the second as a serial clock (SCL). If the flag locator is set to 0x01, the order of the SDA and SCL signals is reversed. Both GPIO pins must be able to drive an output and the SDA pin must be also able to read an input.

The pins can be specified in the kernel configuration with the *offset* and the *mask* locators. The *offset* and *mask* can also be specified when **gpioiic** is attached at runtime using the GPIOATTACH [ioctl(2)](/ioctl/2.md) on the [gpio(4)](/gpio/4.md) device. Each bit in the *mask* locator defines one pin; the pin number is calculated as an addition of the bit position and the *offset* locator. For example, *offset* *17* and *mask* *0x5* defines pin numbers 17 and 19.

## SEE ALSO

[gpio(4)](/gpio/4.md), [iic(4)](/iic/4.md), [intro(4)](/intro/4.md)

## HISTORY

The **gpioiic** driver first appeared in OpenBSD 3.9.

## AUTHORS

The **gpioiic** driver was written by Alexander Yurchenko ⟨*grange@openbsd.org*⟩.
