12345678910111213141516171819202122232425262728293031323334353637 |
- #pragma once
- #include <AP_HAL/I2CDevice.h>
- #include "RGBLed.h"
- class NCP5623 : public RGBLed {
- public:
- NCP5623(uint8_t bus);
- protected:
- bool hw_init(void) override;
- bool hw_set_rgb(uint8_t r, uint8_t g, uint8_t b) override;
- private:
- AP_HAL::OwnPtr<AP_HAL::I2CDevice> _dev;
- void _timer(void);
- bool write(uint8_t reg, uint8_t data);
- bool write_pwm(uint8_t rgb[3]);
- uint8_t rgb[3];
- bool _need_update;
- uint8_t _bus;
- };
|