Elaborate on the UHK I2C address allocation strategy. Use hex numbers instead of binary for I2C addresses.

This commit is contained in:
László Monda
2017-09-19 16:52:58 +02:00
parent 57e6a6c067
commit d7b3aee50e

View File

@@ -10,19 +10,34 @@
// 7-bit I2C addresses - see http://www.i2c-bus.org/addressing/
// Also see https://learn.adafruit.com/i2c-addresses/the-list
// General call / Start byte 0b0000000
// CBUS address 0b0000001
// Reserved for different bus formats 0b0000010
// Reserved for future purposes 0b0000011
// High-Speed master code 0b00001XX
#define I2C_ADDRESS_LEFT_KEYBOARD_HALF 0b0001000
#define I2C_ADDRESS_LED_DRIVER_LEFT 0b1110100
// LED driver / touchpad 0b1110101
// LED driver / touchpad 0b1110110
#define I2C_ADDRESS_LED_DRIVER_RIGHT 0b1110111
// In order to minimize the chance of I2C address collisions in the future, an explicit
// address allocation strategy is utilized. The idea is to spread UHK I2C slaves 8 addresses
// away from each other. Given that most I2C devices expose at most 3 address pins which
// equal to a continuous block of 8 addresses, this strategy allows a lot of room when
// adding further I2C slaves.
// Reserved for general call address 0x00
// Reserved for CBUS compatibility 0x01
// Reserved for different bus formats 0x02
// Reserved for future purposes 0x03
// Reserved for high-speed mode master 0x04
// Reserved for high-speed mode master 0x05
// Reserved for high-speed mode master 0x06
// Reserved for high-speed mode master 0x07
#define I2C_ADDRESS_LEFT_KEYBOARD_HALF 0x08
#define I2C_ADDRESS_LED_DRIVER_LEFT 0x74
// LED driver / touchpad 0x75
// LED driver / touchpad 0x76
#define I2C_ADDRESS_LED_DRIVER_RIGHT 0x77
// Touchpad 0b00001XX
// 10-bit slave addressing 0b11110XX
// Reserved for future purposes 0b11111XX
// Reserved for 10-bit addressing 0x78
// Reserved for 10-bit addressing 0x79
// Reserved for 10-bit addressing 0x7A
// Reserved for 10-bit addressing 0x7B
// Reserved for future purposes 0x7C
// Reserved for future purposes 0x7D
// Reserved for future purposes 0x7E
// Reserved for future purposes 0x7F
// The EEPROM is featured separately as it's not connected to the main I2C bus.
#define I2C_ADDRESS_EEPROM 0b1010000