nxp,emios-pwm

Description

NXP eMIOS PWM node. Each channel (UC) in eMIOS can be configured to use for
PWM and capture operation. There are several modes supported by this module,
some modes only support on channels that have internal counter, some modes
require to use a reference timebase from a counter bus.

OPWMB and OPWMCB modes use reference timebase. Please notice that the devicetree
node for counter bus should be enabled and configured for using, please see
'nxp,emios' bindings.

Examples

emios0_pwm: pwm {
  pwm0 {
    channel = <16>;
    mode = "OPWFMB";
    counter-bus-type = "BUS_INTERNAL";
    prescaler = <8>;
  };

  pwm1 {
    channel = <9>;
    mode = "OPWMB";
    counter-bus-type = "BUS_C";
    phase-shift = <100>;
  };

  pwm2 {
    channel = <2>;
    mode = "OPWMCB_LEAD_EDGE";
    counter-bus-type = "BUS_B";
    dead-time = <100>;
  };
};

Properties

Top level properties

These property descriptions apply to “nxp,emios-pwm” nodes themselves. This page also describes child node properties in the following sections.

Properties not inherited from the base binding file.

Name

Type

Details

pinctrl-0

phandles

Pin configuration/s for the first state. Content is specific to the
selected pin controller driver implementation.

This property is required.

pinctrl-names

string-array

Names for the provided states. The number of names needs to match the
number of states.

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.

pinctrl-1

phandles

Pin configuration/s for the second state. See pinctrl-0.

pinctrl-2

phandles

Pin configuration/s for the third state. See pinctrl-0.

pinctrl-3

phandles

Pin configuration/s for the fourth state. See pinctrl-0.

pinctrl-4

phandles

Pin configuration/s for the fifth state. See pinctrl-0.

Child node properties

Name

Type

Details

channel

int

eMIOS PWM channel

This property is required.

mode

string

Select PWM mode:
- OPWFMB: Provides waveforms with variable duty cycle and frequency.
          This mode uses internal counter.

- OPWMB:  Generate pulses with programmable leading and trailing
          edge placement. The period is determined by period of
          an external counter driven in MCB Up Mode. Changing PWM period
          at runtime will impact to all channels share the same timebase.
          The new period and cycle take effect in next period boundary.

- OPWMCB: Generates a center aligned PWM with dead time insertion to the
          leading or trailing edge. The period is determined by period of
          an external counter driven in MCB Up Down Mode. Changing PWM period
          at runtime will impact to all channels share the same timebase,
          The new period and cycle take effect in next period boundary.

- SAIC: Single action input capture mode, the eMIOS captures events as soon as
        they occur. The value of latest captured event is stored and can be read
        by software. This mode uses internal counter with range [0, 0xFFFF].

This property is required.

Legal values: OPWFMB, OPWMB, OPWMCB_TRAIL_EDGE, OPWMCB_LEAD_EDGE, SAIC

counter-bus-type

string

Counter bus provides the time base for each channel (UC).
Global counter bus provides the time base for any other channels.
Local counter bus provides the time base for specific channels.
Channel drives counter bus only use the internal counter as its time base.
  - BUS_A: global bus, driven by channel 23, used by other all channels
  - BUS_B: local bus,  driven by channel 0,  used by channels 1-7
  - BUS_C: local bus,  driven by channel 8,  used by channels 9-15
  - BUS_D: local bus,  driven by channel 16, used by channels 17-23
  - BUS_F: global bus, driven by channel 22, used by other all channels
  - BUS_INTERNAL: the channel's own internal counter, OPWFMB and SAIC mode use this type

This property is required.

Legal values: BUS_A, BUS_B, BUS_C, BUS_D, BUS_F, BUS_INTERNAL

prescaler

int

The clock divider for internal counter prescaler.

Default value: 1

Value range: 1 to 16

dead-time

int

Dead time (in ticks) for PWM channel in OPWMCB mode.

Default value: 0

phase-shift

int

Phase Shift (in ticks) for PWM channel in OPWMB mode.

Default value: 0

input-filter

int

Select the minimum input pulse width, in filter clock cycles that can pass
through the input filter. The filter latency - the difference in time between
the input and the response is three clock edges. Default 0 means the filter
is bypassed. The clock source for programmable input filter is eMIOS clock.

Default value: 0

Legal values: 0, 2, 4, 8, 16

Specifier cell names

  • pwm cells: channel, period, flags