-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate the I2C chip_id map for AFC devices and RTM devices
Create different i2c_chip_mapping_t arrays and reserve chip_id numbers between 0 and 63 to AFC devices and between 64 and 127 to the RTM devices.
- Loading branch information
1 parent
7a91948
commit 2eb350d
Showing
14 changed files
with
118 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include "i2c.h" | ||
#include "rtm_i2c_mapping.h" | ||
#include "i2c_mapping.h" | ||
#include "port.h" | ||
|
||
i2c_chip_mapping_t i2c_chip_rtm_map[I2C_CHIP_RTM_CNT] = { | ||
[CHIP_ID_RTM_PCA9554 - 64] = { I2C_BUS_RTM_ID, 0x20 }, | ||
[CHIP_ID_RTM_EEPROM - 64] = { I2C_BUS_RTM_ID, 0x50 }, | ||
[CHIP_ID_RTM_LM75_0 - 64] = { I2C_BUS_RTM_ID, 0x48 }, | ||
[CHIP_ID_RTM_LM75_1 - 64] = { I2C_BUS_RTM_ID, 0x49 }, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#ifndef RTM_I2C_MAPPING_H_ | ||
#define RTM_I2C_MAPPING_H_ | ||
|
||
#include "i2c.h" | ||
|
||
enum { | ||
CHIP_ID_RTM_PCA9554 = 64, | ||
CHIP_ID_RTM_EEPROM, | ||
CHIP_ID_RTM_LM75_0, | ||
CHIP_ID_RTM_LM75_1 | ||
}; | ||
|
||
#define I2C_CHIP_RTM_CNT 4 | ||
|
||
extern i2c_chip_mapping_t i2c_chip_rtm_map[I2C_CHIP_RTM_CNT]; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include "i2c.h" | ||
#include "rtm_i2c_mapping.h" | ||
#include "i2c_mapping.h" | ||
#include "port.h" | ||
|
||
i2c_chip_mapping_t i2c_chip_rtm_map[I2C_CHIP_RTM_CNT] = { | ||
[CHIP_ID_RTM_PCA9554_LEDS - 64] = { I2C_BUS_RTM_ID, 0x20 }, | ||
[CHIP_ID_RTM_PCA9554_PWR - 64] = { I2C_BUS_RTM_ID, 0x21 }, | ||
[CHIP_ID_RTM_EEPROM - 64] = { I2C_BUS_RTM_ID, 0x50 }, | ||
[CHIP_ID_RTM_LM75_0 - 64] = { I2C_BUS_RTM_ID, 0x48 }, | ||
[CHIP_ID_RTM_LM75_1 - 64] = { I2C_BUS_RTM_ID, 0x49 }, | ||
[CHIP_ID_RTM_LM75_2 - 64] = { I2C_BUS_RTM_ID, 0x4B }, | ||
[CHIP_ID_RTM_MAX11609 - 64] = { I2C_BUS_RTM_ID, 0x33 }, | ||
[CHIP_ID_RTM_CDCE906 - 64] = { I2C_BUS_RTM_ID, 0x69 }, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#ifndef RTM_I2C_MAPPING_H_ | ||
#define RTM_I2C_MAPPING_H_ | ||
|
||
#include "i2c.h" | ||
|
||
enum { | ||
CHIP_ID_RTM_PCA9554_LEDS = 64, | ||
CHIP_ID_RTM_PCA9554_PWR, | ||
CHIP_ID_RTM_EEPROM, | ||
CHIP_ID_RTM_LM75_0, | ||
CHIP_ID_RTM_LM75_1, | ||
CHIP_ID_RTM_LM75_2, | ||
CHIP_ID_RTM_MAX11609, | ||
CHIP_ID_RTM_CDCE906, | ||
}; | ||
|
||
#define I2C_CHIP_RTM_CNT 8 | ||
|
||
extern i2c_chip_mapping_t i2c_chip_rtm_map[I2C_CHIP_RTM_CNT]; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters