IS31FL3731 (scroll_hat v0.1.0) View Source

Integration for the IS31FL3731 I2C LED Driver

Link to this section Summary

Functions

Display the specified frame

Set the LEDs settings for the specified frame

Set the confifuration mode of the driver

Set software shutdown or normal operation

Link to this section Types

Specs

frame() :: 0..7

Specs

i2c() :: Circuits.I2C.bus()

Specs

result() :: :ok | {:error, term()}

Link to this section Functions

Link to this function

display_frame(i2c, frame)

View Source

Specs

display_frame(i2c(), frame()) :: result()

Display the specified frame

In picture mode, this will display the specified frame according to the settings for that frame stored in memory

Link to this function

set_frame(i2c, frame, led_map)

View Source

Set the LEDs settings for the specified frame

This would be used to set LED's on/off, LED blink state, and the PWM of each LED and requires the bytes to be formatted already according to tables 3-6 in the IS31FL3731 datasheet.

Link to this function

set_mode(i2c, mode, frame_start \\ 0)

View Source

Set the confifuration mode of the driver

Supported modes: 0x00: Picture 0x01: Auto frame play 0x02: Audio frame play

The third argument is only used to set the starting frame when using Auto frame play mode.

Link to this function

shutdown_control(i2c, mode)

View Source

Specs

shutdown_control(i2c(), mode :: 1 | 0) :: result()

Set software shutdown or normal operation

modes: 0 -> shutdown 1 -> normal operation