22 lines
730 B
C
22 lines
730 B
C
#ifndef MRBGEMS_MACHINE_PWM_PWM_H
|
|
#define MRBGEMS_MACHINE_PWM_PWM_H
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
typedef struct {
|
|
uint32_t freq;
|
|
uint16_t duty;
|
|
bool enabled;
|
|
} machine_pwm_config_t;
|
|
|
|
int mrb_machine_pwm_impl_init(uint32_t channel, machine_pwm_config_t *config);
|
|
int mrb_machine_pwm_impl_freq_set(uint32_t channel, uint32_t freq);
|
|
uint32_t mrb_machine_pwm_impl_freq_get(uint32_t channel);
|
|
int mrb_machine_pwm_impl_duty_set(uint32_t channel, uint16_t duty);
|
|
uint16_t mrb_machine_pwm_impl_duty_get(uint32_t channel);
|
|
int mrb_machine_pwm_impl_output_set(uint32_t channel, bool enable);
|
|
bool mrb_machine_pwm_impl_output_get(uint32_t channel);
|
|
|
|
#endif // MRBGEMS_MACHINE_PWM_PWM_H
|