Mcp2221

Website:

https://github.com/pmunts/libsimpleio

Author:
  • Philip Munts
Maintainer:
  • Philip Munts <phil@munts.net>
License:

BSD-1-Clause

Version:

2.22364.1

Alire CI:

Dependencies: Dependents:

No dependents.

Badge:

MCP2221 USB Raw HID I/O Expander Library for GNAT Ada

#embedded #linux #mcp2221 #adc #dac #gpio #i2c #motor #pwm #sensor #serial #servo #spi #stepper

This crate contains a subset of the Linux Simple I/O Library Ada packages that are relevant for building programs for the MCP2221 USB Raw HID I/O expander.

This crate can be built for Linux, MacOS, or Windows targets.

The MCP2221A is a PIC16F1455 microcontroller that has been preprogrammed with firmware to implement two USB devices: a USB serial port and a raw HID device that acts as an I/O expander providing one I2C bus controller (master only) and four GPIO pins (GP0, GP1, GP2, and GP3).

The GPIO pins GP1, GP2, and GP3 can be configured for some alternate functions, including 10-bit A/D inputs or 5-bit D/A outputs:

GP1: GPIO ADC1GP2: GPIO ADC2 DAC1GP3: GPIO ADC3 DAC2

The MCP2221A replaces an earlier part, the MCP2221. The only difference between the older MCP2221 and the newer MCP2221A is that the latter supports some higher baud rates on the USB serial port device. Since this crate only deals with the raw HID I/O expander functions, it will work fine with either the older MCP2221 or the newer MCP2221A.