32 #define PWM_SYSFS_PATH_LEN 64
47 char *_export,
char *_enable,
48 char *_duty,
char *_period,
int pwm_sysfs_init(struct PWM_Sysfs *pwm, char *base_path, char *_export, char *_enable, char *_duty, char *_period, uint8_t channel)
char enable_path[PWM_SYSFS_PATH_LEN]
path to enable file
void pwm_sysfs_set_duty(struct PWM_Sysfs *pwm, uint32_t duty)
void pwm_sysfs_enable(struct PWM_Sysfs *pwm, bool enable)
#define PWM_SYSFS_PATH_LEN
int duty_cycle_fd
file descriptor to write/update duty cycle
void pwm_sysfs_set_period(struct PWM_Sysfs *pwm, uint32_t period)
uint32_t duty_cycle_nsec
current duty cycle (in nsec)
uint32_t period_nsec
current period (in nsec)
char duty_path[PWM_SYSFS_PATH_LEN]
path to duty file
char period_path[PWM_SYSFS_PATH_LEN]
path to period file
bool enabled
true if pwm is enabled