15141d415SCédric Le Goater /* 25141d415SCédric Le Goater * PCA9552 I2C LED blinker 35141d415SCédric Le Goater * 45141d415SCédric Le Goater * Copyright (c) 2017-2018, IBM Corporation. 55141d415SCédric Le Goater * 65141d415SCédric Le Goater * This work is licensed under the terms of the GNU GPL, version 2 or 75141d415SCédric Le Goater * later. See the COPYING file in the top-level directory. 85141d415SCédric Le Goater */ 95141d415SCédric Le Goater #ifndef PCA9552_H 105141d415SCédric Le Goater #define PCA9552_H 115141d415SCédric Le Goater 125141d415SCédric Le Goater #include "hw/i2c/i2c.h" 13*db1015e9SEduardo Habkost #include "qom/object.h" 145141d415SCédric Le Goater 155141d415SCédric Le Goater #define TYPE_PCA9552 "pca9552" 16736132e4SPhilippe Mathieu-Daudé #define TYPE_PCA955X "pca955x" 17*db1015e9SEduardo Habkost typedef struct PCA955xState PCA955xState; 18736132e4SPhilippe Mathieu-Daudé #define PCA955X(obj) OBJECT_CHECK(PCA955xState, (obj), TYPE_PCA955X) 195141d415SCédric Le Goater 20ec17228aSPhilippe Mathieu-Daudé #define PCA955X_NR_REGS 10 21736132e4SPhilippe Mathieu-Daudé #define PCA955X_PIN_COUNT_MAX 16 225141d415SCédric Le Goater 23*db1015e9SEduardo Habkost struct PCA955xState { 245141d415SCédric Le Goater /*< private >*/ 255141d415SCédric Le Goater I2CSlave i2c; 265141d415SCédric Le Goater /*< public >*/ 275141d415SCédric Le Goater 285141d415SCédric Le Goater uint8_t len; 295141d415SCédric Le Goater uint8_t pointer; 305141d415SCédric Le Goater 31ec17228aSPhilippe Mathieu-Daudé uint8_t regs[PCA955X_NR_REGS]; 32586f495bSPhilippe Mathieu-Daudé qemu_irq gpio[PCA955X_PIN_COUNT_MAX]; 332df252d8SPhilippe Mathieu-Daudé char *description; /* For debugging purpose only */ 34*db1015e9SEduardo Habkost }; 355141d415SCédric Le Goater 365141d415SCédric Le Goater #endif 37