mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
LM3S9B96 update
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4899 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -280,13 +280,11 @@
|
|||||||
# define GPIO_SSI0_FSS (GPIO_FUNC_PFIO | GPIO_PORTA | 3) /* PA3: SSI0 frame (SSI0Fss) */
|
# define GPIO_SSI0_FSS (GPIO_FUNC_PFIO | GPIO_PORTA | 3) /* PA3: SSI0 frame (SSI0Fss) */
|
||||||
# define GPIO_SSI0_RX (GPIO_FUNC_PFINPUT | GPIO_PORTA | 4) /* PA4: SSI0 receive (SSI0Rx) */
|
# define GPIO_SSI0_RX (GPIO_FUNC_PFINPUT | GPIO_PORTA | 4) /* PA4: SSI0 receive (SSI0Rx) */
|
||||||
# define GPIO_SSI0_TX (GPIO_FUNC_PFOUTPUT | GPIO_PORTA | 5) /* PA5: SSI0 transmit (SSI0Tx) */
|
# define GPIO_SSI0_TX (GPIO_FUNC_PFOUTPUT | GPIO_PORTA | 5) /* PA5: SSI0 transmit (SSI0Tx) */
|
||||||
# define GPIO_I2C1_SCL (GPIO_FUNC_PFOUTPUT | GPIO_PORTA | 7) /* PA6: I2C1 clock (I2C1SCL) */
|
# define GPIO_I2C1_SCL (GPIO_FUNC_PFODIO | GPIO_PORTA | 6) /* PA6: I2C1 clock (I2C1SCL) */
|
||||||
# define GPIO_I2C1_SDA (GPIO_FUNC_PFODIO | GPIO_PORTA | 7) /* PA7: I2C1 data (I2C1SDA) */
|
# define GPIO_I2C1_SDA (GPIO_FUNC_PFODIO | GPIO_PORTA | 7) /* PA7: I2C1 data (I2C1SDA) */
|
||||||
# define GPIO_PWM1_2 (GPIO_FUNC_PFOUTPUT | GPIO_PORTB | 0) /* PB0: PWM Generator 1, PWM2 */
|
# define GPIO_PWM1_2 (GPIO_FUNC_PFOUTPUT | GPIO_PORTB | 0) /* PB0: PWM Generator 1, PWM2 */
|
||||||
# define GPIO_PWM1_3 (GPIO_FUNC_PFOUTPUT | GPIO_PORTB | 1) /* PB1: PWM Generator 1, PWM3 */
|
# define GPIO_PWM1_3 (GPIO_FUNC_PFOUTPUT | GPIO_PORTB | 1) /* PB1: PWM Generator 1, PWM3 */
|
||||||
# define GPIO_USB0ID (GPIO_FUNC_PFINPUT | GPIO_PORTB | 0) /* PB0: USBID signal from the USB-On-the-Go */
|
# define GPIO_I2C0_SCL (GPIO_FUNC_PFODIO | GPIO_PORTB | 2) /* PB2: I2C0 clock (I2C0SCL) */
|
||||||
# define GPIO_USB0VBUS (GPIO_FUNC_PFODIO | GPIO_PORTB | 1) /* PB1: USB VBUS input signal from USB-OTG */
|
|
||||||
# define GPIO_I2C0_SCL (GPIO_FUNC_PFOUTPUT | GPIO_PORTB | 2) /* PB2: I2C0 clock (I2C0SCL) */
|
|
||||||
# define GPIO_I2C0_SDA (GPIO_FUNC_PFODIO | GPIO_PORTB | 3) /* PB3: I2C0 data (I2C0SDA) */
|
# define GPIO_I2C0_SDA (GPIO_FUNC_PFODIO | GPIO_PORTB | 3) /* PB3: I2C0 data (I2C0SDA) */
|
||||||
# define GPIO_CMP0_NIN (GPIO_FUNC_PFINPUT | GPIO_PORTB | 4) /* PB4: Analog comparator 0 negative input (C0-) */
|
# define GPIO_CMP0_NIN (GPIO_FUNC_PFINPUT | GPIO_PORTB | 4) /* PB4: Analog comparator 0 negative input (C0-) */
|
||||||
# define GPIO_CMP1_NIN (GPIO_FUNC_PFINPUT | GPIO_PORTB | 5) /* PB5: Analog comparator 1 negative input (C1-) */
|
# define GPIO_CMP1_NIN (GPIO_FUNC_PFINPUT | GPIO_PORTB | 5) /* PB5: Analog comparator 1 negative input (C1-) */
|
||||||
|
|||||||
@@ -304,8 +304,8 @@
|
|||||||
# define SYSCON_RCC_OSCSRC_IOSC (1 << SYSCON_RCC_OSCSRC_SHIFT) /* Internal oscillator (reset) */
|
# define SYSCON_RCC_OSCSRC_IOSC (1 << SYSCON_RCC_OSCSRC_SHIFT) /* Internal oscillator (reset) */
|
||||||
# define SYSCON_RCC_OSCSRC_IOSC4 (2 << SYSCON_RCC_OSCSRC_SHIFT) /* Internal oscillator / 4 */
|
# define SYSCON_RCC_OSCSRC_IOSC4 (2 << SYSCON_RCC_OSCSRC_SHIFT) /* Internal oscillator / 4 */
|
||||||
# define SYSCON_RCC_OSCSRC_30KHZ (3 << SYSCON_RCC_OSCSRC_SHIFT) /* 30KHz internal oscillator */
|
# define SYSCON_RCC_OSCSRC_30KHZ (3 << SYSCON_RCC_OSCSRC_SHIFT) /* 30KHz internal oscillator */
|
||||||
#define SYSCON_RCC_XTAL_SHIFT 6 /* Bits 9-6: Crystal Value */
|
#define SYSCON_RCC_XTAL_SHIFT 6 /* Bits 10-6: Crystal Value */
|
||||||
#define SYSCON_RCC_XTAL_MASK (0x0f << SYSCON_RCC_XTAL_SHIFT)
|
#define SYSCON_RCC_XTAL_MASK (0x1f << SYSCON_RCC_XTAL_SHIFT)
|
||||||
# define SYSCON_RCC_XTAL1000KHZ ( 0 << SYSCON_RCC_XTAL_SHIFT) /* 1.0000MHz (NO PLL) */
|
# define SYSCON_RCC_XTAL1000KHZ ( 0 << SYSCON_RCC_XTAL_SHIFT) /* 1.0000MHz (NO PLL) */
|
||||||
# define SYSCON_RCC_XTAL1843KHZ ( 1 << SYSCON_RCC_XTAL_SHIFT) /* 1.8432MHz (NO PLL) */
|
# define SYSCON_RCC_XTAL1843KHZ ( 1 << SYSCON_RCC_XTAL_SHIFT) /* 1.8432MHz (NO PLL) */
|
||||||
# define SYSCON_RCC_XTAL2000KHZ ( 2 << SYSCON_RCC_XTAL_SHIFT) /* 2.0000MHz (NO PLL) */
|
# define SYSCON_RCC_XTAL2000KHZ ( 2 << SYSCON_RCC_XTAL_SHIFT) /* 2.0000MHz (NO PLL) */
|
||||||
@@ -322,6 +322,15 @@
|
|||||||
# define SYSCON_RCC_XTAL7373KHZ (13 << SYSCON_RCC_XTAL_SHIFT) /* 7.3728MHz */
|
# define SYSCON_RCC_XTAL7373KHZ (13 << SYSCON_RCC_XTAL_SHIFT) /* 7.3728MHz */
|
||||||
# define SYSCON_RCC_XTAL8000KHZ (14 << SYSCON_RCC_XTAL_SHIFT) /* 8.0000MHz */
|
# define SYSCON_RCC_XTAL8000KHZ (14 << SYSCON_RCC_XTAL_SHIFT) /* 8.0000MHz */
|
||||||
# define SYSCON_RCC_XTAL8192KHZ (15 << SYSCON_RCC_XTAL_SHIFT) /* 8.1920MHz */
|
# define SYSCON_RCC_XTAL8192KHZ (15 << SYSCON_RCC_XTAL_SHIFT) /* 8.1920MHz */
|
||||||
|
#ifdef CONFIG_ARCH_CHIP_LM3S9B96
|
||||||
|
# define SYSCON_RCC_XTAL10000KHZ (16 << SYSCON_RCC_XTAL_SHIFT) /* 10.0 MHz (USB) */
|
||||||
|
# define SYSCON_RCC_XTAL12000KHZ (17 << SYSCON_RCC_XTAL_SHIFT) /* 12.0 MHz (USB) */
|
||||||
|
# define SYSCON_RCC_XTAL12888KHZ (18 << SYSCON_RCC_XTAL_SHIFT) /* 12.288 MHz */
|
||||||
|
# define SYSCON_RCC_XTAL13560KHZ (19 << SYSCON_RCC_XTAL_SHIFT) /* 13.56 MHz */
|
||||||
|
# define SYSCON_RCC_XTAL14318KHZ (20 << SYSCON_RCC_XTAL_SHIFT) /* 14.31818 MHz */
|
||||||
|
# define SYSCON_RCC_XTAL16000KHZ (21 << SYSCON_RCC_XTAL_SHIFT) /* 16.0 MHz (USB) */
|
||||||
|
# define SYSCON_RCC_XTAL16384KHZ (22 << SYSCON_RCC_XTAL_SHIFT) /* 16.384 MHz */
|
||||||
|
#endif
|
||||||
#define SYSCON_RCC_BYPASS (1 << 11) /* Bit 11: PLL Bypass */
|
#define SYSCON_RCC_BYPASS (1 << 11) /* Bit 11: PLL Bypass */
|
||||||
#define SYSCON_RCC_PWRDN (1 << 13) /* Bit 13: PLL Power Down */
|
#define SYSCON_RCC_PWRDN (1 << 13) /* Bit 13: PLL Power Down */
|
||||||
#define SYSCON_RCC_USESYSDIV (1 << 22) /* Bit 22: Enable System Clock Divider */
|
#define SYSCON_RCC_USESYSDIV (1 << 22) /* Bit 22: Enable System Clock Divider */
|
||||||
|
|||||||
@@ -3,5 +3,5 @@
|
|||||||
# see misc/tools/kconfig-language.txt.
|
# see misc/tools/kconfig-language.txt.
|
||||||
#
|
#
|
||||||
|
|
||||||
if ARCH_BOARD_EKK_LM3S9B96
|
if ARCH_BOARD_EKKLM3S9B96
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
|
|
||||||
/* RCC settings */
|
/* RCC settings */
|
||||||
|
|
||||||
#define SYSCON_RCC_XTAL SYSCON_RCC_XTAL8000KHZ /* Eagle100 on-board crystall is 8.00 MHz */
|
#define SYSCON_RCC_XTAL SYSCON_RCC_XTAL16000KHZ /* 16.000 MHz crystal */
|
||||||
#define XTAL_FREQUENCY 16000000
|
#define XTAL_FREQUENCY 16000000
|
||||||
|
|
||||||
/* Oscillator source is the main oscillator (not internal, internal/4, 30KHz or
|
/* Oscillator source is the main oscillator (not internal, internal/4, 30KHz or
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define LM3S_SYSDIV 4
|
#define LM3S_SYSDIV 4
|
||||||
#define SYSCLK_FREQUENCY 80000000 /* 80MHz */
|
#define SYSCLK_FREQUENCY 50000000 /* 50MHz */
|
||||||
|
|
||||||
/* Other RCC settings:
|
/* Other RCC settings:
|
||||||
*
|
*
|
||||||
@@ -88,7 +88,7 @@
|
|||||||
|
|
||||||
/* LED definitions ******************************************************************/
|
/* LED definitions ******************************************************************/
|
||||||
|
|
||||||
/* The EKK-LMS3oB96 Eval Kit has only one user LED: Port D, Bit 0. Below is the mapping of this
|
/* The EKK-LMS39B96 Eval Kit has only one user LED: Port D, Bit 0. Below is the mapping of this
|
||||||
* single LED. From this single LED, we can get the following information:
|
* single LED. From this single LED, we can get the following information:
|
||||||
*
|
*
|
||||||
* OFF Steady: The system has failed to boot to the point of enabling interrupts
|
* OFF Steady: The system has failed to boot to the point of enabling interrupts
|
||||||
|
|||||||
@@ -1,119 +1,115 @@
|
|||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* configs/ekk-lm3s9b96/src/ekklm3s9b96_internal.h
|
* configs/ekk-lm3s9b96/src/ekklm3s9b96_internal.h
|
||||||
* arch/arm/src/board/lm3s6965ek_internal.n
|
* arch/arm/src/board/lm3s6965ek_internal.n
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
||||||
* Authors: Gregory Nutt <gnutt@nuttx.org>
|
* Authors: Gregory Nutt <gnutt@nuttx.org>
|
||||||
* Jose Pablo Rojas V. <jrojas@nx-engineering.com>
|
* Jose Pablo Rojas V. <jrojas@nx-engineering.com>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
* are met:
|
* are met:
|
||||||
*
|
*
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer.
|
* notice, this list of conditions and the following disclaimer.
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in
|
* notice, this list of conditions and the following disclaimer in
|
||||||
* the documentation and/or other materials provided with the
|
* the documentation and/or other materials provided with the
|
||||||
* distribution.
|
* distribution.
|
||||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||||
* used to endorse or promote products derived from this software
|
* used to endorse or promote products derived from this software
|
||||||
* without specific prior written permission.
|
* without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
#ifndef __CONFIGS_EKK_LM3S9B96_SRC_EKKLM3S9B96_INTERNAL_H
|
#ifndef __CONFIGS_EKK_LM3S9B96_SRC_EKKLM3S9B96_INTERNAL_H
|
||||||
#define __CONFIGS_EKK_LM3S9B96_SRC_EKKLM3S9B96_INTERNAL_H
|
#define __CONFIGS_EKK_LM3S9B96_SRC_EKKLM3S9B96_INTERNAL_H
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#include <nuttx/compiler.h>
|
#include <nuttx/compiler.h>
|
||||||
|
|
||||||
#include "chip.h"
|
#include "chip.h"
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Definitions
|
* Definitions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/* How many SSI modules does this chip support? The LM3S9B96 supports 2 SSI
|
/* How many SSI modules does this chip support? The LM3S9B96 supports 2 SSI
|
||||||
* modules (others may support more than 2 -- in such case, the following must be
|
* modules (others may support more than 2 -- in such case, the following must be
|
||||||
* expanded).
|
* expanded).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if LM3S_NSSI == 0
|
#if LM3S_NSSI == 0
|
||||||
# undef CONFIG_SSI0_DISABLE
|
# undef CONFIG_SSI0_DISABLE
|
||||||
# define CONFIG_SSI0_DISABLE 1
|
# define CONFIG_SSI0_DISABLE 1
|
||||||
# undef CONFIG_SSI1_DISABLE
|
# undef CONFIG_SSI1_DISABLE
|
||||||
# define CONFIG_SSI1_DISABLE 1
|
# define CONFIG_SSI1_DISABLE 1
|
||||||
#elif LM3S_NSSI == 1
|
#elif LM3S_NSSI == 1
|
||||||
# undef CONFIG_SSI1_DISABLE
|
# undef CONFIG_SSI1_DISABLE
|
||||||
# define CONFIG_SSI1_DISABLE 1
|
# define CONFIG_SSI1_DISABLE 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* EKK-LM3S9B96 Eval Kit ************************************************************/
|
/* EKK-LM3S9B96 Eval Kit ************************************************************/
|
||||||
|
|
||||||
/* GPIO Usage
|
/* GPIO Usage
|
||||||
*
|
*
|
||||||
* PIN SIGNAL EVB Function
|
* PIN SIGNAL EVB Function
|
||||||
* --- ----------- ---------------------------------------
|
* --- ----------- ---------------------------------------
|
||||||
* 26 PA0/U0RX Virtual COM port receive
|
* 26 PA0/U0RX Virtual COM port receive
|
||||||
* 27 PA1/U0TX Virtual COM port transmit
|
* 27 PA1/U0TX Virtual COM port transmit
|
||||||
* 66 PB0/USB0ID USBID signal from the USB-On-the-Go
|
* 66 PB0/USB0ID USBID signal from the USB-On-the-Go
|
||||||
* 67 PB1/USB0VBUS USB VBUS input signal from USB-OTG
|
* 67 PB1/USB0VBUS USB VBUS input signal from USB-OTG
|
||||||
* 92 PB4/GPIO User pushbutton SW2.
|
* 92 PB4/GPIO User pushbutton SW2.
|
||||||
* 80 PC0/TCK/SWCLK JTAG or SWD clock input
|
* 80 PC0/TCK/SWCLK JTAG or SWD clock input
|
||||||
* 79 PC1/TMS/SWDIO JTAG TMS input or SWD bidirectional signal SWDIO
|
* 79 PC1/TMS/SWDIO JTAG TMS input or SWD bidirectional signal SWDIO
|
||||||
* 78 PC2/TDI JTAG TDI signal input
|
* 78 PC2/TDI JTAG TDI signal input
|
||||||
* 77 PC3/TDO/SWO JTAG TDO output or SWD trace signal SWO output.
|
* 77 PC3/TDO/SWO JTAG TDO output or SWD trace signal SWO output.
|
||||||
* 10 PD0/GPIO User LED
|
* 10 PD0/GPIO User LED
|
||||||
* 60 PF2/LED1 Ethernet LED1 (yellow)
|
* 60 PF2/LED1 Ethernet LED1 (yellow)
|
||||||
* 59 PF3/LED0 Ethernet LED0 (green)
|
* 59 PF3/LED0 Ethernet LED0 (green)
|
||||||
* 83 PH3/USB0EPEN USB-OTG power switch
|
* 83 PH3/USB0EPEN USB-OTG power switch
|
||||||
* 76 PH4/USB0PFLT Overcurrent input status from USB-OTG power switch
|
* 76 PH4/USB0PFLT Overcurrent input status from USB-OTG power switch
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* GPIO for LED's:
|
/* GPIO for LED's:
|
||||||
* - PD0: User LED
|
* - PD0: User LED
|
||||||
* - PF2: LED1 (yellow)
|
*/
|
||||||
* - PF3: LED0 (green)
|
|
||||||
*/
|
#define LED_GPIO (GPIO_FUNC_OUTPUT | GPIO_VALUE_ONE | GPIO_PORTD | 0)
|
||||||
|
|
||||||
#define LED_GPIO (GPIO_FUNC_OUTPUT | GPIO_VALUE_ONE | GPIO_PORTD | 0)
|
/************************************************************************************
|
||||||
#define LED1_GPIO (GPIO_FUNC_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORTF | 2)
|
* Public Functions
|
||||||
#define LED0_GPIO (GPIO_FUNC_OUTPUT | GPIO_VALUE_ONE | GPIO_PORTF | 3)
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
#ifndef __ASSEMBLY__
|
||||||
* Public Functions
|
|
||||||
************************************************************************************/
|
/************************************************************************************
|
||||||
|
* Name: lm3s_ssiinitialize
|
||||||
#ifndef __ASSEMBLY__
|
*
|
||||||
|
* Description:
|
||||||
/************************************************************************************
|
* Called to configure SPI chip select GPIO pins for the LM3S6965 Eval Kit.
|
||||||
* Name: lm3s_ssiinitialize
|
*
|
||||||
*
|
************************************************************************************/
|
||||||
* Description:
|
|
||||||
* Called to configure SPI chip select GPIO pins for the LM3S6965 Eval Kit.
|
extern void weak_function lm3s_ssiinitialize(void);
|
||||||
*
|
|
||||||
************************************************************************************/
|
#endif /* __ASSEMBLY__ */
|
||||||
|
#endif /* __CONFIGS_EKK_LM3S9B96_SRC_EKKLM3S9B96_INTERNAL_H */
|
||||||
extern void weak_function lm3s_ssiinitialize(void);
|
|
||||||
|
|
||||||
#endif /* __ASSEMBLY__ */
|
|
||||||
#endif /* __CONFIGS_EKK_LM3S9B96_SRC_EKKLM3S9B96_INTERNAL_H */
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,91 +1,91 @@
|
|||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* configs/ekk-lm3s9b96/src/up_boot.c
|
* configs/ekk-lm3s9b96/src/up_boot.c
|
||||||
* arch/arm/src/board/up_boot.c
|
* arch/arm/src/board/up_boot.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
||||||
* Authors: Gregory Nutt <gnutt@nuttx.org>
|
* Authors: Gregory Nutt <gnutt@nuttx.org>
|
||||||
* Jose Pablo Rojas V. <jrojas@nx-engineering.com>
|
* Jose Pablo Rojas V. <jrojas@nx-engineering.com>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
* are met:
|
* are met:
|
||||||
*
|
*
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer.
|
* notice, this list of conditions and the following disclaimer.
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in
|
* notice, this list of conditions and the following disclaimer in
|
||||||
* the documentation and/or other materials provided with the
|
* the documentation and/or other materials provided with the
|
||||||
* distribution.
|
* distribution.
|
||||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||||
* used to endorse or promote products derived from this software
|
* used to endorse or promote products derived from this software
|
||||||
* without specific prior written permission.
|
* without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
#include <arch/board/board.h>
|
#include <arch/board/board.h>
|
||||||
|
|
||||||
#include "up_arch.h"
|
#include "up_arch.h"
|
||||||
#include "up_internal.h"
|
#include "up_internal.h"
|
||||||
#include "ekklm3s9b96_internal.h"
|
#include "ekklm3s9b96_internal.h"
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Definitions
|
* Definitions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Private Functions
|
* Private Functions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Name: lm3s_boardinitialize
|
* Name: lm3s_boardinitialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* All LM3S architectures must provide the following entry point. This entry point
|
* All LM3S architectures must provide the following entry point. This entry point
|
||||||
* is called early in the intitialization -- after all memory has been configured
|
* is called early in the intitialization -- after all memory has been configured
|
||||||
* and mapped but before any devices have been initialized.
|
* and mapped but before any devices have been initialized.
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
void lm3s_boardinitialize(void)
|
void lm3s_boardinitialize(void)
|
||||||
{
|
{
|
||||||
/* Configure SPI chip selects if 1) SSI is not disabled, and 2) the weak function
|
/* Configure SPI chip selects if 1) SSI is not disabled, and 2) the weak function
|
||||||
* lm3s_ssiinitialize() has been brought into the link.
|
* lm3s_ssiinitialize() has been brought into the link.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if !defined(CONFIG_SSI0_DISABLE) || !defined(CONFIG_SSI1_DISABLE)
|
#if !defined(CONFIG_SSI0_DISABLE) || !defined(CONFIG_SSI1_DISABLE)
|
||||||
if (lm3s_ssiinitialize)
|
if (lm3s_ssiinitialize)
|
||||||
{
|
{
|
||||||
lm3s_ssiinitialize();
|
lm3s_ssiinitialize();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Configure on-board LEDs if LED support has been selected. */
|
/* Configure on-board LEDs if LED support has been selected. */
|
||||||
|
|
||||||
#ifdef CONFIG_ARCH_LEDS
|
#ifdef CONFIG_ARCH_LEDS
|
||||||
up_ledinit();
|
up_ledinit();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,99 +1,99 @@
|
|||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* configs/lm3s6965-ek/src/up_ethernet.c
|
* configs/lm3s6965-ek/src/up_ethernet.c
|
||||||
* arch/arm/src/board/up_ethernet.c
|
* arch/arm/src/board/up_ethernet.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
||||||
* Authors: Gregory Nutt <gnutt@nuttx.org>
|
* Authors: Gregory Nutt <gnutt@nuttx.org>
|
||||||
* Jose Pablo Rojas V. <jrojas@nx-engineering.com>
|
* Jose Pablo Rojas V. <jrojas@nx-engineering.com>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
* are met:
|
* are met:
|
||||||
*
|
*
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer.
|
* notice, this list of conditions and the following disclaimer.
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in
|
* notice, this list of conditions and the following disclaimer in
|
||||||
* the documentation and/or other materials provided with the
|
* the documentation and/or other materials provided with the
|
||||||
* distribution.
|
* distribution.
|
||||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||||
* used to endorse or promote products derived from this software
|
* used to endorse or promote products derived from this software
|
||||||
* without specific prior written permission.
|
* without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include <arch/board/board.h>
|
#include <arch/board/board.h>
|
||||||
#include <net/ethernet.h>
|
#include <net/ethernet.h>
|
||||||
|
|
||||||
#include "up_arch.h"
|
#include "up_arch.h"
|
||||||
#include "chip.h"
|
#include "chip.h"
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Definitions
|
* Definitions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Private Functions
|
* Private Functions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Name: lm3s_ethernetmac
|
* Name: lm3s_ethernetmac
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* For the Ethernet Eval Kits, the MAC address will be stored in the non-volatile
|
* For the Ethernet Eval Kits, the MAC address will be stored in the non-volatile
|
||||||
* USER0 and USER1 registers. If CONFIG_LM3S_BOARDMAC is defined, this function
|
* USER0 and USER1 registers. If CONFIG_LM3S_BOARDMAC is defined, this function
|
||||||
* will obtain the MAC address from these registers.
|
* will obtain the MAC address from these registers.
|
||||||
*
|
*
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_LM3S_BOARDMAC
|
#ifdef CONFIG_LM3S_BOARDMAC
|
||||||
void lm3s_ethernetmac(struct ether_addr *ethaddr)
|
void lm3s_ethernetmac(struct ether_addr *ethaddr)
|
||||||
{
|
{
|
||||||
uint32_t user0;
|
uint32_t user0;
|
||||||
uint32_t user1;
|
uint32_t user1;
|
||||||
|
|
||||||
/* Get the current value of the user registers */
|
/* Get the current value of the user registers */
|
||||||
|
|
||||||
user0 = getreg32(LM3S_FLASH_USERREG0);
|
user0 = getreg32(LM3S_FLASH_USERREG0);
|
||||||
user1 = getreg32(LM3S_FLASH_USERREG1);
|
user1 = getreg32(LM3S_FLASH_USERREG1);
|
||||||
|
|
||||||
nlldbg("user: %06x:%06x\n", user1 & 0x00ffffff, user0 & 0x00ffffff);
|
nlldbg("user: %06x:%06x\n", user1 & 0x00ffffff, user0 & 0x00ffffff);
|
||||||
DEBUGASSERT(user0 != 0xffffffff && user1 != 0xffffffff);
|
DEBUGASSERT(user0 != 0xffffffff && user1 != 0xffffffff);
|
||||||
|
|
||||||
/* Re-format that MAC address the way that uIP expects to see it */
|
/* Re-format that MAC address the way that uIP expects to see it */
|
||||||
|
|
||||||
ethaddr->ether_addr_octet[0] = ((user0 >> 0) & 0xff);
|
ethaddr->ether_addr_octet[0] = ((user0 >> 0) & 0xff);
|
||||||
ethaddr->ether_addr_octet[1] = ((user0 >> 8) & 0xff);
|
ethaddr->ether_addr_octet[1] = ((user0 >> 8) & 0xff);
|
||||||
ethaddr->ether_addr_octet[2] = ((user0 >> 16) & 0xff);
|
ethaddr->ether_addr_octet[2] = ((user0 >> 16) & 0xff);
|
||||||
ethaddr->ether_addr_octet[3] = ((user1 >> 0) & 0xff);
|
ethaddr->ether_addr_octet[3] = ((user1 >> 0) & 0xff);
|
||||||
ethaddr->ether_addr_octet[4] = ((user1 >> 8) & 0xff);
|
ethaddr->ether_addr_octet[4] = ((user1 >> 8) & 0xff);
|
||||||
ethaddr->ether_addr_octet[5] = ((user1 >> 16) & 0xff);
|
ethaddr->ether_addr_octet[5] = ((user1 >> 16) & 0xff);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -105,8 +105,6 @@ void up_ledinit(void)
|
|||||||
|
|
||||||
led_dumpgpio("up_ledinit before lm3s_configgpio()");
|
led_dumpgpio("up_ledinit before lm3s_configgpio()");
|
||||||
lm3s_configgpio(LED_GPIO);
|
lm3s_configgpio(LED_GPIO);
|
||||||
lm3s_configgpio(LED0_GPIO);
|
|
||||||
lm3s_configgpio(LED1_GPIO);
|
|
||||||
led_dumpgpio("up_ledinit after lm3s_configgpio()");
|
led_dumpgpio("up_ledinit after lm3s_configgpio()");
|
||||||
g_nest = 0;
|
g_nest = 0;
|
||||||
}
|
}
|
||||||
@@ -133,7 +131,6 @@ void up_ledon(int led)
|
|||||||
case LED_STACKCREATED:
|
case LED_STACKCREATED:
|
||||||
led_dumpgpio("up_ledon: before lm3s_gpiowrite()");
|
led_dumpgpio("up_ledon: before lm3s_gpiowrite()");
|
||||||
lm3s_gpiowrite(LED_GPIO, false);
|
lm3s_gpiowrite(LED_GPIO, false);
|
||||||
lm3s_gpiowrite(LED0_GPIO, false);
|
|
||||||
led_dumpgpio("up_ledon: after lm3s_gpiowrite()");
|
led_dumpgpio("up_ledon: after lm3s_gpiowrite()");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -162,7 +159,6 @@ void up_ledoff(int led)
|
|||||||
{
|
{
|
||||||
led_dumpgpio("up_ledoff: before lm3s_gpiowrite()");
|
led_dumpgpio("up_ledoff: before lm3s_gpiowrite()");
|
||||||
lm3s_gpiowrite(LED_GPIO, true);
|
lm3s_gpiowrite(LED_GPIO, true);
|
||||||
lm3s_gpiowrite(LED0_GPIO, true);
|
|
||||||
led_dumpgpio("up_ledoff: after lm3s_gpiowrite()");
|
led_dumpgpio("up_ledoff: after lm3s_gpiowrite()");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -45,9 +45,6 @@
|
|||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include <nuttx/spi.h>
|
|
||||||
#include <nuttx/mmcsd.h>
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|||||||
+162
-162
@@ -1,162 +1,162 @@
|
|||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* configs/ekk-lm3s9b96/src/up_ssi.c
|
* configs/ekk-lm3s9b96/src/up_ssi.c
|
||||||
* arch/arm/src/board/up_ssi.c
|
* arch/arm/src/board/up_ssi.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
||||||
* Authors: Gregory Nutt <gnutt@nuttx.org>
|
* Authors: Gregory Nutt <gnutt@nuttx.org>
|
||||||
* Jose Pablo Rojas V. <jrojas@nx-engineering.com>
|
* Jose Pablo Rojas V. <jrojas@nx-engineering.com>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
* are met:
|
* are met:
|
||||||
*
|
*
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer.
|
* notice, this list of conditions and the following disclaimer.
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in
|
* notice, this list of conditions and the following disclaimer in
|
||||||
* the documentation and/or other materials provided with the
|
* the documentation and/or other materials provided with the
|
||||||
* distribution.
|
* distribution.
|
||||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||||
* used to endorse or promote products derived from this software
|
* used to endorse or promote products derived from this software
|
||||||
* without specific prior written permission.
|
* without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
#include <nuttx/spi.h>
|
#include <nuttx/spi.h>
|
||||||
#include <arch/board/board.h>
|
#include <arch/board/board.h>
|
||||||
|
|
||||||
#include "up_arch.h"
|
#include "up_arch.h"
|
||||||
#include "chip.h"
|
#include "chip.h"
|
||||||
#include "lm3s_internal.h"
|
#include "lm3s_internal.h"
|
||||||
#include "ekklm3s9b96_internal.h"
|
#include "ekklm3s9b96_internal.h"
|
||||||
|
|
||||||
#if !defined(CONFIG_SSI0_DISABLE) || !defined(CONFIG_SSI1_DISABLE)
|
#if !defined(CONFIG_SSI0_DISABLE) || !defined(CONFIG_SSI1_DISABLE)
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Definitions
|
* Definitions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/* Enables debug output from this file (needs CONFIG_DEBUG too) */
|
/* Enables debug output from this file (needs CONFIG_DEBUG too) */
|
||||||
|
|
||||||
#undef SSI_DEBUG /* Define to enable debug */
|
#undef SSI_DEBUG /* Define to enable debug */
|
||||||
#undef SSI_VERBOSE /* Define to enable verbose debug */
|
#undef SSI_VERBOSE /* Define to enable verbose debug */
|
||||||
|
|
||||||
#ifdef SSI_DEBUG
|
#ifdef SSI_DEBUG
|
||||||
# define ssidbg lldbg
|
# define ssidbg lldbg
|
||||||
# ifdef SSI_VERBOSE
|
# ifdef SSI_VERBOSE
|
||||||
# define ssivdbg lldbg
|
# define ssivdbg lldbg
|
||||||
# else
|
# else
|
||||||
# define ssivdbg(x...)
|
# define ssivdbg(x...)
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
# undef SSI_VERBOSE
|
# undef SSI_VERBOSE
|
||||||
# define ssidbg(x...)
|
# define ssidbg(x...)
|
||||||
# define ssivdbg(x...)
|
# define ssivdbg(x...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Dump GPIO registers */
|
/* Dump GPIO registers */
|
||||||
|
|
||||||
#ifdef SSI_VERBOSE
|
#ifdef SSI_VERBOSE
|
||||||
#if 0
|
#if 0
|
||||||
# define ssi_dumpgpio(m) lm3s_dumpgpio(SDCCS_GPIO, m)
|
# define ssi_dumpgpio(m) lm3s_dumpgpio(SDCCS_GPIO, m)
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
# define ssi_dumpgpio(m)
|
# define ssi_dumpgpio(m)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Private Functions
|
* Private Functions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Name: lm3s_ssiinitialize
|
* Name: lm3s_ssiinitialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called to configure SPI chip select GPIO pins for the LM3S6965 Eval Kit.
|
* Called to configure SPI chip select GPIO pins for the LM3S6965 Eval Kit.
|
||||||
*
|
*
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
void weak_function lm3s_ssiinitialize(void)
|
void weak_function lm3s_ssiinitialize(void)
|
||||||
{
|
{
|
||||||
/* Configure the SPI CS GPIO */
|
/* Configure the SPI CS GPIO */
|
||||||
#if 0
|
#if 0
|
||||||
ssi_dumpgpio("lm3s_ssiinitialize() Entry)");
|
ssi_dumpgpio("lm3s_ssiinitialize() Entry");
|
||||||
ssi_dumpgpio("lm3s_ssiinitialize() Exit");
|
ssi_dumpgpio("lm3s_ssiinitialize() Exit");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* The external functions, lm3s_spiselect and lm3s_spistatus must be provided
|
* The external functions, lm3s_spiselect and lm3s_spistatus must be provided
|
||||||
* by board-specific logic. The are implementations of the select and status
|
* by board-specific logic. The are implementations of the select and status
|
||||||
* methods SPI interface defined by struct spi_ops_s (see include/nuttx/spi.h).
|
* methods SPI interface defined by struct spi_ops_s (see include/nuttx/spi.h).
|
||||||
* All othermethods (including up_spiinitialize()) are provided by common
|
* All othermethods (including up_spiinitialize()) are provided by common
|
||||||
* logic. To use this common SPI logic on your board:
|
* logic. To use this common SPI logic on your board:
|
||||||
*
|
*
|
||||||
* 1. Provide lm3s_spiselect() and lm3s_spistatus() functions in your
|
* 1. Provide lm3s_spiselect() and lm3s_spistatus() functions in your
|
||||||
* board-specific logic. This function will perform chip selection and
|
* board-specific logic. This function will perform chip selection and
|
||||||
* status operations using GPIOs in the way your board is configured.
|
* status operations using GPIOs in the way your board is configured.
|
||||||
* 2. Add a call to up_spiinitialize() in your low level initialization
|
* 2. Add a call to up_spiinitialize() in your low level initialization
|
||||||
* logic
|
* logic
|
||||||
* 3. The handle returned by up_spiinitialize() may then be used to bind the
|
* 3. The handle returned by up_spiinitialize() may then be used to bind the
|
||||||
* SPI driver to higher level logic (e.g., calling
|
* SPI driver to higher level logic (e.g., calling
|
||||||
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
||||||
* the SPI MMC/SD driver).
|
* the SPI MMC/SD driver).
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void lm3s_spiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
|
void lm3s_spiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
|
||||||
{
|
{
|
||||||
ssidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
|
ssidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
|
||||||
ssi_dumpgpio("lm3s_spiselect() Entry");
|
ssi_dumpgpio("lm3s_spiselect() Entry");
|
||||||
if (devid == SPIDEV_MMCSD)
|
if (devid == SPIDEV_MMCSD)
|
||||||
{
|
{
|
||||||
/* Assert the CS pin to the card */
|
/* Assert the CS pin to the card */
|
||||||
|
|
||||||
lm3s_gpiowrite(SDCCS_GPIO, !selected);
|
lm3s_gpiowrite(SDCCS_GPIO, !selected);
|
||||||
}
|
}
|
||||||
#ifdef CONFIG_NX_LCDDRIVER
|
#ifdef CONFIG_NX_LCDDRIVER
|
||||||
else if (devid == SPIDEV_DISPLAY)
|
else if (devid == SPIDEV_DISPLAY)
|
||||||
{
|
{
|
||||||
/* Assert the CS pin to the display */
|
/* Assert the CS pin to the display */
|
||||||
|
|
||||||
lm3s_gpiowrite(OLEDCS_GPIO, !selected);
|
lm3s_gpiowrite(OLEDCS_GPIO, !selected);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
ssi_dumpgpio("lm3s_spiselect() Exit");
|
ssi_dumpgpio("lm3s_spiselect() Exit");
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t lm3s_spistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
|
uint8_t lm3s_spistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
|
||||||
{
|
{
|
||||||
ssidbg("Returning SPI_STATUS_PRESENT\n");
|
ssidbg("Returning SPI_STATUS_PRESENT\n");
|
||||||
return SPI_STATUS_PRESENT;
|
return SPI_STATUS_PRESENT;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif /* !CONFIG_SSI0_DISABLE || !CONFIG_SSI1_DISABLE */
|
#endif /* !CONFIG_SSI0_DISABLE || !CONFIG_SSI1_DISABLE */
|
||||||
|
|||||||
Reference in New Issue
Block a user