diff --git a/configs/dk-tm4c129x/src/tm4c_tmp100.c b/configs/dk-tm4c129x/src/tm4c_tmp100.c index 63694a696dd..88bca5de7d2 100644 --- a/configs/dk-tm4c129x/src/tm4c_tmp100.c +++ b/configs/dk-tm4c129x/src/tm4c_tmp100.c @@ -1,7 +1,7 @@ /**************************************************************************** * 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 * * 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 */ - i2c = up_i2cinitialize(TMP100_I2CBUS); + i2c = tiva_i2cbus_initialize(TMP100_I2CBUS); if (!i2c) { return -ENODEV; @@ -94,7 +94,7 @@ int tiva_tmp100_initialize(FAR const char *devpath) ret = lm75_register(devpath, i2c, TMP100_I2CADDR); if (ret < 0) { - (void)up_i2cuninitialize(i2c); + (void)tiva_i2cbus_uninitialize(i2c); } return ret; diff --git a/configs/ea3131/locked/mklocked.sh b/configs/ea3131/locked/mklocked.sh index 2df7293b105..29b357ae399 100755 --- a/configs/ea3131/locked/mklocked.sh +++ b/configs/ea3131/locked/mklocked.sh @@ -122,7 +122,7 @@ if [ "$answer" = y ]; then echo "EXTERN(up_earlyserialinit)" >>ld-locked.inc fi -# up_i2cinitialize -- Not conditioned on anything +# xyz_i2cbus_initialize -- Not conditioned on anything answer=$(checkconfig CONFIG_USBDEV) if [ "$answer" = y ]; then diff --git a/configs/sama5d3x-ek/src/sam_at24.c b/configs/sama5d3x-ek/src/sam_at24.c index cd6658fa814..ea59b48b33f 100644 --- a/configs/sama5d3x-ek/src/sam_at24.c +++ b/configs/sama5d3x-ek/src/sam_at24.c @@ -1,7 +1,7 @@ /**************************************************************************** * 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 * * Redistribution and use in source and binary forms, with or without @@ -68,6 +68,7 @@ #include #include +#include "sam_twi.h" #include "sama5d3x-ek.h" #ifdef HAVE_AT24 @@ -102,7 +103,7 @@ int sam_at24_automount(int minor) /* No.. Get the I2C bus driver */ fvdbg("Initialize TWI%d\n", AT24_BUS); - i2c = up_i2cinitialize(AT24_BUS); + i2c = sam_i2cbus_initialize(AT24_BUS); if (!i2c) { fdbg("ERROR: Failed to initialize TWI%d\n", AT24_BUS); diff --git a/configs/sama5d3x-ek/src/sam_ov2640.c b/configs/sama5d3x-ek/src/sam_ov2640.c index d7875dab38f..cc401ac56ad 100644 --- a/configs/sama5d3x-ek/src/sam_ov2640.c +++ b/configs/sama5d3x-ek/src/sam_ov2640.c @@ -1,7 +1,7 @@ /**************************************************************************** * 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 * * Redistribution and use in source and binary forms, with or without @@ -51,6 +51,7 @@ #include "sam_periphclks.h" #include "sam_lcd.h" #include "sam_pck.h" +#include "sam_twi.h" #include "sam_pio.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)*/ - i2c = up_i2cinitialize(OV2640_BUS); + i2c = sam_i2cbus_initialize(OV2640_BUS); if (!i2c) { gdbg("ERROR: Failed to initialize TWI%d\n", OV2640_BUS); diff --git a/configs/sama5d3x-ek/src/sam_wm8904.c b/configs/sama5d3x-ek/src/sam_wm8904.c index eadec998778..8d70bdbed17 100644 --- a/configs/sama5d3x-ek/src/sam_wm8904.c +++ b/configs/sama5d3x-ek/src/sam_wm8904.c @@ -1,7 +1,7 @@ /************************************************************************************ * 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 * * 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 */ - i2c = up_i2cinitialize(WM8904_TWI_BUS); + i2c = sam_i2cbus_initialize(WM8904_TWI_BUS); if (!i2c) { auddbg("Failed to initialize TWI%d\n", WM8904_TWI_BUS); diff --git a/configs/sama5d4-ek/src/sam_maxtouch.c b/configs/sama5d4-ek/src/sam_maxtouch.c index 0e14325db3e..391e7b0b80f 100644 --- a/configs/sama5d4-ek/src/sam_maxtouch.c +++ b/configs/sama5d4-ek/src/sam_maxtouch.c @@ -1,7 +1,7 @@ /************************************************************************************ * 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 * * 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 */ - i2c = up_i2cinitialize(MXT_TWI_BUS); + i2c = sam_i2cbus_initialize(MXT_TWI_BUS); if (!i2c) { 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"); irq_detach(IRQ_CHG_MXT); - /* up_i2cuninitialize(i2c); */ + /* sam_i2cbus_uninitialize(i2c); */ return -ENODEV; } diff --git a/configs/sama5d4-ek/src/sam_pmic.c b/configs/sama5d4-ek/src/sam_pmic.c index 1f10ea2fd89..0b6344dbf75 100644 --- a/configs/sama5d4-ek/src/sam_pmic.c +++ b/configs/sama5d4-ek/src/sam_pmic.c @@ -77,7 +77,7 @@ void sam_pmic_initialize(void) /* 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) { dbg("ERROR: Failed to initialize TWI%d\n", PMIC_TWI_BUS); diff --git a/configs/sama5d4-ek/src/sam_wm8904.c b/configs/sama5d4-ek/src/sam_wm8904.c index 5561d88f764..5a12abdfcb0 100644 --- a/configs/sama5d4-ek/src/sam_wm8904.c +++ b/configs/sama5d4-ek/src/sam_wm8904.c @@ -269,7 +269,7 @@ int sam_wm8904_initialize(int minor) /* 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) { auddbg("Failed to initialize TWI%d\n", WM8904_TWI_BUS); diff --git a/configs/same70-xplained/src/sam_at24config.c b/configs/same70-xplained/src/sam_at24config.c index e9857cfcd05..aac1de3571d 100644 --- a/configs/same70-xplained/src/sam_at24config.c +++ b/configs/same70-xplained/src/sam_at24config.c @@ -1,7 +1,7 @@ /************************************************************************************ * 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 * * 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 */ - i2c = up_i2cinitialize(0); + i2c = sam_i2cbus_initialize(0); if (!i2c) { fdbg("ERROR: Failed to initialize TWI0\n"); @@ -85,7 +85,7 @@ int sam_at24config(void) if (!at24) { fdbg("ERROR: Failed to initialize the AT24 driver\n"); - (void)up_i2cuninitialize(i2c); + (void)sam_i2cbus_uninitialize(i2c); return -ENODEV; } @@ -103,7 +103,7 @@ int sam_at24config(void) if (ret < 0) { fdbg("ERROR: Failed to bind AT24 driver to the MTD config device\n"); - (void)up_i2cuninitialize(i2c); + (void)sam_i2cbus_uninitialize(i2c); } return ret; diff --git a/configs/same70-xplained/src/sam_ethernet.c b/configs/same70-xplained/src/sam_ethernet.c index ed504709a3e..e1ff523070a 100644 --- a/configs/same70-xplained/src/sam_ethernet.c +++ b/configs/same70-xplained/src/sam_ethernet.c @@ -1,7 +1,7 @@ /************************************************************************************ * 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 * * 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 */ - i2c = up_i2cinitialize(0); + i2c = sam_i2cbus_initialize(0); if (!i2c) { ndbg("ERROR: Failed to initialize TWI0\n"); @@ -175,7 +175,7 @@ int sam_emac0_setmac(void) if (!at24) { ndbg("ERROR: Failed to initialize the AT24 driver\n"); - (void)up_i2cuninitialize(i2c); + (void)sam_i2cbus_uninitialize(i2c); return -ENODEV; } @@ -185,7 +185,7 @@ int sam_emac0_setmac(void) if (ret < 0) { ndbg("ERROR: AT24 ioctl(MTDIOC_EXTENDED) failed: %d\n", ret); - (void)up_i2cuninitialize(i2c); + (void)sam_i2cbus_uninitialize(i2c); return ret; } @@ -195,7 +195,7 @@ int sam_emac0_setmac(void) if (nread < 6) { ndbg("ERROR: AT24 read(AT24XX_MACADDR_OFFSET) failed: ld\n", (long)nread); - (void)up_i2cuninitialize(i2c); + (void)sam_i2cbus_uninitialize(i2c); return (int)nread; } @@ -211,7 +211,7 @@ int sam_emac0_setmac(void) * REVISIT: Need an interface to release the AT24 instance too */ - ret = up_i2cuninitialize(i2c); + ret = sam_i2cbus_uninitialize(i2c); if (ret < 0) { ndbg("ERROR: Failed to release the I2C interface: %d\n", ret); diff --git a/configs/samv71-xult/src/sam_at24config.c b/configs/samv71-xult/src/sam_at24config.c index 2cf9d75442c..7191454e472 100644 --- a/configs/samv71-xult/src/sam_at24config.c +++ b/configs/samv71-xult/src/sam_at24config.c @@ -1,7 +1,7 @@ /************************************************************************************ * 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 * * 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 */ - i2c = up_i2cinitialize(0); + i2c = sam_i2cbus_initialize(0); if (!i2c) { fdbg("ERROR: Failed to initialize TWI0\n"); @@ -85,7 +85,7 @@ int sam_at24config(void) if (!at24) { fdbg("ERROR: Failed to initialize the AT24 driver\n"); - (void)up_i2cuninitialize(i2c); + (void)sam_i2cbus_uninitialize(i2c); return -ENODEV; } @@ -103,7 +103,7 @@ int sam_at24config(void) if (ret < 0) { fdbg("ERROR: Failed to bind AT24 driver to the MTD config device\n"); - (void)up_i2cuninitialize(i2c); + (void)sam_i2cbus_uninitialize(i2c); } return ret; diff --git a/configs/samv71-xult/src/sam_bringup.c b/configs/samv71-xult/src/sam_bringup.c index a5b6c9b08ed..83be9db8e19 100644 --- a/configs/samv71-xult/src/sam_bringup.c +++ b/configs/samv71-xult/src/sam_bringup.c @@ -1,7 +1,7 @@ /**************************************************************************** * 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 * * Redistribution and use in source and binary forms, with or without @@ -133,10 +133,10 @@ int sam_bringup(void) #if defined(HAVE_RTC_PCF85263) /* Get an instance of the TWIHS0 I2C interface */ - i2c = up_i2cinitialize(PCF85263_TWI_BUS); + i2c = sam_i2cbus_initialize(PCF85263_TWI_BUS); 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 { @@ -158,10 +158,10 @@ int sam_bringup(void) #elif defined(HAVE_RTC_DSXXXX) /* Get an instance of the TWIHS0 I2C interface */ - i2c = up_i2cinitialize(DSXXXX_TWI_BUS); + i2c = sam_i2cbus_initialize(DSXXXX_TWI_BUS); 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 { diff --git a/configs/samv71-xult/src/sam_ethernet.c b/configs/samv71-xult/src/sam_ethernet.c index 15c8a5dd54e..2c2e2a48f8c 100644 --- a/configs/samv71-xult/src/sam_ethernet.c +++ b/configs/samv71-xult/src/sam_ethernet.c @@ -1,7 +1,7 @@ /************************************************************************************ * 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 * * 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 */ - i2c = up_i2cinitialize(0); + i2c = sam_i2cbus_initialize(0); if (!i2c) { ndbg("ERROR: Failed to initialize TWI0\n"); @@ -179,7 +179,7 @@ int sam_emac0_setmac(void) if (!at24) { ndbg("ERROR: Failed to initialize the AT24 driver\n"); - (void)up_i2cuninitialize(i2c); + (void)sam_i2cbus_uninitialize(i2c); return -ENODEV; } @@ -189,7 +189,7 @@ int sam_emac0_setmac(void) if (ret < 0) { ndbg("ERROR: AT24 ioctl(MTDIOC_EXTENDED) failed: %d\n", ret); - (void)up_i2cuninitialize(i2c); + (void)sam_i2cbus_uninitialize(i2c); return ret; } @@ -199,7 +199,7 @@ int sam_emac0_setmac(void) if (nread < 6) { ndbg("ERROR: AT24 read(AT24XX_MACADDR_OFFSET) failed: ld\n", (long)nread); - (void)up_i2cuninitialize(i2c); + (void)sam_i2cbus_uninitialize(i2c); return (int)nread; } @@ -215,7 +215,7 @@ int sam_emac0_setmac(void) * REVISIT: Need an interface to release the AT24 instance too */ - ret = up_i2cuninitialize(i2c); + ret = sam_i2cbus_uninitialize(i2c); if (ret < 0) { ndbg("ERROR: Failed to release the I2C interface: %d\n", ret); diff --git a/configs/samv71-xult/src/sam_maxtouch.c b/configs/samv71-xult/src/sam_maxtouch.c index bf769a29587..e9512e98d31 100644 --- a/configs/samv71-xult/src/sam_maxtouch.c +++ b/configs/samv71-xult/src/sam_maxtouch.c @@ -1,7 +1,7 @@ /************************************************************************************ * 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 * * 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 */ - i2c = up_i2cinitialize(MXT_TWI_BUS); + i2c = sam_i2cbus_initialize(MXT_TWI_BUS); if (!i2c) { 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"); irq_detach(IRQ_MXT_CHG); - /* up_i2cuninitialize(i2c); */ + /* sam_i2cbus_uninitialize(i2c); */ return -ENODEV; } diff --git a/configs/samv71-xult/src/sam_wm8904.c b/configs/samv71-xult/src/sam_wm8904.c index fd6477fa77e..7679d8cb65f 100644 --- a/configs/samv71-xult/src/sam_wm8904.c +++ b/configs/samv71-xult/src/sam_wm8904.c @@ -269,7 +269,7 @@ int sam_wm8904_initialize(int minor) /* 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) { auddbg("Failed to initialize TWI%d\n", WM8904_TWI_BUS); diff --git a/configs/stm3210e-eval/src/stm32_lm75.c b/configs/stm3210e-eval/src/stm32_lm75.c index fc606929842..ba0591fb87c 100644 --- a/configs/stm3210e-eval/src/stm32_lm75.c +++ b/configs/stm3210e-eval/src/stm32_lm75.c @@ -1,7 +1,7 @@ /************************************************************************************ * 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 * * 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) -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ @@ -89,7 +81,7 @@ int stm32_lm75initialize(FAR const char *devpath) /* Get an instance of the I2C1 interface */ - i2c = up_i2cinitialize(1); + i2c = stm32_i2cbus_initialize(1); if (!i2c) { return -ENODEV; @@ -100,8 +92,9 @@ int stm32_lm75initialize(FAR const char *devpath) ret = lm75_register(devpath, i2c, 0x48); if (ret < 0) { - (void)up_i2cuninitialize(i2c); + (void)stm32_i2cbus_uninitialize(i2c); } + return ret; } diff --git a/configs/stm3220g-eval/src/stm32_stmpe811.c b/configs/stm3220g-eval/src/stm32_stmpe811.c index 09c1b46273b..972d7d53f74 100644 --- a/configs/stm3220g-eval/src/stm32_stmpe811.c +++ b/configs/stm3220g-eval/src/stm32_stmpe811.c @@ -1,7 +1,7 @@ /************************************************************************************ * 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 * * 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 */ - dev = up_i2cinitialize(CONFIG_STMPE811_I2CDEV); + dev = stm32_i2cbus_initialize(CONFIG_STMPE811_I2CDEV); if (!dev) { idbg("Failed to initialize I2C bus %d\n", CONFIG_STMPE811_I2CDEV); @@ -317,7 +317,7 @@ int board_tsc_setup(int minor) if (ret < 0) { idbg("Failed to register STMPE driver: %d\n", ret); - /* up_i2cuninitialize(dev); */ + /* stm32_i2cbus_uninitialize(dev); */ return -ENODEV; } } diff --git a/configs/stm3240g-eval/src/stm32_stmpe811.c b/configs/stm3240g-eval/src/stm32_stmpe811.c index 47dd04d7e8d..3828f16bf4d 100644 --- a/configs/stm3240g-eval/src/stm32_stmpe811.c +++ b/configs/stm3240g-eval/src/stm32_stmpe811.c @@ -1,7 +1,7 @@ /************************************************************************************ * 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 * * 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 */ - dev = up_i2cinitialize(CONFIG_STMPE811_I2CDEV); + dev = stm32_i2cbus_initialize(CONFIG_STMPE811_I2CDEV); if (!dev) { idbg("Failed to initialize I2C bus %d\n", CONFIG_STMPE811_I2CDEV); @@ -317,7 +317,7 @@ int board_tsc_setup(int minor) if (ret < 0) { idbg("Failed to register STMPE driver: %d\n", ret); - /* up_i2cuninitialize(dev); */ + /* stm32_i2cbus_uninitialize(dev); */ return -ENODEV; } } diff --git a/configs/stm32f4discovery/src/stm32_bmp180.c b/configs/stm32f4discovery/src/stm32_bmp180.c index 6a9a695cbb0..5f6aa85ac45 100644 --- a/configs/stm32f4discovery/src/stm32_bmp180.c +++ b/configs/stm32f4discovery/src/stm32_bmp180.c @@ -46,6 +46,7 @@ #include #include "stm32.h" +#include "stm32_i2c.h" #include "stm32f4discovery.h" #if defined(CONFIG_I2C) && defined(CONFIG_BMP180) @@ -83,7 +84,7 @@ int stm32_bmp180initialize(FAR const char *devpath) /* Initialize I2C */ - i2c = up_i2cinitialize(BMP180_I2C_PORTNO); + i2c = stm32_i2cbus_initialize(BMP180_I2C_PORTNO); if (!i2c) { diff --git a/configs/stm32f4discovery/src/stm32_pca9635.c b/configs/stm32f4discovery/src/stm32_pca9635.c index d335c520d95..7fcae301d14 100644 --- a/configs/stm32f4discovery/src/stm32_pca9635.c +++ b/configs/stm32f4discovery/src/stm32_pca9635.c @@ -1,7 +1,7 @@ /************************************************************************************ * 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 * * Redistribution and use in source and binary forms, with or without @@ -49,8 +49,9 @@ #include -#include "stm32f4discovery.h" #include "stm32_gpio.h" +#include "stm32_i2c.h" +#include "stm32f4discovery.h" #ifdef CONFIG_PCA9635PW @@ -82,7 +83,7 @@ int stm32_pca9635_initialize(void) /* Get the I2C driver that interfaces with the pca9635 (PCA9635_I2CBUS)*/ - i2c = up_i2cinitialize(PCA9635_I2CBUS); + i2c = stm32_i2cbus_initialize(PCA9635_I2CBUS); if (!i2c) { dbg("ERROR: Failed to initialize I2C%d\n", PCA9635_I2CBUS); diff --git a/configs/tm4c123g-launchpad/src/tm4c_at24.c b/configs/tm4c123g-launchpad/src/tm4c_at24.c index bb5ef16a011..a6e97591f33 100644 --- a/configs/tm4c123g-launchpad/src/tm4c_at24.c +++ b/configs/tm4c123g-launchpad/src/tm4c_at24.c @@ -1,7 +1,7 @@ /**************************************************************************** * 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 * * Redistribution and use in source and binary forms, with or without @@ -65,6 +65,7 @@ #include #include +#include "tiva_i2c.h" #include "tm4c123g-launchpad.h" #ifdef HAVE_AT24 @@ -98,7 +99,7 @@ int tm4c_at24_automount(int minor) { /* No.. Get the I2C bus driver */ - i2c = up_i2cinitialize(AT24_BUS); + i2c = tiva_i2cbus_initialize(AT24_BUS); if (!i2c) { syslog(LOG_ERR, "ERROR: Failed to initialize SPI%d\n", AT24_BUS); diff --git a/configs/vsn/src/sif.c b/configs/vsn/src/sif.c index 1dcc479b29c..7a490c70c71 100644 --- a/configs/vsn/src/sif.c +++ b/configs/vsn/src/sif.c @@ -88,6 +88,7 @@ #include "stm32_gpio.h" #include "stm32_spi.h" +#include "stm32_i2c.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_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.i2c2 = up_i2cinitialize(2); + vsn_sif.i2c1 = stm32_i2cbus_initialize(1); + vsn_sif.i2c2 = stm32_i2cbus_initialize(2); vsn_sif.spi2 = stm32_spibus_initialize(2);