tree: 4daea1b27a67752de4f8197ab52854cff35f8fae [path history] [tgz]
  1. fake_dev.cc
  2. fake_dev.h
  3. ftdi.cc
  4. ftdi.h
  5. i2c.cc
  6. i2c.h
  7. mcp.cc
  8. mcp.h
  9. README.md
  10. retry.cc
  11. retry.h
  12. uart.cc
  13. uart.h
hps/hal/README.md

HPS Hardware Abstraction Layer

The HPS code uses a HAL (Hardware Abstraction Layer) interface to access the HPS hardware device. The dev.h interface defines the HAL API. This HAL library implements the various access methods that are used.

I2C

The i2c implementation uses a i2c device to connect to the hardware module.

FTDI

The ftdi implementation uses the libftdi1 library to remotely interface a minimal I2C connection via FTDI USB interface devices such as FT4232H.

FakeDev

The FakeDev class implements an internal s/w simulator of the HPS hardware for testing and development.

UART

The uart implementation uses a serial protocol to communicate with a remote device.

MCP

The mcp class implements a driver that uses the libusb library to communicate to a MCP2221A device (used as an I2C bridge).

The MCP2221A USB device may need to have appropriate udev rules to allow write access to the device, and also to disable the kernel from attempting to claim the device as a USB HID device. The following lines can be placed in /etc/udev/rules.d/99-mcp.rules, and the udev rules reloaded via /etc/init.d/udev reload. The device may need to be unplugged and replugged for the rules to be run again:

# MCP2221A rules
SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="00dd", GROUP="dialout", MODE="0664", RUN="/bin/sh -c 'echo -n $kernel > /sys/bus/usb/drivers/usbhid/unbind'"

Retry

The retry class is a shim proxy layer that allows calls to be retried upon error.