![]() |
NEORV32 API Reference
The NEORV32 RISC-V Processor
|
Pulse-Width Modulation Controller (PWM) HW driver header file. More...
#include <stdint.h>Go to the source code of this file.
Data Structures | |
| struct | neorv32_pwm_t |
Macros | |
IO Device: Pulse Width Modulation Controller (PWM) | |
| #define | NEORV32_PWM ((neorv32_pwm_t*) (NEORV32_PWM_BASE)) |
Functions | |
Prototypes | |
| 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 header file.
| #define NEORV32_PWM ((neorv32_pwm_t*) (NEORV32_PWM_BASE)) |
PWM module hardware handle (neorv32_pwm_t)
| 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 (16 bits). |
| void neorv32_pwm_ch_disable_single | ( | int | ch | ) |
Disable individual PWM channel using bit mask.
| [in] | ch | Channel select (0..16). |
| void neorv32_pwm_ch_enable_mask | ( | uint32_t | mask | ) |
Enable PWM channel using bit mask.
| [in] | mask | Channel bit mask (16 bits). |
| void neorv32_pwm_ch_enable_single | ( | int | ch | ) |
Enable individual PWM channel.
| [in] | ch | Channel select (0..16). |
| void neorv32_pwm_ch_set_duty | ( | int | ch, |
| int | duty ) |
Set PWM channel's duty cycle.
| [in] | ch | Channel select (0..15). |
| [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..15). |
| [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. |