123 lines
4.4 KiB
C
123 lines
4.4 KiB
C
/****************************************************************************
|
|
* boards/arm/samd2l2/arduino-m0/src/arduino_m0.h
|
|
*
|
|
* 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.
|
|
*
|
|
****************************************************************************/
|
|
|
|
#ifndef __BOARDS_ARM_SAMD2L2_ARDUINO_M0_SRC_ARDUINO_M0_H
|
|
#define __BOARDS_ARM_SAMD2L2_ARDUINO_M0_SRC_ARDUINO_M0_H
|
|
|
|
/****************************************************************************
|
|
* Included Files
|
|
****************************************************************************/
|
|
|
|
#include <nuttx/config.h>
|
|
#include <nuttx/compiler.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <arch/irq.h>
|
|
#include <nuttx/irq.h>
|
|
|
|
#include "sam_config.h"
|
|
#include "sam_pinmap.h"
|
|
|
|
/****************************************************************************
|
|
* Pre-processor Definitions
|
|
****************************************************************************/
|
|
|
|
/* LEDs:
|
|
* There is a LED on board the Arduino M0 board.
|
|
*
|
|
* This LED is controlled by PA17 and the LED can be activated by driving
|
|
* PA17 to High.
|
|
*
|
|
* When CONFIG_ARCH_LEDS is defined in the NuttX configuration, NuttX will
|
|
* control the LED as follows:
|
|
*
|
|
* SYMBOL Meaning LED
|
|
* ------------------- ----------------------- ------
|
|
* LED_STARTED NuttX has been started OFF
|
|
* LED_HEAPALLOCATE Heap has been allocated OFF
|
|
* LED_IRQSENABLED Interrupts enabled OFF
|
|
* LED_STACKCREATED Idle stack created ON
|
|
* LED_INIRQ In an interrupt N/C
|
|
* LED_SIGNAL In a signal handler N/C
|
|
* LED_ASSERTION An assertion failed N/C
|
|
* LED_PANIC The system has crashed FLASH
|
|
*
|
|
* Thus if the LED is statically on, NuttX has successfully booted and is,
|
|
* apparently, running normally. If the LED is flashing at approximately
|
|
* 2Hz, then a fatal error has been detected and the system has halted.
|
|
*/
|
|
|
|
#define PORT_STATUS_LED (PORT_OUTPUT | PORT_PULL_NONE | PORT_OUTPUT_SET | \
|
|
PORTA | PORT_PIN17)
|
|
|
|
/****************************************************************************
|
|
* Public Types
|
|
****************************************************************************/
|
|
|
|
/****************************************************************************
|
|
* Public Data
|
|
****************************************************************************/
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
/****************************************************************************
|
|
* Public Functions Definitions
|
|
****************************************************************************/
|
|
|
|
/****************************************************************************
|
|
* Name: sam_bringup
|
|
*
|
|
* Description:
|
|
* Perform architecture-specific initialization
|
|
*
|
|
* CONFIG_BOARD_LATE_INITIALIZE=y :
|
|
* Called from board_late_initialize().
|
|
*
|
|
* CONFIG_BOARD_LATE_INITIALIZE=y && CONFIG_BOARDCTL=y :
|
|
* Called from the NSH library
|
|
*
|
|
****************************************************************************/
|
|
|
|
int sam_bringup(void);
|
|
|
|
/****************************************************************************
|
|
* Name: sam_adc_setup
|
|
*
|
|
* Description:
|
|
* Initialize ADC and register the ADC driver.
|
|
*
|
|
****************************************************************************/
|
|
|
|
int sam_adc_setup(void);
|
|
|
|
/****************************************************************************
|
|
* Name: sam_spidev_initialize
|
|
*
|
|
* Description:
|
|
* Called to configure SPI chip select PORT pins for the SAM3U-EK board.
|
|
*
|
|
****************************************************************************/
|
|
|
|
void weak_function sam_spidev_initialize(void);
|
|
|
|
#endif /* __ASSEMBLY__ */
|
|
#endif /* __BOARDS_ARM_SAMD2L2_ARDUINO_M0_SRC_ARDUINO_M0_H */
|