The sample did not use PWM in a proper way: it relied on a PWM device
handle, but channel or flags were hardcoded in the code. This patch
changes the sample to use a local binding ("pwm-servo") where the `pwms`
property is defined. This allows to make use of pwm_dt_spec facilities,
reducing the overall sample complexity and making it more portable
without editing the source code. The custom binding also requires to
provide the minimum/maximum pulse width so that different servos can be
easily plugged in without the need to edit sources.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
9 lines
177 B
YAML
9 lines
177 B
YAML
sample:
|
|
name: Servo Motor using PWM
|
|
tests:
|
|
sample.basic.servo_motor:
|
|
tags: drivers pwm
|
|
depends_on: pwm
|
|
harness: motor
|
|
filter: dt_compat_enabled("pwm-servo")
|