From 5144e9fa99e61c632cae47651614cea49aca281c Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 12 Feb 2015 06:49:11 -0600 Subject: [PATCH] The TM4C1294 Launchpad has no on-board TMP100 temperature sensor --- configs/tm4c1294-launchpad/include/board.h | 22 +--- configs/tm4c1294-launchpad/src/Makefile | 6 -- .../src/tm4c1294-launchpad.h | 7 +- configs/tm4c1294-launchpad/src/tm4c_bringup.c | 22 +--- configs/tm4c1294-launchpad/src/tm4c_tmp100.c | 102 ------------------ 5 files changed, 3 insertions(+), 156 deletions(-) delete mode 100644 configs/tm4c1294-launchpad/src/tm4c_tmp100.c diff --git a/configs/tm4c1294-launchpad/include/board.h b/configs/tm4c1294-launchpad/include/board.h index ee4d8b55dc..bd12d07e40 100644 --- a/configs/tm4c1294-launchpad/include/board.h +++ b/configs/tm4c1294-launchpad/include/board.h @@ -205,9 +205,7 @@ * * 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 + * I2C6: PB6-7 are used for I2C to the EM connector. */ #define GPIO_I2C3_SCL GPIO_I2C3_SCL_1 @@ -276,23 +274,5 @@ void tiva_setled(int led, bool ledon); void tiva_setleds(uint8_t ledset); #endif -/************************************************************************************ - * Name: tiva_tmp100_initialize - * - * Description: - * Initialize and register the TMP-100 Temperature Sensor driver. - * - * Input parameters: - * devpath - The full path to the driver to register. E.g., "/dev/temp0" - * - * Returned Value: - * Zero (OK) on success; a negated errno value on failure. - * - ************************************************************************************/ - -#if defined(CONFIG_I2C) && defined(CONFIG_I2C_LM75) && defined(CONFIG_TIVA_I2C6) -int tiva_tmp100_initialize(FAR const char *devpath); -#endif - #endif /* __ASSEMBLY__ */ #endif /* __CONFIGS_TM4C1294_LAUNCHPAD_INCLUDE_BOARD_H */ diff --git a/configs/tm4c1294-launchpad/src/Makefile b/configs/tm4c1294-launchpad/src/Makefile index 8609a6a9c9..7480e46afe 100644 --- a/configs/tm4c1294-launchpad/src/Makefile +++ b/configs/tm4c1294-launchpad/src/Makefile @@ -63,12 +63,6 @@ ifeq ($(CONFIG_NSH_ARCHINIT),y) CSRCS += tm4c_nsh.c endif -ifeq ($(CONFIG_I2C_LM75),y) -ifeq ($(CONFIG_TIVA_I2C6),y) -CSRCS += tm4c_tmp100.c -endif -endif - COBJS = $(CSRCS:.c=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) diff --git a/configs/tm4c1294-launchpad/src/tm4c1294-launchpad.h b/configs/tm4c1294-launchpad/src/tm4c1294-launchpad.h index 0c20e8439a..961fcadbfd 100644 --- a/configs/tm4c1294-launchpad/src/tm4c1294-launchpad.h +++ b/configs/tm4c1294-launchpad/src/tm4c1294-launchpad.h @@ -111,14 +111,9 @@ /* 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 + * I2C6: PB6-7 are used for I2C to the connector. */ -#define TMP100_I2CBUS 6 -#define TMP100_I2CADDR 0x4a - /* Speaker outputs *****************************************************************/ /* PB2/PD4 are used for the speaker output */ diff --git a/configs/tm4c1294-launchpad/src/tm4c_bringup.c b/configs/tm4c1294-launchpad/src/tm4c_bringup.c index afaafaba4b..e2e47bf071 100644 --- a/configs/tm4c1294-launchpad/src/tm4c_bringup.c +++ b/configs/tm4c1294-launchpad/src/tm4c_bringup.c @@ -49,20 +49,10 @@ * Pre-Processor Definitions ****************************************************************************/ -#if defined(CONFIG_I2C) && defined(CONFIG_I2C_LM75) && defined(CONFIG_TIVA_I2C6) -# define HAVE_TMP100 -#endif - #ifdef CONFIG_DK_TM4C129X_TIMER # define HAVE_TIMER #endif -#ifdef CONFIG_SYSTEM_LM75_DEVNAME -# define TMP100_DEVNAME CONFIG_SYSTEM_LM75_DEVNAME -#else -# define TMP100_DEVNAME "/dev/temp" -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -77,20 +67,10 @@ int tm4c_bringup(void) { -#if defined(HAVE_TMP100) || defined(HAVE_TIMER) +#ifdef HAVE_TIMER int ret; #endif -#ifdef HAVE_TMP100 - /* Initialize and register the TMP-100 Temperature Sensor driver. */ - - ret = tiva_tmp100_initialize(TMP100_DEVNAME); - if (ret < 0) - { - dbg("ERROR: Failed to initialize TMP100 driver: %d\n", ret); - } -#endif - #ifdef HAVE_TIMER /* Initialize the timer driver */ diff --git a/configs/tm4c1294-launchpad/src/tm4c_tmp100.c b/configs/tm4c1294-launchpad/src/tm4c_tmp100.c deleted file mode 100644 index 8a871677b0..0000000000 --- a/configs/tm4c1294-launchpad/src/tm4c_tmp100.c +++ /dev/null @@ -1,102 +0,0 @@ -/**************************************************************************** -ħ * configs/tm4c1294-launchpad/src/tiva_tmp100.c - * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include - -#include -#include -#include "tiva_i2c.h" -#include "tm4c1294-launchpad.h" - -#if defined(CONFIG_I2C) && defined(CONFIG_I2C_LM75) && \ - defined(CONFIG_TIVA_I2C6) - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: tiva_tmp100_initialize - * - * Description: - * Initialize and register the LM-75 Temperature Sensor driver. - * - * Input parameters: - * devpath - The full path to the driver to register. E.g., "/dev/temp0" - * - * Returned Value: - * Zero (OK) on success; a negated errno value on failure. - * - ****************************************************************************/ - -int tiva_tmp100_initialize(FAR const char *devpath) -{ - FAR struct i2c_dev_s *i2c; - int ret; - - /* Get an instance of the I2C6 interface */ - - i2c = up_i2cinitialize(TMP100_I2CBUS); - if (!i2c) - { - return -ENODEV; - } - - /* Then register the temperature sensor */ - - ret = lm75_register(devpath, i2c, TMP100_I2CADDR); - if (ret < 0) - { - (void)up_i2cuninitialize(i2c); - } - - return ret; -} - -#endif /* CONFIG_I2C && CONFIG_I2C_LM75 && CONFIG_TIVA_I2C6 */