BL4S200 User’s Manual
86
setPPM
int setPPM(int channel, float frequency, float offset,
float duty, char invert, char bind_offset, char bind_duty);
FUNCTION DESCRIPTION
Sets up a PPM output on the selected configurable I/O channel with the specified
frequency and duty cycle. The PPM output of the PPM can be inverted. The offset and
duty of the PPM can be bound to a PWM/PPM on another channel on the same RIO
block so that they share an edge.
NOTE:
Configurable I/O channels DIO30 and DIO31 do not support PWM/PPM
functionality, and cannot be used with this function call.
PARAMETERS
channel
configurable I/O channel being set up for PPM, 0–29
(DIO0–DIO29)
frequency
PPM frequency in Hz (should be from 2 Hz to 50 kHz); use -1 to
preserve the existing frequency on the RIO block
offset
PPM offset (should be from 0 to 100%); use -1 and
bind_offset
parameter to use bound edge to set the offset (an offset above
100.0% will be set to 100.0%)
NOTE:
A zero offset will produce the smallest offset possible, which is one count. If you
must have a zero offset, use
setPWM()
instead of
setPPM()
.
duty
PPM duty cycle (should be from 0 to 100%); use -1 and
bind_
duty
parameter to use bound edge to set the duty cycle (a PPM
duty cycle above 100.0% will be set to 100.0%)
NOTE:
PPM will not wrap around the PPM period. If
offset
is set to 25%, the 75 to
100% duty cycle will have the same effect as
offset
= 25%,
duty
= 75%. The same
waveform as a wrapped PPM can be created using an inverted PPM
invert
whether the PPM output is inverted; the PPM output normally
starts with the output low, goes high at the offset, and stays high
for the remainder of the duty cycle; inverted will start with the out-
put high, goes low at the offset, and stays low for the duration of
the duty cycle.
0 — noninverted
1 — inverted
bind_offset
use
BL_BIND_LEAD
or
BL_BIND_TRAIL
to enable binding for the
leading edge of the PPM signal to another PWM or PPM output on
a channel hosted by same RIO chip and block. Bindings allow
PWM and PPM outputs to align their leading and trailing edges.