pwm(3)

πŸ“¦
version 1.75 Β· 4 versions
, in debian trixie, ubuntu noble, ubuntu questing

πŸ’– pwm(3) β€” Pulse Width Modulation πŸ’–

okay bestie, welcome to the pwm glow-up πŸ’… this is a page from the bcm2835 library, and it's all about making your GPIO pins pulse like they're at a concert 🎢 no cap.


✨ 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 πŸ‘‘

So here's the tea πŸ“: this lets you control 2 independent PWM channels. A limited subset of GPIO pins can be connected to one of these 2 channels, and that's how you get PWM control of GPIO pins. It's giving remote control for your pins, periodt.

You have to set the desired pin into a particular Alt Fun to PWM output. See the PWM documentation on the Main Page. iykyk πŸ’œ


πŸŽ€ Function Documentation πŸŽ€

void bcm2835_pwm_set_clock (uint32_t divisor) [extern]

Sets the PWM clock divisor, to control the basic PWM pulse widths. literally the speed dial for your pulses ✨

Parameters 🫢

  • divisor β€” Divides the basic 19.2MHz PWM clock. You can use one of the common values BCM2835_PWM_CLOCK_DIVIDER_* in bcm2835PWMClockDivider. iconic little menu of presets πŸ’…

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(). it's giving fraction energy 😭

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. main character energy fr fr πŸ‘‘

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. no pulses if you leave this off bestie, don't do that πŸ™ˆ

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. it's the ceiling, the limit, the vibe check 🌸

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. not a human author, just a very efficient little robot 🧚✨


πŸ’– that's the whole page bestie! go forth and modulate those pulses πŸ’–

okay and for the cute sign-off: this whole thing is bcm2835, Version 1.75, and it's the pwm(3) page from the Library Functions Manual. slay πŸ’…πŸŒˆβ­

πŸ“¦ where this page comes from