Skip to content

Commit

Permalink
Merged in alinjerpelea/nuttx (pull request #925)
Browse files Browse the repository at this point in the history
configs: spresense: add MSC and USB Composite device

* configs: spresense: add USB Composite device

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* configs: spresense: add usbmsc configuration

    the usbmsc support has been added and we can add an configuration
    for spresense board

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* configs: spresense: add button template

    Spresense board does not have buttons and this is a template
    for gpio buttons that can be connected on the external header

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

Approved-by: Gregory Nutt <gnutt@nuttx.org>
  • Loading branch information
jerpelea authored and gregory-nutt committed Jul 2, 2019
1 parent 574595d commit 79e79f0
Show file tree
Hide file tree
Showing 4 changed files with 472 additions and 0 deletions.
8 changes: 8 additions & 0 deletions configs/spresense/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ CSRCS += cxd56_userleds.c
endif
endif

ifeq ($(CONFIG_ARCH_BUTTONS),y)
CSRCS += cxd56_buttons.c
endif

ifeq ($(CONFIG_CXD56_GPIO_IRQ),y)
CSRCS += cxd56_gpioif.c
endif
Expand Down Expand Up @@ -100,6 +104,10 @@ ifeq ($(CONFIG_USBMSC),y)
CSRCS += cxd56_usbmsc.c
endif

ifeq ($(CONFIG_USBDEV_COMPOSITE),y)
CSRCS += cxd56_composite.c
endif

ifeq ($(CONFIG_NETDEVICES),y)
CSRCS += cxd56_netinit.c
endif
Expand Down
96 changes: 96 additions & 0 deletions configs/spresense/src/cxd56_buttons.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/****************************************************************************
* configs/spresense/src/cxd56_buttons.c
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/

/****************************************************************************
* Included Files
****************************************************************************/

#include <nuttx/config.h>

#include <stdint.h>
#include <stdbool.h>

#include <debug.h>
#include <nuttx/arch.h>
#include <nuttx/board.h>
#include <nuttx/irq.h>

#include <arch/board/board.h>

#include "cxd56_gpio.h"
#include "cxd56_gpioint.h"
#include "cxd56_pinconfig.h"

/****************************************************************************
* Pre-processor Definitions
****************************************************************************/

/****************************************************************************
* Public Functions
****************************************************************************/

/* Below functions are template to support the Board button for NuttX original
* feature. If you support the feature, copy this file into your board
* directory and implement the contents.
*/

/****************************************************************************
* Name: board_button_initialize
****************************************************************************/

void board_button_initialize(void)
{
}

/****************************************************************************
* Name: board_buttons
****************************************************************************/

uint32_t board_buttons(void)
{
uint8_t ret = 0;
return ret;
}

/****************************************************************************
* Name: board_button_irq
****************************************************************************/

#ifdef CONFIG_ARCH_IRQBUTTONS
int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg)
{
return OK;
}
#endif
Loading

0 comments on commit 79e79f0

Please sign in to comment.