Pulse-Width Modulation Controller (PWM) HW driver source file.
More...
Pulse-Width Modulation Controller (PWM) HW driver source file.
- Note
- These functions should only be used if the PWM unit was synthesized (IO_PWM_EN = true).
- See also
- https://stnolting.github.io/neorv32/sw/files.html
◆ neorv32_pmw_get_num_channels()
int neorv32_pmw_get_num_channels |
( |
void | | ) |
|
Get number of implemented PWM channels.
- Warning
- This function will override all channel configuration registers.
- Returns
- Number of implemented PWM channels.
◆ neorv32_pwm_available()
int neorv32_pwm_available |
( |
void | | ) |
|
Check if PWM unit was synthesized.
- Returns
- 0 if PWM was not synthesized, 1 if PWM is available.
◆ neorv32_pwm_ch_disable()
void neorv32_pwm_ch_disable |
( |
int | channel | ) |
|
Disable PWM channel.
- Parameters
-
[in] | channel | Channel select (0..15). |
◆ neorv32_pwm_ch_enable()
void neorv32_pwm_ch_enable |
( |
int | channel | ) |
|
Enable PWM channel.
- Parameters
-
[in] | channel | Channel select (0..15). |
◆ neorv32_pwm_ch_set_clock()
void neorv32_pwm_ch_set_clock |
( |
int | channel, |
|
|
int | prsc, |
|
|
int | cdiv ) |
Set PWM channel's clock configuration.
- Parameters
-
[in] | channel | Channel select (0..15). |
[in] | prsc | Coarse clock prescaler select (3-bit, LSB-aligned). See NEORV32_CLOCK_PRSC_enum. |
[in] | cdiv | Fine clock divider value (10-bit, LSB-aligned). |
◆ neorv32_pwm_ch_set_duty()
void neorv32_pwm_ch_set_duty |
( |
int | channel, |
|
|
int | duty ) |
Set PWM channel's duty cycle.
- Parameters
-
[in] | channel | Channel select (0..15). |
[in] | duty | Duty cycle (8-bit, LSB-aligned). |