Skip to content

Conversation

@javad123javad
Copy link
Contributor

This patch series add driver support for TI TLC59731 RGB controller, along side the changes applied for STM32WB5MM_DK board and a demo samples based on this board.

@zephyrbot zephyrbot added platform: STM32 ST Micro STM32 area: Samples Samples area: LED Label to identify LED subsystem platform: TI SimpleLink Texas Instruments SimpleLink MCU area: Devicetree Binding PR modifies or adds a Device Tree binding labels Feb 2, 2024
@javad123javad javad123javad force-pushed the drivers_led_implement_driver_for_TLC59731_RGB_controller branch 3 times, most recently from cedaa5c to bded838 Compare February 2, 2024 10:13
@erwango erwango added this to the v3.7.0 milestone Feb 2, 2024
@erwango erwango requested review from ajarmouni-st and removed request for vanti February 2, 2024 10:14
@javad123javad javad123javad force-pushed the drivers_led_implement_driver_for_TLC59731_RGB_controller branch from bded838 to 30c9dcd Compare February 2, 2024 10:50
@javad123javad javad123javad force-pushed the drivers_led_implement_driver_for_TLC59731_RGB_controller branch from 30c9dcd to bffee23 Compare February 2, 2024 11:06
@ajarmouni-st
Copy link
Contributor

STM32WB5MM_DK doc should be updated to inform the user that RGB and IR LEDs share MCU resources, & so to use the RGB LED, JP5 must be ON and JP4 OFF (GPIO H1 becomes the chip select for the RGB device on spi1).
(from section 7.5.5 in https://www.st.com/resource/en/user_manual/um2825-discovery-kit-with-stm32wb5mmg-module-stmicroelectronics.pdf)

@simonguinot simonguinot self-assigned this Feb 2, 2024
Copy link
Contributor

@simonguinot simonguinot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @javad123javad,

Thanks for contributing support for the TLC59731 controller !

I started to review the driver but at some point (reading the datasheet) I realized that the TLC59731 is a LED strip controller (i.e. which can be cascaded). If it is correct, then you need to migrate this driver into the led_strip subsystem.

Additionally, while it is possible to use the CPU to send pulses through a GPIO (as you did), you may prefer to use an SPI controller instead. The idea is to program the SPI controller to send pulses through the MOSI pin. This method allows to offload the CPU. See the ws2812_spi driver as an example. I am not sure if it is possible here, but please check it.

Copy link
Contributor

@simonguinot simonguinot Feb 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the TLC59731 controller specification I read that the brightness granularity of each channel is fixed to 256. So what is the purpose for the {min,max}_brightness properties ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The overall Grayscale brightness of the RGB led is controlled by this properties. Furthermore, according to section 8.4 of the datasheet, it is possible to control the brightness of each channel:

The TLC59731 can adjust the brightness of each output channel using a pulse width modulation (PWM) control
scheme. The PWM data bit length for each output is 8 bits. The architecture of 8 bits per channel results in 256
brightness steps, from 0% to 99.98% ON-time duty cycle

@javad123javad
Copy link
Contributor Author

Hi @javad123javad,

Thanks for contributing support for the TLC59731 controller !

I started to review the driver but at some point (reading the datasheet) I realized that the TLC59731 is a LED strip controller (i.e. which can be cascaded). If it is correct, then you need to migrate this driver into the led_strip subsystem.

Additionally, while it is possible to use the CPU to send pulses through a GPIO (as you did), you may prefer to use an SPI controller instead. The idea is to program the SPI controller to send pulses through the MOSI pin. This method allows to offload the CPU. See the ws2812_spi driver as an example. I am not sure if it is possible here, but please check it.

Hi @simonguinot
Thanks a lot for your comments. Before using GPIOs I have tried to use SPI to implement the driver, however it was not working. However, I will try to write the new version of the driver based on SPI.

@javad123javad javad123javad force-pushed the drivers_led_implement_driver_for_TLC59731_RGB_controller branch 2 times, most recently from 1a35d1b to 1756520 Compare February 5, 2024 07:57
@javad123javad javad123javad force-pushed the drivers_led_implement_driver_for_TLC59731_RGB_controller branch 2 times, most recently from 3cae81b to 1139961 Compare February 5, 2024 11:05
Javad Rahimipetroudi added 3 commits February 5, 2024 12:12
TLC59731 is a 3-Channel, 8-Bit, PWM LED Driver with
TI Single-Wire interface (EasySet) protocol.

Signed-off-by: Javad Rahimipetroudi <[email protected]>
This patch add RGB LED support for the TI
TLC59731 RGB controller.

Signed-off-by: Javad Rahimipetroudi <[email protected]>
This patch adds sample test case for TI
TLC59731 RGB controller.

Signed-off-by: Javad Rahimipetroudi <[email protected]>
@javad123javad javad123javad force-pushed the drivers_led_implement_driver_for_TLC59731_RGB_controller branch from 1139961 to d324abd Compare February 5, 2024 11:12
@simonguinot
Copy link
Contributor

Hi @javad123javad. Please close this PR and open a new one when it is ready.

@javad123javad
Copy link
Contributor Author

Hi @javad123javad. Please close this PR and open a new one when it is ready.

Hi @simonguinot
It is almost finished. Is there any other changes that should I apply in a new PR?

@simonguinot
Copy link
Contributor

Hi @javad123javad. Please close this PR and open a new one when it is ready.

Hi @simonguinot It is almost finished. Is there any other changes that should I apply in a new PR?

From what I can see it is definitely not ready. I can see a struct led_driver_api defined in the driver instead of a struct led_strip_driver_api. So there is still some work to do. Please close this PR. Reviewers don't need to be notified at each update while the development is still ongoing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Devicetree Binding PR modifies or adds a Device Tree binding area: LED Label to identify LED subsystem area: Samples Samples platform: STM32 ST Micro STM32 platform: TI SimpleLink Texas Instruments SimpleLink MCU

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants