UMCPMIOCTL(8)

UMCPMIOCTL(8) | System Manager's Manual | UMCPMIOCTL(8)

# NAME

`umcpmioctl` — interact with a MCP2221 / MCP2221A multi-io chip

# SYNOPSIS

`umcpmioctl` | [`-dh`] device `status`

`umcpmioctl` | [`-dh`] device `get sram`

`umcpmioctl` | [`-dh`] device `get gp`

`umcpmioctl` | [`-dh`] device `get flash cs`

`umcpmioctl` | [`-dh`] device `get flash gp`

`umcpmioctl` | [`-dh`] device `get flash usbman`

`umcpmioctl` | [`-dh`] device `get flash usbprod`

`umcpmioctl` | [`-dh`] device `get flash usbsn`

`umcpmioctl` | [`-dh`] device `get flash chipsn`

`umcpmioctl` | [`-dh`] device `put flash gp` GPn PIN_FUNCTION ...

# DESCRIPTION

The `umcpmioctl` utility interacts with a MCP2221 / MCP2221A and can be used to pull the status of the chip, get the SRAM values, get the values from the on-board FLASH and can be used to set some of the FLASH values associated with the GPIO pins. The values from flash are copied into the SRAM when the chip enumerates or powers up.

For the `put flash` command, GPn is one of `GP0`, `GP1`, `GP2` or `GP3`, and PIN_FUNCTION is one of `GPIO_PIN_INPUT`, `GPIO_PIN_OUTPUT`, `GPIO_PIN_ALT0`, `GPIO_PIN_ALT1`, `GPIO_PIN_ALT2`, `GPIO_PIN_ALT3`, `DEFAULT_OUTPUT_ZERO` or `DEFAULT_OUTPUT_ONE`.

For the `put flash` command, the GPn and PIN_FUNCTION pairs may be repeated.

# EXAMPLES

`umcpmioctl /dev/umcpmio0ctl status`

Query the chip for its status.

`umcpmioctl /dev/umcpmio0ctl get sram`

Return the values from the SRAM on the chip.

`umcpmioctl /dev/umcpmio0ctl get flash cs`

Return the values for the chip settings from the FLASH.

`umcpmioctl /dev/umcpmio0ctl put flash gp GP0 GPIO_PIN_INPUT`

This will set the GP0 pin to be an input pin on start up of the chip.

`umcpmioctl /dev/umcpmio0ctl put flash gp GP2 GPIO_PIN_OUTPUT GP0 GPIO_PIN_ALT0`

This will set the GP2 pin to be an output pin and GP0 pin to have the ALT0 function upon chip start up.

# SEE ALSO

gpio(4), umcpmio(4)

# HISTORY

The `umcpmioctl` utility first appeared in NetBSD 11.0.

# AUTHORS

The `umcpmioctl` utility was written by Brad Spencer <brad@anduin.eldar.org>.

# BUGS

Only the gpio settings can be changed in FLASH.

The output is not very pleasant to use and one will probably need to have the data sheet for the MCP2221 / MCP2221A on hand to make sense of it.

November 24, 2024 | NetBSD 11.0