APM:Libraries
Classes | Macros | Enumerations | Variables
RCOutput_Bebop.cpp File Reference
#include <AP_HAL/AP_HAL.h>
#include "RCOutput_Bebop.h"
#include <errno.h>
#include <poll.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/mman.h>
#include <sys/time.h>
#include <unistd.h>
#include <utility>
#include <AP_HAL/utility/sparse-endian.h>
#include <AP_Math/AP_Math.h>
#include "Util.h"
Include dependency graph for RCOutput_Bebop.cpp:

Go to the source code of this file.

Classes

struct  bldc_info
 

Macros

#define BEBOP_BLDC_I2C_ADDR   0x08
 
#define BEBOP_BLDC_STARTPROP   0x40
 
#define BEBOP_BLDC_SETREFSPEED   0x02
 
#define BEBOP_BLDC_GETOBSDATA   0x20
 
#define BEBOP_BLDC_TOGGLE_GPIO   0x4d
 
#define BEBOP_BLDC_GPIO_0   (1 << 0)
 
#define BEBOP_BLDC_GPIO_1   (1 << 1)
 
#define BEBOP_BLDC_GPIO_2   (1 << 2)
 
#define BEBOP_BLDC_GPIO_3   (1 << 3)
 
#define BEBOP_BLDC_GPIO_POWER   (1 << 4)
 
#define BEBOP_BLDC_STOP_PROP   0x60
 
#define BEBOP_BLDC_CLEAR_ERROR   0x80
 
#define BEBOP_BLDC_PLAY_SOUND   0x82
 
#define BEBOP_BLDC_GET_INFO   0xA0
 
#define BEBOP_BLDC_MIN_PERIOD_US   1100
 
#define BEBOP_BLDC_MAX_PERIOD_US   1900
 
#define BEBOP_BLDC_MIN_RPM   1000
 
#define BEBOP_BLDC_MAX_RPM_1   11000
 
#define BEBOP_BLDC_MAX_RPM_2   12200
 
#define BEBOP_BLDC_MAX_RPM_DISCO   12500
 
#define RCOUT_BEBOP_RTPRIO   14
 
#define BEBOP_BLDC_TIMEOUT_NS   500000000
 

Enumerations

enum  { BEBOP_BLDC_STARTED, BEBOP_BLDC_STOPPED }
 
enum  BLDC_STATUS { BEBOP_BLDC_STATUS_STOPPED =1, BEBOP_BLDC_STATUS_RAMPUP =2, BEBOP_BLDC_STATUS_RUNNING =4, BEBOP_BLDC_STATUS_RAMPDOWN =5 }
 

Variables

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

Macro Definition Documentation

◆ BEBOP_BLDC_CLEAR_ERROR

#define BEBOP_BLDC_CLEAR_ERROR   0x80

Definition at line 48 of file RCOutput_Bebop.cpp.

Referenced by Linux::RCOutput_Bebop::_clear_error().

◆ BEBOP_BLDC_GET_INFO

#define BEBOP_BLDC_GET_INFO   0xA0

Definition at line 52 of file RCOutput_Bebop.cpp.

Referenced by Linux::RCOutput_Bebop::_get_info().

◆ BEBOP_BLDC_GETOBSDATA

#define BEBOP_BLDC_GETOBSDATA   0x20

Definition at line 26 of file RCOutput_Bebop.cpp.

Referenced by Linux::RCOutput_Bebop::read_obs_data().

◆ BEBOP_BLDC_GPIO_0

#define BEBOP_BLDC_GPIO_0   (1 << 0)

Definition at line 40 of file RCOutput_Bebop.cpp.

◆ BEBOP_BLDC_GPIO_1

#define BEBOP_BLDC_GPIO_1   (1 << 1)

Definition at line 41 of file RCOutput_Bebop.cpp.

◆ BEBOP_BLDC_GPIO_2

#define BEBOP_BLDC_GPIO_2   (1 << 2)

Definition at line 42 of file RCOutput_Bebop.cpp.

Referenced by Linux::RCOutput_Bebop::init().

◆ BEBOP_BLDC_GPIO_3

#define BEBOP_BLDC_GPIO_3   (1 << 3)

Definition at line 43 of file RCOutput_Bebop.cpp.

