Line data Source code
1 : /* 2 : IS31FL3195 I2C driver 3 : 4 : This program is free software: you can redistribute it and/or modify 5 : it under the terms of the GNU General Public License as published by 6 : the Free Software Foundation, either version 3 of the License, or 7 : (at your option) any later version. 8 : 9 : This program is distributed in the hope that it will be useful, 10 : but WITHOUT ANY WARRANTY; without even the implied warranty of 11 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 : GNU General Public License for more details. 13 : 14 : You should have received a copy of the GNU General Public License 15 : along with this program. If not, see <http://www.gnu.org/licenses/>. 16 : 17 : Datasheet: https://www.lumissil.com/assets/pdf/core/IS31FL3195_DS.pdf 18 : 19 : */ 20 : #pragma once 21 : 22 : #include "AP_Notify_config.h" 23 : 24 : #if AP_NOTIFY_IS31FL3195_ENABLED 25 : 26 : #include <AP_HAL/I2CDevice.h> 27 : #include "RGBLed.h" 28 : 29 : class IS31FL3195 : public RGBLed 30 : { 31 : public: 32 : IS31FL3195(uint8_t bus, uint8_t addr); 33 16752 : ~IS31FL3195() { delete _dev; } 34 : 35 : bool init(void) override; 36 : protected: 37 : bool hw_set_rgb(uint8_t r, uint8_t g, uint8_t b) override; 38 : 39 : private: 40 : AP_HAL::I2CDevice *_dev; 41 : uint8_t _bus; 42 : uint8_t _addr; 43 : 44 : void _timer(void); 45 : bool _need_update; 46 : uint8_t rgb[3]; 47 : }; 48 : 49 : #endif // AP_NOTIFY_IS31FL3195_ENABLED