[PATCH 0/3] Add device DM163 (led driver, matrix colors shield & display)

Inès Varhol posted 3 patches 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20240126193657.792005-1-ines.varhol@telecom-paris.fr
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Arnaud Minier <arnaud.minier@telecom-paris.fr>, "Inès Varhol" <ines.varhol@telecom-paris.fr>, Alistair Francis <alistair@alistair23.me>, Thomas Huth <thuth@redhat.com>, Laurent Vivier <lvivier@redhat.com>
There is a newer version of this series
hw/arm/Kconfig                 |   1 +
hw/arm/stm32l4x5_soc.c         |  55 +++++-
hw/display/Kconfig             |   3 +
hw/display/dm163.c             | 307 +++++++++++++++++++++++++++++++++
hw/display/meson.build         |   1 +
hw/display/trace-events        |  13 ++
include/hw/arm/stm32l4x5_soc.h |   3 +
include/hw/display/dm163.h     |  57 ++++++
tests/qtest/dm163-test.c       | 192 +++++++++++++++++++++
tests/qtest/meson.build        |   1 +
10 files changed, 632 insertions(+), 1 deletion(-)
create mode 100644 hw/display/dm163.c
create mode 100644 include/hw/display/dm163.h
create mode 100644 tests/qtest/dm163-test.c
[PATCH 0/3] Add device DM163 (led driver, matrix colors shield & display)
Posted by Inès Varhol 10 months ago
This device implements the IM120417002 colors shield v1.1 for Arduino
(which relies on the DM163 8x3-channel led driving logic) and features
a simple display of an 8x8 RGB matrix.

This color shield can be plugged on the Arduino board (or the
B-L475E-IOT01A board) to drive an 8x8 RGB led matrix.
This RGB led matrix takes advantage of retinal persistance to
seemingly display different colors in each row.

It'd be convenient to set the QEMU console's refresh rate
in order to ensure that the delay before turning off rows
(2 frames currently) isn't too short. However
`dpy_ui_info_supported(s->console)` can't be used.

I saw that Kconfig configurable components aren't visible in C files,
does that mean it's impossible to make the DM163 device optional when
using the B-L475E-IOT01A board?

Based-on: 20240123122505.516393-1-ines.varhol@telecom-paris.fr
([PATCH v3 0/3] Add device STM32L4x5 GPIO)

Signed-off-by: Arnaud Minier <arnaud.minier@telecom-paris.fr>
Signed-off-by: Inès Varhol <ines.varhol@telecom-paris.fr>

Inès Varhol (3):
  hw/display : Add device DM163
  hw/arm : Connect DM163 to STM32L4x5
  tests/qtest : Add testcase for DM163

 hw/arm/Kconfig                 |   1 +
 hw/arm/stm32l4x5_soc.c         |  55 +++++-
 hw/display/Kconfig             |   3 +
 hw/display/dm163.c             | 307 +++++++++++++++++++++++++++++++++
 hw/display/meson.build         |   1 +
 hw/display/trace-events        |  13 ++
 include/hw/arm/stm32l4x5_soc.h |   3 +
 include/hw/display/dm163.h     |  57 ++++++
 tests/qtest/dm163-test.c       | 192 +++++++++++++++++++++
 tests/qtest/meson.build        |   1 +
 10 files changed, 632 insertions(+), 1 deletion(-)
 create mode 100644 hw/display/dm163.c
 create mode 100644 include/hw/display/dm163.h
 create mode 100644 tests/qtest/dm163-test.c

-- 
2.43.0
Re: [PATCH 0/3] Add device DM163 (led driver, matrix colors shield & display)
Posted by Philippe Mathieu-Daudé 9 months, 3 weeks ago
Hi Inès,

On 26/1/24 20:31, Inès Varhol wrote:
> This device implements the IM120417002 colors shield v1.1 for Arduino
> (which relies on the DM163 8x3-channel led driving logic) and features
> a simple display of an 8x8 RGB matrix.
> 
> This color shield can be plugged on the Arduino board (or the
> B-L475E-IOT01A board) to drive an 8x8 RGB led matrix.

Nice. Do you have an example? Or better, a test :)

> This RGB led matrix takes advantage of retinal persistance to
> seemingly display different colors in each row.
> 
> It'd be convenient to set the QEMU console's refresh rate
> in order to ensure that the delay before turning off rows
> (2 frames currently) isn't too short. However
> `dpy_ui_info_supported(s->console)` can't be used.

Cc'ing Marc-André Lureau.

> I saw that Kconfig configurable components aren't visible in C files,
> does that mean it's impossible to make the DM163 device optional when
> using the B-L475E-IOT01A board?

You could (but shouldn't) use for build-time:

   #include CONFIG_DEVICES

But better at run-time using [module_]object_class_by_name().

> Based-on: 20240123122505.516393-1-ines.varhol@telecom-paris.fr
> ([PATCH v3 0/3] Add device STM32L4x5 GPIO)
> 
> Signed-off-by: Arnaud Minier <arnaud.minier@telecom-paris.fr>
> Signed-off-by: Inès Varhol <ines.varhol@telecom-paris.fr>
> 
> Inès Varhol (3):
>    hw/display : Add device DM163
>    hw/arm : Connect DM163 to STM32L4x5
>    tests/qtest : Add testcase for DM163


Re: [PATCH 0/3] Add device DM163 (led driver, matrix colors shield & display)
Posted by Inès Varhol 9 months, 3 weeks ago
Hello,

> De: "Philippe Mathieu-Daudé" <philmd@linaro.org>
> Envoyé: Lundi 5 Février 2024 15:03:59
> 
> Hi Inès,
> 
> On 26/1/24 20:31, Inès Varhol wrote:
> > This device implements the IM120417002 colors shield v1.1 for Arduino
> > (which relies on the DM163 8x3-channel led driving logic) and features
> > a simple display of an 8x8 RGB matrix.
> > 
> > This color shield can be plugged on the Arduino board (or the
> > B-L475E-IOT01A board) to drive an 8x8 RGB led matrix.
> 
> Nice. Do you have an example? Or better, a test :)
> 

Actually I don't know how to test the display with QTest :/
(I've tested it by running custom executables)

I've seen that `qtest_init_internal` sets `-display none`
so I imagine there's no way to test the display visually.

It seems to me that I can't use a qdev property (to access
the DM163 buffer and check its content) either since there's
no `visit_type_*` for arrays.

I could technically access all the elements in the array 
(returning a different element each time in the getter for
example), but that seems sketchy.


In short, how can I provide a test or an example?

Best regards,

Ines