mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 01:21:26 +08:00
Merged in alinjerpelea/nuttx (pull request #993)
arm: codestyle fixes 4
* arm: max326xx: codestyle fixes
After the board restructuration is time for codestyle cleanup
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
* arm: moxart: codestyle fixes
After the board restructuration is time for codestyle cleanup
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
* arm: nrf52: codestyle fixes
After the board restructuration is time for codestyle cleanup
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
* arm: nuc1xx: codestyle fixes
After the board restructuration is time for codestyle cleanup
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
* arm: xmc4: codestyle fixes
After the board restructuration is time for codestyle cleanup
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
* arm: tms570: codestyle fixes
After the board restructuration is time for codestyle cleanup
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
* arm: str71x: codestyle fixes
After the board restructuration is time for codestyle cleanup
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
committed by
Gregory Nutt
parent
de47c8f52f
commit
0dc41ff4ba
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* boards/max32660-evsys/include/board.h
|
* boards/arm/max326xx/max32660-evsys/include/board.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
@@ -33,8 +33,8 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __BOARDS_ARM_MAX32660_EVSYS_INCLUDE_BOARD_H
|
#ifndef __BOARDS_ARM_MAX326XX_MAX32660_EVSYS_INCLUDE_BOARD_H
|
||||||
#define __BOARDS_ARM_MAX32660_EVSYS_INCLUDE_BOARD_H
|
#define __BOARDS_ARM_MAX326XX_MAX32660_EVSYS_INCLUDE_BOARD_H
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
@@ -75,7 +75,8 @@
|
|||||||
*
|
*
|
||||||
* ------------------- ---------------------------- ------
|
* ------------------- ---------------------------- ------
|
||||||
* SYMBOL Meaning LED
|
* SYMBOL Meaning LED
|
||||||
* ------------------- ---------------------------- ------ */
|
* ------------------- ---------------------------- ------
|
||||||
|
*/
|
||||||
|
|
||||||
#define LED_STARTED 0 /* NuttX has been started OFF */
|
#define LED_STARTED 0 /* NuttX has been started OFF */
|
||||||
#define LED_HEAPALLOCATE 0 /* Heap has been allocated OFF */
|
#define LED_HEAPALLOCATE 0 /* Heap has been allocated OFF */
|
||||||
@@ -185,4 +186,4 @@
|
|||||||
|
|
||||||
/* DMA **********************************************************************/
|
/* DMA **********************************************************************/
|
||||||
|
|
||||||
#endif /* __BOARDS_ARM_NUCLEO_F303ZE_INCLUDE_BOARD_H */
|
#endif /* __BOARDS_ARM_MAX326XX_MAX32660_EVSYS_INCLUDE_BOARD_H */
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
############################################################################
|
############################################################################
|
||||||
# boards/max32660-evsys/scripts/Make.defs
|
# boards/arm/max326xx/max32660-evsys/scripts/Make.defs
|
||||||
#
|
#
|
||||||
# Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
# Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* boards/max32660-evsys/scripts/flash.ld
|
* boards/arm/max326xx/max32660-evsys/scripts/flash.ld
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* boards/max32660-evsys/scripts/sram.ld
|
* boards/arm/max326xx/max32660-evsys/scripts/sram.ld
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
############################################################################
|
############################################################################
|
||||||
# boards/max32660-evsys/src/Makefile
|
# boards/arm/max326xx/max32660-evsys/src/Makefile
|
||||||
#
|
#
|
||||||
# Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
# Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* boards/max32660-evsys/src/max32660-evsys.h
|
* boards/arm/max326xx/max32660-evsys/src/max32660-evsys.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
@@ -33,8 +33,8 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __BOARDS_ARM_MAX32660_EVSYS_SRC_MAX32660_EVSYS_H
|
#ifndef __BOARDS_ARM_MAX326XX_MAX32660_EVSYS_SRC_MAX32660_EVSYS_H
|
||||||
#define __BOARDS_ARM_MAX32660_EVSYS_SRC_MAX32660_EVSYS_H
|
#define __BOARDS_ARM_MAX326XX_MAX32660_EVSYS_SRC_MAX32660_EVSYS_H
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
@@ -110,10 +110,11 @@
|
|||||||
* Description:
|
* Description:
|
||||||
* Bring up board features.
|
* Bring up board features.
|
||||||
*
|
*
|
||||||
* If CONFIG_BOARD_LATE_INITIALIZE=y, then this function will be called from
|
* If CONFIG_BOARD_LATE_INITIALIZE=y, then this function will be called
|
||||||
* board_late_initialize().
|
* from board_late_initialize().
|
||||||
*
|
*
|
||||||
* If CONFIG_BOARD_LATE_INITIALIZE is not selected, but CONFIG_LIB_BOARDCTL=y
|
* If CONFIG_BOARD_LATE_INITIALIZE is not selected,
|
||||||
|
* but CONFIG_LIB_BOARDCTL=y
|
||||||
* then this function will *probably* be called from application logic via
|
* then this function will *probably* be called from application logic via
|
||||||
* boardctl().
|
* boardctl().
|
||||||
*
|
*
|
||||||
@@ -124,13 +125,14 @@
|
|||||||
|
|
||||||
int max326_bringup(void);
|
int max326_bringup(void);
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Name: max326_spidev_initialize
|
* Name: max326_spidev_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called to configure SPI chip select GPIO pins for the MAX3660-EVSYS board.
|
* Called to configure SPI chip select GPIO pins for the MAX3660-EVSYS
|
||||||
|
* board.
|
||||||
*
|
*
|
||||||
************************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_MAX326XX_HAVE_SPIM
|
#ifdef CONFIG_MAX326XX_HAVE_SPIM
|
||||||
void max326_spidev_initialize(void);
|
void max326_spidev_initialize(void);
|
||||||
@@ -148,4 +150,4 @@ void max326_spidev_initialize(void);
|
|||||||
int max326_mmcsd_initialize(int minor);
|
int max326_mmcsd_initialize(int minor);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* __BOARDS_ARM_NUCLEO_F303ZE_INCLUDE_BOARD_H */
|
#endif /* __BOARDS_ARM_MAX326XX_MAX32660_EVSYS_SRC_MAX32660_EVSYS_H */
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* config/max32660-evsys/src/max326_appinit.c
|
* boards/arm/max326xx/max32660-evsys/src/max326_appinit.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* boards/max32660-evsys/src/max326_autoleds.c
|
* boards/arm/max326xx/max32660-evsys/src/max326_autoleds.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* boards/max32660-evsys/src/max326_boot.c
|
* boards/arm/max326xx/max32660-evsys/src/max326_boot.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* config/max32660-evsys/src/max326_bringup.c
|
* boards/arm/max326xx/max32660-evsys/src/max326_bringup.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
@@ -67,10 +67,11 @@
|
|||||||
* Description:
|
* Description:
|
||||||
* Bring up board features.
|
* Bring up board features.
|
||||||
*
|
*
|
||||||
* If CONFIG_BOARD_LATE_INITIALIZE=y, then this function will be called from
|
* If CONFIG_BOARD_LATE_INITIALIZE=y, then this function will be called
|
||||||
* board_late_initialize().
|
* from board_late_initialize().
|
||||||
*
|
*
|
||||||
* If CONFIG_BOARD_LATE_INITIALIZE is not selected, but CONFIG_LIB_BOARDCTL=y
|
* If CONFIG_BOARD_LATE_INITIALIZE is not selected,
|
||||||
|
* but CONFIG_LIB_BOARDCTL=y
|
||||||
* then this function will *probably* be called from application logic via
|
* then this function will *probably* be called from application logic via
|
||||||
* boardctl().
|
* boardctl().
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* boards/sama5d2-xult/src/sam_buttons.c
|
* boards/arm/max326xx/max32660-evsys/src/max326_buttons.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
@@ -145,5 +145,4 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CONFIG_ARCH_BUTTONS */
|
#endif /* CONFIG_ARCH_BUTTONS */
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* boards/max32660-evsys/src/max326_mmcsd.c
|
* boards/arm/max326xx/max32660-evsys/src/max326_mmcsd.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* boards/max32660-evsys/src/ma326_spi.c
|
* boards/arm/max326xx/max32660-evsys/src/ma326_spi.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
@@ -31,11 +31,11 @@
|
|||||||
* 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>
|
||||||
|
|
||||||
@@ -54,17 +54,18 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_MAX326XX_HAVE_SPIM
|
#ifdef CONFIG_MAX326XX_HAVE_SPIM
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Name: max326_spidev_initialize
|
* Name: max326_spidev_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called to configure SPI chip select GPIO pins for the MAX3660-EVSYS board.
|
* Called to configure SPI chip select GPIO pins for the MAX3660-EVSYS
|
||||||
|
* board.
|
||||||
*
|
*
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void max326_spidev_initialize(void)
|
void max326_spidev_initialize(void)
|
||||||
{
|
{
|
||||||
@@ -78,31 +79,35 @@ void max326_spidev_initialize(void)
|
|||||||
* Name: max326_spi0/1select and max326_spi0/1status
|
* Name: max326_spi0/1select and max326_spi0/1status
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The external functions, max326_spi0/1select and max326_spi0/1status must be
|
* The external functions, max326_spi0/1select and max326_spi0/1status must
|
||||||
* provided by board-specific logic. They are implementations of the select
|
* be provided by board-specific logic.
|
||||||
* and status methods of the SPI interface defined by struct spi_ops_s (see
|
* They are implementations of the select and status methods of the SPI
|
||||||
* include/nuttx/spi/spi.h). All other methods (including max326_spibus_initialize())
|
* interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h).
|
||||||
* are provided by common STM32 logic. To use this common SPI logic on your
|
* All other methods (including max326_spibus_initialize())
|
||||||
* board:
|
* are provided by common STM32 logic.
|
||||||
|
* To use this common SPI logic on your board:
|
||||||
*
|
*
|
||||||
* 1. Provide logic in max326_boardinitialize() to configure SPI chip select
|
* 1. Provide logic in max326_boardinitialize() to configure SPI chip select
|
||||||
* pins.
|
* pins.
|
||||||
* 2. Provide max326_spi0/1select() and max326_spi0/1status() functions in your
|
* 2. Provide max326_spi0/1select() and max326_spi0/1status() functions in
|
||||||
* board-specific logic. These functions will perform chip selection and
|
* your board-specific logic.
|
||||||
* status operations using GPIOs in the way your board is configured.
|
* These functions will perform chip selection and status operations
|
||||||
* 3. Add a calls to max326_spibus_initialize() in your low level application
|
* using GPIOs in the way your board is configured.
|
||||||
* initialization logic
|
* 3. Add a calls to max326_spibus_initialize() in your low level
|
||||||
* 4. The handle returned by max326_spibus_initialize() may then be used to bind the
|
* application initialization logic
|
||||||
* SPI driver to higher level logic (e.g., calling
|
* 4. The handle returned by max326_spibus_initialize() may then be used to
|
||||||
|
* bind the 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).
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_MAX326XX_SPIM0
|
#ifdef CONFIG_MAX326XX_SPIM0
|
||||||
void max326_spi0select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected)
|
void max326_spi0select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||||
|
bool selected)
|
||||||
{
|
{
|
||||||
spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
|
spiinfo("devid: %d CS: %s\n", (int)devid,
|
||||||
|
selected ? "assert" : "de-assert");
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t max326_spi0status(FAR struct spi_dev_s *dev, uint32_t devid)
|
uint8_t max326_spi0status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||||
@@ -112,9 +117,11 @@ uint8_t max326_spi0status(FAR struct spi_dev_s *dev, uint32_t devid)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_MAX326XX_SPIM1
|
#ifdef CONFIG_MAX326XX_SPIM1
|
||||||
void max326_spi1select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected)
|
void max326_spi1select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||||
|
bool selected)
|
||||||
{
|
{
|
||||||
spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
|
spiinfo("devid: %d CS: %s\n", (int)devid,
|
||||||
|
selected ? "assert" : "de-assert");
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t max326_spi1status(FAR struct spi_dev_s *dev, uint32_t devid)
|
uint8_t max326_spi1status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||||
@@ -168,5 +175,4 @@ int max326_spi3cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif /* CONFIG_SPI_CMDDATA */
|
#endif /* CONFIG_SPI_CMDDATA */
|
||||||
|
|
||||||
#endif /* CONFIG_MAX326XX_HAVE_SPIM */
|
#endif /* CONFIG_MAX326XX_HAVE_SPIM */
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* boards/max32660-evsys/src/max326_userleds.c
|
* boards/arm/max326xx/max32660-evsys/src/max326_userleds.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
@@ -83,5 +83,5 @@ void board_userled_all(uint8_t ledset)
|
|||||||
{
|
{
|
||||||
/* Low illuminates */
|
/* Low illuminates */
|
||||||
|
|
||||||
max326_gpio_write(GPIO_LED, (ledset & BOARD_LED_BIT) == 0));
|
max326_gpio_write(GPIO_LED, (ledset & BOARD_LED_BIT) == 0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* boards/arduino-due/include/board.h
|
* boards/arm/moxart/moxa/include/board.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
@@ -31,14 +31,14 @@
|
|||||||
* 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 __BOARDS_ARM_MOXA_INCLUDE_BOARD_H
|
#ifndef __BOARDS_ARM_MOXART_MOXA_INCLUDE_BOARD_H
|
||||||
#define __BOARDS_ARM_MOXA_INCLUDE_BOARD_H
|
#define __BOARDS_ARM_MOXART_MOXA_INCLUDE_BOARD_H
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
@@ -47,18 +47,19 @@
|
|||||||
# include <stdbool.h>
|
# include <stdbool.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* Clocking *************************************************************************/
|
/* Clocking *****************************************************************/
|
||||||
/* After power-on reset, the device is running on a 4MHz internal RC. These
|
|
||||||
* definitions will configure clocking
|
/* After power-on reset, the device is running on a 4MHz internal RC.
|
||||||
|
* These definitions will configure clocking
|
||||||
*
|
*
|
||||||
* MAINOSC: Frequency = 12MHz (crysta)
|
* MAINOSC: Frequency = 12MHz (crysta)
|
||||||
* PLLA: PLL Divider = 1, Multiplier = 14 to generate PLLACK = 168MHz
|
* PLLA: PLL Divider = 1, Multiplier = 14 to generate PLLACK = 168MHz
|
||||||
* Master Clock (MCK): Source = PLLACK, Prescalar = 1 to generate MCK = 84MHz
|
* Master Clock (MCK): Source = PLLACK, Prescalar = 1 to generate MCK = 84MHz
|
||||||
* CPU clock: 84MHz
|
* CPU clock: 84MHz
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define BOARD_32KOSC_FREQUENCY (32768)
|
#define BOARD_32KOSC_FREQUENCY (32768)
|
||||||
@@ -140,7 +141,8 @@
|
|||||||
|
|
||||||
#define BOARD_FWS 4
|
#define BOARD_FWS 4
|
||||||
|
|
||||||
/* LED definitions ******************************************************************/
|
/* LED definitions **********************************************************/
|
||||||
|
|
||||||
/* There are three user-controllable LEDs on board the Moxa board:
|
/* There are three user-controllable LEDs on board the Moxa board:
|
||||||
*
|
*
|
||||||
* LED GPIO
|
* LED GPIO
|
||||||
@@ -175,7 +177,9 @@
|
|||||||
*
|
*
|
||||||
* SYMBOL MEANING LED STATE
|
* SYMBOL MEANING LED STATE
|
||||||
* L TX RX
|
* L TX RX
|
||||||
* ----------------------- -------------------------- -------- -------- -------- */
|
* ----------------------- -------------------------- -------- -------- --------
|
||||||
|
*/
|
||||||
|
|
||||||
#define LED_STARTED 0 /* NuttX has been started OFF OFF OFF */
|
#define LED_STARTED 0 /* NuttX has been started OFF OFF OFF */
|
||||||
#define LED_HEAPALLOCATE 0 /* Heap has been allocated OFF OFF OFF */
|
#define LED_HEAPALLOCATE 0 /* Heap has been allocated OFF OFF OFF */
|
||||||
#define LED_IRQSENABLED 0 /* Interrupts enabled OFF OFF OFF */
|
#define LED_IRQSENABLED 0 /* Interrupts enabled OFF OFF OFF */
|
||||||
@@ -194,14 +198,15 @@
|
|||||||
* at approximately 2Hz, then a fatal error has been detected and the system
|
* at approximately 2Hz, then a fatal error has been detected and the system
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Button definitions ***************************************************************/
|
/* Button definitions *******************************************************/
|
||||||
|
|
||||||
/* There are no buttons on the Moxa board. */
|
/* There are no buttons on the Moxa board. */
|
||||||
|
|
||||||
/* GPIO pin configurations **********************************************************/
|
/* GPIO pin configurations **************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Public Data
|
* Public Data
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
|
|
||||||
@@ -214,9 +219,9 @@ extern "C"
|
|||||||
#define EXTERN extern
|
#define EXTERN extern
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Public Function Prototypes
|
* Public Function Prototypes
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
inline void ftintc010_set_trig_mode(int irq, int mode);
|
inline void ftintc010_set_trig_mode(int irq, int mode);
|
||||||
inline void ftintc010_set_trig_level(int irq, int level);
|
inline void ftintc010_set_trig_level(int irq, int level);
|
||||||
@@ -225,6 +230,5 @@ inline void ftintc010_set_trig_level(int irq, int level);
|
|||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* __ASSEMBLY__ */
|
#endif /* __ASSEMBLY__ */
|
||||||
#endif /* __BOARDS_ARM_MOXA_INCLUDE_BOARD_H */
|
#endif /* __BOARDS_ARM_MOXART_MOXA_INCLUDE_BOARD_H */
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
############################################################################
|
############################################################################
|
||||||
# boards/moxa/scripts/Make.defs
|
# boards/arm/moxart/moxa/scripts/Make.defs
|
||||||
#
|
#
|
||||||
# Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved.
|
# Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved.
|
||||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* boards/moxa/scripts/moxa.ld
|
* boards/arm/moxart/moxa/scripts/moxa.ld
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
############################################################################
|
############################################################################
|
||||||
# boards/moxa/src/Makefile
|
# boards/arm/moxart/moxa/src/Makefile
|
||||||
#
|
#
|
||||||
# Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
# Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* config/moxart/src/moxart_appinit.c
|
* boards/arm/moxart/moxart/src/moxart_appinit.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
|
||||||
* Author: Anton D. Kachalov <mouse@mayc.ru>
|
* Author: Anton D. Kachalov <mouse@mayc.ru>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* config/moxart/src/moxart_boot.c
|
* boards/arm/moxart/moxart/src/moxart_boot.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||||
* Author: Anton D. Kachalov <mouse@mayc.ru>
|
* Author: Anton D. Kachalov <mouse@mayc.ru>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* config/moxa/src/moxart_reset.c
|
* boards/arm/moxart/moxa/src/moxart_reset.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2019 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2019 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* boards/nrf52_generic/include/board.h
|
* boards/arm/nrf52/nrf52_generic/include/board.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||||
* Author: Janne Rosberg <janne@offcode.fi>
|
* Author: Janne Rosberg <janne@offcode.fi>
|
||||||
@@ -33,8 +33,8 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef _CONFIGS_NRF52_GENERIC_INCLUDE_BOARD_H
|
#ifndef __BOARDS_ARM_NRF52_NRF52_GENERIC_INCLUDE_BOARD_H
|
||||||
#define _CONFIGS_NRF52_GENERIC_INCLUDE_BOARD_H
|
#define __BOARDS_ARM_NRF52_NRF52_GENERIC_INCLUDE_BOARD_H
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
@@ -56,8 +56,8 @@
|
|||||||
#define BOARD_SYSTICK_CLOCK (64000000)
|
#define BOARD_SYSTICK_CLOCK (64000000)
|
||||||
|
|
||||||
/* LED definitions *********************************************************/
|
/* LED definitions *********************************************************/
|
||||||
/*
|
|
||||||
* A low output illuminates the LED.
|
/* A low output illuminates the LED.
|
||||||
*
|
*
|
||||||
* LED index values for use with board_userled()
|
* LED index values for use with board_userled()
|
||||||
*/
|
*/
|
||||||
@@ -98,6 +98,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* Button definitions *******************************************************/
|
/* Button definitions *******************************************************/
|
||||||
|
|
||||||
/* Board supports four buttons. */
|
/* Board supports four buttons. */
|
||||||
|
|
||||||
#define BUTTON_BTN1 0
|
#define BUTTON_BTN1 0
|
||||||
@@ -113,12 +114,12 @@
|
|||||||
#define BUTTON_BTN4_BIT (1 << BUTTON_BTN4)
|
#define BUTTON_BTN4_BIT (1 << BUTTON_BTN4)
|
||||||
|
|
||||||
/* UART Pins ****************************************************************/
|
/* UART Pins ****************************************************************/
|
||||||
/*
|
|
||||||
* The following definitions must be provided so that the NRF52 serial
|
/* The following definitions must be provided so that the NRF52 serial
|
||||||
* driver can set up the UART for the serial console properly.
|
* driver can set up the UART for the serial console properly.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define BOARD_UART0_RX_PIN (GPIO_INPUT | GPIO_PIN(CONFIG_NRF52_GENERIC_UART0_RX_PIN))
|
#define BOARD_UART0_RX_PIN (GPIO_INPUT | GPIO_PIN(CONFIG_NRF52_GENERIC_UART0_RX_PIN))
|
||||||
#define BOARD_UART0_TX_PIN (GPIO_OUTPUT | GPIO_VALUE_ONE | GPIO_PIN(CONFIG_NRF52_GENERIC_UART0_TX_PIN))
|
#define BOARD_UART0_TX_PIN (GPIO_OUTPUT | GPIO_VALUE_ONE | GPIO_PIN(CONFIG_NRF52_GENERIC_UART0_TX_PIN))
|
||||||
|
|
||||||
#endif /* _CONFIGS_NRF52_GENERIC_INCLUDE_BOARD_H */
|
#endif /* __BOARDS_ARM_NRF52_NRF52_GENERIC_INCLUDE_BOARD_H */
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
############################################################################
|
############################################################################
|
||||||
# boards/nrf52-generic/scripts/Make.defs
|
# boards/arm/nrf52/nrf52-generic/scripts/Make.defs
|
||||||
#
|
#
|
||||||
# Copyright (C) 2014, 2017, 2018 Gregory Nutt. All rights reserved.
|
# Copyright (C) 2014, 2017, 2018 Gregory Nutt. All rights reserved.
|
||||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* boards/nrf52-generic/scripts/flash_config.ld
|
* boards/arm/nrf52/nrf52-generic/scripts/flash_config.ld
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||||
* Author: Janne Rosberg <janne@offcode.fi>
|
* Author: Janne Rosberg <janne@offcode.fi>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
############################################################################
|
############################################################################
|
||||||
# boards/nrf52-generic/src/Makefile
|
# boards/arm/nrf52/nrf52-generic/src/Makefile
|
||||||
#
|
#
|
||||||
# Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
# Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||||
# Author: Janne Rosberg <janne@offcode.fi>
|
# Author: Janne Rosberg <janne@offcode.fi>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* boards/nrf52-generic/src/nrf52-generic.h
|
* boards/arm/nrf52/nrf52-generic/src/nrf52-generic.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
@@ -33,8 +33,8 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef _CONFIGS_NRF52GENERIC_SRC_NRF52GENERIC_H
|
#ifndef __BOARDS_ARM_NRF52_NRF52GENERIC_SRC_NRF52GENERIC_H
|
||||||
#define _CONFIGS_NRF52GENERIC_SRC_NRF52GENERIC_H
|
#define __BOARDS_ARM_NRF52_NRF52GENERIC_SRC_NRF52GENERIC_H
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
@@ -50,6 +50,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* LED definitions **********************************************************/
|
/* LED definitions **********************************************************/
|
||||||
|
|
||||||
/* Definitions to configure LED GPIO as outputs */
|
/* Definitions to configure LED GPIO as outputs */
|
||||||
|
|
||||||
#define GPIO_LED1 (GPIO_OUTPUT | GPIO_VALUE_ONE | GPIO_PIN(CONFIG_NRF52_GENERIC_LED1_PIN))
|
#define GPIO_LED1 (GPIO_OUTPUT | GPIO_VALUE_ONE | GPIO_PIN(CONFIG_NRF52_GENERIC_LED1_PIN))
|
||||||
@@ -58,6 +59,7 @@
|
|||||||
#define GPIO_LED4 (GPIO_OUTPUT | GPIO_VALUE_ONE | GPIO_PIN(CONFIG_NRF52_GENERIC_LED4_PIN))
|
#define GPIO_LED4 (GPIO_OUTPUT | GPIO_VALUE_ONE | GPIO_PIN(CONFIG_NRF52_GENERIC_LED4_PIN))
|
||||||
|
|
||||||
/* Button definitions *******************************************************/
|
/* Button definitions *******************************************************/
|
||||||
|
|
||||||
/* Board supports four buttons. */
|
/* Board supports four buttons. */
|
||||||
|
|
||||||
#define GPIO_BUTTON1 (GPIO_INPUT | GPIO_PULLUP | GPIO_PIN13)
|
#define GPIO_BUTTON1 (GPIO_INPUT | GPIO_PULLUP | GPIO_PIN13)
|
||||||
@@ -96,4 +98,4 @@
|
|||||||
int nrf52_bringup(void);
|
int nrf52_bringup(void);
|
||||||
|
|
||||||
#endif /* __ASSEMBLY__ */
|
#endif /* __ASSEMBLY__ */
|
||||||
#endif /* _CONFIGS_NRF52GENERIC_SRC_NRF52GENERIC_H */
|
#endif /* __BOARDS_ARM_NRF52_NRF52GENERIC_SRC_NRF52GENERIC_H */
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* config/nrf52-generic/src/nrf52_appinit.c
|
* boards/arm/nrf52/nrf52-generic/src/nrf52_appinit.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||||
* Author: Janne Rosberg <janne@offcode.fi>
|
* Author: Janne Rosberg <janne@offcode.fi>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* boards/nrf52-generic/src/lpc43_autoleds.c
|
* boards/arm/nrf52/nrf52-generic/src/lpc43_autoleds.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* boards/nrf52-generic/src/lpc43_boot.c
|
* boards/arm/nrf52/nrf52-generic/src/lpc43_boot.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* config/nrf52-generic/src/nrf53_bringup.c
|
* boards/arm/nrf52/nrf52-generic/src/nrf53_bringup.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* boards/nrf52-generic/src/nrf52_buttons.c
|
* boards/arm/nrf52/nrf52-generic/src/nrf52_buttons.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||||
* Author: Janne Rosberg <janne@offcode.fi>
|
* Author: Janne Rosberg <janne@offcode.fi>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* boards/nrf52-generic/src/nrf52_userleds.c
|
* boards/arm/nrf52/nrf52-generic/src/nrf52_userleds.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||||
* Author: Janne Rosberg <janne@offcode.fi>
|
* Author: Janne Rosberg <janne@offcode.fi>
|
||||||
@@ -56,9 +56,10 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* LED definitions **********************************************************/
|
/* LED definitions **********************************************************/
|
||||||
/*
|
|
||||||
* If CONFIG_ARCH_LEDS is not defined, then the LEDs are completely under
|
/* If CONFIG_ARCH_LEDS is not defined, then the LEDs are completely under
|
||||||
* control of the application. The following interfaces are then available
|
* control of the application. The following interfaces are then available
|
||||||
* for application control of the LEDs:
|
* for application control of the LEDs:
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* boards/nutiny-nuc120/include/board.h
|
* boards/arm/nuc1xx/nutiny-nuc120/include/board.h
|
||||||
* include/arch/board/board.h
|
* include/arch/board/board.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||||
@@ -32,14 +32,14 @@
|
|||||||
* 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 __BOARDS_ARM_NUTINY_NUC12_INCLUDE_BOARD_H
|
#ifndef __BOARDS_ARM_NUC1XX_NUTINY_NUC12_INCLUDE_BOARD_H
|
||||||
#define __BOARDS_ARM_NUTINY_NUC12_INCLUDE_BOARD_H
|
#define __BOARDS_ARM_NUC1XX_NUTINY_NUC12_INCLUDE_BOARD_H
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
@@ -47,10 +47,12 @@
|
|||||||
# include <stdint.h>
|
# include <stdint.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
/* Clocking *************************************************************************/
|
|
||||||
|
/* Clocking *****************************************************************/
|
||||||
|
|
||||||
/* Crystal frequencies */
|
/* Crystal frequencies */
|
||||||
|
|
||||||
#define BOARD_XTALHI_FREQUENCY 12000000
|
#define BOARD_XTALHI_FREQUENCY 12000000
|
||||||
@@ -93,15 +95,18 @@
|
|||||||
#define BOARD_USB_N 1
|
#define BOARD_USB_N 1
|
||||||
#define BOARD_USB_FREQUENCY (BOARD_PLL_FOUT / BOARD_USB_N)
|
#define BOARD_USB_FREQUENCY (BOARD_PLL_FOUT / BOARD_USB_N)
|
||||||
|
|
||||||
/* LED definitions ******************************************************************/
|
/* LED definitions **********************************************************/
|
||||||
/* The NuTiny has a single green LED that can be controlled from sofware. This LED
|
|
||||||
* is connected to PIN17. It is pulled high so a low value will illuminate the LED.
|
/* The NuTiny has a single green LED that can be controlled from sofware.
|
||||||
|
* This LED is connected to PIN17.
|
||||||
|
* It is pulled high so a low value will illuminate the LED.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define BOARD_NLEDS 1
|
#define BOARD_NLEDS 1
|
||||||
|
|
||||||
/* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board the
|
/* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board
|
||||||
* NuTiny. The following definitions describe how NuttX controls the LEDs:
|
* the NuTiny.
|
||||||
|
* The following definitions describe how NuttX controls the LEDs:
|
||||||
*
|
*
|
||||||
* SYMBOL Meaning LED state
|
* SYMBOL Meaning LED state
|
||||||
* Initially all LED is OFF
|
* Initially all LED is OFF
|
||||||
@@ -112,7 +117,8 @@
|
|||||||
* LED_STACKCREATED Idle stack created LED ON
|
* LED_STACKCREATED Idle stack created LED ON
|
||||||
* LED_INIRQ In an interrupt LED should glow
|
* LED_INIRQ In an interrupt LED should glow
|
||||||
* LED_SIGNAL In a signal handler LED might glow
|
* LED_SIGNAL In a signal handler LED might glow
|
||||||
* LED_ASSERTION An assertion failed LED ON while handling the assertion
|
* LED_ASSERTION An assertion failed LED ON while handling the
|
||||||
|
* assertion
|
||||||
* LED_PANIC The system has crashed LED Blinking at 2Hz
|
* LED_PANIC The system has crashed LED Blinking at 2Hz
|
||||||
* LED_IDLE NUC1XX is is sleep mode (Optional, not used)
|
* LED_IDLE NUC1XX is is sleep mode (Optional, not used)
|
||||||
*/
|
*/
|
||||||
@@ -126,9 +132,10 @@
|
|||||||
#define LED_ASSERTION 0
|
#define LED_ASSERTION 0
|
||||||
#define LED_PANIC 0
|
#define LED_PANIC 0
|
||||||
|
|
||||||
/* Button definitions ***************************************************************/
|
/* Button definitions *******************************************************/
|
||||||
|
|
||||||
/* The NuTiny has no buttons */
|
/* The NuTiny has no buttons */
|
||||||
|
|
||||||
#define NUM_BUTTONS 0
|
#define NUM_BUTTONS 0
|
||||||
|
|
||||||
#endif /* __BOARDS_ARM_NUTINY_NUC12_INCLUDE_BOARD_H */
|
#endif /* __BOARDS_ARM_NUC1XX_NUTINY_NUC12_INCLUDE_BOARD_H */
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
############################################################################
|
############################################################################
|
||||||
# boards/nutiny-nuc120/scripts/Make.defs
|
# boards/arm/nuc1xx/nutiny-nuc120/scripts/Make.defs
|
||||||
#
|
#
|
||||||
# Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved.
|
# Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved.
|
||||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* boards/nutiny-nuc120/scripts/nutiny-nuc120.ld
|
* boards/arm/nuc1xx/nutiny-nuc120/scripts/nutiny-nuc120.ld
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
############################################################################
|
############################################################################
|
||||||
# boards/nutiny-nuc120/src/Makefile
|
# boards/arm/nuc1xx/nutiny-nuc120/src/Makefile
|
||||||
#
|
#
|
||||||
# Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
# Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* boards/nutiny-nuc120/src/nuc_boardinitialize.c
|
* boards/arm/nuc1xx/nutiny-nuc120/src/nuc_boardinitialize.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
@@ -31,11 +31,11 @@
|
|||||||
* 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>
|
||||||
|
|
||||||
@@ -46,32 +46,33 @@
|
|||||||
#include "up_arch.h"
|
#include "up_arch.h"
|
||||||
#include "nutiny-nuc120.h"
|
#include "nutiny-nuc120.h"
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Private Functions
|
* Private Functions
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Name: nuc_boardinitialize
|
* Name: nuc_boardinitialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* All NUC1XX architectures must provide the following entry point. This entry point
|
* All NUC1XX architectures must provide the following entry point.
|
||||||
* is called early in the intitialization -- after all memory has been configured
|
* This entry point is called early in the intitialization -- after all
|
||||||
* and mapped but before any devices have been initialized.
|
* memory has been configured and mapped but before any devices have been
|
||||||
|
* initialized.
|
||||||
*
|
*
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void nuc_boardinitialize(void)
|
void nuc_boardinitialize(void)
|
||||||
{
|
{
|
||||||
/* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function
|
/* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak
|
||||||
* nuc_spidev_initialize() has been brought into the link.
|
* function nuc_spidev_initialize() has been brought into the link.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(CONFIG_NUC1XX_SPI1) || defined(CONFIG_NUC1XX_SPI2) || defined(CONFIG_NUC1XX_SPI3)
|
#if defined(CONFIG_NUC1XX_SPI1) || defined(CONFIG_NUC1XX_SPI2) || defined(CONFIG_NUC1XX_SPI3)
|
||||||
@@ -81,9 +82,10 @@ void nuc_boardinitialize(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Initialize USB if the 1) USB device controller is in the configuration and 2)
|
/* Initialize USB if the 1) USB device controller is in the configuration
|
||||||
* disabled, and 3) the weak function nuc_usbinitialize() has been brought
|
* and 2) disabled, and 3) the weak function nuc_usbinitialize() has been
|
||||||
* into the build. Presumeably either CONFIG_USBDEV is also selected.
|
* brought into the build.
|
||||||
|
* Presumeably either CONFIG_USBDEV is also selected.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef CONFIG_NUC1XX_USB
|
#ifdef CONFIG_NUC1XX_USB
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* boards/nutiny-nuc120/src/up_autoleds.c
|
* boards/arm/nuc1xx/nutiny-nuc120/src/up_autoleds.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
@@ -32,12 +32,14 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* The NuTiny has a single green LED that can be controlled from sofware.
|
/* The NuTiny has a single green LED that can be controlled from sofware.
|
||||||
* This LED is connected to PIN17. It is pulled high so a low value will
|
* This LED is connected to PIN17. It is pulled high so a low value will
|
||||||
* illuminate the LED.
|
* illuminate the LED.
|
||||||
*
|
*
|
||||||
* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board the
|
* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board
|
||||||
* NuTiny. The following definitions describe how NuttX controls the LEDs:
|
* the NuTiny.
|
||||||
|
* The following definitions describe how NuttX controls the LEDs:
|
||||||
*
|
*
|
||||||
* SYMBOL Meaning LED state
|
* SYMBOL Meaning LED state
|
||||||
* Initially all LED is OFF
|
* Initially all LED is OFF
|
||||||
@@ -48,7 +50,8 @@
|
|||||||
* LED_STACKCREATED Idle stack created LED ON
|
* LED_STACKCREATED Idle stack created LED ON
|
||||||
* LED_INIRQ In an interrupt LED should glow
|
* LED_INIRQ In an interrupt LED should glow
|
||||||
* LED_SIGNAL In a signal handler LED might glow
|
* LED_SIGNAL In a signal handler LED might glow
|
||||||
* LED_ASSERTION An assertion failed LED ON while handling the assertion
|
* LED_ASSERTION An assertion failed LED ON while handling the
|
||||||
|
* assertion
|
||||||
* LED_PANIC The system has crashed LED Blinking at 2Hz
|
* LED_PANIC The system has crashed LED Blinking at 2Hz
|
||||||
* LED_IDLE NUC1XX is is sleep mode (Optional, not used)
|
* LED_IDLE NUC1XX is is sleep mode (Optional, not used)
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************************************
|
/****************************************************************************
|
||||||
* boards/nutiny-nuc120/src/nutiny-nuc120.h
|
* boards/arm/nuc1xx/nutiny-nuc120/src/nutiny-nuc120.h
|
||||||
* arch/arm/src/board/nutiny-nuc120.n
|
* arch/arm/src/board/nutiny-nuc120.n
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||||
@@ -32,30 +32,34 @@
|
|||||||
* 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 __BOARDS_ARM_NUTINY_NUC120_SRC_NUTINY_NUC120_H
|
#ifndef __BOARDS_ARM_NUC1XX_NUTINY_NUC120_SRC_NUTINY_NUC120_H
|
||||||
#define __BOARDS_ARM_NUTINY_NUC120_SRC_NUTINY_NUC120_H
|
#define __BOARDS_ARM_NUC1XX_NUTINY_NUC120_SRC_NUTINY_NUC120_H
|
||||||
|
|
||||||
/****************************************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#include <nuttx/compiler.h>
|
#include <nuttx/compiler.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
/****************************************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************************************/
|
****************************************************************************/
|
||||||
/* Configuration ************************************************************************************/
|
|
||||||
|
|
||||||
/* NuTiny-EVB-120 GPIOs *****************************************************************************/
|
/* Configuration ************************************************************/
|
||||||
/* The NuTiny has a single green LED that can be controlled from sofware. This LED
|
|
||||||
* is connected to PIN17 (PB.0). It is pulled high so a low value will illuminate the LED.
|
/* NuTiny-EVB-120 GPIOs *****************************************************/
|
||||||
|
|
||||||
|
/* The NuTiny has a single green LED that can be controlled from sofware.
|
||||||
|
* This LED is connected to PIN17 (PB.0).
|
||||||
|
* It is pulled high so a low value will illuminate the LED.
|
||||||
*
|
*
|
||||||
* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board the
|
* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board
|
||||||
* NuTiny. The following definitions describe how NuttX controls the LEDs:
|
* the NuTiny.
|
||||||
|
* The following definitions describe how NuttX controls the LEDs:
|
||||||
*
|
*
|
||||||
* SYMBOL Meaning LED state
|
* SYMBOL Meaning LED state
|
||||||
* Initially all LED is OFF
|
* Initially all LED is OFF
|
||||||
@@ -66,66 +70,66 @@
|
|||||||
* LED_STACKCREATED Idle stack created LED ON
|
* LED_STACKCREATED Idle stack created LED ON
|
||||||
* LED_INIRQ In an interrupt LED should glow
|
* LED_INIRQ In an interrupt LED should glow
|
||||||
* LED_SIGNAL In a signal handler LED might glow
|
* LED_SIGNAL In a signal handler LED might glow
|
||||||
* LED_ASSERTION An assertion failed LED ON while handling the assertion
|
* LED_ASSERTION An assertion failed LED ON while handling the
|
||||||
|
* assertion
|
||||||
* LED_PANIC The system has crashed LED Blinking at 2Hz
|
* LED_PANIC The system has crashed LED Blinking at 2Hz
|
||||||
* LED_IDLE NUC1XX is in sleep mode (Optional, not used)
|
* LED_IDLE NUC1XX is in sleep mode (Optional, not used)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define GPIO_LED (GPIO_OUTPUT | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN0)
|
#define GPIO_LED (GPIO_OUTPUT | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN0)
|
||||||
|
|
||||||
/* Button definitions ***************************************************************/
|
/* Button definitions *******************************************************/
|
||||||
|
|
||||||
/* The NuTiny has no buttons */
|
/* The NuTiny has no buttons */
|
||||||
|
|
||||||
/****************************************************************************************************
|
/****************************************************************************
|
||||||
* Public Types
|
* Public Types
|
||||||
****************************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************************************
|
/****************************************************************************
|
||||||
* Public data
|
* Public data
|
||||||
****************************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
|
|
||||||
/****************************************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************************************
|
/****************************************************************************
|
||||||
* Name: nuc_spidev_initialize
|
* Name: nuc_spidev_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called to configure SPI chip select GPIO pins for the NuTiny-EVB-120 board.
|
* Called to configure SPI chip select GPIO pins for the NuTiny-EVB-120
|
||||||
|
* board.
|
||||||
*
|
*
|
||||||
****************************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void weak_function nuc_spidev_initialize(void);
|
void weak_function nuc_spidev_initialize(void);
|
||||||
|
|
||||||
/****************************************************************************************************
|
/****************************************************************************
|
||||||
* Name: nuc_usbinitialize
|
* Name: nuc_usbinitialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called from nuc_usbinitialize very early in inialization to setup USB-related
|
* Called from nuc_usbinitialize very early in inialization to setup
|
||||||
* GPIO pins for the NuTiny-EVB-120 board.
|
* USB-related GPIO pins for the NuTiny-EVB-120 board.
|
||||||
*
|
*
|
||||||
****************************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_STM32_USB
|
#ifdef CONFIG_STM32_USB
|
||||||
void weak_function nuc_usbinitialize(void);
|
void weak_function nuc_usbinitialize(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************************************
|
/****************************************************************************
|
||||||
* Name: nuc_led_initialize
|
* Name: nuc_led_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Initialize the on-board LED
|
* Initialize the on-board LED
|
||||||
*
|
*
|
||||||
****************************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_ARCH_LEDS
|
#ifdef CONFIG_ARCH_LEDS
|
||||||
void nuc_led_initialize(void);
|
void nuc_led_initialize(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif /* __ASSEMBLY__ */
|
#endif /* __ASSEMBLY__ */
|
||||||
#endif /* __BOARDS_ARM_NUTINY_NUC120_SRC_NUTINY_NUC120_H */
|
#endif /* __BOARDS_ARM_NUC1XX_NUTINY_NUC120_SRC_NUTINY_NUC120_H */
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* boards/olimex-strp711/include/board.h
|
* boards/arm/str71x/olimex-strp711/include/board.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
@@ -32,14 +32,15 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Features:
|
* Features:
|
||||||
*
|
*
|
||||||
* - MCU: STR711FR2T6 16/32 bit ARM7TDMI™ with 256K Bytes Program Flash,
|
* - MCU: STR711FR2T6 16/32 bit ARM7TDMI™ with 256K Bytes Program Flash,
|
||||||
* 64K Bytes RAM, USB 2.0, RTC, 12 bit ADC, 4x UARTs, 2x I2C,2x SPI,
|
* 64K Bytes RAM, USB 2.0, RTC, 12 bit ADC, 4x UARTs, 2x I2C,2x SPI,
|
||||||
* 5x 32bit TIMERS, 2x PWM, 2x CCR, WDT, up to 50MHz operation
|
* 5x 32bit TIMERS, 2x PWM, 2x CCR, WDT, up to 50MHz operation
|
||||||
* - Standard JTAG connector with ARM 2x10 pin layout for programming/debugging
|
* - Standard JTAG connector with ARM 2x10 pin layout for programming/
|
||||||
* with ARM-JTAG
|
* debugging with ARM-JTAG
|
||||||
* - USB connector
|
* - USB connector
|
||||||
* - Two channel RS232 interface and drivers
|
* - Two channel RS232 interface and drivers
|
||||||
* - SD/MMC card connector
|
* - SD/MMC card connector
|
||||||
@@ -62,8 +63,8 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef _CONFIGS_OLIMEX_STRP711_BOARD_H
|
#ifndef __BOARDS_ARM_STR71X_OLIMEX_STRP711_INCLUDE_BOARD_H
|
||||||
#define _CONFIGS_OLIMEX_STRP711_BOARD_H
|
#define __BOARDS_ARM_STR71X_OLIMEX_STRP711_INCLUDE_BOARD_H
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
@@ -150,7 +151,9 @@
|
|||||||
|
|
||||||
/* Button definitions *******************************************************/
|
/* Button definitions *******************************************************/
|
||||||
|
|
||||||
/* The Olimex board has two buttons, one labled "BUT" and the other "WAKEUP" */
|
/* The Olimex board has two buttons,
|
||||||
|
* one labled "BUT" and the other "WAKEUP"
|
||||||
|
*/
|
||||||
|
|
||||||
#define BUT_BUTTON 1 /* Bit 0: BUT button is depressed */
|
#define BUT_BUTTON 1 /* Bit 0: BUT button is depressed */
|
||||||
#define WAKEUP_BUTTON 2 /* Bit 1: WAKEUP button is depressed */
|
#define WAKEUP_BUTTON 2 /* Bit 1: WAKEUP button is depressed */
|
||||||
@@ -162,7 +165,8 @@
|
|||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
#define EXTERN extern "C"
|
#define EXTERN extern "C"
|
||||||
extern "C" {
|
extern "C"
|
||||||
|
{
|
||||||
#else
|
#else
|
||||||
#define EXTERN extern
|
#define EXTERN extern
|
||||||
#endif
|
#endif
|
||||||
@@ -177,4 +181,4 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* _CONFIGS_OLIMEX_STRP711_BOARD_H */
|
#endif /* __BOARDS_ARM_STR71X_OLIMEX_STRP711_INCLUDE_BOARD_H */
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
##############################################################################
|
##############################################################################
|
||||||
# boards/olimex-strp711/scripts/Make.defs
|
# boards/arm/str71x/olimex-strp711/scripts/Make.defs
|
||||||
#
|
#
|
||||||
# Copyright (C) 2008-2009, 2011, 2017 Gregory Nutt. All rights reserved.
|
# Copyright (C) 2008-2009, 2011, 2017 Gregory Nutt. All rights reserved.
|
||||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* boards/olimex-strp711/scripts/ld.script
|
* boards/arm/str71x/olimex-strp711/scripts/ld.script
|
||||||
*
|
*
|
||||||
* Copyright (C) 2010 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2010 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
############################################################################
|
############################################################################
|
||||||
# boards/olimex-strp711/src/Makefile
|
# boards/arm/str71x/olimex-strp711/src/Makefile
|
||||||
#
|
#
|
||||||
# Copyright (C) 2007-2008, 2010, 2012 Gregory Nutt. All rights reserved.
|
# Copyright (C) 2007-2008, 2010, 2012 Gregory Nutt. All rights reserved.
|
||||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* config/olimex-strp711/src/str71_appinit.c
|
* boards/arm/str71x/olimex-strp711/src/str71_appinit.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2010, 2016 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2009-2010, 2016 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
@@ -153,10 +153,12 @@ int board_app_initialize(uintptr_t arg)
|
|||||||
syslog(LOG_INFO, "Binding SPI port %d to MMC/SD slot %d\n",
|
syslog(LOG_INFO, "Binding SPI port %d to MMC/SD slot %d\n",
|
||||||
CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
|
CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
|
||||||
|
|
||||||
ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi);
|
ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO,
|
||||||
|
spi);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
syslog(LOG_ERR, "ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
|
syslog(LOG_ERR,
|
||||||
|
"ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
|
||||||
CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret);
|
CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* boards/olimex-strp711/src/str71_buttons.c
|
* boards/arm/str71x/olimex-strp711/src/str71_buttons.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2009, 2015 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2008-2009, 2015 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* boards/olimex-strp711/src/str71_enc28j60.c
|
* boards/arm/str71x/olimex-strp711/src/str71_enc28j60.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2010, 2012, 2017 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2010, 2012, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
@@ -33,8 +33,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/*
|
/* ENC28J60 Module
|
||||||
* ENC28J60 Module
|
|
||||||
*
|
*
|
||||||
* The ENC28J60 module does not come on the Olimex-STR-P711, but this
|
* The ENC28J60 module does not come on the Olimex-STR-P711, but this
|
||||||
* describes how I have connected it. NOTE that the ENC28J60 requires an
|
* describes how I have connected it. NOTE that the ENC28J60 requires an
|
||||||
@@ -43,7 +42,8 @@
|
|||||||
*
|
*
|
||||||
* Module CON5 QFN ENC2860 Description
|
* Module CON5 QFN ENC2860 Description
|
||||||
* --------------- -------------------------------------------------------
|
* --------------- -------------------------------------------------------
|
||||||
* 1 J8-1 NET CS 5 ~CS Chip select input pin for SPI interface (active low)
|
* 1 J8-1 NET CS 5 ~CS Chip select input pin for SPI interface
|
||||||
|
* (active low)
|
||||||
* 2 2 SCK 4 SCK Clock in pin for SPI interface
|
* 2 2 SCK 4 SCK Clock in pin for SPI interface
|
||||||
* 3 3 MOSI 3 SI Data in pin for SPI interface
|
* 3 3 MOSI 3 SI Data in pin for SPI interface
|
||||||
* 4 4 MISO 2 SO Data out pin for SPI interface
|
* 4 4 MISO 2 SO Data out pin for SPI interface
|
||||||
@@ -227,11 +227,12 @@ void up_netinitialize(void)
|
|||||||
ret = str71x_xticonfig(ENC28J60_IRQ, false);
|
ret = str71x_xticonfig(ENC28J60_IRQ, false);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
nerr("ERROR: Failed configure interrupt for IRQ %d: %d\n", ENC28J60_IRQ, ret);
|
nerr("ERROR: Failed configure interrupt for IRQ %d: %d\n",
|
||||||
|
ENC28J60_IRQ, ret);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Take ENC28J60 out of reset (active low)*/
|
/* Take ENC28J60 out of reset (active low) */
|
||||||
|
|
||||||
reg16 = getreg16(STR71X_GPIO0_PD);
|
reg16 = getreg16(STR71X_GPIO0_PD);
|
||||||
reg16 &= ~ENC_GPIO0_NETRST;
|
reg16 &= ~ENC_GPIO0_NETRST;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* boards/olimex-strp711/src/str71_leds.c
|
* boards/arm/str71x/olimex-strp711/src/str71_leds.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
@@ -154,7 +154,7 @@ void board_autoled_on(int led)
|
|||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
case LED_STARTED:
|
case LED_STARTED:
|
||||||
str71_setleds(0, STR71X_LED1GPIO1_BIT|STR71X_LED2GPIO1_BIT); /* Clear LED1&2 */
|
str71_setleds(0, STR71X_LED1GPIO1_BIT | STR71X_LED2GPIO1_BIT); /* Clear LED1&2 */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LED_HEAPALLOCATE:
|
case LED_HEAPALLOCATE:
|
||||||
@@ -166,11 +166,11 @@ void board_autoled_on(int led)
|
|||||||
case LED_INIRQ:
|
case LED_INIRQ:
|
||||||
case LED_SIGNAL:
|
case LED_SIGNAL:
|
||||||
case LED_ASSERTION:
|
case LED_ASSERTION:
|
||||||
str71_setleds(STR71X_LED1GPIO1_BIT|STR71X_LED2GPIO1_BIT, 0); /* Set LED1&2 */
|
str71_setleds(STR71X_LED1GPIO1_BIT | STR71X_LED2GPIO1_BIT, 0); /* Set LED1&2 */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LED_PANIC:
|
case LED_PANIC:
|
||||||
str71_setleds(STR71X_LED2GPIO1_BIT|g_led2set, g_led2set); /* Set LED1, preserve LED2 */
|
str71_setleds(STR71X_LED2GPIO1_BIT | g_led2set, g_led2set); /* Set LED1, preserve LED2 */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -213,7 +213,7 @@ void board_autoled_off(int led)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case LED_PANIC:
|
case LED_PANIC:
|
||||||
str71_setleds(g_led2set, STR71X_LED1GPIO1_BIT|g_led2clr); /* Clear LED1, preserve LED2 */
|
str71_setleds(g_led2set, STR71X_LED1GPIO1_BIT | g_led2clr); /* Clear LED1, preserve LED2 */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* config/olimex-strp711/src/str71_spi.c
|
* boards/arm/str71x/olimex-strp711/src/str71_spi.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2010, 2012, 2016-2017 Gregory Nutt. All rights
|
* Copyright (C) 2008-2010, 2012, 2016-2017 Gregory Nutt. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
@@ -140,9 +140,10 @@
|
|||||||
|
|
||||||
/* ENC28J60 Module
|
/* ENC28J60 Module
|
||||||
*
|
*
|
||||||
* The ENC28J60 module does not come on the Olimex-STR-P711, but this describes
|
* The ENC28J60 module does not come on the Olimex-STR-P711, but this
|
||||||
* how I have connected it. NOTE that the ENC28J60 requires an external interrupt
|
* describes how I have connected it.
|
||||||
* (XTI) pin. The only easily accessible XTI pins are on SPI0/1 so you can't have
|
* NOTE that the ENC28J60 requires an external interrupt (XTI) pin.
|
||||||
|
* The only easily accessible XTI pins are on SPI0/1 so you can't have
|
||||||
* both SPI0 and 1 together with this configuration.
|
* both SPI0 and 1 together with this configuration.
|
||||||
*
|
*
|
||||||
* STR-P711 PIN PIN CONFIGURATION ENC28J60 CONNECTION
|
* STR-P711 PIN PIN CONFIGURATION ENC28J60 CONNECTION
|
||||||
@@ -394,22 +395,29 @@ struct str71x_spidev_s
|
|||||||
|
|
||||||
/* Helpers */
|
/* Helpers */
|
||||||
|
|
||||||
static inline uint16_t spi_getreg(FAR struct str71x_spidev_s *priv, uint8_t offset);
|
static inline uint16_t spi_getreg(FAR struct str71x_spidev_s *priv,
|
||||||
static inline void spi_putreg(FAR struct str71x_spidev_s *priv, uint8_t offset, uint16_t value);
|
uint8_t offset);
|
||||||
|
static inline void spi_putreg(FAR struct str71x_spidev_s *priv,
|
||||||
|
uint8_t offset, uint16_t value);
|
||||||
static inline void spi_drain(FAR struct str71x_spidev_s *priv);
|
static inline void spi_drain(FAR struct str71x_spidev_s *priv);
|
||||||
|
|
||||||
/* SPI methods */
|
/* SPI methods */
|
||||||
|
|
||||||
static int spi_lock(FAR struct spi_dev_s *dev, bool lock);
|
static int spi_lock(FAR struct spi_dev_s *dev, bool lock);
|
||||||
static void spi_select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected);
|
static void spi_select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||||
static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency);
|
bool selected);
|
||||||
|
static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev,
|
||||||
|
uint32_t frequency);
|
||||||
static uint8_t spi_status(FAR struct spi_dev_s *dev, uint32_t devid);
|
static uint8_t spi_status(FAR struct spi_dev_s *dev, uint32_t devid);
|
||||||
#ifdef CONFIG_SPI_CMDDATA
|
#ifdef CONFIG_SPI_CMDDATA
|
||||||
static int spi_cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd);
|
static int spi_cmddata(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||||
|
bool cmd);
|
||||||
#endif
|
#endif
|
||||||
static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd);
|
static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd);
|
||||||
static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size_t buflen);
|
static void spi_sndblock(FAR struct spi_dev_s *dev,
|
||||||
static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t buflen);
|
FAR const void *buffer, size_t buflen);
|
||||||
|
static void spi_recvblock(FAR struct spi_dev_s *dev,
|
||||||
|
FAR void *buffer, size_t buflen);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Data
|
* Private Data
|
||||||
@@ -473,7 +481,8 @@ static struct str71x_spidev_s g_spidev1 =
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static inline uint16_t spi_getreg(FAR struct str71x_spidev_s *priv, uint8_t offset)
|
static inline uint16_t spi_getreg(FAR struct str71x_spidev_s *priv,
|
||||||
|
uint8_t offset)
|
||||||
{
|
{
|
||||||
return getreg16(priv->spibase + offset);
|
return getreg16(priv->spibase + offset);
|
||||||
}
|
}
|
||||||
@@ -494,7 +503,8 @@ static inline uint16_t spi_getreg(FAR struct str71x_spidev_s *priv, uint8_t offs
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static inline void spi_putreg(FAR struct str71x_spidev_s *priv, uint8_t offset, uint16_t value)
|
static inline void spi_putreg(FAR struct str71x_spidev_s *priv,
|
||||||
|
uint8_t offset, uint16_t value)
|
||||||
{
|
{
|
||||||
putreg16(value, priv->spibase + offset);
|
putreg16(value, priv->spibase + offset);
|
||||||
}
|
}
|
||||||
@@ -614,7 +624,8 @@ static int spi_lock(FAR struct spi_dev_s *dev, bool lock)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static void spi_select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected)
|
static void spi_select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||||
|
bool selected)
|
||||||
{
|
{
|
||||||
FAR struct str71x_spidev_s *priv = (FAR struct str71x_spidev_s *)dev;
|
FAR struct str71x_spidev_s *priv = (FAR struct str71x_spidev_s *)dev;
|
||||||
uint16_t reg16;
|
uint16_t reg16;
|
||||||
@@ -657,7 +668,8 @@ static void spi_select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency)
|
static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev,
|
||||||
|
uint32_t frequency)
|
||||||
{
|
{
|
||||||
FAR struct str71x_spidev_s *priv = (FAR struct str71x_spidev_s *)dev;
|
FAR struct str71x_spidev_s *priv = (FAR struct str71x_spidev_s *)dev;
|
||||||
uint32_t divisor;
|
uint32_t divisor;
|
||||||
@@ -692,13 +704,13 @@ static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency)
|
|||||||
/* The BSPI must be disable when the following setting is made. */
|
/* The BSPI must be disable when the following setting is made. */
|
||||||
|
|
||||||
cr1 = spi_getreg(priv, STR71X_BSPI_CSR1_OFFSET);
|
cr1 = spi_getreg(priv, STR71X_BSPI_CSR1_OFFSET);
|
||||||
cr1 &= ~(STR71X_BSPICSR1_BSPE|STR71X_BSPICSR1_MSTR);
|
cr1 &= ~(STR71X_BSPICSR1_BSPE | STR71X_BSPICSR1_MSTR);
|
||||||
spi_putreg(priv, STR71X_BSPI_CSR1_OFFSET, cr1);
|
spi_putreg(priv, STR71X_BSPI_CSR1_OFFSET, cr1);
|
||||||
spi_putreg(priv, STR71X_BSPI_CLK_OFFSET, (uint16_t)divisor);
|
spi_putreg(priv, STR71X_BSPI_CLK_OFFSET, (uint16_t)divisor);
|
||||||
|
|
||||||
/* Now we can enable the BSP in master mode */
|
/* Now we can enable the BSP in master mode */
|
||||||
|
|
||||||
cr1 |= (STR71X_BSPICSR1_BSPE|STR71X_BSPICSR1_MSTR);
|
cr1 |= (STR71X_BSPICSR1_BSPE | STR71X_BSPICSR1_MSTR);
|
||||||
spi_putreg(priv, STR71X_BSPI_CSR1_OFFSET, cr1);
|
spi_putreg(priv, STR71X_BSPI_CSR1_OFFSET, cr1);
|
||||||
|
|
||||||
return STR71X_PCLK1 / divisor;
|
return STR71X_PCLK1 / divisor;
|
||||||
@@ -872,9 +884,9 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* There is a race condition where TFNE may go false just before
|
/* There is a race condition where TFNE may go false just before
|
||||||
* RFNE goes true and this loop terminates prematurely. The nasty little
|
* RFNE goes true and this loop terminates prematurely.
|
||||||
* delay in the following solves that (it could probably be tuned to
|
* The nasty little delay in the following solves that
|
||||||
* improve performance).
|
* (it could probably be tuned to improve performance).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
else if ((csr2 & STR71X_BSPICSR2_TFNE) != 0)
|
else if ((csr2 & STR71X_BSPICSR2_TFNE) != 0)
|
||||||
@@ -895,17 +907,20 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size
|
|||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* dev - Device-specific state data
|
* dev - Device-specific state data
|
||||||
* buffer - A pointer to the buffer in which to recieve data
|
* buffer - A pointer to the buffer in which to recieve data
|
||||||
* buflen - the length of data that can be received in the buffer in number
|
* buflen - the length of data that can be received in the buffer in
|
||||||
* of words. The wordsize is determined by the number of bits-per-word
|
* number of words.
|
||||||
|
* The wordsize is determined by the number of bits-per-word
|
||||||
* selected for the SPI interface. If nbits <= 8, the data is
|
* selected for the SPI interface. If nbits <= 8, the data is
|
||||||
* packed into uint8_t; if nbits >8, the data is packed into uint16_t's
|
* packed into uint8_t; if nbits >8, the data is packed into
|
||||||
|
* uint16_t's
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t buflen)
|
static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer,
|
||||||
|
size_t buflen)
|
||||||
{
|
{
|
||||||
FAR struct str71x_spidev_s *priv = (FAR struct str71x_spidev_s *)dev;
|
FAR struct str71x_spidev_s *priv = (FAR struct str71x_spidev_s *)dev;
|
||||||
FAR uint8_t *ptr = (FAR uint8_t*)buffer;
|
FAR uint8_t *ptr = (FAR uint8_t*)buffer;
|
||||||
@@ -913,7 +928,9 @@ static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t bu
|
|||||||
|
|
||||||
DEBUGASSERT(priv && priv->spibase);
|
DEBUGASSERT(priv && priv->spibase);
|
||||||
|
|
||||||
/* While there is remaining to be sent (and no synchronization error has occurred) */
|
/* While there is remaining to be sent
|
||||||
|
* (and no synchronization error has occurred)
|
||||||
|
*/
|
||||||
|
|
||||||
while (buflen || fifobytes)
|
while (buflen || fifobytes)
|
||||||
{
|
{
|
||||||
@@ -976,9 +993,10 @@ FAR struct spi_dev_s *str71_spibus_initialize(int port)
|
|||||||
|
|
||||||
if (!g_spidev0.initialized)
|
if (!g_spidev0.initialized)
|
||||||
{
|
{
|
||||||
/* The default, alternate functionality of the GPIO0 pin selections is
|
/* The default, alternate functionality of the GPIO0 pin
|
||||||
* UART3/I2C1. In order to have BSP0 functionality, we also have to
|
* selections is UART3/I2C1.
|
||||||
* set the BSPI0 enable bit in the PCU BOOTCR register.
|
* In order to have BSP0 functionality, we also have to set the
|
||||||
|
* BSPI0 enable bit in the PCU BOOTCR register.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
reg16 = getreg16(STR71X_PCU_BOOTCR);
|
reg16 = getreg16(STR71X_PCU_BOOTCR);
|
||||||
@@ -995,17 +1013,18 @@ FAR struct spi_dev_s *str71_spibus_initialize(int port)
|
|||||||
|
|
||||||
reg16 = getreg16(STR71X_GPIO0_PC0);
|
reg16 = getreg16(STR71X_GPIO0_PC0);
|
||||||
reg16 &= ~BSPI0_GPIO0_ALL;
|
reg16 &= ~BSPI0_GPIO0_ALL;
|
||||||
reg16 |= (BSPI0_GPIO0_ALT|BSPI0_GPIO0_INTTL|BSPI0_GPIO0_OUTPP);
|
reg16 |= (BSPI0_GPIO0_ALT | BSPI0_GPIO0_INTTL |
|
||||||
|
BSPI0_GPIO0_OUTPP);
|
||||||
putreg16(reg16, STR71X_GPIO0_PC0);
|
putreg16(reg16, STR71X_GPIO0_PC0);
|
||||||
|
|
||||||
reg16 = getreg16(STR71X_GPIO0_PC1);
|
reg16 = getreg16(STR71X_GPIO0_PC1);
|
||||||
reg16 &= ~BSPI0_GPIO0_ALL;
|
reg16 &= ~BSPI0_GPIO0_ALL;
|
||||||
reg16 |= (BSPI0_GPIO0_ALT|BSPI0_GPIO0_INCMOS);
|
reg16 |= (BSPI0_GPIO0_ALT | BSPI0_GPIO0_INCMOS);
|
||||||
putreg16(reg16, STR71X_GPIO0_PC1);
|
putreg16(reg16, STR71X_GPIO0_PC1);
|
||||||
|
|
||||||
reg16 = getreg16(STR71X_GPIO0_PC2);
|
reg16 = getreg16(STR71X_GPIO0_PC2);
|
||||||
reg16 &= ~BSPI0_GPIO0_ALL;
|
reg16 &= ~BSPI0_GPIO0_ALL;
|
||||||
reg16 |= (BSPI0_GPIO0_ALT|BSPI0_GPIO0_OUTPP);
|
reg16 |= (BSPI0_GPIO0_ALT | BSPI0_GPIO0_OUTPP);
|
||||||
putreg16(reg16, STR71X_GPIO0_PC2);
|
putreg16(reg16, STR71X_GPIO0_PC2);
|
||||||
|
|
||||||
/* Start with enc28j60 de-selected (active low) and in
|
/* Start with enc28j60 de-selected (active low) and in
|
||||||
@@ -1039,7 +1058,7 @@ FAR struct spi_dev_s *str71_spibus_initialize(int port)
|
|||||||
#ifdef BSPI0_GPIO1_ALL
|
#ifdef BSPI0_GPIO1_ALL
|
||||||
reg16 = getreg16(STR71X_GPIO1_PC0);
|
reg16 = getreg16(STR71X_GPIO1_PC0);
|
||||||
reg16 &= ~BSPI0_GPIO1_ALL;
|
reg16 &= ~BSPI0_GPIO1_ALL;
|
||||||
reg16 |= (BSPI0_GPIO1_INTTL|BSPI0_GPIO1_OUTPP);
|
reg16 |= (BSPI0_GPIO1_INTTL | BSPI0_GPIO1_OUTPP);
|
||||||
putreg16(reg16, STR71X_GPIO1_PC0);
|
putreg16(reg16, STR71X_GPIO1_PC0);
|
||||||
|
|
||||||
reg16 = getreg16(STR71X_GPIO1_PC1);
|
reg16 = getreg16(STR71X_GPIO1_PC1);
|
||||||
@@ -1080,17 +1099,18 @@ FAR struct spi_dev_s *str71_spibus_initialize(int port)
|
|||||||
|
|
||||||
reg16 = getreg16(STR71X_GPIO0_PC0);
|
reg16 = getreg16(STR71X_GPIO0_PC0);
|
||||||
reg16 &= ~BSPI1_GPIO0_ALL;
|
reg16 &= ~BSPI1_GPIO0_ALL;
|
||||||
reg16 |= (BSPI1_GPIO0_ALT|BSPI1_GPIO0_INTTL|BSPI1_GPIO0_OUTPP);
|
reg16 |= (BSPI1_GPIO0_ALT | BSPI1_GPIO0_INTTL |
|
||||||
|
BSPI1_GPIO0_OUTPP);
|
||||||
putreg16(reg16, STR71X_GPIO0_PC0);
|
putreg16(reg16, STR71X_GPIO0_PC0);
|
||||||
|
|
||||||
reg16 = getreg16(STR71X_GPIO0_PC1);
|
reg16 = getreg16(STR71X_GPIO0_PC1);
|
||||||
reg16 &= ~BSPI1_GPIO0_ALL;
|
reg16 &= ~BSPI1_GPIO0_ALL;
|
||||||
reg16 |= (BSPI1_GPIO0_ALT|BSPI1_GPIO0_INCMOS);
|
reg16 |= (BSPI1_GPIO0_ALT | BSPI1_GPIO0_INCMOS);
|
||||||
putreg16(reg16, STR71X_GPIO0_PC1);
|
putreg16(reg16, STR71X_GPIO0_PC1);
|
||||||
|
|
||||||
reg16 = getreg16(STR71X_GPIO0_PC2);
|
reg16 = getreg16(STR71X_GPIO0_PC2);
|
||||||
reg16 &= ~BSPI1_GPIO0_ALL;
|
reg16 &= ~BSPI1_GPIO0_ALL;
|
||||||
reg16 |= (BSPI1_GPIO0_ALT|BSPI1_GPIO0_OUTPP);
|
reg16 |= (BSPI1_GPIO0_ALT | BSPI1_GPIO0_OUTPP);
|
||||||
putreg16(reg16, STR71X_GPIO0_PC2);
|
putreg16(reg16, STR71X_GPIO0_PC2);
|
||||||
|
|
||||||
/* Start with MMC/SD disabled */
|
/* Start with MMC/SD disabled */
|
||||||
@@ -1120,7 +1140,7 @@ FAR struct spi_dev_s *str71_spibus_initialize(int port)
|
|||||||
#ifdef BSPI1_GPIO1_ALL
|
#ifdef BSPI1_GPIO1_ALL
|
||||||
reg16 = getreg16(STR71X_GPIO1_PC0);
|
reg16 = getreg16(STR71X_GPIO1_PC0);
|
||||||
reg16 &= ~BSPI1_GPIO1_ALL;
|
reg16 &= ~BSPI1_GPIO1_ALL;
|
||||||
reg16 |= (BSPI1_GPIO1_INTTL|BSPI1_GPIO1_OUTPP);
|
reg16 |= (BSPI1_GPIO1_INTTL | BSPI1_GPIO1_OUTPP);
|
||||||
putreg16(reg16, STR71X_GPIO1_PC0);
|
putreg16(reg16, STR71X_GPIO1_PC0);
|
||||||
|
|
||||||
reg16 = getreg16(STR71X_GPIO1_PC1);
|
reg16 = getreg16(STR71X_GPIO1_PC1);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* boards/launchxl-tms57004/include/board.h
|
* boards/arm/tms570/launchxl-tms57004/include/board.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
@@ -31,14 +31,14 @@
|
|||||||
* 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 __BOARDS_ARM_LAUNCHXL_TMS57004_INCLUDE_BOARD_H
|
#ifndef __BOARDS_ARM_TMS570_LAUNCHXL_TMS57004_INCLUDE_BOARD_H
|
||||||
#define __BOARDS_ARM_LAUNCHXL_TMS57004_INCLUDE_BOARD_H
|
#define __BOARDS_ARM_TMS570_LAUNCHXL_TMS57004_INCLUDE_BOARD_H
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
@@ -47,11 +47,12 @@
|
|||||||
# include <stdbool.h>
|
# include <stdbool.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
/* Clocking *****************************************************************/
|
||||||
|
|
||||||
/* Clocking *************************************************************************/
|
|
||||||
/* The LaunchXL-TMS57004 has a 16 MHz external crystal. */
|
/* The LaunchXL-TMS57004 has a 16 MHz external crystal. */
|
||||||
|
|
||||||
#define BOARD_FCLKIN_FREQUENCY 16000000 /* 16 MHz crystal frequency */
|
#define BOARD_FCLKIN_FREQUENCY 16000000 /* 16 MHz crystal frequency */
|
||||||
@@ -137,10 +138,10 @@
|
|||||||
#define BOARD_RWAIT 1 /* One read access wait state */
|
#define BOARD_RWAIT 1 /* One read access wait state */
|
||||||
#define BOARD_EWAIT 4 /* Four wait states for EEPROM access */
|
#define BOARD_EWAIT 4 /* Four wait states for EEPROM access */
|
||||||
|
|
||||||
/* PIN Multiplexor Initializer ******************************************************/
|
/* PIN Multiplexor Initializer **********************************************/
|
||||||
|
|
||||||
/* You may specify one alternative from each set (the first is the default and,
|
/* You may specify one alternative from each set (the first is the default
|
||||||
* hence, could probably be omitted):
|
* and, hence, could probably be omitted):
|
||||||
*
|
*
|
||||||
* 1. {GIOA0, SPI3nCS3}
|
* 1. {GIOA0, SPI3nCS3}
|
||||||
* 2. {GIOA1, SPI3nCS2}
|
* 2. {GIOA1, SPI3nCS2}
|
||||||
@@ -178,7 +179,8 @@
|
|||||||
PINMUX_MIBSPI1NENA_PIN, \
|
PINMUX_MIBSPI1NENA_PIN, \
|
||||||
PINMUX_MIBSPI1NCS1_PIN
|
PINMUX_MIBSPI1NCS1_PIN
|
||||||
|
|
||||||
/* LED definitions ******************************************************************/
|
/* LED definitions **********************************************************/
|
||||||
|
|
||||||
/* LEDs
|
/* LEDs
|
||||||
*
|
*
|
||||||
* The launchpad has several LEDs:
|
* The launchpad has several LEDs:
|
||||||
@@ -190,8 +192,9 @@
|
|||||||
* - Two white, user LEDs labeled D12 that connects to the NHET08
|
* - Two white, user LEDs labeled D12 that connects to the NHET08
|
||||||
* pin and D11 that connects to GIOA2.
|
* pin and D11 that connects to GIOA2.
|
||||||
*
|
*
|
||||||
* NHET08 is one of 32 N2HET pins than can be available to the user if not used by
|
* NHET08 is one of 32 N2HET pins than can be available to the user if not
|
||||||
* N2HET. This implementation, however, uses only the single LED driven by GIOA2.
|
* used by N2HET.
|
||||||
|
* This implementation, however, uses only the single LED driven by GIOA2.
|
||||||
* That LED is tied to ground and illuminated with a high level output value.
|
* That LED is tied to ground and illuminated with a high level output value.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -217,7 +220,8 @@
|
|||||||
*
|
*
|
||||||
* ---------------------- ---------------------------- ------
|
* ---------------------- ---------------------------- ------
|
||||||
* SYMBOL Meaning LED
|
* SYMBOL Meaning LED
|
||||||
* ---------------------- ---------------------------- ------ */
|
* ---------------------- ---------------------------- ------
|
||||||
|
*/
|
||||||
|
|
||||||
#define LED_STARTED 0 /* NuttX has been started OFF */
|
#define LED_STARTED 0 /* NuttX has been started OFF */
|
||||||
#define LED_HEAPALLOCATE 0 /* Heap has been allocated OFF */
|
#define LED_HEAPALLOCATE 0 /* Heap has been allocated OFF */
|
||||||
@@ -234,13 +238,16 @@
|
|||||||
* 2Hz, then a fatal error has been detected and the system has halted.
|
* 2Hz, then a fatal error has been detected and the system has halted.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Button definitions ***************************************************************/
|
/* Button definitions *******************************************************/
|
||||||
|
|
||||||
/* Buttons
|
/* Buttons
|
||||||
*
|
*
|
||||||
* The launchpad has three mechanical buttons. Two of these are reset buttons: One
|
* The launchpad has three mechanical buttons.
|
||||||
* button is labeled PORRST performs a power-on reset and one labeled RST performs
|
* Two of these are reset buttons:
|
||||||
* an MCU reset. Only one button is available for general software usage. That
|
* One button is labeled PORRST performs a power-on reset and one labeled
|
||||||
* button is labeled GIOA7 and is, obviously, sensed on GIOA7.
|
* RST performs an MCU reset.
|
||||||
|
* Only one button is available for general software usage.
|
||||||
|
* That button is labeled GIOA7 and is, obviously, sensed on GIOA7.
|
||||||
*
|
*
|
||||||
* GIOA7 is tied to ground, but will be pulled high if the GIOA7 button is
|
* GIOA7 is tied to ground, but will be pulled high if the GIOA7 button is
|
||||||
* depressed.
|
* depressed.
|
||||||
@@ -251,9 +258,9 @@
|
|||||||
|
|
||||||
#define BUTTON_GIOA7_BIT (1 << BUTTON_GIOA7)
|
#define BUTTON_GIOA7_BIT (1 << BUTTON_GIOA7)
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Public Data
|
* Public Data
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
|
|
||||||
@@ -266,9 +273,9 @@ extern "C"
|
|||||||
#define EXTERN extern
|
#define EXTERN extern
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Public Function Prototypes
|
* Public Function Prototypes
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#undef EXTERN
|
#undef EXTERN
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
@@ -276,4 +283,4 @@ extern "C"
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* __ASSEMBLY__ */
|
#endif /* __ASSEMBLY__ */
|
||||||
#endif /* __BOARDS_ARM_LAUNCHXL_TMS57004_INCLUDE_BOARD_H */
|
#endif /* __BOARDS_ARM_TMS570_LAUNCHXL_TMS57004_INCLUDE_BOARD_H */
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
############################################################################
|
############################################################################
|
||||||
# boards/launchxl-tms57004/scripts/Make.defs
|
# boards/arm/tms570/launchxl-tms57004/scripts/Make.defs
|
||||||
#
|
#
|
||||||
# Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved.
|
# Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved.
|
||||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user