32 #define PWM_SYSFS_PATH_LEN 64
47 char *_export,
char *_enable,
48 char *_duty,
char *_period,
void pwm_sysfs_set_period(struct PWM_Sysfs *pwm, uint32_t period)
void pwm_sysfs_set_duty(struct PWM_Sysfs *pwm, uint32_t duty)
char enable_path[PWM_SYSFS_PATH_LEN]
path to enable file
int duty_cycle_fd
file descriptor to write/update duty cycle
uint32_t duty_cycle_nsec
current duty cycle (in nsec)
void pwm_sysfs_enable(struct PWM_Sysfs *pwm, bool enable)
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
int pwm_sysfs_init(struct PWM_Sysfs *pwm, char *base_path, char *_export, char *_enable, char *_duty, char *_period, uint8_t channel)
#define PWM_SYSFS_PATH_LEN
bool enabled
true if pwm is enabled
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.