![]() |
NEORV32 API Reference
The NEORV32 RISC-V Processor
|
Pulse-Width Modulation Controller (PWM) HW driver source file. More...
#include <neorv32.h>Functions | |
| int | neorv32_pwm_available (void) |
| int | neorv32_pmw_get_num_channels (void) |
| void | neorv32_pwm_set_clock (int prsc) |
| void | neorv32_pwm_ch_enable_mask (uint32_t mask) |
| void | neorv32_pwm_ch_disable_mask (uint32_t mask) |
| void | neorv32_pwm_ch_enable_single (int ch) |
| void | neorv32_pwm_ch_disable_single (int ch) |
| void | neorv32_pwm_ch_setup (int ch, int top, int pol) |
| void | neorv32_pwm_ch_set_duty (int ch, int duty) |
Pulse-Width Modulation Controller (PWM) HW driver source file.
| int neorv32_pmw_get_num_channels | ( | void | ) |
Get number of implemented PWM channels.
| int neorv32_pwm_available | ( | void | ) |
Check if PWM unit was synthesized.
| void neorv32_pwm_ch_disable_mask | ( | uint32_t | mask | ) |
Disable PWM channel using bit mask.
| [in] | mask | Channel bit mask. |
| void neorv32_pwm_ch_disable_single | ( | int | ch | ) |
Disable individual PWM channel using bit mask.
| [in] | ch | Channel select (0..31). |
| void neorv32_pwm_ch_enable_mask | ( | uint32_t | mask | ) |
Enable PWM channel using bit mask.
| [in] | mask | Channel bit mask. |
| void neorv32_pwm_ch_enable_single | ( | int | ch | ) |
Enable individual PWM channel.
| [in] | ch | Channel select (0..31). |
| void neorv32_pwm_ch_set_duty | ( | int | ch, |
| int | duty ) |
Set PWM channel's duty cycle.
| [in] | ch | Channel select (0..31). |
| [in] | duty | Duty cycle (16-bit). |
| void neorv32_pwm_ch_setup | ( | int | ch, |
| int | top, | ||
| int | pol ) |
Configure a single channel's wrap value and polarity.
| [in] | ch | Channel select (0..31). |
| [in] | top | Wrap value for PWM counter (16-bit). |
| [in] | pol | Idle polarity of PWM output (0 or 1). |
| void neorv32_pwm_set_clock | ( | int | prsc | ) |
Set global PWM counter clock prescaler.
| [in] | prsc | Clock prescaler select (0..7). See NEORV32_CLOCK_PRSC_enum. |