LED Controller Peripheral

This peripheral is applicable to IS31Fl3216 chip that is a light LED controller with an audio modulation mode. It can store data of 8 Frames with internal RAM to play small animations automatically. You can also use it to control a number of LEDs connected to GPIOs. If you want to use the IS31Fl3216, see functions periph_is31fl3216_init(), periph_is31fl3216_set_blink_pattern(), periph_is31fl3216_set_duty(), periph_is31fl3216_set_state().

Application Examples

Implementation of this API is demonstrated in checks/check_display_led example.

API Reference

Header File

Functions

esp_periph_handle_t periph_is31fl3216_init(periph_is31fl3216_cfg_t *is31fl3216_config)

Initializate the is31fl3216.

参数

is31fl3216_config

返回

  • ESP_OK Success

  • ESP_FAIL Fail

esp_err_t periph_is31fl3216_set_state(esp_periph_handle_t periph, periph_is31fl3216_state_t state)

Set the state of all the channels.

参数
  • periph – The is31fl3216 handle

  • state – The state of all channels

返回

  • ESP_OK Success

  • ESP_FAIL Fail

Set the current enable channels.

参数
  • periph – The is31fl3216 handle

  • blink_pattern – The bit pattern of enabled channels

返回

  • ESP_OK Success

  • ESP_FAIL Fail

esp_err_t periph_is31fl3216_set_duty(esp_periph_handle_t periph, uint8_t index, uint8_t value)

Set the duty of the channel.

参数
  • periph – The is31fl3216 handle

  • index – The channel number

  • value – The value of the channel’s duty to be set

返回

  • ESP_OK Success

  • ESP_FAIL Fail

esp_err_t periph_is31fl3216_set_duty_step(esp_periph_handle_t periph, uint8_t step)

Set the duty step of flash.

参数
  • periph – The is31fl3216 handle

  • step – The step of flash

返回

  • ESP_OK Success

  • ESP_FAIL Fail

esp_err_t periph_is31fl3216_set_interval(esp_periph_handle_t periph, uint16_t interval_ms)

Set the internval time.

参数
  • periph – The is31fl3216 handle

  • interval_ms – Time of interval

返回

  • ESP_OK Success

  • ESP_FAIL Fail

esp_err_t periph_is31fl3216_set_shift_mode(esp_periph_handle_t periph, periph_is31_shift_mode_t mode)

Set the shift mode.

参数
  • periph – The is31fl3216 handle

  • mode – Mode of periph_is31_shift_mode_t

返回

  • ESP_OK Success

  • ESP_FAIL Fail

esp_err_t periph_is31fl3216_set_light_on_num(esp_periph_handle_t periph, uint16_t light_on_num, uint16_t max_light_num)

Set the light on numbers.

参数
  • periph – The is31fl3216 handle

  • light_on_num – Enabled led number

  • max_light_num – Maximum led number

返回

  • ESP_OK Success

  • ESP_FAIL Fail

esp_err_t periph_is31fl3216_set_act_time(esp_periph_handle_t periph, uint16_t act_ms)

Set the action time.

参数
  • periph – The is31fl3216 handle

  • act_ms – Action time, unit is millisecond, 0 is infinite

返回

  • ESP_OK Success

  • ESP_FAIL Fail

Structures

struct periph_is31fl3216_cfg_t

The configuration of is31fl3216.

Public Members

uint32_t duty[IS31FL3216_CH_NUM]

An array of the is31fl3216’s duty

uint16_t is31fl3216_pattern

Current enable channel

periph_is31fl3216_state_t state

The state of all the channels

Macros

IS31FL3216_CH_NUM
BLUE_LED_MAX_NUM

Enumerations

enum periph_is31fl3216_state_t

Values:

enumerator IS31FL3216_STATE_UNKNOWN
enumerator IS31FL3216_STATE_OFF
enumerator IS31FL3216_STATE_ON
enumerator IS31FL3216_STATE_FLASH
enumerator IS31FL3216_STATE_BY_AUDIO
enumerator IS31FL3216_STATE_SHIFT
enum periph_is31_shift_mode_t

Values:

enumerator PERIPH_IS31_SHIFT_MODE_UNKNOWN
enumerator PERIPH_IS31_SHIFT_MODE_ACC

accumulation mode

enumerator PERIPH_IS31_SHIFT_MODE_SINGLE