You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.1 KiB
39 lines
1.1 KiB
11 years ago
|
|
||
10 years ago
|
#ifndef __AP_HAL_LINUX_RCOUTPUT_PCA9685_H__
|
||
|
#define __AP_HAL_LINUX_RCOUTPUT_PCA9685_H__
|
||
11 years ago
|
|
||
10 years ago
|
#include "AP_HAL_Linux.h"
|
||
11 years ago
|
|
||
10 years ago
|
class Linux::LinuxRCOutput_PCA9685 : public AP_HAL::RCOutput {
|
||
10 years ago
|
public:
|
||
10 years ago
|
LinuxRCOutput_PCA9685(bool external_clock, uint8_t channel_offset,
|
||
|
uint8_t oe_pin_number);
|
||
|
~LinuxRCOutput_PCA9685();
|
||
11 years ago
|
void init(void* machtnichts);
|
||
10 years ago
|
void reset_all_channels();
|
||
11 years ago
|
void set_freq(uint32_t chmask, uint16_t freq_hz);
|
||
|
uint16_t get_freq(uint8_t ch);
|
||
|
void enable_ch(uint8_t ch);
|
||
|
void disable_ch(uint8_t ch);
|
||
|
void write(uint8_t ch, uint16_t period_us);
|
||
|
void write(uint8_t ch, uint16_t* period_us, uint8_t len);
|
||
|
uint16_t read(uint8_t ch);
|
||
|
void read(uint16_t* period_us, uint8_t len);
|
||
|
|
||
|
private:
|
||
|
void reset();
|
||
10 years ago
|
|
||
11 years ago
|
AP_HAL::Semaphore *_i2c_sem;
|
||
10 years ago
|
AP_HAL::DigitalSource *_enable_pin;
|
||
10 years ago
|
uint16_t _frequency;
|
||
10 years ago
|
float _osc_clock;
|
||
10 years ago
|
|
||
|
uint16_t *_pulses_buffer;
|
||
10 years ago
|
|
||
10 years ago
|
bool _external_clock;
|
||
10 years ago
|
uint8_t _channel_offset;
|
||
10 years ago
|
uint8_t _oe_pin_number;
|
||
11 years ago
|
};
|
||
|
|
||
10 years ago
|
#endif // __AP_HAL_LINUX_RCOUTPUT_PCA9685_H__
|