summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2015-01-05 13:40:55 -0600
committerGregory Nutt <gnutt@nuttx.org>2015-01-05 13:40:55 -0600
commit13ecce93e4be193583100c5cb5744677c5c95f37 (patch)
tree6981e1560929c2db09e8a279adb3a781a0b743d6
parent64d41aedd095d65f708a19c8041d54e68dc33195 (diff)
downloadnuttx-13ecce93e4be193583100c5cb5744677c5c95f37.tar.gz
nuttx-13ecce93e4be193583100c5cb5744677c5c95f37.tar.bz2
nuttx-13ecce93e4be193583100c5cb5744677c5c95f37.zip
DK-TM4C129X: Enable I2C6 and the I2C tool in the default configuration
-rw-r--r--nuttx/configs/dk-tm4c129x/include/board.h8
-rw-r--r--nuttx/configs/dk-tm4c129x/nsh/defconfig26
-rw-r--r--nuttx/configs/dk-tm4c129x/src/dk-tm4c129x.h10
3 files changed, 41 insertions, 3 deletions
diff --git a/nuttx/configs/dk-tm4c129x/include/board.h b/nuttx/configs/dk-tm4c129x/include/board.h
index e147d1d85..7df3b08eb 100644
--- a/nuttx/configs/dk-tm4c129x/include/board.h
+++ b/nuttx/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/nuttx/configs/dk-tm4c129x/nsh/defconfig b/nuttx/configs/dk-tm4c129x/nsh/defconfig
index a45029233..a6cd6e6b2 100644
--- a/nuttx/configs/dk-tm4c129x/nsh/defconfig
+++ b/nuttx/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
@@ -210,6 +210,14 @@ 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
#
CONFIG_TIVA_PHY_INTERNAL=y
@@ -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/nuttx/configs/dk-tm4c129x/src/dk-tm4c129x.h b/nuttx/configs/dk-tm4c129x/src/dk-tm4c129x.h
index 5fb9f5337..6935752e3 100644
--- a/nuttx/configs/dk-tm4c129x/src/dk-tm4c129x.h
+++ b/nuttx/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 */