◆ BEBOP_BLDC_GPIO_POWER

#define BEBOP_BLDC_GPIO_POWER   (1 << 4)

Definition at line 44 of file RCOutput_Bebop.cpp.

Referenced by Linux::RCOutput_Bebop::init().

◆ BEBOP_BLDC_I2C_ADDR

#define BEBOP_BLDC_I2C_ADDR   0x08

Definition at line 22 of file RCOutput_Bebop.cpp.

◆ BEBOP_BLDC_MAX_PERIOD_US

#define BEBOP_BLDC_MAX_PERIOD_US   1900

Definition at line 55 of file RCOutput_Bebop.cpp.

◆ BEBOP_BLDC_MAX_RPM_1

#define BEBOP_BLDC_MAX_RPM_1   11000

Definition at line 58 of file RCOutput_Bebop.cpp.

Referenced by Linux::RCOutput_Bebop::_run_rcout().

◆ BEBOP_BLDC_MAX_RPM_2

#define BEBOP_BLDC_MAX_RPM_2   12200

Definition at line 59 of file RCOutput_Bebop.cpp.

Referenced by Linux::RCOutput_Bebop::_run_rcout().

◆ BEBOP_BLDC_MAX_RPM_DISCO

#define BEBOP_BLDC_MAX_RPM_DISCO   12500

Definition at line 60 of file RCOutput_Bebop.cpp.

Referenced by Linux::RCOutput_Bebop::_run_rcout().

◆ BEBOP_BLDC_MIN_PERIOD_US

#define BEBOP_BLDC_MIN_PERIOD_US   1100

Definition at line 54 of file RCOutput_Bebop.cpp.

◆ BEBOP_BLDC_MIN_RPM

#define BEBOP_BLDC_MIN_RPM   1000

Definition at line 56 of file RCOutput_Bebop.cpp.

Referenced by Linux::RCOutput_Bebop::_period_us_to_rpm().

◆ BEBOP_BLDC_PLAY_SOUND

#define BEBOP_BLDC_PLAY_SOUND   0x82

◆ BEBOP_BLDC_SETREFSPEED

#define BEBOP_BLDC_SETREFSPEED   0x02

Definition at line 24 of file RCOutput_Bebop.cpp.

Referenced by Linux::RCOutput_Bebop::_set_ref_speed().

◆ BEBOP_BLDC_STARTPROP

#define BEBOP_BLDC_STARTPROP   0x40

Definition at line 23 of file RCOutput_Bebop.cpp.

Referenced by Linux::RCOutput_Bebop::_start_prop().

◆ BEBOP_BLDC_STOP_PROP

#define BEBOP_BLDC_STOP_PROP   0x60

Definition at line 46 of file RCOutput_Bebop.cpp.

Referenced by Linux::RCOutput_Bebop::_stop_prop().

◆ BEBOP_BLDC_TIMEOUT_NS

#define BEBOP_BLDC_TIMEOUT_NS   500000000

Definition at line 67 of file RCOutput_Bebop.cpp.

Referenced by Linux::RCOutput_Bebop::_run_rcout().

◆ BEBOP_BLDC_TOGGLE_GPIO

#define BEBOP_BLDC_TOGGLE_GPIO   0x4d

Definition at line 39 of file RCOutput_Bebop.cpp.

Referenced by Linux::RCOutput_Bebop::_toggle_gpio().

◆ RCOUT_BEBOP_RTPRIO

#define RCOUT_BEBOP_RTPRIO   14

Definition at line 65 of file RCOutput_Bebop.cpp.

Referenced by Linux::RCOutput_Bebop::init().

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
BEBOP_BLDC_STARTED 
BEBOP_BLDC_STOPPED 

Definition at line 69 of file RCOutput_Bebop.cpp.

◆ BLDC_STATUS

Enumerator
BEBOP_BLDC_STATUS_STOPPED 
BEBOP_BLDC_STATUS_RAMPUP 
BEBOP_BLDC_STATUS_RUNNING 
BEBOP_BLDC_STATUS_RAMPDOWN 

Definition at line 75 of file RCOutput_Bebop.cpp.

Variable Documentation

◆ hal

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

Definition at line 84 of file RCOutput_Bebop.cpp.