Tiva: Add build framework and skeleton files for Tiva I2C driver. Initial commit is just the STM32 I2C driver with name changes and STM32-specific logic removed

This commit is contained in:
Gregory Nutt 2014-12-09 11:43:36 -06:00
parent a026df3f95
commit f5c124e081
4 changed files with 2143 additions and 10 deletions

View File

@ -22,6 +22,7 @@ config ARCH_CHIP_LM3S9B96
depends on ARCH_CHIP_LM
select ARCH_CORTEXM3
select ARCH_CHIP_LM3S
select TIVA_HAVE_UART3
config ARCH_CHIP_LM3S6432
bool "LM3S6432"
@ -34,12 +35,14 @@ config ARCH_CHIP_LM3S6965
depends on ARCH_CHIP_LM
select ARCH_CORTEXM3
select ARCH_CHIP_LM3S
select TIVA_HAVE_UART3
config ARCH_CHIP_LM3S8962
bool "LM3S8962"
depends on ARCH_CHIP_LM
select ARCH_CORTEXM3
select ARCH_CHIP_LM3S
select TIVA_HAVE_UART3
config ARCH_CHIP_LM4F120
bool "LM4F120"
@ -54,6 +57,8 @@ config ARCH_CHIP_TM4C123GH6ZRB
select ARCH_CORTEXM4
select ARCH_CHIP_TM4C
select ARCH_HAVE_FPU
select TIVA_HAVE_I2C4
select TIVA_HAVE_I2C5
config ARCH_CHIP_TM4C123GH6PMI
bool "TM4C123GH6PMI"
@ -76,12 +81,23 @@ config ARCH_CHIP_LM3S
config ARCH_CHIP_LM4F
bool
select TIVA_HAVE_I2C2
select TIVA_HAVE_I2C3
select TIVA_HAVE_UART3
select TIVA_HAVE_UART4
select TIVA_HAVE_UART5
select TIVA_HAVE_UART6
select TIVA_HAVE_UART7
config ARCH_CHIP_TM4C
bool
config TIVA_HAVE_SSI1
bool
select TIVA_HAVE_I2C2
select TIVA_HAVE_I2C3
select TIVA_HAVE_UART3
select TIVA_HAVE_UART4
select TIVA_HAVE_UART5
select TIVA_HAVE_UART6
select TIVA_HAVE_UART7
config LM_REVA2
bool "Rev A2"
@ -97,6 +113,73 @@ config TIVA_BOARD_EARLYINIT
menu "Tiva/Stellaris Peripheral Support"
config TIVA_I2C
bool
config TIVA_HAVE_I2C2
bool
config TIVA_HAVE_I2C3
bool
config TIVA_HAVE_I2C4
bool
config TIVA_HAVE_I2C5
bool
config TIVA_HAVE_UART3
bool
config TIVA_HAVE_UART4
bool
config TIVA_HAVE_UART5
bool
config TIVA_HAVE_UART6
bool
config TIVA_HAVE_UART7
bool
config TIVA_HAVE_SSI1
bool
config TIVA_I2C0
bool "I2C0"
default n
select TIVA_I2C
config TIVA_I2C1
bool "I2C1"
default n
select TIVA_I2C
config TIVA_I2C2
bool "I2C2"
default n
depends on TIVA_HAVE_I2C2
select TIVA_I2C
config TIVA_I2C3
bool "I2C3"
default n
depends on TIVA_HAVE_I2C3
select TIVA_I2C
config TIVA_I2C4
bool "I2C4"
default n
depends on TIVA_HAVE_I2C4
select TIVA_I2C
config TIVA_I2C5
bool "I2C5"
default n
depends on TIVA_HAVE_I2C5
select TIVA_I2C
config TIVA_UART0
bool "UART0"
select ARCH_HAVE_UART0
@ -115,31 +198,31 @@ config TIVA_UART2
config TIVA_UART3
bool "UART3"
default n
depends on ARCH_CHIP_LM4F || ARCH_CHIP_TM4C
depends on TIVA_HAVE_UART3
select ARCH_HAVE_UART3
config TIVA_UART4
bool "UART4"
default n
depends on ARCH_CHIP_LM4F || ARCH_CHIP_TM4C
depends on TIVA_HAVE_UART4
select ARCH_HAVE_UART4
config TIVA_UART5
bool "UART5"
default n
depends on ARCH_CHIP_LM4F || ARCH_CHIP_TM4C
depends on TIVA_HAVE_UART5
select ARCH_HAVE_UART5
config TIVA_UART6
bool "UART6"
default n
depends on ARCH_CHIP_LM4F || ARCH_CHIP_TM4C
depends on TIVA_HAVE_UART6
select ARCH_HAVE_UART6
config TIVA_UART7
bool "UART7"
default n
depends on ARCH_CHIP_LM4F || ARCH_CHIP_TM4C
depends on TIVA_HAVE_UART7
select ARCH_HAVE_UART7
config SSI0_DISABLE

View File

@ -86,10 +86,14 @@ ifeq ($(CONFIG_BUILD_PROTECTED),y)
CHIP_CSRCS += tiva_userspace.c tiva_mpuinit.c
endif
ifdef CONFIG_NET
ifeq ($(CONFIG_TIVA_I2C),y)
CHIP_CSRCS += tiva_i2c.c
endif
ifeq ($(CONFIG_NET),y)
CHIP_CSRCS += tiva_ethernet.c
endif
ifdef CONFIG_TIVA_FLASH
ifeq ($(CONFIG_TIVA_FLASH),y)
CHIP_CSRCS += tiva_flash.c
endif

1997
arch/arm/src/tiva/tiva_i2c.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,49 @@
/************************************************************************************
* arch/arm/src/tiva/tiva_i2c.h
*
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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.
*
************************************************************************************/
#ifndef __ARCH_ARM_SRC_TIVA_TIVA_I2C_H
#define __ARCH_ARM_SRC_TIVA_TIVA_I2C_H
/************************************************************************************
* Included Files
************************************************************************************/
#include <nuttx/config.h>
#include <nuttx/i2c.h>
#include "chip.h"
#include "chip/tiva_i2c.h"
#endif /* __ARCH_ARM_SRC_TIVA_TIVA_I2C_H */