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