Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
Main Page
Related Pages
Modules
Data Structures
Data Structures
Data Structure Index
Data Fields
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Files
File List
Globals
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
m
n
p
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
pwm_sysfs.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2017 Gautier Hattenberger <gautier.hattenberger@enac.fr>
3
*
4
* This file is part of Paparazzi.
5
*
6
* Paparazzi is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2, or (at your option)
9
* any later version.
10
*
11
* Paparazzi is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with paparazzi; see the file COPYING. If not, see
18
* <http://www.gnu.org/licenses/>.
19
*/
20
27
#ifndef PWM_SYSFS_H
28
#define PWM_SYSFS_H
29
30
#include "
std.h
"
31
32
#define PWM_SYSFS_PATH_LEN 64
33
36
struct
PWM_Sysfs
{
37
uint32_t
duty_cycle_nsec
;
38
uint32_t
period_nsec
;
39
bool
enabled
;
40
int
duty_cycle_fd
;
41
char
enable_path
[
PWM_SYSFS_PATH_LEN
];
42
char
duty_path
[
PWM_SYSFS_PATH_LEN
];
43
char
period_path
[
PWM_SYSFS_PATH_LEN
];
44
};
45
46
extern
int
pwm_sysfs_init
(
struct
PWM_Sysfs
*
pwm
,
char
*base_path,
47
char
*_export,
char
*_enable,
48
char
*_duty,
char
*_period,
49
uint8_t
channel
);
50
extern
void
pwm_sysfs_set_period
(
struct
PWM_Sysfs
*
pwm
,
uint32_t
period);
51
extern
void
pwm_sysfs_set_duty
(
struct
PWM_Sysfs
*
pwm
,
uint32_t
duty);
52
extern
void
pwm_sysfs_enable
(
struct
PWM_Sysfs
*
pwm
,
bool
enable);
53
54
#endif
55
channel
static uint8_t channel
Definition:
ADS8344.c:80
PWM_Sysfs::enable_path
char enable_path[PWM_SYSFS_PATH_LEN]
path to enable file
Definition:
pwm_sysfs.h:41
uint32_t
unsigned long uint32_t
Definition:
types.h:18
PWM_Sysfs::duty_path
char duty_path[PWM_SYSFS_PATH_LEN]
path to duty file
Definition:
pwm_sysfs.h:42
std.h
pwm_sysfs_init
int pwm_sysfs_init(struct PWM_Sysfs *pwm, char *base_path, char *_export, char *_enable, char *_duty, char *_period, uint8_t channel)
Definition:
pwm_sysfs.c:52
uint8_t
unsigned char uint8_t
Definition:
types.h:14
PWM_Sysfs::period_path
char period_path[PWM_SYSFS_PATH_LEN]
path to period file
Definition:
pwm_sysfs.h:43
pwm_sysfs_set_duty
void pwm_sysfs_set_duty(struct PWM_Sysfs *pwm, uint32_t duty)
Definition:
pwm_sysfs.c:101
PWM_Sysfs::duty_cycle_fd
int duty_cycle_fd
file descriptor to write/update duty cycle
Definition:
pwm_sysfs.h:40
PWM_Sysfs::enabled
bool enabled
true if pwm is enabled
Definition:
pwm_sysfs.h:39
pwm
timer subsystem PPM input on SERVO6 pin actuators pwm(if PWM_USE_TIM1) TIM8 radio_control/ppm(if USE_PPM_TIM8)(non-advanced timers using RCC_APB2) TIM2 adc(if USE_AD_TIM2
PWM_Sysfs::duty_cycle_nsec
uint32_t duty_cycle_nsec
current duty cycle (in nsec)
Definition:
pwm_sysfs.h:37
PWM_Sysfs::period_nsec
uint32_t period_nsec
current period (in nsec)
Definition:
pwm_sysfs.h:38
pwm_sysfs_set_period
void pwm_sysfs_set_period(struct PWM_Sysfs *pwm, uint32_t period)
Definition:
pwm_sysfs.c:91
PWM_Sysfs
PWM structure.
Definition:
pwm_sysfs.h:36
pwm_sysfs_enable
void pwm_sysfs_enable(struct PWM_Sysfs *pwm, bool enable)
Definition:
pwm_sysfs.c:114
PWM_SYSFS_PATH_LEN
#define PWM_SYSFS_PATH_LEN
Definition:
pwm_sysfs.h:32
sw
airborne
arch
linux
mcu_periph
pwm_sysfs.h
Generated on Tue Feb 1 2022 13:51:12 for Paparazzi UAS by
1.8.17