Commit Graph

7 Commits

Author SHA1 Message Date
Hector Palacios c8257ea56e apix-pwm-example: make a more visual PWM change on LED
When running this example on an LED-connected GPIO, the delay
of 1 second is too large, and the selected values not very good
to notice the difference in brightness.

Use a ramp array of values with a more visual difference when
running on an LED and shorten the wait between changes.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2021-06-08 16:23:51 +02:00
Hector Bujanda a2412edf38 apix-gpio-example: make use of libgpiod
From the user point of view the the main change is the addition of function
ldx_gpio_request_by_controller() which selects the gpio to use using following
arguments:
   - controller: The controller name or alias of the GPIO to request.
   - line: The line number of the GPIO to request.
   - request_mode argument has been removed since that argument only has
     sense for sysfs related functions as it controls the way the line is
     exported and unexported.

The configuration file entries change to following format:
   - USER_LED = mca-gpio,12
   - USER_BUTTON = mca-gpio,10

Also improved argument parsing and help

https://jira.digi.com/browse/DEL-6425

Signed-off-by: Hector Bujanda hector.bujanda@digi.com
2020-04-27 11:00:22 +02:00
Hector Bujanda dfa1e51519 apix-pwm-example: apix-adc-example: improve arguments parsing
In previous implementation, if alias wanted to be used, it had to be passed twice.

https://jira.digi.com/browse/DEL-6425

Signed-off-by: Hector Bujanda <hector.bujanda@digi.com>
2020-04-02 12:39:21 -07:00
Francisco Gil f89af39654 pwm: fix a problem with the pwm example.
The first time that the example is run there was an error
related with an invalid value for the duty cycle.
With this fix we set the duty cycle to 0 when we close the example.

Signed-off-by: Francisco Gil <francisco.gilmartinez@digi.com>
2017-11-30 13:12:58 +01:00
Francisco Gil 3b7bbdbf65 dey-examples: Rework the examples to be launch-ready
Signed-off-by: Francisco Gil <francisco.gilmartinez@digi.com>
2017-11-30 13:12:58 +01:00
Francisco Gil Martinez d574d6b748 examples refactor the examples
Signed-off-by: Francisco Gil Martinez <francisco.gilmartinez@digi.com>
2017-10-06 16:18:16 +02:00
Francisco Gil Martinez 372d338d3f pwm_apix_sample: add an example for the pwm digi apix
https://jira.digi.com/browse/DEL-4881

Signed-off-by: Francisco Gil Martinez <francisco.gilmartinez@digi.com>
2017-09-11 09:40:57 +02:00