APM:Libraries
Macros | Variables
RCOutput_PCA9685.cpp File Reference
#include "RCOutput_PCA9685.h"
#include <cmath>
#include <dirent.h>
#include <fcntl.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <utility>
#include <AP_HAL/AP_HAL.h>
#include "GPIO.h"
Include dependency graph for RCOutput_PCA9685.cpp:

Go to the source code of this file.

Macros

#define PCA9685_RA_MODE1   0x00
 
#define PCA9685_RA_MODE2   0x01
 
#define PCA9685_RA_LED0_ON_L   0x06
 
#define PCA9685_RA_LED0_ON_H   0x07
 
#define PCA9685_RA_LED0_OFF_L   0x08
 
#define PCA9685_RA_LED0_OFF_H   0x09
 
#define PCA9685_RA_ALL_LED_ON_L   0xFA
 
#define PCA9685_RA_ALL_LED_ON_H   0xFB
 
#define PCA9685_RA_ALL_LED_OFF_L   0xFC
 
#define PCA9685_RA_ALL_LED_OFF_H   0xFD
 
#define PCA9685_RA_PRE_SCALE   0xFE
 
#define PCA9685_MODE1_RESTART_BIT   (1 << 7)
 
#define PCA9685_MODE1_EXTCLK_BIT   (1 << 6)
 
#define PCA9685_MODE1_AI_BIT   (1 << 5)
 
#define PCA9685_MODE1_SLEEP_BIT   (1 << 4)
 
#define PCA9685_MODE1_SUB1_BIT   (1 << 3)
 
#define PCA9685_MODE1_SUB2_BIT   (1 << 2)
 
#define PCA9685_MODE1_SUB3_BIT   (1 << 1)
 
#define PCA9685_MODE1_ALLCALL_BIT   (1 << 0)
 
#define PCA9685_ALL_LED_OFF_H_SHUT   (1 << 4)
 
#define PCA9685_MODE2_INVRT_BIT   (1 << 4)
 
#define PCA9685_MODE2_OCH_BIT   (1 << 3)
 
#define PCA9685_MODE2_OUTDRV_BIT   (1 << 2)
 
#define PCA9685_MODE2_OUTNE1_BIT   (1 << 1)
 
#define PCA9685_MODE2_OUTNE0_BIT   (1 << 0)
 
#define PCA9685_INTERNAL_CLOCK   (1.04f * 25000000.f)
 
#define PCA9685_EXTERNAL_CLOCK   24576000.f
 
#define PWM_CHAN_COUNT   16
 

Variables

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

Macro Definition Documentation

◆ PCA9685_ALL_LED_OFF_H_SHUT

#define PCA9685_ALL_LED_OFF_H_SHUT   (1 << 4)

Definition at line 38 of file RCOutput_PCA9685.cpp.

Referenced by Linux::RCOutput_PCA9685::set_freq().

◆ PCA9685_EXTERNAL_CLOCK

#define PCA9685_EXTERNAL_CLOCK   24576000.f

Definition at line 51 of file RCOutput_PCA9685.cpp.

Referenced by Linux::RCOutput_PCA9685::RCOutput_PCA9685().

◆ PCA9685_INTERNAL_CLOCK

#define PCA9685_INTERNAL_CLOCK   (1.04f * 25000000.f)

Definition at line 50 of file RCOutput_PCA9685.cpp.

Referenced by Linux::RCOutput_PCA9685::RCOutput_PCA9685().

◆ PCA9685_MODE1_AI_BIT

#define PCA9685_MODE1_AI_BIT   (1 << 5)

Definition at line 32 of file RCOutput_PCA9685.cpp.

Referenced by Linux::RCOutput_PCA9685::set_freq().

◆ PCA9685_MODE1_ALLCALL_BIT

#define PCA9685_MODE1_ALLCALL_BIT   (1 << 0)

Definition at line 37 of file RCOutput_PCA9685.cpp.

◆ PCA9685_MODE1_EXTCLK_BIT

#define PCA9685_MODE1_EXTCLK_BIT   (1 << 6)

Definition at line 31 of file RCOutput_PCA9685.cpp.

Referenced by Linux::RCOutput_PCA9685::set_freq().

◆ PCA9685_MODE1_RESTART_BIT

#define PCA9685_MODE1_RESTART_BIT   (1 << 7)

Definition at line 30 of file RCOutput_PCA9685.cpp.

Referenced by Linux::RCOutput_PCA9685::set_freq().

