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.
38 lines
1.0 KiB
38 lines
1.0 KiB
10 years ago
|
/*
|
||
7 years ago
|
PCA9685LED I2C driver
|
||
10 years ago
|
|
||
|
This program is free software: you can redistribute it and/or modify
|
||
|
it under the terms of the GNU General Public License as published by
|
||
|
the Free Software Foundation, either version 3 of the License, or
|
||
|
(at your option) any later version.
|
||
|
|
||
|
This program is distributed in the hope that it will be useful,
|
||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
GNU General Public License for more details.
|
||
|
|
||
|
You should have received a copy of the GNU General Public License
|
||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||
|
*/
|
||
9 years ago
|
#pragma once
|
||
10 years ago
|
|
||
9 years ago
|
#include <AP_HAL/I2CDevice.h>
|
||
7 years ago
|
#include "RGBLed.h"
|
||
10 years ago
|
|
||
7 years ago
|
class PCA9685LED_I2C : public RGBLed
|
||
10 years ago
|
{
|
||
7 years ago
|
public:
|
||
7 years ago
|
PCA9685LED_I2C(void);
|
||
10 years ago
|
protected:
|
||
8 years ago
|
bool hw_init(void) override;
|
||
|
bool hw_set_rgb(uint8_t r, uint8_t g, uint8_t b) override;
|
||
9 years ago
|
|
||
|
private:
|
||
|
AP_HAL::OwnPtr<AP_HAL::I2CDevice> _dev;
|
||
8 years ago
|
void _timer(void);
|
||
8 years ago
|
struct {
|
||
|
uint8_t r, g, b;
|
||
|
} rgb;
|
||
|
bool _need_update;
|
||
10 years ago
|
};
|