Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: I2Cdev_MAX32630FTHR
Adafruit_IS31FL3731.h
00001 #ifndef _ADAFRUIT_IS31FL3731_H_ 00002 #define _ADAFRUIT_IS31FL3731_H_ 00003 00004 #include "mbed.h" 00005 #include "Adafruit_GFX.h" 00006 #include "I2Cdev.h" 00007 00008 00009 #define ISSI_ADDR_DEFAULT 0x74 00010 00011 #define ISSI_REG_CONFIG 0x00 00012 #define ISSI_REG_CONFIG_PICTUREMODE 0x00 00013 #define ISSI_REG_CONFIG_AUTOPLAYMODE 0x08 00014 #define ISSI_REG_CONFIG_AUDIOPLAYMODE 0x18 00015 00016 #define ISSI_CONF_PICTUREMODE 0x00 00017 #define ISSI_CONF_AUTOFRAMEMODE 0x04 00018 #define ISSI_CONF_AUDIOMODE 0x08 00019 00020 #define ISSI_REG_PICTUREFRAME 0x01 00021 00022 #define ISSI_REG_SHUTDOWN 0x0A 00023 #define ISSI_REG_AUDIOSYNC 0x06 00024 00025 #define ISSI_COMMANDREGISTER 0xFD 00026 #define ISSI_BANK_FUNCTIONREG 0x0B // helpfully called 'page nine' 00027 00028 #define I2C_SDA P3_4//D14 00029 #define I2C_SCL P3_5//D15 00030 00031 //I2Cdev* myDevI2C = new I2Cdev(); 00032 00033 class Adafruit_IS31FL3731 : public Adafruit_GFX { 00034 public: 00035 Adafruit_IS31FL3731(uint8_t x=16, uint8_t y=9):Adafruit_GFX(x,y){ 00036 I2Cdev* myDevI2C = new I2Cdev(); 00037 myI2C = myDevI2C; 00038 };//, I2Cdev* theI2C=myDevI2C); 00039 bool begin(uint8_t addr = ISSI_ADDR_DEFAULT); 00040 I2Cdev* myI2C; 00041 virtual void drawPixel(int16_t x, int16_t y, uint16_t color); 00042 void clear(void); 00043 00044 void setLEDPWM(uint8_t lednum, uint8_t pwm, uint8_t bank = 0); 00045 void audioSync(bool sync); 00046 void setFrame(uint8_t b); 00047 void displayFrame(uint8_t frame); 00048 00049 00050 protected: 00051 void selectBank(uint8_t bank); 00052 void writeRegister8(uint8_t bank, uint8_t reg, uint8_t data); 00053 uint8_t readRegister8(uint8_t bank, uint8_t reg); 00054 uint8_t _i2caddr, _frame; 00055 }; 00056 00057 class Adafruit_IS31FL3731_Wing : public Adafruit_IS31FL3731 { 00058 public: 00059 Adafruit_IS31FL3731_Wing():Adafruit_IS31FL3731(16,9){ 00060 //myboss = mainboss; 00061 };//I2Cdev* theI2C); 00062 virtual void drawPixel(int16_t x, int16_t y, uint16_t color); 00063 }; 00064 00065 00066 00067 #endif
Generated on Mon Jul 18 2022 17:51:09 by
1.7.2