Skip to content

Commit

Permalink
Merge pull request #1 from FrameworkComputer/is31fl3743a
Browse files Browse the repository at this point in the history
Port to IS31FL3743A
  • Loading branch information
JohnAZoidberg authored Oct 9, 2023
2 parents 2cb2606 + b58d7f3 commit 5f13ae8
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 312 deletions.
29 changes: 6 additions & 23 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "is31fl3741"
version = "0.2.2"
name = "is31fl3743"
version = "0.1.0"
edition = "2021"
authors = ["Liz Frost", "Daniel Schaefer"]
authors = ["Daniel Schaefer"]
categories = ["embedded", "no-std"]
description = "Driver for Lumissil Microsystem's IS31FL3741 IC"
description = "Driver for Lumissil Microsystem's IS31FL3743A IC"
license = "MIT"
repository = "https://github.com/FrameworkComputer/is31fl3741-rs"
repository = "https://github.com/FrameworkComputer/is31fl3743a-rs"
readme = "README.md"

[dependencies]
Expand All @@ -16,23 +16,6 @@ embedded-graphics-core = { optional = true, version = "0.4.0" }
[package.metadata.docs.rs]
all-features = true

[dev-dependencies]
cortex-m-rt = "0.7.3"
cortex-m = "0.7.7"
panic-halt = "0.2.0"
stm32g0xx-hal = {version = "0.2.0", features = ["rt", "stm32g071"]}
tinybmp = "0.5.0"
embedded-graphics = "0.8.1"

[features]
adafruit_rgb_13x9 = []
embedded_graphics = ["embedded-graphics-core"]
default = ["adafruit_rgb_13x9", "embedded_graphics"]

[[example]]
name = "stm32"
required-features = ["adafruit_rgb_13x9"]

[[example]]
name = "gaypride"
required-features = ["adafruit_rgb_13x9", "embedded_graphics"]
default = ["embedded_graphics"]
37 changes: 15 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,38 @@
[![Crates.io](https://img.shields.io/crates/v/is31fl3741)](https://crates.io/crates/is31fl3741)
[![docs.rs](https://img.shields.io/docsrs/is31fl3741)](https://docs.rs/is31fl3741/latest/is31fl3741/)
[![Crates.io](https://img.shields.io/crates/v/is31fl3743a)](https://crates.io/crates/is31fl3743a)
[![docs.rs](https://img.shields.io/docsrs/is31fl3743a)](https://docs.rs/is31fl3743a/latest/is31fl3743a/)

[![lint](https://github.com/FrameworkComputer/is31fl3741-rs/actions/workflows/lint.yml/badge.svg)](https://github.com/FrameworkComputer/is31fl3741-rs/actions/workflows/lint.yml)
[![build](https://github.com/FrameworkComputer/is31fl3741-rs/actions/workflows/build.yml/badge.svg)](https://github.com/FrameworkComputer/is31fl3741-rs/actions/workflows/build.yml)
[![lint](https://github.com/FrameworkComputer/is31fl3743a-rs/actions/workflows/lint.yml/badge.svg)](https://github.com/FrameworkComputer/is31fl3743a-rs/actions/workflows/lint.yml)
[![build](https://github.com/FrameworkComputer/is31fl3743a-rs/actions/workflows/build.yml/badge.svg)](https://github.com/FrameworkComputer/is31fl3743a-rs/actions/workflows/build.yml)


# is31fl3741 driver
# is31fl3743a driver

Driver for [Lumissil Microsystem's IS31FL3741 integrated circuit](https://www.lumissil.com/assets/pdf/core/IS31FL3741_DS.pdf). Some of the major features of this library are:
Driver for [Lumissil Microsystem's IS31FL3743A integrated circuit](https://www.lumissil.com/assets/pdf/core/IS31FL3743A_DS.pdf). Some of the major features of this library are:

1. Use of embedded HAL traits (works with any embedded device that supports the required traits). This means that this driver is platform agnostic.
2. Library features (only turn on what devices you need to save compiled binary space).
3. [Examples](./examples) on how to use this driver.
Right now there is only an example on how to use this crate with a stm32 nucleo.
3. [Examples](./examples) on how to use this driver. (TODO)

## Install

To install this driver in your project add the following line to your `Cargo.toml`'s `dependencies` table:

```toml
is31fl3741 = "0.2.2"
```

By default this version will only contain the core driver.
To use a preconfigured device (currently just [Adafruit IS31FL3741 13x9 PWM RGB LED Matrix](https://www.adafruit.com/product/5201)),
you would need to change this line to include that device:

```toml
is31fl3741 = { version = "0.2.2", features = ["adafruit13x9"] }
is31fl3743a = "0.1.0"
```

## Graphics

This driver contains optional support for the [embedded-graphics](https://docs.rs/embedded-graphics/latest/embedded_graphics/) library.
Enable the `embedded_graphics` feature to use it.

The `gaypride` example shows off a use of this.
## References

## Inspiration
Contains code derived from:

This driver is ~~ripped off~~ modified from [gleich](https://github.com/gleich/)'s [is31fl3731 crate](https://github.com/gleich/is31fl3731).
I was originally planning on just making a PR, but the driver ended up too differet.
- https://github.com/FrameworkComputer/is31fl3741-rs
- https://github.com/stillinbeta/is31fl3741
- https://github.com/gleich/is31fl3731

That driver is a port of [adafruit's driver for the is31fl3731](https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3731) in the Rust programming language.
The 43A chip is the I2C variant, the 43B chip is the SPI variant of the same chip.
For the SPI variant of the device, consider using the `is31fl3741b` crate instead.
Binary file removed examples/gaypride.bmp
Binary file not shown.
50 changes: 0 additions & 50 deletions examples/gaypride.rs

This file was deleted.

14 changes: 4 additions & 10 deletions examples/stm32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use panic_halt as _;

// use cortex_m::delay::Delay;
use cortex_m_rt::entry;
use is31fl3741::devices::AdafruitRGB13x9;
use is31fl3743::devices::AdafruitRGB13x9;

use stm32g0xx_hal::{
prelude::*,
Expand Down Expand Up @@ -39,14 +39,8 @@ fn main() -> ! {
matrix.set_scaling(0xFF).expect("failed to set scaling");

loop {
for y in 0..9 {
for x in 0..13 {
matrix
.pixel_rgb(x, y, 0x1E, 0x90, 0xFF)
.expect("couldn't turn on");
delay.delay_ms(100u8);
matrix.pixel_rgb(x, y, 0, 0, 0).expect("couldn't turn off");
}
}
matrix.fill(0xFF).expect("failed to turn on all LEDs");
delay.delay_ms(100u8);
matrix.fill(0x00).expect("failed to turn off all LEDs");
}
}
Loading

0 comments on commit 5f13ae8

Please sign in to comment.