# SPDX-FileCopyrightText: Tony DiCola 2017 for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`adafruit_is31fl3731.charlie_wing`
====================================================
CircuitPython driver for the IS31FL3731 charlieplex IC.
* Author(s): Tony DiCola, Melissa LeBlanc-Williams
Implementation Notes
--------------------
**Hardware:**
* `Adafruit 15x7 CharliePlex LED Matrix Display FeatherWings
<https://www.adafruit.com/product/2965>`_
**Software and Dependencies:**
* Adafruit CircuitPython firmware for the supported boards:
https://github.com/adafruit/circuitpython/releases
"""
# imports
from . import IS31FL3731
[docs]class CharlieWing(IS31FL3731):
"""Supports the Charlieplexed feather wing"""
width = 15
height = 7
[docs] @staticmethod
def pixel_addr(x, y):
"""Calulate the offset into the device array for x,y pixel"""
if x > 7:
x = 15 - x
y += 8
else:
y = 7 - y
return x * 16 + y