CHIP_IO

A CHIP IO library for Python: IO+PWM+SPWM+ADC+Utilities

View the Project on GitHub

CHIP_IO.PWM

Import the PWM module as follows

  import CHIP_IO.PWM as PWM

For the CHIP, this requires the PWM0 DTBO loaded via the OverlayManager or other means. For the CHIP, PWM1 is unavaiable For the CHIP Pro, PWM0 and PWM1 are setup in the base DTB by default

toggle_debug()

Enable/Disable the Debug

is_chip_pro()

Function to report to the calling script if the SBC is a CHIP or a CHIP Pro

start(channel, duty_cycle=0.0, frequency=2000.0, polarity=0)

Start the Software PWM

stop(channel)

Stop the PWM

set_duty_cycle(channel, duty_cycle)

Set the duty cycle of the PWM

set_pulse_width_ns(channel, pulse_width_ns)

Set the width of the PWM pulse in nano seconds

set_frequency(channel, frequency)

Set the frequency of the PWM in Hertz

set_period_ns(channel, pulse_width_ns)

Set the period of the PWM pulse in nano seconds

cleanup(channel)

Cleanup PWM. If not channel input, all PWM will be cleaned up

home