Metadata-Version: 2.1
Name: imagehat
Version: 0.0.14
Summary: Image HAT
Home-page: UNKNOWN
Author: Richard Waschhauser
License: UNKNOWN
Keywords: Raspberry Pi,USB
Platform: UNKNOWN
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: System :: Hardware
Requires-Python: >=3.5
Description-Content-Type: text/markdown

# Image HAT

![PyPI - Status](https://img.shields.io/pypi/status/imagehat)
![PyPI - License](https://img.shields.io/pypi/l/imagehat)
![PyPI - Python Versions](https://img.shields.io/pypi/pyversions/imagehat)
![PyPI - Version](https://img.shields.io/pypi/v/imagehat)
![PyPI - Downloads](https://img.shields.io/pypi/dm/imagehat)

## Installation

### Install dependencies
The python3-smbus package
```bash
$ sudo apt install python3-smbus
```

### Install using pip
```bash
$ sudo pip3 install -U imagehat
```

## Listing attributes and methods

```python
#!/usr/bin/env python3
from imagehat import *

hat = ImageHat(0x20) # 0x20 is the I2C bus address

hat.host             # get selected host
hat.host = 0         # unplug USB device
hat.host = 1         # switch USB device to host 1
hat.host = 2         # switch USB device to host 2

hat.usb_power        # get state of USB device power supply
hat_usb_power = 0    # turn off USB device power supply
hat.usb_power = 1    # turn on USB device power supply

hat.host2_in         # get USB power state of host 2

hat.ext_in           # get state of external input

hat.ext_out          # get state of external output
hat.ext_out = 0      # turn off external output
hat.ext_out = 1      # turn on external output
```


