pwm(3)

NAME
pwm - Pulse Width Modulation

SYNOPSIS

  Functions

void bcm2835_pwm_set_clock (uint32_t divisor)
void bcm2835_pwm_set_mode (uint8_t channel, uint8_t markspace, uint8_t enabled)
void bcm2835_pwm_set_range (uint8_t channel, uint32_t range)
void bcm2835_pwm_set_data (uint8_t channel, uint32_t data)

Detailed Description

Allows control of 2 independent PWM channels. A limited subset of GPIO pins can be connected to one of these 2 channels, allowing PWM control of GPIO pins. You have to set the desired pin into a particular Alt Fun to PWM output. See the PWM documentation on the Main Page.

Function Documentation

  void bcm2835_pwm_set_clock (uint32_t divisor) [extern]
Sets the PWM clock divisor, to control the basic PWM pulse widths.

Parameters
    divisor Divides the basic 19.2MHz PWM clock. You can use one of the common values BCM2835_PWM_CLOCK_DIVIDER_* in bcm2835PWMClockDivider

  void bcm2835_pwm_set_data (uint8_t channel, uint32_t data) [extern]
Sets the PWM pulse ratio to emit to DATA/RANGE, where RANGE is set by bcm2835_pwm_set_range().

Parameters
    channel The PWM channel. 0 or 1.
    data Controls the PWM output ratio as a fraction of the range. Can vary from 0 to RANGE.

  void bcm2835_pwm_set_mode (uint8_t channel, uint8_t markspace, uint8_t enabled) [extern]
Sets the mode of the given PWM channel, allowing you to control the PWM mode and enable/disable that channel

Parameters
    channel The PWM channel. 0 or 1.
    markspace Set true if you want Mark-Space mode. 0 for Balanced mode.
    enabled Set true to enable this channel and produce PWM pulses.

  void bcm2835_pwm_set_range (uint8_t channel, uint32_t range) [extern]
Sets the maximum range of the PWM output. The data value can vary between 0 and this range to control PWM output

Parameters
    channel The PWM channel. 0 or 1.
    range The maximum value permitted for DATA.

Author

Generated automatically by Doxygen for bcm2835 from the source code.