APM:Libraries
Classes | Macros | Variables
GPIO_Sysfs.cpp File Reference
#include "GPIO_Sysfs.h"
#include <AP_HAL/AP_HAL.h>
#include <fcntl.h>
#include <stdio.h>
#include <sys/stat.h>
#include <unistd.h>
#include "Util.h"
Include dependency graph for GPIO_Sysfs.cpp:

Go to the source code of this file.

Classes

union  gpio_params
 

Macros

#define LOW   0
 
#define HIGH   1
 
#define assert_vpin(v_, max_, ...)
 
#define UINT32_MAX_STR   "4294967295"
 
#define GPIO_BASE_PATH   "/sys/class/gpio/"
 
#define GPIO_PATH_MAX   (sizeof(GPIO_BASE_PATH) + sizeof(gpio_params) - 1)
 

Variables

static const AP_HAL::HALhal = AP_HAL::get_HAL()
 

Macro Definition Documentation

◆ assert_vpin

#define assert_vpin (   v_,
  max_,
  ... 
)
Value:
do { \
if (v_ >= max_) { \
hal.console->printf("warning (%s): vpin %u out of range [0, %u)\n",\
__PRETTY_FUNCTION__, v_, max_); \
return __VA_ARGS__; \
} \
} while (0)

Definition at line 14 of file GPIO_Sysfs.cpp.

Referenced by Linux::GPIO_Sysfs::_export_pin(), Linux::GPIO_Sysfs::channel(), Linux::GPIO_Sysfs::pinMode(), Linux::GPIO_Sysfs::read(), and Linux::GPIO_Sysfs::write().

◆ GPIO_BASE_PATH

#define GPIO_BASE_PATH   "/sys/class/gpio/"

◆ GPIO_PATH_MAX

#define GPIO_PATH_MAX   (sizeof(GPIO_BASE_PATH) + sizeof(gpio_params) - 1)

◆ HIGH

#define HIGH   1

Definition at line 13 of file GPIO_Sysfs.cpp.

Referenced by Linux::DigitalSource_Sysfs::write(), and Linux::GPIO_Sysfs::write().

◆ LOW

#define LOW   0

Definition at line 12 of file GPIO_Sysfs.cpp.

Referenced by Linux::DigitalSource_Sysfs::read(), and Linux::GPIO_Sysfs::read().

◆ UINT32_MAX_STR

#define UINT32_MAX_STR   "4294967295"

Definition at line 26 of file GPIO_Sysfs.cpp.

Variable Documentation

◆ hal

const AP_HAL::HAL& hal = AP_HAL::get_HAL()
static

Definition at line 24 of file GPIO_Sysfs.cpp.