board/circuit-express: Add usbnsh configuration

This commit is contained in:
Brennan Ashton 2021-05-15 23:45:48 -07:00 committed by Alan Carvalho de Assis
parent 2972e7015e
commit 4a2d4c1950
4 changed files with 171 additions and 0 deletions

View File

@ -0,0 +1,66 @@
#
# This file is autogenerated: PLEASE DO NOT EDIT IT.
#
# You can use "make menuconfig" to make any modifications to the installed .config file.
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
# modifications.
#
# CONFIG_DISABLE_POSIX_TIMERS is not set
# CONFIG_NSH_DISABLEBG is not set
# CONFIG_NSH_DISABLESCRIPT is not set
# CONFIG_NSH_DISABLE_CMP is not set
# CONFIG_NSH_DISABLE_DD is not set
# CONFIG_NSH_DISABLE_EXEC is not set
# CONFIG_NSH_DISABLE_EXIT is not set
# CONFIG_NSH_DISABLE_GET is not set
# CONFIG_NSH_DISABLE_HEXDUMP is not set
# CONFIG_NSH_DISABLE_IFCONFIG is not set
# CONFIG_NSH_DISABLE_ITEF is not set
# CONFIG_NSH_DISABLE_LOOPS is not set
# CONFIG_NSH_DISABLE_LOSETUP is not set
# CONFIG_NSH_DISABLE_MB is not set
# CONFIG_NSH_DISABLE_MKRD is not set
# CONFIG_NSH_DISABLE_PS is not set
# CONFIG_NSH_DISABLE_PUT is not set
# CONFIG_NSH_DISABLE_SEMICOLON is not set
# CONFIG_NSH_DISABLE_WGET is not set
# CONFIG_NSH_DISABLE_XD is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="circuit-express"
CONFIG_ARCH_BOARD_CIRCUIT_EXPRESS=y
CONFIG_ARCH_CHIP="samd2l2"
CONFIG_ARCH_CHIP_SAMD21G18A=y
CONFIG_ARCH_CHIP_SAMD2X=y
CONFIG_ARCH_STACKDUMP=y
CONFIG_BOARD_LOOPSPERMSEC=3410
CONFIG_BUILTIN=y
CONFIG_CDCACM=y
CONFIG_DEBUG_FULLOPT=y
CONFIG_DEBUG_SYMBOLS=y
CONFIG_DEFAULT_SMALL=y
CONFIG_MAX_TASKS=16
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_USBCONSOLE=y
CONFIG_PREALLOC_TIMERS=4
CONFIG_PTHREAD_STACK_DEFAULT=1536
CONFIG_RAM_SIZE=32768
CONFIG_RAM_START=0x20000000
CONFIG_RAW_BINARY=y
CONFIG_RR_INTERVAL=200
CONFIG_SAMD2L2_SERCOM4=y
CONFIG_SAMD2L2_USB=y
CONFIG_SCHED_WAITPID=y
CONFIG_SDCLONE_DISABLE=y
CONFIG_STACK_COLORATION=y
CONFIG_START_DAY=21
CONFIG_START_MONTH=6
CONFIG_START_YEAR=2015
CONFIG_SYSTEM_NSH=y
CONFIG_TASK_NAME_SIZE=0
CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=1536
CONFIG_USART4_RXBUFSIZE=64
CONFIG_USART4_SERIAL_CONSOLE=y
CONFIG_USART4_TXBUFSIZE=64
CONFIG_USBDEV=y
CONFIG_USERMAIN_STACKSIZE=1536
CONFIG_USER_ENTRYPOINT="nsh_main"

View File

@ -349,6 +349,20 @@
#define BOARD_SERCOM4_FREQUENCY BOARD_GCLK0_FREQUENCY
/* USB definitions **********************************************************/
/* This is the source clock generator for the GCLK_USB clock
*/
#define BOARD_USB_GCLKGEN 0
#define BOARD_USB_FREQUENCY BOARD_GCLK0_FREQUENCY
/* default USB Pad calibration (not used yet by USB driver) */
#define BOARD_USB_PADCAL_P 29
#define BOARD_USB_PADCAL_N 5
#define BOARD_USB_PADCAL_TRIM 3
/* LED definitions **********************************************************/
/* There are 2 LEDs on board the Adafruit Circuit Express board in addition

View File

@ -34,4 +34,8 @@ ifeq ($(CONFIG_LIB_BOARDCTL),y)
CSRCS += sam_appinit.c
endif
ifeq ($(CONFIG_USBDEV),y)
CSRCS += sam_usb.c
endif
include $(TOPDIR)/boards/Board.mk

View File

@ -0,0 +1,87 @@
/****************************************************************************
* boards/arm/samd2l2/circuit-express/src/sam_usb.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
#include <sched.h>
#include <errno.h>
#include <assert.h>
#include <debug.h>
#include <nuttx/usb/usbdev.h>
#include <nuttx/usb/usbhost.h>
#include <nuttx/usb/usbdev_trace.h>
#include "debug.h"
#include "chip.h"
#include "sam_port.h"
#include "saml_periphclks.h"
#include "circuit_express.h"
#if defined(CONFIG_SAMD2L2_USB)
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: sam_usbinitialize
*
* Description:
* Called from sam_boot very early in initialization to setup
* USB-related GPIO pins for the Circuit Express board.
*
* USB Ports
* The SAML21 features USB device and host:
*
*
****************************************************************************/
void weak_function sam_usbinitialize(void)
{
}
/****************************************************************************
* Name: sam_usbsuspend
*
* Description:
* Board logic must provide the sam_usbsuspend logic if the USBDEV driver
* is used.
* This function is called whenever the USB enters or leaves suspend mode.
* This is an opportunity for the board logic to shutdown clocks, power,
* etc. while the USB is suspended.
*
****************************************************************************/
#ifdef CONFIG_USBDEV
void sam_usb_suspend(FAR struct usbdev_s *dev, bool resume)
{
uinfo("board: resume: %d\n", resume);
}
#endif
#endif /* CONFIG_SAMDL_USB */