APM:Libraries
libraries
AP_HAL_Linux
GPIO.cpp
Go to the documentation of this file.
1
#include <
AP_HAL/AP_HAL.h
>
2
3
#include "
GPIO.h
"
4
5
using namespace
Linux
;
6
7
static
const
AP_HAL::HAL
&
hal
=
AP_HAL::get_HAL
();
8
9
DigitalSource::DigitalSource
(uint8_t
v
) :
10
_v(v)
11
{
12
13
}
14
15
void
DigitalSource::mode
(uint8_t output)
16
{
17
hal.
gpio
->
pinMode
(
_v
, output);
18
}
19
20
uint8_t
DigitalSource::read
()
21
{
22
return
hal.
gpio
->
read
(
_v
);
23
}
24
25
void
DigitalSource::write
(uint8_t
value
)
26
{
27
return
hal.
gpio
->
write
(
_v
,value);
28
}
29
30
void
DigitalSource::toggle
()
31
{
32
write
(!
read
());
33
}
Linux::DigitalSource::DigitalSource
DigitalSource(uint8_t v)
Definition:
GPIO.cpp:9
AP_HAL.h
GPIO.h
Linux::DigitalSource::read
uint8_t read()
Definition:
GPIO.cpp:20
AP_HAL::GPIO::write
virtual void write(uint8_t pin, uint8_t value)=0
Linux::DigitalSource::toggle
void toggle()
Definition:
GPIO.cpp:30
AP_HAL::HAL
Definition:
HAL.h:26
Linux::DigitalSource::write
void write(uint8_t value)
Definition:
GPIO.cpp:25
Linux::hal
static const AP_HAL::HAL & hal
Definition:
I2CDevice.cpp:61
AP_HAL::GPIO::pinMode
virtual void pinMode(uint8_t pin, uint8_t output)=0
v
float v
Definition:
Printf.cpp:15
AP_HAL::get_HAL
const HAL & get_HAL()
Definition:
HAL_ChibiOS_Class.cpp:234
AP_HAL::GPIO::read
virtual uint8_t read(uint8_t pin)=0
Linux::DigitalSource::mode
void mode(uint8_t output)
Definition:
GPIO.cpp:15
AP_HAL::HAL::gpio
AP_HAL::GPIO * gpio
Definition:
HAL.h:111
value
float value
Definition:
SIM_FlightAxis.cpp:42
Linux
Definition:
CameraSensor.h:19
Linux::DigitalSource::_v
uint8_t _v
Definition:
GPIO.h:15
Generated on Sun Jun 17 2018 14:18:48 for APM:Libraries by
1.8.13