zephyr,pwm-bitbang

Description

Bitbang PWM controller.

Generates PWM signals on arbitrary GPIO pins using a hardware timer
as the time base. Each channel maps to one GPIO pin.
The period is the same for all PWM channels.

Examples

bitbang_pwm: bitbang-pwm {
    compatible = "zephyr,pwm-bitbang";
    status = "okay";
    #pwm-cells = <3>;
    timer = <&timer2>;
    pwm-gpios = <&gpioa 5 GPIO_ACTIVE_HIGH>,
                <&gpiob 3 GPIO_ACTIVE_HIGH>;
};

Properties

Properties not inherited from the base binding file.

Name

Type

Details

timer

phandle

Reference to the hardware timer peripheral used as a time base
for generating the timer interrupts (e.g., &timer2).

This property is required.

pwm-gpios

phandle-array

List of GPIO pins that serve as PWM output channels. Each entry
corresponds to one PWM channel.

This property is required.

#pwm-cells

int

Number of items to expect in a pwm specifier

This property is required.

Constant value: 3

channels

int

Number of PWM channels supported by the controller.

Specifier cell names

  • pwm cells: channel, period, flags