RocketLogger  2.0.1
pwm.c
Go to the documentation of this file.
1 
32 #include "rl.h"
33 #include "sysfs.h"
34 
35 #include "pwm.h"
36 
37 int pwm_init(void) {
44 
48 
52 
53  sysfs_write_int((EPWM0A_SYSFS_PATH "enable"), 1);
54  sysfs_write_int((EPWM1A_SYSFS_PATH "enable"), 1);
55  sysfs_write_int((EPWM1B_SYSFS_PATH "enable"), 1);
56 
57  return SUCCESS;
58 }
59 
60 void pwm_deinit(void) {
61  sysfs_write_int((EPWM0A_SYSFS_PATH "enable"), 0);
62  sysfs_write_int((EPWM1A_SYSFS_PATH "enable"), 0);
63  sysfs_write_int((EPWM1B_SYSFS_PATH "enable"), 0);
64 
68 }
void pwm_deinit(void)
Definition: pwm.c:60
int pwm_init(void)
Definition: pwm.c:37
#define EPWM0A_SYSFS_PATH
Path to the Linux sysfs ePWM0A module.
Definition: pwm.h:49
#define EPWM1B_SYSFS_INDEX
Index of the Linux sysfs ePWM1B module.
Definition: pwm.h:46
#define PWMSS0_SYSFS_PATH
Definition: pwm.h:37
#define PWM_DUTY_CYCLE_DEFAULT
Default PWM period in nanoseconds.
Definition: pwm.h:58
#define EPWM1B_SYSFS_PATH
Path to the Linux sysfs ePWM1B module.
Definition: pwm.h:53
#define PWMSS1_SYSFS_PATH
Path to the Linux sysfs PWMSS1 module device files.
Definition: pwm.h:39
#define PWM_PERIOD_DEFAULT
Default PWM period in nanoseconds.
Definition: pwm.h:56
#define EPWM1A_SYSFS_PATH
Path to the Linux sysfs ePWM1A module.
Definition: pwm.h:51
#define EPWM1A_SYSFS_INDEX
Index of the Linux sysfs ePWM1A module.
Definition: pwm.h:44
#define EPWM0A_SYSFS_INDEX
Index of the Linux sysfs ePWM0A module.
Definition: pwm.h:42
#define SUCCESS
Function return value for successful completion.
Definition: rl.h:44
int sysfs_unexport(char const *const sysfs_file, int value)
Definition: sysfs.c:54
int sysfs_write_int(char const *const sysfs_file, int value)
Definition: sysfs.c:136
int sysfs_export_unexported(char const *const sysfs_path, char const *const sysfs_export_file, int value)
Definition: sysfs.c:76