Pulse-width modulation (PWM) is a technique that modifies the duty cycle of a pulsing signal to encode information or to control the amount of energy provided to a charge. The TPM (Timer/PWM Module) is a channel timer that supports input capture, output compare, and the generation of PWM signals to control electrical motor and power management applications. The counter, compare, and capture registers are clocked by an asynchronous clock that can remain enabled in low power modes.
On the ConnectCore 91 system-on-module:
-
Has six TPM signals (from TPM1 to TPM6), where only two (TPM4 and TPM6) are available from the i.MX91 system-on-chip (multiplexed with other signals).
On the ConnectCore 93 Development Kit:
-
TPM6 is used as LVDS PWM backlight.
Kernel configuration
You can manage the i.MX91 PWM driver support through the following kernel configuration option:
-
i.MX TPM PWM support (
CONFIG_PWM_IMX_TPM
)
This option is enabled as built-in on the default ConnectCore 91 kernel configuration file.
Kernel driver
The driver for the i.MX91 PWM is located at:
File | Description |
---|---|
PWM driver |
Device tree bindings and customization
The i.MX91 PWM interface is documented at Documentation/devicetree/bindings/pwm/imx-tpm-pwm.yaml
.
i.MX91 PWM interfaces
The common i.MX91 CPU device tree file contains entries for TPM4 and TPM6 channels. More entries are expected to be added in the future.
Use the PWM channels
Using Digi APIx library from a C application
An example application called apix-pwm-example
is included in the dey-examples-digiapix recipe (part of dey-examples package) of the meta-digi layer.
This application shows how to generate a PWM signal using Digi APIx library on the ConnectCore 91 platform.
Go to GitHub to see the application instructions and source code.
See PWM API for more information about the PWM APIx.