1 | /* |
2 | * PCA9552 I2C LED blinker |
3 | * |
4 | * Copyright (c) 2017-2018, IBM Corporation. |
5 | * |
6 | * This work is licensed under the terms of the GNU GPL, version 2 or |
7 | * later. See the COPYING file in the top-level directory. |
8 | */ |
9 | #ifndef PCA9552_H |
10 | #define PCA9552_H |
11 | |
12 | #include "hw/i2c/i2c.h" |
13 | |
14 | #define TYPE_PCA9552 "pca9552" |
15 | #define PCA9552(obj) OBJECT_CHECK(PCA9552State, (obj), TYPE_PCA9552) |
16 | |
17 | #define PCA9552_NR_REGS 10 |
18 | |
19 | typedef struct PCA9552State { |
20 | /*< private >*/ |
21 | I2CSlave i2c; |
22 | /*< public >*/ |
23 | |
24 | uint8_t len; |
25 | uint8_t pointer; |
26 | |
27 | uint8_t regs[PCA9552_NR_REGS]; |
28 | uint8_t max_reg; |
29 | uint8_t nr_leds; |
30 | } PCA9552State; |
31 | |
32 | #endif |
33 | |