PWM auf Pins 0 bis 20
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
#include "pwm.h"
|
||||
#include "pins.h"
|
||||
#include "hw_pwm.h"
|
||||
#include "pio_pwm.h"
|
||||
|
||||
void pwm_all_init(void) {
|
||||
hw_pwm_init();
|
||||
pio_pwm_init();
|
||||
}
|
||||
|
||||
void pwm_ch_set(unsigned channel, uint16_t level) {
|
||||
if (channel < PWM_HW_COUNT) {
|
||||
hw_pwm_set(PWM_HW_FIRST_PIN + channel, level);
|
||||
} else if (channel < PWM_TOTAL_COUNT) {
|
||||
pio_pwm_set(channel - PWM_HW_COUNT, level);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user