Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers/dali: add initial lowlevel support #16766

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dylad
Copy link
Member

@dylad dylad commented Aug 21, 2021

Contribution description

This PR adds initial support for the lowlevel part of the DALI protocol (part of IEC 60929). In the current state, it adds the lowlevel functions which allow a master to send data to slaves and receive the optional answer. This implementation is a bit naive as I didn't spend much time on it. I wanted to have something working quickly so there is room for improvement.
Only the master part is supported by this PR but adding support for the slave part should not be too difficult.

Typical DALI network consists on a bus controller (master) with up to 64 peripherals (slaves) such as ballasts or up to 16 groups of devices.

Testing procedure

I tested this PR on a custom board as some hardware is needed to handle the electrical level.
Otherwise, connect one or more slaves to your DALI bus and use the provided test application.

EDIT:
This PR was reworked to add support for both mode. I've rename master/slave to host/peripheral and create two test applications for testing. tests/driver_dali_host has the same purpose as before. tests/driver_dali_peripheral will answer to DALI QUERY STATUS cmd (0x90) and you can also switch on/off board LEDs if the node receive the command 0x05 or 0x00.
tests/driver_dali_host and tests/driver_dali_peripheral can be tested altogether with two board but it would be better to test the peripheral mode with another commercial device to act as host.

Issues/PRs references

None but an user asked about DALI on the forum

@dylad dylad added Type: new feature The issue requests / The PR implemements a new feature for RIOT Area: drivers Area: Device drivers Community: help wanted The contributors require help from other members of the community labels Aug 21, 2021
@github-actions github-actions bot added Area: Kconfig Area: Kconfig integration Area: tests Area: tests and testing framework labels Aug 21, 2021
@dylad dylad force-pushed the pr/drivers/dali_lowlevel_support branch from 115d86e to aacce49 Compare August 21, 2021 21:11
@TA1DB
Copy link

TA1DB commented Sep 6, 2021

Hi, works fine on stm32f429i-disc1 board, errors on esp32-wrover-kit. https://forum.riot-os.org/t/any-work-or-interest-in-dali-master-dali-slave/3323/6

@dylad dylad added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Sep 6, 2021
@dylad
Copy link
Member Author

dylad commented Sep 6, 2021

Latest commit should fix compilation errors on various platforms.

@TA1DB
Copy link

TA1DB commented Sep 7, 2021

Hi,

Latest commit should fix compilation errors on various platforms.

Yes, the latest commit fixed compilation errors on my esp32-wrover-kit. Thanks and best regards.

@dylad dylad force-pushed the pr/drivers/dali_lowlevel_support branch from 40420b4 to cac3616 Compare September 28, 2021 16:04
@dylad
Copy link
Member Author

dylad commented Sep 28, 2021

Force pushed this PR as it was completely rework.
Slave mode support was added. Modes were renamed to host/peripheral instead of master/slave for obvious reasons.
A dedicated test was created for the peripheral mode so one can test it. If your board has onboard LEDs, you can switch on/off with DALI if you send the right commands.

@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions.

@stale stale bot added the State: stale State: The issue / PR has no activity for >185 days label Apr 16, 2022
@TA1DB
Copy link

TA1DB commented May 29, 2022

Hi dear reviewers, please don't let this pull request to be deleted !

@stale stale bot removed the State: stale State: The issue / PR has no activity for >185 days label May 29, 2022
@dylad
Copy link
Member Author

dylad commented May 30, 2022

Hi @TA1DB,
Were you able to test the slave implementation on your side with another master ?

@TA1DB
Copy link

TA1DB commented Jun 7, 2022

Hi @dylad , no unfortunately because I am busy with another subject but I am following your Dali work here and plan to come back soon.

@Teufelchen1
Copy link
Contributor

Whats the status here? Still working? May I convert it to a draft?

@dylad
Copy link
Member Author

dylad commented Mar 19, 2024

Unfortunately, I don't have access to the custom hardware I was using for this so maybe revert to draft is a good idea unless I manage to get my hand on something else to continue this.

@Teufelchen1 Teufelchen1 marked this pull request as draft March 19, 2024 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: drivers Area: Device drivers Area: Kconfig Area: Kconfig integration Area: tests Area: tests and testing framework Community: help wanted The contributors require help from other members of the community Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants