Rename up_i2c initialize and uninitialize functions using the correct MCU-specific naming

This commit is contained in:
Gregory Nutt
2016-02-02 12:25:14 -06:00
parent cbb5025150
commit a135df609f
22 changed files with 68 additions and 69 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/dk-tm4c129x/src/tiva_tmp100.c * configs/dk-tm4c129x/src/tiva_tmp100.c
* *
* Copyright (C) 2015 Gregory Nutt. All rights reserved. * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -83,7 +83,7 @@ int tiva_tmp100_initialize(FAR const char *devpath)
/* Get an instance of the I2C6 interface */ /* Get an instance of the I2C6 interface */
i2c = up_i2cinitialize(TMP100_I2CBUS); i2c = tiva_i2cbus_initialize(TMP100_I2CBUS);
if (!i2c) if (!i2c)
{ {
return -ENODEV; return -ENODEV;
@@ -94,7 +94,7 @@ int tiva_tmp100_initialize(FAR const char *devpath)
ret = lm75_register(devpath, i2c, TMP100_I2CADDR); ret = lm75_register(devpath, i2c, TMP100_I2CADDR);
if (ret < 0) if (ret < 0)
{ {
(void)up_i2cuninitialize(i2c); (void)tiva_i2cbus_uninitialize(i2c);
} }
return ret; return ret;
+1 -1
View File
@@ -122,7 +122,7 @@ if [ "$answer" = y ]; then
echo "EXTERN(up_earlyserialinit)" >>ld-locked.inc echo "EXTERN(up_earlyserialinit)" >>ld-locked.inc
fi fi
# up_i2cinitialize -- Not conditioned on anything # xyz_i2cbus_initialize -- Not conditioned on anything
answer=$(checkconfig CONFIG_USBDEV) answer=$(checkconfig CONFIG_USBDEV)
if [ "$answer" = y ]; then if [ "$answer" = y ]; then
+3 -2
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* config/sama5d3x-ek/src/sam_at24.c * config/sama5d3x-ek/src/sam_at24.c
* *
* Copyright (C) 2013 Gregory Nutt. All rights reserved. * Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -68,6 +68,7 @@
#include <nuttx/mtd/mtd.h> #include <nuttx/mtd/mtd.h>
#include <nuttx/fs/nxffs.h> #include <nuttx/fs/nxffs.h>
#include "sam_twi.h"
#include "sama5d3x-ek.h" #include "sama5d3x-ek.h"
#ifdef HAVE_AT24 #ifdef HAVE_AT24
@@ -102,7 +103,7 @@ int sam_at24_automount(int minor)
/* No.. Get the I2C bus driver */ /* No.. Get the I2C bus driver */
fvdbg("Initialize TWI%d\n", AT24_BUS); fvdbg("Initialize TWI%d\n", AT24_BUS);
i2c = up_i2cinitialize(AT24_BUS); i2c = sam_i2cbus_initialize(AT24_BUS);
if (!i2c) if (!i2c)
{ {
fdbg("ERROR: Failed to initialize TWI%d\n", AT24_BUS); fdbg("ERROR: Failed to initialize TWI%d\n", AT24_BUS);
+3 -2
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/sama5d3x-ek/src/sam_ov2640.c * configs/sama5d3x-ek/src/sam_ov2640.c
* *
* Copyright (C) 2013 Gregory Nutt. All rights reserved. * Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -51,6 +51,7 @@
#include "sam_periphclks.h" #include "sam_periphclks.h"
#include "sam_lcd.h" #include "sam_lcd.h"
#include "sam_pck.h" #include "sam_pck.h"
#include "sam_twi.h"
#include "sam_pio.h" #include "sam_pio.h"
#include "chip/sam_pinmap.h" #include "chip/sam_pinmap.h"
@@ -157,7 +158,7 @@ static inline int ov2640_camera_initialize(void)
/* Get the I2C driver that interfaces with the camers (OV2640_BUS)*/ /* Get the I2C driver that interfaces with the camers (OV2640_BUS)*/
i2c = up_i2cinitialize(OV2640_BUS); i2c = sam_i2cbus_initialize(OV2640_BUS);
if (!i2c) if (!i2c)
{ {
gdbg("ERROR: Failed to initialize TWI%d\n", OV2640_BUS); gdbg("ERROR: Failed to initialize TWI%d\n", OV2640_BUS);
+2 -2
View File
@@ -1,7 +1,7 @@
/************************************************************************************ /************************************************************************************
* configs/sama5d3x-ek/src/sam_wm8904.c * configs/sama5d3x-ek/src/sam_wm8904.c
* *
* Copyright (C) 2014 Gregory Nutt. All rights reserved. * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -269,7 +269,7 @@ int sam_wm8904_initialize(int minor)
/* Get an instance of the I2C interface for the WM8904 chip select */ /* Get an instance of the I2C interface for the WM8904 chip select */
i2c = up_i2cinitialize(WM8904_TWI_BUS); i2c = sam_i2cbus_initialize(WM8904_TWI_BUS);
if (!i2c) if (!i2c)
{ {
auddbg("Failed to initialize TWI%d\n", WM8904_TWI_BUS); auddbg("Failed to initialize TWI%d\n", WM8904_TWI_BUS);
+3 -3
View File
@@ -1,7 +1,7 @@
/************************************************************************************ /************************************************************************************
* configs/sama5d4-ek/src/sam_maxtouch.c * configs/sama5d4-ek/src/sam_maxtouch.c
* *
* Copyright (C) 2014 Gregory Nutt. All rights reserved. * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -259,7 +259,7 @@ int board_tsc_setup(int minor)
/* Get an instance of the I2C interface for the touchscreen chip select */ /* Get an instance of the I2C interface for the touchscreen chip select */
i2c = up_i2cinitialize(MXT_TWI_BUS); i2c = sam_i2cbus_initialize(MXT_TWI_BUS);
if (!i2c) if (!i2c)
{ {
idbg("Failed to initialize I2C%d\n", MXT_TWI_BUS); idbg("Failed to initialize I2C%d\n", MXT_TWI_BUS);
@@ -278,7 +278,7 @@ int board_tsc_setup(int minor)
{ {
idbg("ERROR: Failed to register touchscreen device\n"); idbg("ERROR: Failed to register touchscreen device\n");
irq_detach(IRQ_CHG_MXT); irq_detach(IRQ_CHG_MXT);
/* up_i2cuninitialize(i2c); */ /* sam_i2cbus_uninitialize(i2c); */
return -ENODEV; return -ENODEV;
} }
+1 -1
View File
@@ -77,7 +77,7 @@ void sam_pmic_initialize(void)
/* Get an instance of the I2C interface for the PMIC */ /* Get an instance of the I2C interface for the PMIC */
i2c = up_i2cinitialize(PMIC_TWI_BUS); i2c = sam_i2cbus_initialize(PMIC_TWI_BUS);
if (!i2c) if (!i2c)
{ {
dbg("ERROR: Failed to initialize TWI%d\n", PMIC_TWI_BUS); dbg("ERROR: Failed to initialize TWI%d\n", PMIC_TWI_BUS);
+1 -1
View File
@@ -269,7 +269,7 @@ int sam_wm8904_initialize(int minor)
/* Get an instance of the I2C interface for the WM8904 chip select */ /* Get an instance of the I2C interface for the WM8904 chip select */
i2c = up_i2cinitialize(WM8904_TWI_BUS); i2c = sam_i2cbus_initialize(WM8904_TWI_BUS);
if (!i2c) if (!i2c)
{ {
auddbg("Failed to initialize TWI%d\n", WM8904_TWI_BUS); auddbg("Failed to initialize TWI%d\n", WM8904_TWI_BUS);
+4 -4
View File
@@ -1,7 +1,7 @@
/************************************************************************************ /************************************************************************************
* configs/same70-xplained/src/sam_at24config.c * configs/same70-xplained/src/sam_at24config.c
* *
* Copyright (C) 2015 Gregory Nutt. All rights reserved. * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -72,7 +72,7 @@ int sam_at24config(void)
/* Get an instance of the TWI0 interface */ /* Get an instance of the TWI0 interface */
i2c = up_i2cinitialize(0); i2c = sam_i2cbus_initialize(0);
if (!i2c) if (!i2c)
{ {
fdbg("ERROR: Failed to initialize TWI0\n"); fdbg("ERROR: Failed to initialize TWI0\n");
@@ -85,7 +85,7 @@ int sam_at24config(void)
if (!at24) if (!at24)
{ {
fdbg("ERROR: Failed to initialize the AT24 driver\n"); fdbg("ERROR: Failed to initialize the AT24 driver\n");
(void)up_i2cuninitialize(i2c); (void)sam_i2cbus_uninitialize(i2c);
return -ENODEV; return -ENODEV;
} }
@@ -103,7 +103,7 @@ int sam_at24config(void)
if (ret < 0) if (ret < 0)
{ {
fdbg("ERROR: Failed to bind AT24 driver to the MTD config device\n"); fdbg("ERROR: Failed to bind AT24 driver to the MTD config device\n");
(void)up_i2cuninitialize(i2c); (void)sam_i2cbus_uninitialize(i2c);
} }
return ret; return ret;
+6 -6
View File
@@ -1,7 +1,7 @@
/************************************************************************************ /************************************************************************************
* configs/same70-xplained/src/sam_ethernet.c * configs/same70-xplained/src/sam_ethernet.c
* *
* Copyright (C) 2015 Gregory Nutt. All rights reserved. * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -162,7 +162,7 @@ int sam_emac0_setmac(void)
/* Get an instance of the TWI0 interface */ /* Get an instance of the TWI0 interface */
i2c = up_i2cinitialize(0); i2c = sam_i2cbus_initialize(0);
if (!i2c) if (!i2c)
{ {
ndbg("ERROR: Failed to initialize TWI0\n"); ndbg("ERROR: Failed to initialize TWI0\n");
@@ -175,7 +175,7 @@ int sam_emac0_setmac(void)
if (!at24) if (!at24)
{ {
ndbg("ERROR: Failed to initialize the AT24 driver\n"); ndbg("ERROR: Failed to initialize the AT24 driver\n");
(void)up_i2cuninitialize(i2c); (void)sam_i2cbus_uninitialize(i2c);
return -ENODEV; return -ENODEV;
} }
@@ -185,7 +185,7 @@ int sam_emac0_setmac(void)
if (ret < 0) if (ret < 0)
{ {
ndbg("ERROR: AT24 ioctl(MTDIOC_EXTENDED) failed: %d\n", ret); ndbg("ERROR: AT24 ioctl(MTDIOC_EXTENDED) failed: %d\n", ret);
(void)up_i2cuninitialize(i2c); (void)sam_i2cbus_uninitialize(i2c);
return ret; return ret;
} }
@@ -195,7 +195,7 @@ int sam_emac0_setmac(void)
if (nread < 6) if (nread < 6)
{ {
ndbg("ERROR: AT24 read(AT24XX_MACADDR_OFFSET) failed: ld\n", (long)nread); ndbg("ERROR: AT24 read(AT24XX_MACADDR_OFFSET) failed: ld\n", (long)nread);
(void)up_i2cuninitialize(i2c); (void)sam_i2cbus_uninitialize(i2c);
return (int)nread; return (int)nread;
} }
@@ -211,7 +211,7 @@ int sam_emac0_setmac(void)
* REVISIT: Need an interface to release the AT24 instance too * REVISIT: Need an interface to release the AT24 instance too
*/ */
ret = up_i2cuninitialize(i2c); ret = sam_i2cbus_uninitialize(i2c);
if (ret < 0) if (ret < 0)
{ {
ndbg("ERROR: Failed to release the I2C interface: %d\n", ret); ndbg("ERROR: Failed to release the I2C interface: %d\n", ret);
+4 -4
View File
@@ -1,7 +1,7 @@
/************************************************************************************ /************************************************************************************
* configs/samv71-xult/src/sam_at24config.c * configs/samv71-xult/src/sam_at24config.c
* *
* Copyright (C) 2015 Gregory Nutt. All rights reserved. * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -72,7 +72,7 @@ int sam_at24config(void)
/* Get an instance of the TWI0 interface */ /* Get an instance of the TWI0 interface */
i2c = up_i2cinitialize(0); i2c = sam_i2cbus_initialize(0);
if (!i2c) if (!i2c)
{ {
fdbg("ERROR: Failed to initialize TWI0\n"); fdbg("ERROR: Failed to initialize TWI0\n");
@@ -85,7 +85,7 @@ int sam_at24config(void)
if (!at24) if (!at24)
{ {
fdbg("ERROR: Failed to initialize the AT24 driver\n"); fdbg("ERROR: Failed to initialize the AT24 driver\n");
(void)up_i2cuninitialize(i2c); (void)sam_i2cbus_uninitialize(i2c);
return -ENODEV; return -ENODEV;
} }
@@ -103,7 +103,7 @@ int sam_at24config(void)
if (ret < 0) if (ret < 0)
{ {
fdbg("ERROR: Failed to bind AT24 driver to the MTD config device\n"); fdbg("ERROR: Failed to bind AT24 driver to the MTD config device\n");
(void)up_i2cuninitialize(i2c); (void)sam_i2cbus_uninitialize(i2c);
} }
return ret; return ret;
+5 -5
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* config/samv71-xult/src/sam_bringup.c * config/samv71-xult/src/sam_bringup.c
* *
* Copyright (C) 2015 Gregory Nutt. All rights reserved. * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -133,10 +133,10 @@ int sam_bringup(void)
#if defined(HAVE_RTC_PCF85263) #if defined(HAVE_RTC_PCF85263)
/* Get an instance of the TWIHS0 I2C interface */ /* Get an instance of the TWIHS0 I2C interface */
i2c = up_i2cinitialize(PCF85263_TWI_BUS); i2c = sam_i2cbus_initialize(PCF85263_TWI_BUS);
if (i2c == NULL) if (i2c == NULL)
{ {
SYSLOG("ERROR: up_i2cinitialize(%d) failed\n", PCF85263_TWI_BUS); SYSLOG("ERROR: sam_i2cbus_initialize(%d) failed\n", PCF85263_TWI_BUS);
} }
else else
{ {
@@ -158,10 +158,10 @@ int sam_bringup(void)
#elif defined(HAVE_RTC_DSXXXX) #elif defined(HAVE_RTC_DSXXXX)
/* Get an instance of the TWIHS0 I2C interface */ /* Get an instance of the TWIHS0 I2C interface */
i2c = up_i2cinitialize(DSXXXX_TWI_BUS); i2c = sam_i2cbus_initialize(DSXXXX_TWI_BUS);
if (i2c == NULL) if (i2c == NULL)
{ {
SYSLOG("ERROR: up_i2cinitialize(%d) failed\n", DSXXXX_TWI_BUS); SYSLOG("ERROR: sam_i2cbus_initialize(%d) failed\n", DSXXXX_TWI_BUS);
} }
else else
{ {
+6 -6
View File
@@ -1,7 +1,7 @@
/************************************************************************************ /************************************************************************************
* configs/samv71-xult/src/sam_ethernet.c * configs/samv71-xult/src/sam_ethernet.c
* *
* Copyright (C) 2015 Gregory Nutt. All rights reserved. * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -166,7 +166,7 @@ int sam_emac0_setmac(void)
/* Get an instance of the TWI0 interface */ /* Get an instance of the TWI0 interface */
i2c = up_i2cinitialize(0); i2c = sam_i2cbus_initialize(0);
if (!i2c) if (!i2c)
{ {
ndbg("ERROR: Failed to initialize TWI0\n"); ndbg("ERROR: Failed to initialize TWI0\n");
@@ -179,7 +179,7 @@ int sam_emac0_setmac(void)
if (!at24) if (!at24)
{ {
ndbg("ERROR: Failed to initialize the AT24 driver\n"); ndbg("ERROR: Failed to initialize the AT24 driver\n");
(void)up_i2cuninitialize(i2c); (void)sam_i2cbus_uninitialize(i2c);
return -ENODEV; return -ENODEV;
} }
@@ -189,7 +189,7 @@ int sam_emac0_setmac(void)
if (ret < 0) if (ret < 0)
{ {
ndbg("ERROR: AT24 ioctl(MTDIOC_EXTENDED) failed: %d\n", ret); ndbg("ERROR: AT24 ioctl(MTDIOC_EXTENDED) failed: %d\n", ret);
(void)up_i2cuninitialize(i2c); (void)sam_i2cbus_uninitialize(i2c);
return ret; return ret;
} }
@@ -199,7 +199,7 @@ int sam_emac0_setmac(void)
if (nread < 6) if (nread < 6)
{ {
ndbg("ERROR: AT24 read(AT24XX_MACADDR_OFFSET) failed: ld\n", (long)nread); ndbg("ERROR: AT24 read(AT24XX_MACADDR_OFFSET) failed: ld\n", (long)nread);
(void)up_i2cuninitialize(i2c); (void)sam_i2cbus_uninitialize(i2c);
return (int)nread; return (int)nread;
} }
@@ -215,7 +215,7 @@ int sam_emac0_setmac(void)
* REVISIT: Need an interface to release the AT24 instance too * REVISIT: Need an interface to release the AT24 instance too
*/ */
ret = up_i2cuninitialize(i2c); ret = sam_i2cbus_uninitialize(i2c);
if (ret < 0) if (ret < 0)
{ {
ndbg("ERROR: Failed to release the I2C interface: %d\n", ret); ndbg("ERROR: Failed to release the I2C interface: %d\n", ret);
+3 -3
View File
@@ -1,7 +1,7 @@
/************************************************************************************ /************************************************************************************
* configs/samv7-xult/src/sam_maxtouch.c * configs/samv7-xult/src/sam_maxtouch.c
* *
* Copyright (C) 2015 Gregory Nutt. All rights reserved. * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -258,7 +258,7 @@ int board_tsc_setup(int minor)
/* Get an instance of the I2C interface for the touchscreen chip select */ /* Get an instance of the I2C interface for the touchscreen chip select */
i2c = up_i2cinitialize(MXT_TWI_BUS); i2c = sam_i2cbus_initialize(MXT_TWI_BUS);
if (!i2c) if (!i2c)
{ {
idbg("Failed to initialize I2C%d\n", MXT_TWI_BUS); idbg("Failed to initialize I2C%d\n", MXT_TWI_BUS);
@@ -277,7 +277,7 @@ int board_tsc_setup(int minor)
{ {
idbg("ERROR: Failed to register touchscreen device\n"); idbg("ERROR: Failed to register touchscreen device\n");
irq_detach(IRQ_MXT_CHG); irq_detach(IRQ_MXT_CHG);
/* up_i2cuninitialize(i2c); */ /* sam_i2cbus_uninitialize(i2c); */
return -ENODEV; return -ENODEV;
} }
+1 -1
View File
@@ -269,7 +269,7 @@ int sam_wm8904_initialize(int minor)
/* Get an instance of the I2C interface for the WM8904 chip select */ /* Get an instance of the I2C interface for the WM8904 chip select */
i2c = up_i2cinitialize(WM8904_TWI_BUS); i2c = sam_i2cbus_initialize(WM8904_TWI_BUS);
if (!i2c) if (!i2c)
{ {
auddbg("Failed to initialize TWI%d\n", WM8904_TWI_BUS); auddbg("Failed to initialize TWI%d\n", WM8904_TWI_BUS);
+4 -11
View File
@@ -1,7 +1,7 @@
/************************************************************************************ /************************************************************************************
* configs/stm3210e-eval/src/stm32_lm75.c * configs/stm3210e-eval/src/stm32_lm75.c
* *
* Copyright (C) 2011 Gregory Nutt. All rights reserved. * Copyright (C) 2011, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -50,14 +50,6 @@
#if defined(CONFIG_I2C) && defined(CONFIG_I2C_LM75) && defined(CONFIG_STM32_I2C1) #if defined(CONFIG_I2C) && defined(CONFIG_I2C_LM75) && defined(CONFIG_STM32_I2C1)
/************************************************************************************
* Pre-processor Definitions
************************************************************************************/
/************************************************************************************
* Private Functions
************************************************************************************/
/************************************************************************************ /************************************************************************************
* Public Functions * Public Functions
************************************************************************************/ ************************************************************************************/
@@ -89,7 +81,7 @@ int stm32_lm75initialize(FAR const char *devpath)
/* Get an instance of the I2C1 interface */ /* Get an instance of the I2C1 interface */
i2c = up_i2cinitialize(1); i2c = stm32_i2cbus_initialize(1);
if (!i2c) if (!i2c)
{ {
return -ENODEV; return -ENODEV;
@@ -100,8 +92,9 @@ int stm32_lm75initialize(FAR const char *devpath)
ret = lm75_register(devpath, i2c, 0x48); ret = lm75_register(devpath, i2c, 0x48);
if (ret < 0) if (ret < 0)
{ {
(void)up_i2cuninitialize(i2c); (void)stm32_i2cbus_uninitialize(i2c);
} }
return ret; return ret;
} }
+3 -3
View File
@@ -1,7 +1,7 @@
/************************************************************************************ /************************************************************************************
* configs/stm3220g-eval/src/stm32_stmpe811.c * configs/stm3220g-eval/src/stm32_stmpe811.c
* *
* Copyright (C) 2012 Gregory Nutt. All rights reserved. * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -294,7 +294,7 @@ int board_tsc_setup(int minor)
/* Get an instance of the I2C interface */ /* Get an instance of the I2C interface */
dev = up_i2cinitialize(CONFIG_STMPE811_I2CDEV); dev = stm32_i2cbus_initialize(CONFIG_STMPE811_I2CDEV);
if (!dev) if (!dev)
{ {
idbg("Failed to initialize I2C bus %d\n", CONFIG_STMPE811_I2CDEV); idbg("Failed to initialize I2C bus %d\n", CONFIG_STMPE811_I2CDEV);
@@ -317,7 +317,7 @@ int board_tsc_setup(int minor)
if (ret < 0) if (ret < 0)
{ {
idbg("Failed to register STMPE driver: %d\n", ret); idbg("Failed to register STMPE driver: %d\n", ret);
/* up_i2cuninitialize(dev); */ /* stm32_i2cbus_uninitialize(dev); */
return -ENODEV; return -ENODEV;
} }
} }
+3 -3
View File
@@ -1,7 +1,7 @@
/************************************************************************************ /************************************************************************************
* configs/stm3240g-eval/src/stm32_stmpe811.c * configs/stm3240g-eval/src/stm32_stmpe811.c
* *
* Copyright (C) 2012 Gregory Nutt. All rights reserved. * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -294,7 +294,7 @@ int board_tsc_setup(int minor)
/* Get an instance of the I2C interface */ /* Get an instance of the I2C interface */
dev = up_i2cinitialize(CONFIG_STMPE811_I2CDEV); dev = stm32_i2cbus_initialize(CONFIG_STMPE811_I2CDEV);
if (!dev) if (!dev)
{ {
idbg("Failed to initialize I2C bus %d\n", CONFIG_STMPE811_I2CDEV); idbg("Failed to initialize I2C bus %d\n", CONFIG_STMPE811_I2CDEV);
@@ -317,7 +317,7 @@ int board_tsc_setup(int minor)
if (ret < 0) if (ret < 0)
{ {
idbg("Failed to register STMPE driver: %d\n", ret); idbg("Failed to register STMPE driver: %d\n", ret);
/* up_i2cuninitialize(dev); */ /* stm32_i2cbus_uninitialize(dev); */
return -ENODEV; return -ENODEV;
} }
} }
+2 -1
View File
@@ -46,6 +46,7 @@
#include <nuttx/sensors/bmp180.h> #include <nuttx/sensors/bmp180.h>
#include "stm32.h" #include "stm32.h"
#include "stm32_i2c.h"
#include "stm32f4discovery.h" #include "stm32f4discovery.h"
#if defined(CONFIG_I2C) && defined(CONFIG_BMP180) #if defined(CONFIG_I2C) && defined(CONFIG_BMP180)
@@ -83,7 +84,7 @@ int stm32_bmp180initialize(FAR const char *devpath)
/* Initialize I2C */ /* Initialize I2C */
i2c = up_i2cinitialize(BMP180_I2C_PORTNO); i2c = stm32_i2cbus_initialize(BMP180_I2C_PORTNO);
if (!i2c) if (!i2c)
{ {
+4 -3
View File
@@ -1,7 +1,7 @@
/************************************************************************************ /************************************************************************************
* configs/stm32f4discovery/src/stm32_pca9635.c * configs/stm32f4discovery/src/stm32_pca9635.c
* *
* Copyright (C) 2014 Gregory Nutt. All rights reserved. * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -49,8 +49,9 @@
#include <arch/irq.h> #include <arch/irq.h>
#include "stm32f4discovery.h"
#include "stm32_gpio.h" #include "stm32_gpio.h"
#include "stm32_i2c.h"
#include "stm32f4discovery.h"
#ifdef CONFIG_PCA9635PW #ifdef CONFIG_PCA9635PW
@@ -82,7 +83,7 @@ int stm32_pca9635_initialize(void)
/* Get the I2C driver that interfaces with the pca9635 (PCA9635_I2CBUS)*/ /* Get the I2C driver that interfaces with the pca9635 (PCA9635_I2CBUS)*/
i2c = up_i2cinitialize(PCA9635_I2CBUS); i2c = stm32_i2cbus_initialize(PCA9635_I2CBUS);
if (!i2c) if (!i2c)
{ {
dbg("ERROR: Failed to initialize I2C%d\n", PCA9635_I2CBUS); dbg("ERROR: Failed to initialize I2C%d\n", PCA9635_I2CBUS);
+3 -2
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* config/sama5d3x-ek/src/tm4c_at24.c * config/sama5d3x-ek/src/tm4c_at24.c
* *
* Copyright (C) 2014 Gregory Nutt. All rights reserved. * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -65,6 +65,7 @@
#include <nuttx/mtd/mtd.h> #include <nuttx/mtd/mtd.h>
#include <nuttx/fs/nxffs.h> #include <nuttx/fs/nxffs.h>
#include "tiva_i2c.h"
#include "tm4c123g-launchpad.h" #include "tm4c123g-launchpad.h"
#ifdef HAVE_AT24 #ifdef HAVE_AT24
@@ -98,7 +99,7 @@ int tm4c_at24_automount(int minor)
{ {
/* No.. Get the I2C bus driver */ /* No.. Get the I2C bus driver */
i2c = up_i2cinitialize(AT24_BUS); i2c = tiva_i2cbus_initialize(AT24_BUS);
if (!i2c) if (!i2c)
{ {
syslog(LOG_ERR, "ERROR: Failed to initialize SPI%d\n", AT24_BUS); syslog(LOG_ERR, "ERROR: Failed to initialize SPI%d\n", AT24_BUS);
+3 -2
View File
@@ -88,6 +88,7 @@
#include "stm32_gpio.h" #include "stm32_gpio.h"
#include "stm32_spi.h" #include "stm32_spi.h"
#include "stm32_i2c.h"
#include "vsn.h" #include "vsn.h"
@@ -320,8 +321,8 @@ int sif_anout_init(void)
STM32_TIM_SETMODE(vsn_sif.tim8, STM32_TIM_MODE_UP); STM32_TIM_SETMODE(vsn_sif.tim8, STM32_TIM_MODE_UP);
//STM32_TIM_SETCHANNEL(vsn_sif.tim8, GPIO_OUT_PWRPWM_TIM8_CH, STM32_TIM_CH_OUTPWM | STM32_TIM_CH_POLARITY_NEG); //STM32_TIM_SETCHANNEL(vsn_sif.tim8, GPIO_OUT_PWRPWM_TIM8_CH, STM32_TIM_CH_OUTPWM | STM32_TIM_CH_POLARITY_NEG);
vsn_sif.i2c1 = up_i2cinitialize(1); vsn_sif.i2c1 = stm32_i2cbus_initialize(1);
vsn_sif.i2c2 = up_i2cinitialize(2); vsn_sif.i2c2 = stm32_i2cbus_initialize(2);
vsn_sif.spi2 = stm32_spibus_initialize(2); vsn_sif.spi2 = stm32_spibus_initialize(2);