PX4 Firmware
PX4 Autopilot Software http://px4.io
|
Driver/configurator for the Mikrokopter BL-Ctrl. More...
#include <px4_platform_common/px4_config.h>
#include <px4_platform_common/tasks.h>
#include <drivers/device/i2c.h>
#include <parameters/param.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>
#include <semaphore.h>
#include <string.h>
#include <fcntl.h>
#include <poll.h>
#include <errno.h>
#include <stdio.h>
#include <math.h>
#include <unistd.h>
#include <nuttx/arch.h>
#include <nuttx/i2c/i2c_master.h>
#include <board_config.h>
#include <drivers/device/device.h>
#include <drivers/drv_pwm_output.h>
#include <drivers/drv_hrt.h>
#include <drivers/drv_rc_input.h>
#include <drivers/drv_mixer.h>
#include <drivers/drv_tone_alarm.h>
#include <systemlib/err.h>
#include <lib/mixer/MixerGroup.hpp>
#include <uORB/topics/actuator_controls.h>
#include <uORB/topics/actuator_outputs.h>
#include <uORB/topics/actuator_armed.h>
#include <uORB/topics/esc_status.h>
#include <uORB/topics/tune_control.h>
Go to the source code of this file.
Classes | |
struct | MotorData_t |
class | MK |
Macros | |
#define | I2C_BUS_SPEED 100000 |
#define | UPDATE_RATE 200 |
#define | MAX_MOTORS 8 |
#define | BLCTRL_BASE_ADDR 0x29 |
#define | BLCTRL_OLD 0 |
#define | BLCTRL_NEW 1 |
#define | BLCTRL_MIN_VALUE -0.920F |
#define | MOTOR_STATE_PRESENT_MASK 0x80 |
#define | MOTOR_STATE_ERROR_MASK 0x7F |
#define | MOTOR_SPINUP_COUNTER 30 |
#define | MOTOR_LOCATE_DELAY 10000000 |
#define | ESC_UORB_PUBLISH_DELAY 500000 |
#define | CONTROL_INPUT_DROP_LIMIT_MS 20 |
#define | RC_MIN_VALUE 1010 |
#define | RC_MAX_VALUE 2100 |
Enumerations | |
enum | MappingMode |
enum | FrameType |
Functions | |
__EXPORT int | mkblctrl_main (int argc, char *argv[]) |
Variables | |
const int | blctrlAddr_quad_plus [] = { 2, 2, -2, -2, 0, 0, 0, 0 } |
const int | blctrlAddr_hexa_plus [] = { 0, 2, 2, -2, 1, -3, 0, 0 } |
const int | blctrlAddr_octo_plus [] = { 0, 3, -1, 0, 3, 0, 0, -5 } |
const int | blctrlAddr_quad_x [] = { 2, 2, -2, -2, 0, 0, 0, 0 } |
const int | blctrlAddr_hexa_x [] = { 2, 4, -2, 0, -3, -1, 0, 0 } |
const int | blctrlAddr_octo_x [] = { 1, 4, 0, 1, -4, 1, 1, -4 } |
const int | blctrlAddr_px4 [] = { 0, 0, 0, 0, 0, 0, 0, 0} |
int | addrTranslator [] = {0, 0, 0, 0, 0, 0, 0, 0} |
Driver/configurator for the Mikrokopter BL-Ctrl.
Definition in file mkblctrl.cpp.
#define BLCTRL_BASE_ADDR 0x29 |
Definition at line 88 of file mkblctrl.cpp.
Referenced by MK::mk_check_for_blctrl(), MK::mk_servo_locate(), MK::mk_servo_set(), MK::mk_servo_test(), and MK::task_main().
#define BLCTRL_MIN_VALUE -0.920F |
Definition at line 91 of file mkblctrl.cpp.
Referenced by MK::mk_servo_test(), and MK::task_main().
#define BLCTRL_NEW 1 |
Definition at line 90 of file mkblctrl.cpp.
Referenced by MK::mk_check_for_blctrl().
#define BLCTRL_OLD 0 |
Definition at line 89 of file mkblctrl.cpp.
Referenced by MK::mk_check_for_blctrl(), MK::mk_servo_set(), and MK::mk_servo_test().
#define CONTROL_INPUT_DROP_LIMIT_MS 20 |
Definition at line 98 of file mkblctrl.cpp.
Referenced by MK::task_main().
#define ESC_UORB_PUBLISH_DELAY 500000 |
Definition at line 96 of file mkblctrl.cpp.
Referenced by MK::task_main().
#define I2C_BUS_SPEED 100000 |
Definition at line 85 of file mkblctrl.cpp.
#define MAX_MOTORS 8 |
Definition at line 87 of file mkblctrl.cpp.
Referenced by MK::mk_check_for_blctrl().
#define MOTOR_LOCATE_DELAY 10000000 |
Definition at line 95 of file mkblctrl.cpp.
Referenced by MK::mk_servo_locate().
#define MOTOR_SPINUP_COUNTER 30 |
Definition at line 94 of file mkblctrl.cpp.
Referenced by MK::mk_servo_test().
#define MOTOR_STATE_ERROR_MASK 0x7F |
Definition at line 93 of file mkblctrl.cpp.
Referenced by MK::mk_servo_set().
#define MOTOR_STATE_PRESENT_MASK 0x80 |
Definition at line 92 of file mkblctrl.cpp.
Referenced by MK::mk_check_for_blctrl(), and MK::mk_servo_set().
#define RC_MAX_VALUE 2100 |
Definition at line 100 of file mkblctrl.cpp.
Referenced by mkblctrl_main().
#define RC_MIN_VALUE 1010 |
Definition at line 99 of file mkblctrl.cpp.
Referenced by mkblctrl_main().
#define UPDATE_RATE 200 |
Definition at line 86 of file mkblctrl.cpp.
enum FrameType |
Definition at line 1150 of file mkblctrl.cpp.
enum MappingMode |
Definition at line 1145 of file mkblctrl.cpp.
int mkblctrl_main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 1249 of file mkblctrl.cpp.
References errx, MK::FRAME_PLUS, MK::FRAME_X, MK::MAPPING_MK, MK::MAPPING_PX4, OK, RC_MAX_VALUE, and RC_MIN_VALUE.
int addrTranslator[] = {0, 0, 0, 0, 0, 0, 0, 0} |
Definition at line 211 of file mkblctrl.cpp.
Referenced by MK::mk_servo_locate(), MK::mk_servo_set(), MK::mk_servo_test(), and MK::set_motor_count().
const int blctrlAddr_hexa_plus[] = { 0, 2, 2, -2, 1, -3, 0, 0 } |
Definition at line 202 of file mkblctrl.cpp.
Referenced by MK::set_motor_count().
const int blctrlAddr_hexa_x[] = { 2, 4, -2, 0, -3, -1, 0, 0 } |
Definition at line 206 of file mkblctrl.cpp.
Referenced by MK::set_motor_count().
const int blctrlAddr_octo_plus[] = { 0, 3, -1, 0, 3, 0, 0, -5 } |
Definition at line 203 of file mkblctrl.cpp.
Referenced by MK::set_motor_count().
const int blctrlAddr_octo_x[] = { 1, 4, 0, 1, -4, 1, 1, -4 } |
Definition at line 207 of file mkblctrl.cpp.
Referenced by MK::set_motor_count().
const int blctrlAddr_px4[] = { 0, 0, 0, 0, 0, 0, 0, 0} |
Definition at line 209 of file mkblctrl.cpp.
Referenced by MK::set_motor_count().
const int blctrlAddr_quad_plus[] = { 2, 2, -2, -2, 0, 0, 0, 0 } |
Definition at line 201 of file mkblctrl.cpp.
Referenced by MK::set_motor_count().
const int blctrlAddr_quad_x[] = { 2, 2, -2, -2, 0, 0, 0, 0 } |
Definition at line 205 of file mkblctrl.cpp.
Referenced by MK::set_motor_count().