Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
#include "std.h"
Go to the source code of this file.
Data Structures | |
struct | PWM_Sysfs |
PWM structure. More... | |
Macros | |
#define | PWM_SYSFS_PATH_LEN 64 |
Functions | |
int | pwm_sysfs_init (struct PWM_Sysfs *pwm, char *base_path, char *_export, char *_enable, char *_duty, char *_period, uint8_t channel) |
void | pwm_sysfs_set_period (struct PWM_Sysfs *pwm, uint32_t period) |
void | pwm_sysfs_set_duty (struct PWM_Sysfs *pwm, uint32_t duty) |
void | pwm_sysfs_enable (struct PWM_Sysfs *pwm, bool enable) |
PWM servos handling using Linux sysfs
Based on PWM_Sysfs driver from ardupilot released under GPL v3
Definition in file pwm_sysfs.h.
struct PWM_Sysfs |
PWM structure.
Definition at line 36 of file pwm_sysfs.h.
Data Fields | ||
---|---|---|
int | duty_cycle_fd | file descriptor to write/update duty cycle |
uint32_t | duty_cycle_nsec | current duty cycle (in nsec) |
char | duty_path[PWM_SYSFS_PATH_LEN] | path to duty file |
char | enable_path[PWM_SYSFS_PATH_LEN] | path to enable file |
bool | enabled | true if pwm is enabled |
uint32_t | period_nsec | current period (in nsec) |
char | period_path[PWM_SYSFS_PATH_LEN] | path to period file |
#define PWM_SYSFS_PATH_LEN 64 |
Definition at line 32 of file pwm_sysfs.h.
void pwm_sysfs_enable | ( | struct PWM_Sysfs * | pwm, |
bool | enable | ||
) |
Definition at line 114 of file pwm_sysfs.c.
References PS_DEBUG_PRINT, pwm(), and write_file().
Referenced by pwm_sysfs_set_duty().
int pwm_sysfs_init | ( | struct PWM_Sysfs * | pwm, |
char * | base_path, | ||
char * | _export, | ||
char * | _enable, | ||
char * | _duty, | ||
char * | _period, | ||
uint8_t | channel | ||
) |
Definition at line 52 of file pwm_sysfs.c.
References channel, PS_DEBUG_PRINT, pwm(), PWM_SYSFS_DEFAULT_PERIOD, PWM_SYSFS_PATH_LEN, pwm_sysfs_set_period(), and write_file().
Referenced by actuators_disco_init().
Definition at line 101 of file pwm_sysfs.c.
References PS_DEBUG_PRINT, pwm(), and pwm_sysfs_enable().
Referenced by actuators_disco_set().
Definition at line 91 of file pwm_sysfs.c.
References PS_DEBUG_PRINT, pwm(), and write_file().
Referenced by pwm_sysfs_init().