Skip to content

Conversation

Copy link

Copilot AI commented Dec 30, 2025

Implements support for BP5758, a 5-channel I2C constant current LED driver IC (address 0x15), and provides a product example for color temperature control.

Driver Implementation

components/light/bp5758/

  • I2C protocol implementation with configurable current limiting (90mA per channel)
  • Channel mapping: 0-2 (RGB), 3-4 (Cold/Warm white)
  • Explicit pin registration: channel 0=SDA, channel 1=SCL
  • Integer division with rounding for precision: (value * max + 127) / 255

Light driver integration

  • Added LIGHT_DEVICE_TYPE_BP5758 enum value
  • Added bp5758_io struct to light_io_conf_t union for I2C pins
  • Kconfig option for device type selection
  • Support for all channel combinations: 1CH, 2CH CW, 3CH RGB, 5CH RGBCW

Product Example

products/light_cw_bp5758/

  • Based on light_cw_pwm structure adapted for I2C control
  • Default configuration: 2CH CW (GPIO6 SDA, GPIO7 SCL)
  • Supports color temperature adjustment (2700K-6500K)
light_driver_config_t cfg = {
    .device_type = LIGHT_DEVICE_TYPE_BP5758,
    .channel_comb = LIGHT_CHANNEL_COMB_2CH_CW,
    .io_conf = {
        .bp5758_io = {
            .sda_io = GPIO_NUM_6,
            .scl_io = GPIO_NUM_7,
        },
    },
};

Notes

Current implementation uses current control registers for brightness scaling. Production deployments should verify register addresses against the specific BP5758 variant datasheet, as grayscale registers may differ. Individual I2C transactions per channel can be batched if protocol supports it.

Original prompt

Create an example for a light using bp5758 as the led driver


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI changed the title [WIP] Add example for light using BP5758 LED driver Add BP5758 I2C LED driver and product example Dec 30, 2025
Copilot AI requested a review from kedars December 30, 2025 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants