File syn_port_pwm.h¶
FileList > port > syn_port_pwm.h
Go to the source code of this file
Hardware PWM port interface — implement these for your platform. More...
#include "../common/syn_defs.h"#include <stdint.h>
Public Functions¶
| Type | Name |
|---|---|
| void | syn_port_pwm_enable (uint8_t channel, bool enable) Enable/disable PWM output. |
| SYN_Status | syn_port_pwm_init (uint8_t channel, uint32_t freq_hz) Initialize a PWM channel. |
| void | syn_port_pwm_set_duty (uint8_t channel, uint8_t duty_pct) Set PWM duty cycle. |
| void | syn_port_pwm_set_duty_raw (uint8_t channel, uint16_t duty_u16) Set PWM duty cycle with fine resolution. |
| void | syn_port_pwm_set_freq (uint8_t channel, uint32_t freq_hz) Set PWM frequency (runtime change). |
Detailed Description¶
Provides channel-based PWM control. Each channel maps to a physical timer/output pin on your MCU.
Public Functions Documentation¶
function syn_port_pwm_enable¶
Enable/disable PWM output.
Parameters:
channelPWM channel index.enabletrue to enable, false to disable.
function syn_port_pwm_init¶
Initialize a PWM channel.
Parameters:
channelPWM channel number.freq_hzPWM frequency in Hz.
Returns:
SYN_OK on success.
function syn_port_pwm_set_duty¶
Set PWM duty cycle.
Parameters:
channelPWM channel number.duty_pctDuty cycle 0–100 (percent).
function syn_port_pwm_set_duty_raw¶
Set PWM duty cycle with fine resolution.
Parameters:
channelPWM channel number.duty_u16Duty cycle 0–65535 (0 = off, 65535 = 100%).
function syn_port_pwm_set_freq¶
Set PWM frequency (runtime change).
Parameters:
channelPWM channel number.freq_hzNew frequency in Hz.
The documentation for this class was generated from the following file src/syntropic/port/syn_port_pwm.h