From 9f2803737d8a0d4c7b2fc1110dc3d38101914a7e Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 5 Jan 2015 13:40:55 -0600 Subject: [PATCH] DK-TM4C129X: Enable I2C6 and the I2C tool in the default configuration --- configs/dk-tm4c129x/include/board.h | 8 ++++++++ configs/dk-tm4c129x/nsh/defconfig | 26 +++++++++++++++++++++++--- configs/dk-tm4c129x/src/dk-tm4c129x.h | 10 ++++++++++ 3 files changed, 41 insertions(+), 3 deletions(-) diff --git a/configs/dk-tm4c129x/include/board.h b/configs/dk-tm4c129x/include/board.h index e147d1d852..7df3b08eb9 100644 --- a/configs/dk-tm4c129x/include/board.h +++ b/configs/dk-tm4c129x/include/board.h @@ -186,9 +186,17 @@ /* I2C: * + * I2C3: PG4-5 are provide to the BoostPack 1 interface + * I2C7: PA4-5 are provide to the BoostPack 2 interface * I2C6: PB6-7 are used for I2C to the TMP100 and the EM connector. + * J18 and J20 must be closed to connect the TMP100. + * I2C address is 0x4A */ +#define GPIO_I2C3_SCL GPIO_I2C3_SCL_1 +#define GPIO_I2C3_SDA GPIO_I2C3_SDA_1 +#define GPIO_I2C7_SCL GPIO_I2C7_SCL_1 +#define GPIO_I2C7_SDA GPIO_I2C7_SDA_1 #define GPIO_I2C6_SCL GPIO_I2C6_SCL_2 #define GPIO_I2C6_SDA GPIO_I2C6_SDA_2 diff --git a/configs/dk-tm4c129x/nsh/defconfig b/configs/dk-tm4c129x/nsh/defconfig index a450292339..a6cd6e6b27 100644 --- a/configs/dk-tm4c129x/nsh/defconfig +++ b/configs/dk-tm4c129x/nsh/defconfig @@ -138,7 +138,7 @@ CONFIG_ARCH_CHIP_TM4C=y # # Tiva/Stellaris Peripheral Support # -# CONFIG_TIVA_I2C is not set +CONFIG_TIVA_I2C=y CONFIG_TIVA_HAVE_I2C1=y CONFIG_TIVA_HAVE_I2C2=y CONFIG_TIVA_HAVE_I2C3=y @@ -165,7 +165,7 @@ CONFIG_TIVA_HAVE_ETHERNET=y # CONFIG_TIVA_I2C3 is not set # CONFIG_TIVA_I2C4 is not set # CONFIG_TIVA_I2C5 is not set -# CONFIG_TIVA_I2C6 is not set +CONFIG_TIVA_I2C6=y # CONFIG_TIVA_I2C7 is not set # CONFIG_TIVA_I2C8 is not set # CONFIG_TIVA_I2C9 is not set @@ -209,6 +209,14 @@ CONFIG_TIVA_HAVE_GPIOQ_IRQS=y CONFIG_TIVA_GPIOP_IRQS=y # CONFIG_TIVA_GPIOQ_IRQS is not set +# +# I2C Configuration +# +# CONFIG_TIVA_I2C_DYNTIMEO is not set +CONFIG_TIVA_I2C_TIMEOSEC=0 +CONFIG_TIVA_I2C_TIMEOMS=500 +CONFIG_TIVA_I2C_TIMEOTICKS=500 + # # Tiva Ethernet Configuration # @@ -420,7 +428,12 @@ CONFIG_DEV_NULL=y # CONFIG_ARCH_HAVE_PWM_PULSECOUNT is not set # CONFIG_PWM is not set # CONFIG_ARCH_HAVE_I2CRESET is not set -# CONFIG_I2C is not set +CONFIG_I2C=y +# CONFIG_I2C_SLAVE is not set +CONFIG_I2C_TRANSFER=y +CONFIG_I2C_WRITEREAD=y +# CONFIG_I2C_POLLED is not set +# CONFIG_I2C_TRACE is not set # CONFIG_SPI is not set # CONFIG_I2S is not set # CONFIG_RTC is not set @@ -999,6 +1012,13 @@ CONFIG_NSH_IOBUFFER_SIZE=512 # # I2C tool # +CONFIG_SYSTEM_I2CTOOL=y +CONFIG_I2CTOOL_MINBUS=6 +CONFIG_I2CTOOL_MAXBUS=6 +CONFIG_I2CTOOL_MINADDR=0x03 +CONFIG_I2CTOOL_MAXADDR=0x77 +CONFIG_I2CTOOL_MAXREGADDR=0xff +CONFIG_I2CTOOL_DEFFREQ=400000 # # INI File Parser diff --git a/configs/dk-tm4c129x/src/dk-tm4c129x.h b/configs/dk-tm4c129x/src/dk-tm4c129x.h index 5fb9f53373..6935752e34 100644 --- a/configs/dk-tm4c129x/src/dk-tm4c129x.h +++ b/configs/dk-tm4c129x/src/dk-tm4c129x.h @@ -114,6 +114,16 @@ #define GPIO_SD_CS (GPIO_FUNC_OUTPUT | GPIO_PADTYPE_STD | GPIO_STRENGTH_4MA | \ GPIO_VALUE_ONE | GPIO_PORTH | GPIO_PIN_4) +/* I2C *****************************************************************************/ +/* I2C3: PG4-5 are provide to the BoostPack 1 interface + * I2C7: PA4-5 are provide to the BoostPack 2 interface + * I2C6: PB6-7 are used for I2C to the TMP100 and the EM connector. + * J18 and J20 must be closed to connect the TMP100. + * I2C address is 0x4A + */ + +#define TMP100_I2CADDR 0x4a + /* Speaker outputs *****************************************************************/ /* PB2/PD4 are used for the speaker output */