From: Andreas Klinger <ak@it-klinger.de>
To: pavel@ucw.cz, jacek.anaszewski@gmail.com, ben.whitten@gmail.com,
geert+renesas@glider.be, w@1wt.eu, pombredanne@nexb.com,
gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
linux-leds@vger.kernel.org
Subject: Re: [PATCH] leds: ledtrig-morse: send out morse code
Date: Fri, 29 Jun 2018 08:41:48 +0200 [thread overview]
Message-ID: <20180629064147.GA3219@arbeit> (raw)
In-Reply-To: <20180628204516.GA29146@amd>
Hi,
Pavel Machek <pavel@ucw.cz> schrieb am Thu, 28. Jun 22:45:
> On Thu 2018-06-28 22:29:57, Andreas Klinger wrote:
> > Hi Pavel,
> >
> > Pavel Machek <pavel@ucw.cz> schrieb am Thu, 28. Jun 20:56:
> > > Hi!
> > >
> > > > Send out a morse code by using LEDs.
> > > >
> > > > This is useful especially on embedded systems without displays to tell the
> > > > user about error conditions and status information.
> > > >
> > > > The trigger will be called "morse"
> > > >
> > > > The string to be send is written into the file morse_string and sent out
> > > > with a workqueue. Supported are letters and digits.
> > > >
> > > > With the file dot_unit the minimal time unit can be adjusted in
> > > > milliseconds.
> > > >
> > > > Signed-off-by: Andreas Klinger <ak@it-klinger.de>
> > >
> > > Can we get more general "pattern" trigger? Some LEDs can do that in
> > > hardware, and it is more general than plain morse.
> > >
> > > Ouch and it already was implemented :-). Patch is in attachment.
> >
> > The idea of the morse trigger is so be able so send out a short error
> > code or if needed also a complete sentence. The morse code don't need
> > extra explanation to the user. Decoding can be found everywhere.
>
> Yeah, well... I don't think decoding sentences in morse code is going
> to be much fun.
>
> And we don't really want encoder in kernel. Just do encoding in
> userspace, and use pattern trigger to display it.
>
> For many uses, morse code is "too geeky", and other patterns will be
> used.
>
> Like " X " for error 1, " X X " for error 2, " .xX .xX " for
> charging, " .xXx. " for everything okay...
>
The hardware i'm using is not able to adjust brightness. It can just switch the
LED on or off. That's it.
If anybody is interested i can submit a version 2 of the morse trigger with the
improvements suggested by Greg and Geert. Please let me know.
Andreas
> > With the pattern trigger one need a translation of the letters and
> > numbers into morse code. This is what the morse trigger is doing.
> >
> > So from my perspective the pattern trigger is something different than
> > the morse one.
>
> Well, pattern trigger is more generic, and can do everything morse
> trigger can do. Lets do that instead.
>
> > Another question:
> > The pattern trigger is not in mainline. Do you know why?
>
> Needs to be resubmitted, I'd say.
>
> Pavel
>
> > > +++ b/Documentation/leds/ledtrig-pattern.txt
> > > @@ -0,0 +1,86 @@
> > > +LED Pattern Trigger
> > > +===================
> > > +
> > > +This is a LED trigger allowing arbitrary pattern execution. It can do gradual
> > > +dimming. This trigger can be configured to repeat the pattern a number of
> > > +times or indefinitely. This is intended as a way of communication for embedded
> > > +systems with no screen.
> > > +
> > > +The trigger can be activated from user space on LED class devices as shown
> > > +below:
> > > +
> > > + echo pattern > trigger
> > > +
> > > +This adds the following sysfs attributes to the LED:
> > > +
> > > + pattern - specifies the pattern. See syntax below.
> > > +
> > > + repeat - number of times the pattern must be repeated.
> > > + writing -1 to this file will make the pattern
> > > + repeat indefinitely.
> > > +
> > > +The pattern will be restarted each time a new value is written to
> > > +the pattern or repeat attribute. When dimming, the LED brightness
> > > +is set every 50 ms.
> > > +
> > > +pattern syntax:
> > > +The pattern is specified in the pattern attribute with an array of comma-
> > > +separated "brightness/length in miliseconds" values. The two components
> > > +of each value are to be separated by a space.
> > > +
> > > +For example, assuming the driven LED supports
> > > +intensity value from 0 to 255:
> > > +
> > > + echo 0 1000, 255 2000 > pattern
> > > +
> > > +Or:
> > > +
> > > + echo 0 1000, 255 2000, > pattern
> > > +
> > > +Will make the LED go gradually from zero-intensity to max (255) intensity
> > > +in 1000 milliseconds, then back to zero intensity in 2000 milliseconds:
> > > +
> > > +LED brightness
> > > + ^
> > > +255-| / \ / \ /
> > > + | / \ / \ /
> > > + | / \ / \ /
> > > + | / \ / \ /
> > > + 0-| / \/ \/
> > > + +---0----1----2----3----4----5----6------------> time (s)
> > > +
> > > +
> > > +
> > > +To make the LED go instantly from one brigntess value to another,
> > > +use zero-time lengths. For example:
> > > +
> > > + echo 0 1000, 0 0, 255 2000, 255 0 > pattern
> > > +
> > > +Will make the LED stay off for one second, then stay at max brightness
> > > +for two seconds:
> > > +
> > > +LED brightness
> > > + ^
> > > +255-| +---------+ +---------+
> > > + | | | | |
> > > + | | | | |
> > > + | | | | |
> > > + 0-| -----+ +----+ +----
> > > + +---0----1----2----3----4----5----6------------> time (s)
> > > +
>
> --
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
next prev parent reply other threads:[~2018-06-29 6:41 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-28 13:42 [PATCH] leds: ledtrig-morse: send out morse code Andreas Klinger
2018-06-28 13:54 ` Greg KH
2018-06-28 15:36 ` Geert Uytterhoeven
2018-06-28 18:21 ` Willy Tarreau
2018-06-28 18:56 ` Pavel Machek
2018-06-28 20:29 ` Andreas Klinger
2018-06-28 20:45 ` Pavel Machek
2018-06-29 6:41 ` Andreas Klinger [this message]
2018-06-29 7:17 ` Pavel Machek
2018-06-29 7:21 ` Geert Uytterhoeven
2018-06-29 7:29 ` Pavel Machek
2018-06-29 7:48 ` Geert Uytterhoeven
2018-06-29 8:07 ` Pavel Machek
2018-06-29 8:24 ` Greg KH
2018-06-29 9:23 ` Pavel Machek
2018-06-28 20:33 ` Andreas Klinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180629064147.GA3219@arbeit \
--to=ak@it-klinger.de \
--cc=ben.whitten@gmail.com \
--cc=geert+renesas@glider.be \
--cc=gregkh@linuxfoundation.org \
--cc=jacek.anaszewski@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=pombredanne@nexb.com \
--cc=w@1wt.eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).