aroarfw
i2c.h
Go to the documentation of this file.
1 //i2c.h:
2 
3 /*
4  * Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2012-2013
5  *
6  * This file is part of aroarfw, a RoarAudio framework for
7  * embedded systems (µControlers).
8  *
9  * This file is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License version 3
11  * or (at your option) any later version as published by
12  * the Free Software Foundation.
13  *
14  * aroarfw is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this software; see the file COPYING. If not, write to
21  * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
22  * Boston, MA 02110-1301, USA.
23  */
24 
25 #ifndef _AROARFW_I2C_H_
26 #define _AROARFW_I2C_H_
27 
28 #include <stdint.h>
29 #include <aroarfw/types.h>
30 
32 #define I2C_OFFSET_IFVERSION 0x00
33 #define I2C_OFFSET_STATUS0 0x01
35 #define I2C_OFFSET_BANKSELECT 0x02
37 #define I2C_OFFSET_DEVERROR 0x03
39 #define I2C_OFFSET_BANKDATA 0x04
41 
43 #define RI2C_INTERFACE_VERSION 0x00
44 
46 #define RI2C_STATUS0_NONE 0x00
47 #define RI2C_STATUS0_DEVICE_READY 0x01
49 #define RI2C_STATUS0_SELFCHECK_PASSED 0x02
51 #define RI2C_STATUS0_SELFCHECK_ERROR 0x04
53 #define RI2C_STATUS0_UPDATES_PENDING 0x08
55 
57 #define RI2C_STATUS1_NONE 0x00
58 #define RI2C_STATUS2_NONE 0x00
60 
62 #define RI2C_CAPS0_BRIDGE_NONE 0x00
63 #define RI2C_CAPS0_BRIDGE_NETWORK 0x01
65 #define RI2C_CAPS0_BRIDGE_ETHERNET 0x02
67 #define RI2C_CAPS0_BRIDGE_I2C 0x04
69 #define RI2C_CAPS0_BRIDGE_SPI 0x08
71 #define RI2C_CAPS0_BRIDGE_DMX512 0x10
73 #define RI2C_CAPS0_BRIDGE_MIDI 0x20
75 #define RI2C_CAPS0_BRIDGE_WAVEFORM 0x40
77 #define RI2C_CAPS0_BRIDGE_RESERVED7 0x80
79 
81 typedef uint8_t ri2c_addr_t;
82 
84 typedef enum {
87 
88 // 1-63: RAF Defined types
91 
92 //$ for i in `seq 64 127`; do v=`expr $i - 64`; printf " //! Vendor specific device type %i\n RI2C_DEV_VENDOR%.2i = %#0.2x,\n" $v $v $i; done
221 } ri2c_dev_t;
222 
224 typedef enum {
230 
232 typedef enum {
233 // 0-31: Generic
242 // 32-63: RAF Defined
243 
244 // DISPLAY interface?
247 
248 // 64-95: RAF Defined Type/Sub-Type specific
249 
250 //$ for i in `seq 64 95`; do v=`expr $i - 64`; printf " //! Assigned Type and Subtype specific bank %i\n RI2C_BANK_TYPEST%.2i = %#0.2x,\n" $v $v $i; done
315 
316 // 96-127: Vendor + Type/Sub-Type specific
317 //$ for i in `seq 96 127`; do v=`expr $i - 96`; printf " //! Vendor, Type and Subtype specific bank %i\n RI2C_BANK_VENDOR%.2i = %#0.2x,\n" $v $v $i; done
382 } ri2c_bank_t;
383 
385 typedef struct {
387  uint8_t vendor;
389  uint8_t type;
391  uint8_t subtype;
393  uint8_t revision;
395  uint8_t parentvendor;
397  uint8_t parenttype;
399  uint8_t parentsubtype;
401  uint8_t caps[3];
404 } __RPACKED__ ri2c_devinfo_data_t;
405 
406 #endif
407 
408 //ll
Vendor specific device type 47.
Definition: i2c.h:188
Vendor, Type and Subtype specific bank 25.
Definition: i2c.h:369
Vendor, Type and Subtype specific bank 0.
Definition: i2c.h:319
Assigned Type and Subtype specific bank 24.
Definition: i2c.h:300
Assigned Type and Subtype specific bank 12.
Definition: i2c.h:276
Vendor, Type and Subtype specific bank 21.
Definition: i2c.h:361
Assigned Type and Subtype specific bank 1.
Definition: i2c.h:254
Vendor specific device type 56.
Definition: i2c.h:206
Vendor specific device type 41.
Definition: i2c.h:176
Vendor specific device type 13.
Definition: i2c.h:120
Vendor specific device type 16.
Definition: i2c.h:126
Vendor specific device type 45.
Definition: i2c.h:184
Vendor specific device type 5.
Definition: i2c.h:104
Vendor specific device type 14.
Definition: i2c.h:122
uint8_t subtype
Vendor specific subtype of device.
Definition: i2c.h:391
ruuid_t serial
Sieral of the device.
Definition: i2c.h:403
Vendor, Type and Subtype specific bank 24.
Definition: i2c.h:367
DMX512 data.
Definition: i2c.h:246
Vendor, Type and Subtype specific bank 13.
Definition: i2c.h:345
Assigned Type and Subtype specific bank 14.
Definition: i2c.h:280
Assigned Type and Subtype specific bank 6.
Definition: i2c.h:264
Assigned Type and Subtype specific bank 11.
Definition: i2c.h:274
ri2c_dev_t
Type for device types.
Definition: i2c.h:84
Vendor specific device type 17.
Definition: i2c.h:128
Vendor specific device type 4.
Definition: i2c.h:102
Vendor, Type and Subtype specific bank 4.
Definition: i2c.h:327
uint8_t parenttype
Parent device's type ID.
Definition: i2c.h:397
Vendor specific device type 27.
Definition: i2c.h:148
Assigned Type and Subtype specific bank 28.
Definition: i2c.h:308
Vendor, Type and Subtype specific bank 2.
Definition: i2c.h:323
Generic device information.
Definition: i2c.h:235
Vendor, Type and Subtype specific bank 26.
Definition: i2c.h:371
Vendor specific device type 36.
Definition: i2c.h:166
Vendor specific device type 61.
Definition: i2c.h:216
Assigned Type and Subtype specific bank 31.
Definition: i2c.h:314
Vendor specific device type 39.
Definition: i2c.h:172
Vendor, Type and Subtype specific bank 27.
Definition: i2c.h:373
Vendor, Type and Subtype specific bank 9.
Definition: i2c.h:337
Vendor, Type and Subtype specific bank 29.
Definition: i2c.h:377
uint8_t ri2c_addr_t
Type for storing I²C slave addresses.
Definition: i2c.h:81
uint8_t revision
Vendor specific revision of the device.
Definition: i2c.h:393
Vendor, Type and Subtype specific bank 8.
Definition: i2c.h:335
Vendor specific device type 23.
Definition: i2c.h:140
Vendor specific device type 3.
Definition: i2c.h:100
Vendor specific device type 52.
Definition: i2c.h:198
Assigned Type and Subtype specific bank 27.
Definition: i2c.h:306
This is a media converter. It converts between two (or more) low level protocols and physical layers...
Definition: i2c.h:228
Assigned Type and Subtype specific bank 16.
Definition: i2c.h:284
Vendor specific device type 32.
Definition: i2c.h:158
Assigned Type and Subtype specific bank 3.
Definition: i2c.h:258
Vendor specific device type 33.
Definition: i2c.h:160
Vendor specific device type 15.
Definition: i2c.h:124
Vendor specific device type 24.
Definition: i2c.h:142
Assigned Type and Subtype specific bank 5.
Definition: i2c.h:262
Assigned Type and Subtype specific bank 7.
Definition: i2c.h:266
Assigned Type and Subtype specific bank 15.
Definition: i2c.h:282
uint8_t vendor
Vendor of this device. This is a assigned device vendor ID.
Definition: i2c.h:387
Vendor, Type and Subtype specific bank 10.
Definition: i2c.h:339
Vendor specific device type 63.
Definition: i2c.h:220
Assigned Type and Subtype specific bank 10.
Definition: i2c.h:272
Assigned Type and Subtype specific bank 18.
Definition: i2c.h:288
uint8_t type
Vendor specific type of device.
Definition: i2c.h:389
Vendor, Type and Subtype specific bank 20.
Definition: i2c.h:359
Vendor specific device type 57.
Definition: i2c.h:208
Vendor specific device type 49.
Definition: i2c.h:192
Assigned Type and Subtype specific bank 2.
Definition: i2c.h:256
Vendor, Type and Subtype specific bank 14.
Definition: i2c.h:347
Assigned Type and Subtype specific bank 17.
Definition: i2c.h:286
Vendor specific device type 55.
Definition: i2c.h:204
Vendor specific device type 26.
Definition: i2c.h:146
Vendor specific device type 30.
Definition: i2c.h:154
Vendor specific device type 44.
Definition: i2c.h:182
Assigned Type and Subtype specific bank 23.
Definition: i2c.h:298
Vendor specific device type 42.
Definition: i2c.h:178
Vendor, Type and Subtype specific bank 23.
Definition: i2c.h:365
Assigned Type and Subtype specific bank 8.
Definition: i2c.h:268
Vendor specific device type 1.
Definition: i2c.h:96
Vendor, Type and Subtype specific bank 7.
Definition: i2c.h:333
Vendor specific device type 8.
Definition: i2c.h:110
Assigned Type and Subtype specific bank 26.
Definition: i2c.h:304
Assigned Type and Subtype specific bank 25.
Definition: i2c.h:302
Type to store (in packed format) static information for the device info bank (bank 0)...
Definition: i2c.h:385
Vendor specific device type 59.
Definition: i2c.h:212
Vendor specific device type 20.
Definition: i2c.h:134
Vendor specific device type 28.
Definition: i2c.h:150
General Purpose Digital Input/Output.
Definition: i2c.h:239
Vendor, Type and Subtype specific bank 19.
Definition: i2c.h:357
Assigned Type and Subtype specific bank 20.
Definition: i2c.h:292
Vendor, Type and Subtype specific bank 1.
Definition: i2c.h:321
Vendor specific device type 54.
Definition: i2c.h:202
Assigned Type and Subtype specific bank 22.
Definition: i2c.h:296
Vendor specific device type 60.
Definition: i2c.h:214
Assigned Type and Subtype specific bank 13.
Definition: i2c.h:278
uint8_t parentsubtype
Parent device's subtype ID.
Definition: i2c.h:399
Most generic device. Supports bank 0.
Definition: i2c.h:86
Assigned Type and Subtype specific bank 4.
Definition: i2c.h:260
General Purpose Analog Input/Output.
Definition: i2c.h:241
Vendor, Type and Subtype specific bank 30.
Definition: i2c.h:379
uint8_t parentvendor
Parent device's vendor ID.
Definition: i2c.h:395
Vendor specific device type 7.
Definition: i2c.h:108
Vendor specific device type 6.
Definition: i2c.h:106
Generic control of the device.
Definition: i2c.h:237
Vendor, Type and Subtype specific bank 22.
Definition: i2c.h:363
ri2c_bank_t
Type for memory banks (commands)
Definition: i2c.h:232
Assigned Type and Subtype specific bank 29.
Definition: i2c.h:310
Vendor specific device type 19.
Definition: i2c.h:132
Generic bridge device. Can be used as prent for vendor specific bridges.
Definition: i2c.h:226
Assigned Type and Subtype specific bank 21.
Definition: i2c.h:294
Assigned Type and Subtype specific bank 19.
Definition: i2c.h:290
Vendor specific device type 46.
Definition: i2c.h:186
Vendor specific device type 35.
Definition: i2c.h:164
Vendor specific device type 62.
Definition: i2c.h:218
Vendor specific device type 9.
Definition: i2c.h:112
Assigned Type and Subtype specific bank 0.
Definition: i2c.h:252
Vendor specific device type 38.
Definition: i2c.h:170
Vendor specific device type 50.
Definition: i2c.h:194
Vendor specific device type 58.
Definition: i2c.h:210
Vendor, Type and Subtype specific bank 3.
Definition: i2c.h:325
Vendor, Type and Subtype specific bank 11.
Definition: i2c.h:341
Vendor, Type and Subtype specific bank 31.
Definition: i2c.h:381
Vendor, Type and Subtype specific bank 15.
Definition: i2c.h:349
Vendor, Type and Subtype specific bank 16.
Definition: i2c.h:351
Vendor specific device type 21.
Definition: i2c.h:136
Vendor specific device type 43.
Definition: i2c.h:180
Vendor specific device type 10.
Definition: i2c.h:114
Vendor specific device type 34.
Definition: i2c.h:162
Vendor, Type and Subtype specific bank 12.
Definition: i2c.h:343
Vendor specific device type 25.
Definition: i2c.h:144
Vendor specific device type 37.
Definition: i2c.h:168
ri2c_subtype_bridge_t
Subtype for devices of type RI2C_DEV_BRIDGE.
Definition: i2c.h:224
Vendor specific device type 53.
Definition: i2c.h:200
Assigned Type and Subtype specific bank 30.
Definition: i2c.h:312
This is a bridge device. It converts between at least two diffrent communication channels. Subtypes are defined in ri2c_subtype_bridge_t.
Definition: i2c.h:90
Vendor specific device type 40.
Definition: i2c.h:174
Vendor, Type and Subtype specific bank 6.
Definition: i2c.h:331
Vendor specific device type 0.
Definition: i2c.h:94
Vendor specific device type 12.
Definition: i2c.h:118
Vendor specific device type 29.
Definition: i2c.h:152
Vendor specific device type 51.
Definition: i2c.h:196
Vendor specific device type 48.
Definition: i2c.h:190
Vendor specific device type 31.
Definition: i2c.h:156
Vendor specific device type 22.
Definition: i2c.h:138
Vendor specific device type 18.
Definition: i2c.h:130
uint8_t ruuid_t[16]
Type to store packed UUID.
Definition: types.h:51
Vendor, Type and Subtype specific bank 28.
Definition: i2c.h:375
Vendor specific device type 2.
Definition: i2c.h:98
Vendor, Type and Subtype specific bank 17.
Definition: i2c.h:353
Assigned Type and Subtype specific bank 9.
Definition: i2c.h:270
Vendor specific device type 11.
Definition: i2c.h:116
Vendor, Type and Subtype specific bank 18.
Definition: i2c.h:355
Vendor, Type and Subtype specific bank 5.
Definition: i2c.h:329