summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-01-25 00:09:58 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-01-25 00:09:58 +0000
commite0e7d9f9b0e4aeba2b34b4a959e240a238fb0a5f (patch)
treeedb40dfd111182351ed7df44d883cafabf24cd27
parent73914fb947019bd12dc1bd95e6e425db0c0b0550 (diff)
downloadpx4-nuttx-e0e7d9f9b0e4aeba2b34b4a959e240a238fb0a5f.tar.gz
px4-nuttx-e0e7d9f9b0e4aeba2b34b4a959e240a238fb0a5f.tar.bz2
px4-nuttx-e0e7d9f9b0e4aeba2b34b4a959e240a238fb0a5f.zip
STM32 F4 I2C updates
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4330 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--nuttx/arch/arm/src/stm32/chip/stm32f40xxx_pinmap.h44
-rwxr-xr-xnuttx/configs/stm3240g-eval/include/board.h10
-rw-r--r--nuttx/fs/fat/fs_fat32.c2
3 files changed, 33 insertions, 23 deletions
diff --git a/nuttx/arch/arm/src/stm32/chip/stm32f40xxx_pinmap.h b/nuttx/arch/arm/src/stm32/chip/stm32f40xxx_pinmap.h
index 876e5101d..11750b0e6 100644
--- a/nuttx/arch/arm/src/stm32/chip/stm32f40xxx_pinmap.h
+++ b/nuttx/arch/arm/src/stm32/chip/stm32f40xxx_pinmap.h
@@ -303,28 +303,28 @@
/* I2C */
-#define GPIO_I2C1_SCL_1 (GPIO_ALT|GPIO_AF4|GPIO_PORTB|GPIO_PIN6)
-#define GPIO_I2C1_SCL_2 (GPIO_ALT|GPIO_AF4|GPIO_PORTB|GPIO_PIN8)
-#define GPIO_I2C1_SDA_1 (GPIO_ALT|GPIO_AF4|GPIO_PORTB|GPIO_PIN7)
-#define GPIO_I2C1_SDA_2 (GPIO_ALT|GPIO_AF4|GPIO_PORTB|GPIO_PIN9)
-#define GPIO_I2C1_SMBA (GPIO_ALT|GPIO_AF4|GPIO_PORTB|GPIO_PIN5)
-
-#define GPIO_I2C2_SCL_1 (GPIO_ALT|GPIO_AF4|GPIO_PORTB|GPIO_PIN10)
-#define GPIO_I2C2_SCL_2 (GPIO_ALT|GPIO_AF4|GPIO_PORTF|GPIO_PIN1)
-#define GPIO_I2C2_SCL_3 (GPIO_ALT|GPIO_AF4|GPIO_PORTH|GPIO_PIN4)
-#define GPIO_I2C2_SDA_1 (GPIO_ALT|GPIO_AF4|GPIO_PORTB|GPIO_PIN11)
-#define GPIO_I2C2_SDA_2 (GPIO_ALT|GPIO_AF4|GPIO_PORTF|GPIO_PIN0)
-#define GPIO_I2C2_SDA_3 (GPIO_ALT|GPIO_AF4|GPIO_PORTH|GPIO_PIN5)
-#define GPIO_I2C2_SMBA_1 (GPIO_ALT|GPIO_AF4|GPIO_PORTB|GPIO_PIN12)
-#define GPIO_I2C2_SMBA_2 (GPIO_ALT|GPIO_AF4|GPIO_PORTF|GPIO_PIN2)
-#define GPIO_I2C2_SMBA_3 (GPIO_ALT|GPIO_AF4|GPIO_PORTH|GPIO_PIN6)
-
-#define GPIO_I2C3_SCL_1 (GPIO_ALT|GPIO_AF4|GPIO_PORTA|GPIO_PIN8)
-#define GPIO_I2C3_SCL_2 (GPIO_ALT|GPIO_AF4|GPIO_PORTH|GPIO_PIN7)
-#define GPIO_I2C3_SDA_1 (GPIO_ALT|GPIO_AF4|GPIO_PORTC|GPIO_PIN9)
-#define GPIO_I2C3_SDA_2 (GPIO_ALT|GPIO_AF4|GPIO_PORTH|GPIO_PIN8)
-#define GPIO_I2C3_SMBA_1 (GPIO_ALT|GPIO_AF4|GPIO_PORTA|GPIO_PIN9)
-#define GPIO_I2C3_SMBA_2 (GPIO_ALT|GPIO_AF4|GPIO_PORTH|GPIO_PIN9)
+#define GPIO_I2C1_SCL_1 (GPIO_ALT|GPIO_AF4|GPIO_SPEED_50MHz|GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN6)
+#define GPIO_I2C1_SCL_2 (GPIO_ALT|GPIO_AF4|GPIO_SPEED_50MHz|GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN8)
+#define GPIO_I2C1_SDA_1 (GPIO_ALT|GPIO_AF4|GPIO_SPEED_50MHz|GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN7)
+#define GPIO_I2C1_SDA_2 (GPIO_ALT|GPIO_AF4|GPIO_SPEED_50MHz|GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN9)
+#define GPIO_I2C1_SMBA (GPIO_ALT|GPIO_AF4|GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN5)
+
+#define GPIO_I2C2_SCL_1 (GPIO_ALT|GPIO_AF4|GPIO_SPEED_50MHz|GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_I2C2_SCL_2 (GPIO_ALT|GPIO_AF4|GPIO_SPEED_50MHz|GPIO_OPENDRAIN|GPIO_PORTF|GPIO_PIN1)
+#define GPIO_I2C2_SCL_3 (GPIO_ALT|GPIO_AF4|GPIO_SPEED_50MHz|GPIO_OPENDRAIN|GPIO_PORTH|GPIO_PIN4)
+#define GPIO_I2C2_SDA_1 (GPIO_ALT|GPIO_AF4|GPIO_SPEED_50MHz|GPIO_OPENDRAIN|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_I2C2_SDA_2 (GPIO_ALT|GPIO_AF4|GPIO_SPEED_50MHz|GPIO_OPENDRAIN|GPIO_PORTF|GPIO_PIN0)
+#define GPIO_I2C2_SDA_3 (GPIO_ALT|GPIO_AF4|GPIO_SPEED_50MHz|GPIO_OPENDRAIN|GPIO_PORTH|GPIO_PIN5)
+#define GPIO_I2C2_SMBA_1 (GPIO_ALT|GPIO_AF4|GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTB|GPIO_PIN12)
+#define GPIO_I2C2_SMBA_2 (GPIO_ALT|GPIO_AF4|GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTF|GPIO_PIN2)
+#define GPIO_I2C2_SMBA_3 (GPIO_ALT|GPIO_AF4|GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTH|GPIO_PIN6)
+
+#define GPIO_I2C3_SCL_1 (GPIO_ALT|GPIO_AF4|GPIO_SPEED_50MHz|GPIO_OPENDRAIN|GPIO_PORTA|GPIO_PIN8)
+#define GPIO_I2C3_SCL_2 (GPIO_ALT|GPIO_AF4|GPIO_SPEED_50MHz|GPIO_OPENDRAIN|GPIO_PORTH|GPIO_PIN7)
+#define GPIO_I2C3_SDA_1 (GPIO_ALT|GPIO_AF4|GPIO_SPEED_50MHz|GPIO_OPENDRAIN|GPIO_PORTC|GPIO_PIN9)
+#define GPIO_I2C3_SDA_2 (GPIO_ALT|GPIO_AF4|GPIO_SPEED_50MHz|GPIO_OPENDRAIN|GPIO_PORTH|GPIO_PIN8)
+#define GPIO_I2C3_SMBA_1 (GPIO_ALT|GPIO_AF4|GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN9)
+#define GPIO_I2C3_SMBA_2 (GPIO_ALT|GPIO_AF4|GPIO_SPEED_50MHz|GPIO_PUSHPULL|GPIO_PORTH|GPIO_PIN9)
/* I2S */
diff --git a/nuttx/configs/stm3240g-eval/include/board.h b/nuttx/configs/stm3240g-eval/include/board.h
index 3096396af..aae5f0e22 100755
--- a/nuttx/configs/stm3240g-eval/include/board.h
+++ b/nuttx/configs/stm3240g-eval/include/board.h
@@ -410,6 +410,16 @@
#define GPIO_CAN2_RX GPIO_CAN2_RX_2
#define GPIO_CAN2_TX GPIO_CAN2_TX_1
+/* I2C. Only I2C1 is available on the STM3240G-EVAL. I2C1_SCL and I2C1_SDA are
+ * available on the following pins:
+ *
+ * - PB6 is I2C1_SCL
+ * - PB9 is I2C1_SDA
+ */
+
+#define GPIO_I2C1_SCL GPIO_I2C1_SCL_1
+#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2
+
/************************************************************************************
* Public Data
************************************************************************************/
diff --git a/nuttx/fs/fat/fs_fat32.c b/nuttx/fs/fat/fs_fat32.c
index 22c285c40..0ec1d78cf 100644
--- a/nuttx/fs/fat/fs_fat32.c
+++ b/nuttx/fs/fat/fs_fat32.c
@@ -2200,7 +2200,7 @@ static int fat_stat(struct inode *mountpt, const char *relpath, struct stat *buf
ret = fat_finddirentry(fs, &dirinfo, relpath);
- /* If nothing was found, then we fail with EEXIST */
+ /* If nothing was found, then we fail with the reported error */
if (ret < 0)
{