Generalize LED driver functions by adding I2C address parameters.

This commit is contained in:
László Monda
2016-09-26 21:37:29 +02:00
parent 7b1f6a37ff
commit 7b3178a10a
3 changed files with 36 additions and 26 deletions

View File

@@ -1,10 +1,15 @@
#ifndef __I2C_H__
#define __I2C_H__
#define LEFT_KEYBOARD_HALF_I2C_ADDRESS_7BIT 8
// 7-bit I2C addresses
// The 7-bit I2C addresses of the IS31FL3731 LED driver range from 0x74 to 0x77
#define LEFT_LED_DRIVER_ADDRESS_7BIT 0b1110100
#define RIGHT_LED_DRIVER_ADDRESS_7BIT 0b1110111
#define I2C_ADDRESS_LEFT_KEYBOARD_HALF 8
// IS31FL3731 LED drivers range from 0x74 to 0x77
#define I2C_ADDRESS_LED_DRIVER_LEFT 0b1110100
#define I2C_ADDRESS_LED_DRIVER_RIGHT 0b1110111
#define IS_I2C_LED_DRIVER_ADDRESS (address) \
(I2C_ADDRESS_LED_DRIVER_LEFT <= address && address <= I2C_ADDRESS_LED_DRIVER_RIGHT)
#endif