APM:Libraries
GPIO.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "AP_HAL_Empty.h"
4 
5 class Empty::GPIO : public AP_HAL::GPIO {
6 public:
7  GPIO();
8  void init();
9  void pinMode(uint8_t pin, uint8_t output);
10  int8_t analogPinToDigitalPin(uint8_t pin);
11  uint8_t read(uint8_t pin);
12  void write(uint8_t pin, uint8_t value);
13  void toggle(uint8_t pin);
14 
15  /* Alternative interface: */
16  AP_HAL::DigitalSource* channel(uint16_t n);
17 
18  /* Interrupt interface: */
19  bool attach_interrupt(uint8_t interrupt_num, AP_HAL::Proc p,
20  uint8_t mode);
21 
22  /* return true if USB cable is connected */
23  bool usb_connected(void);
24 };
25 
27 public:
28  DigitalSource(uint8_t v);
29  void mode(uint8_t output);
30  uint8_t read();
31  void write(uint8_t value);
32  void toggle();
33 private:
34  uint8_t _v;
35 };
GPIO()
Definition: GPIO.cpp:6
bool usb_connected(void)
Definition: GPIO.cpp:42
void(* Proc)(void)
AP_HAL::DigitalSource * channel(uint16_t n)
Definition: GPIO.cpp:32
int8_t analogPinToDigitalPin(uint8_t pin)
Definition: GPIO.cpp:15
void pinMode(uint8_t pin, uint8_t output)
Definition: GPIO.cpp:12
void write(uint8_t pin, uint8_t value)
Definition: GPIO.cpp:25
float v
Definition: Printf.cpp:15
uint8_t _v
Definition: GPIO.h:34
uint8_t read(uint8_t pin)
Definition: GPIO.cpp:21
bool attach_interrupt(uint8_t interrupt_num, AP_HAL::Proc p, uint8_t mode)
Definition: GPIO.cpp:37
float value
void toggle(uint8_t pin)
Definition: GPIO.cpp:28
static int8_t pin
Definition: AnalogIn.cpp:15
void init()
Definition: GPIO.cpp:9