◆ PCA9685_MODE1_SLEEP_BIT

#define PCA9685_MODE1_SLEEP_BIT   (1 << 4)

Definition at line 33 of file RCOutput_PCA9685.cpp.

Referenced by Linux::RCOutput_PCA9685::set_freq().

◆ PCA9685_MODE1_SUB1_BIT

#define PCA9685_MODE1_SUB1_BIT   (1 << 3)

Definition at line 34 of file RCOutput_PCA9685.cpp.

◆ PCA9685_MODE1_SUB2_BIT

#define PCA9685_MODE1_SUB2_BIT   (1 << 2)

Definition at line 35 of file RCOutput_PCA9685.cpp.

◆ PCA9685_MODE1_SUB3_BIT

#define PCA9685_MODE1_SUB3_BIT   (1 << 1)

Definition at line 36 of file RCOutput_PCA9685.cpp.

◆ PCA9685_MODE2_INVRT_BIT

#define PCA9685_MODE2_INVRT_BIT   (1 << 4)

Definition at line 39 of file RCOutput_PCA9685.cpp.

◆ PCA9685_MODE2_OCH_BIT

#define PCA9685_MODE2_OCH_BIT   (1 << 3)

Definition at line 40 of file RCOutput_PCA9685.cpp.

◆ PCA9685_MODE2_OUTDRV_BIT

#define PCA9685_MODE2_OUTDRV_BIT   (1 << 2)

Definition at line 41 of file RCOutput_PCA9685.cpp.

◆ PCA9685_MODE2_OUTNE0_BIT

#define PCA9685_MODE2_OUTNE0_BIT   (1 << 0)

Definition at line 43 of file RCOutput_PCA9685.cpp.

◆ PCA9685_MODE2_OUTNE1_BIT

#define PCA9685_MODE2_OUTNE1_BIT   (1 << 1)

Definition at line 42 of file RCOutput_PCA9685.cpp.

◆ PCA9685_RA_ALL_LED_OFF_H

#define PCA9685_RA_ALL_LED_OFF_H   0xFD

Definition at line 27 of file RCOutput_PCA9685.cpp.

Referenced by Linux::RCOutput_PCA9685::set_freq().

◆ PCA9685_RA_ALL_LED_OFF_L

#define PCA9685_RA_ALL_LED_OFF_L   0xFC

Definition at line 26 of file RCOutput_PCA9685.cpp.

◆ PCA9685_RA_ALL_LED_ON_H

#define PCA9685_RA_ALL_LED_ON_H   0xFB

Definition at line 25 of file RCOutput_PCA9685.cpp.

◆ PCA9685_RA_ALL_LED_ON_L

#define PCA9685_RA_ALL_LED_ON_L   0xFA

Definition at line 24 of file RCOutput_PCA9685.cpp.

Referenced by Linux::RCOutput_PCA9685::reset_all_channels().

◆ PCA9685_RA_LED0_OFF_H

#define PCA9685_RA_LED0_OFF_H   0x09

Definition at line 23 of file RCOutput_PCA9685.cpp.

◆ PCA9685_RA_LED0_OFF_L

#define PCA9685_RA_LED0_OFF_L   0x08

Definition at line 22 of file RCOutput_PCA9685.cpp.

◆ PCA9685_RA_LED0_ON_H

#define PCA9685_RA_LED0_ON_H   0x07

Definition at line 21 of file RCOutput_PCA9685.cpp.

◆ PCA9685_RA_LED0_ON_L

#define PCA9685_RA_LED0_ON_L   0x06

Definition at line 20 of file RCOutput_PCA9685.cpp.

Referenced by Linux::RCOutput_PCA9685::push().

◆ PCA9685_RA_MODE1

#define PCA9685_RA_MODE1   0x00

Definition at line 18 of file RCOutput_PCA9685.cpp.

Referenced by Linux::RCOutput_PCA9685::set_freq().

◆ PCA9685_RA_MODE2

#define PCA9685_RA_MODE2   0x01

Definition at line 19 of file RCOutput_PCA9685.cpp.

◆ PCA9685_RA_PRE_SCALE

#define PCA9685_RA_PRE_SCALE   0xFE

Definition at line 28 of file RCOutput_PCA9685.cpp.

Referenced by Linux::RCOutput_PCA9685::set_freq().

◆ PWM_CHAN_COUNT

#define PWM_CHAN_COUNT   16

Variable Documentation

◆ hal

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

Definition at line 57 of file RCOutput_PCA9685.cpp.