|
FastLED 3.9.15
|
| int fl::setPwmFrequency | ( | int | pin, |
| u32 | frequency_hz ) |
Set PWM frequency for a pin.
Subsequent analogWrite()/setPwm16() calls use this frequency. Automatically selects native hardware PWM or ISR-based software PWM depending on platform.
| pin | Pin number (platform-specific numbering) |
| frequency_hz | Desired PWM frequency in Hz (1-500 Hz for ISR, platform-dependent for native HW) |
Definition at line 274 of file pin.cpp.hpp.
References fl::pwm_state::allocate(), fl::pwm_state::PwmPinState::backend, digitalWrite(), fl::pwm_state::PwmPinState::duty_cycle, fl::pwm_state::ensureIsrActive(), fl::pwm_state::findByPin(), FL_WARN, fl::pwm_state::PwmPinState::frequency_hz, fl::pwm_state::PwmPinState::high_ticks, fl::pwm_state::ISR_FREQUENCY_HZ, fl::pwm_state::IsrSoftware, Low, fl::pwm_state::MAX_ISR_PWM_FREQUENCY, fl::pwm_state::MAX_PWM_CHANNELS, fl::pwm_state::Native, Output, fl::pwm_state::PwmPinState::period_ticks, fl::pwm_state::PwmPinState::pin, fl::pwm_state::PwmPinState::pin_state, pinMode(), fl::pwm_state::releaseChannel(), and fl::pwm_state::PwmPinState::tick_counter.
Referenced by initPanels().
Here is the call graph for this function:
Here is the caller graph for this function: