mirror of
https://github.com/apache/nuttx.git
synced 2026-05-20 20:44:39 +08:00
SAM4S: Add pin multiplexing definitions
This commit is contained in:
@@ -58,7 +58,7 @@
|
||||
#define SAM_PID_PMC (5) /* Power Management Controller */
|
||||
#define SAM_PID_EEFC0 (6) /* Enhanced Embedded Flash Controller 0 */
|
||||
#define SAM_PID_EEFC1 (7) /* Enhanced Embedded Flash Controller 1 */
|
||||
#define SAM_PID_UART (8) /* Universal Asynchronous Receiver Transmitter */
|
||||
#define SAM_PID_UART0 (8) /* Universal Asynchronous Receiver Transmitter */
|
||||
#define SAM_PID_SMC (9) /* Static Memory Controller */
|
||||
#define SAM_PID_PIOA (10) /* Parallel I/O Controller A */
|
||||
#define SAM_PID_PIOB (11) /* Parallel I/O Controller B */
|
||||
@@ -92,7 +92,7 @@
|
||||
#define SAM_IRQ_PMC (SAM_IRQ_EXTINT+SAM_PID_PMC) /* Power Management Controller */
|
||||
#define SAM_IRQ_EEFC0 (SAM_IRQ_EXTINT+SAM_PID_EEFC0) /* Enhanced Embedded Flash Controller 0 */
|
||||
#define SAM_IRQ_EEFC1 (SAM_IRQ_EXTINT+SAM_PID_EEFC1) /* Enhanced Embedded Flash Controller 1 */
|
||||
#define SAM_IRQ_UART (SAM_IRQ_EXTINT+SAM_PID_UART) /* Universal Asynchronous Receiver Transmitter */
|
||||
#define SAM_IRQ_UART0 (SAM_IRQ_EXTINT+SAM_PID_UART0) /* Universal Asynchronous Receiver Transmitter */
|
||||
#define SAM_IRQ_SMC (SAM_IRQ_EXTINT+SAM_PID_SMC) /* Static Memory Controller */
|
||||
#define SAM_IRQ_PIOA (SAM_IRQ_EXTINT+SAM_PID_PIOA) /* Parallel I/O Controller A */
|
||||
#define SAM_IRQ_PIOB (SAM_IRQ_EXTINT+SAM_PID_PIOB) /* Parallel I/O Controller B */
|
||||
|
||||
@@ -122,12 +122,12 @@
|
||||
#define GPIO_MCI_DA (GPIO_PERIPHA|GPIO_CFG_PULLUP|GPIO_PORT_PIOA|GPIO_PIN4)
|
||||
#define GPIO_MCI_DAT0IN (GPIO_INPUT|GPIO_CFG_PULLUP|GPIO_PORT_PIOA|GPIO_PIN5)
|
||||
|
||||
#define GPIO_PWMC_PWMH0 (GPIO_PERIPHA|GPIO_CFG_DEFAULT|GPIO_PORT_PIOB|GPIO_PIN0)
|
||||
#define GPIO_PWMC_PWML0 (GPIO_PERIPHB|GPIO_CFG_DEFAULT|GPIO_PORT_PIOA|GPIO_PIN7)
|
||||
#define GPIO_PWMC_PWMH1 (GPIO_PERIPHA|GPIO_CFG_DEFAULT|GPIO_PORT_PIOB|GPIO_PIN1)
|
||||
#define GPIO_PWMC_PWML1 (GPIO_PERIPHB|GPIO_CFG_DEFAULT|GPIO_PORT_PIOA|GPIO_PIN8)
|
||||
#define GPIO_PWMC_PWMH2 (GPIO_PERIPHA|GPIO_CFG_DEFAULT|GPIO_PORT_PIOB|GPIO_PIN2)
|
||||
#define GPIO_PWMC_PWML2 (GPIO_PERIPHB|GPIO_CFG_DEFAULT|GPIO_PORT_PIOA|GPIO_PIN9)
|
||||
#define GPIO_PWM0_H (GPIO_PERIPHA|GPIO_CFG_DEFAULT|GPIO_PORT_PIOB|GPIO_PIN0)
|
||||
#define GPIO_PWM0_L (GPIO_PERIPHB|GPIO_CFG_DEFAULT|GPIO_PORT_PIOA|GPIO_PIN7)
|
||||
#define GPIO_PWM1_H (GPIO_PERIPHA|GPIO_CFG_DEFAULT|GPIO_PORT_PIOB|GPIO_PIN1)
|
||||
#define GPIO_PWM1_L (GPIO_PERIPHB|GPIO_CFG_DEFAULT|GPIO_PORT_PIOA|GPIO_PIN8)
|
||||
#define GPIO_PWM2_H (GPIO_PERIPHA|GPIO_CFG_DEFAULT|GPIO_PORT_PIOB|GPIO_PIN2)
|
||||
#define GPIO_PWM2_L (GPIO_PERIPHB|GPIO_CFG_DEFAULT|GPIO_PORT_PIOA|GPIO_PIN9)
|
||||
|
||||
#define GPIO_SPI0_MISO (GPIO_PERIPHA|GPIO_CFG_DEFAULT|GPIO_PORT_PIOA|GPIO_PIN13)
|
||||
#define GPIO_SPI0_MOSI (GPIO_PERIPHA|GPIO_CFG_DEFAULT|GPIO_PORT_PIOA|GPIO_PIN14)
|
||||
@@ -149,13 +149,13 @@
|
||||
|
||||
#define GPIO_PCK0 (GPIO_PERIPHB|GPIO_CFG_DEFAULT|GPIO_PORT_PIOA|GPIO_PIN21)
|
||||
|
||||
#define GPIO_TWI_TWD0 (GPIO_PERIPHA|GPIO_CFG_DEFAULT|GPIO_PORT_PIOA|GPIO_PIN9)
|
||||
#define GPIO_TWI_TWCK0 (GPIO_PERIPHA|GPIO_CFG_DEFAULT|GPIO_PORT_PIOA|GPIO_PIN10)
|
||||
#define GPIO_TWI_TWD1 (GPIO_PERIPHA|GPIO_CFG_DEFAULT|GPIO_PORT_PIOA|GPIO_PIN24)
|
||||
#define GPIO_TWI_TWCK1 (GPIO_PERIPHA|GPIO_CFG_DEFAULT|GPIO_PORT_PIOA|GPIO_PIN25)
|
||||
#define GPIO_TWI0_D (GPIO_PERIPHA|GPIO_CFG_DEFAULT|GPIO_PORT_PIOA|GPIO_PIN9)
|
||||
#define GPIO_TWI0_CK (GPIO_PERIPHA|GPIO_CFG_DEFAULT|GPIO_PORT_PIOA|GPIO_PIN10)
|
||||
#define GPIO_TW1I_D (GPIO_PERIPHA|GPIO_CFG_DEFAULT|GPIO_PORT_PIOA|GPIO_PIN24)
|
||||
#define GPIO_TWI1_CK (GPIO_PERIPHA|GPIO_CFG_DEFAULT|GPIO_PORT_PIOA|GPIO_PIN25)
|
||||
|
||||
#define GPIO_UART_TXD (GPIO_PERIPHA|GPIO_CFG_DEFAULT|GPIO_PORT_PIOA|GPIO_PIN12)
|
||||
#define GPIO_UART_RXD (GPIO_PERIPHA|GPIO_CFG_DEFAULT|GPIO_PORT_PIOA|GPIO_PIN11)
|
||||
#define GPIO_UART0_TXD (GPIO_PERIPHA|GPIO_CFG_DEFAULT|GPIO_PORT_PIOA|GPIO_PIN12)
|
||||
#define GPIO_UART0_RXD (GPIO_PERIPHA|GPIO_CFG_DEFAULT|GPIO_PORT_PIOA|GPIO_PIN11)
|
||||
|
||||
#define GPIO_USART0_CTS (GPIO_PERIPHA|GPIO_CFG_DEFAULT|GPIO_PORT_PIOB|GPIO_PIN8)
|
||||
#define GPIO_USART0_DCD (GPIO_PERIPHB|GPIO_CFG_DEFAULT|GPIO_PORT_PIOB|GPIO_PIN11)
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
VECTOR(sam_pmc, SAM_IRQ_PMC) /* Vector 16+5: Power Management Controller */
|
||||
VECTOR(sam_eefc0, SAM_IRQ_EEFC0) /* Vector 16+6: Enhanced Embedded Flash Controller 0 */
|
||||
VECTOR(sam_eefc1, SAM_IRQ_EEFC1) /* Vector 16+7: Enhanced Embedded Flash Controller 1 */
|
||||
VECTOR(sam_uart, SAM_IRQ_UART) /* Vector 16+8: Universal Asynchronous Receiver Transmitter */
|
||||
VECTOR(sam_uart0, SAM_IRQ_UART0) /* Vector 16+8: Universal Asynchronous Receiver Transmitter */
|
||||
VECTOR(sam_smc, SAM_IRQ_SMC) /* Vector 16+9: Static Memory Controller */
|
||||
VECTOR(sam_pioa, SAM_IRQ_PIOA) /* Vector 16+10: Parallel I/O Controller A */
|
||||
VECTOR(sam_piob, SAM_IRQ_PIOB) /* Vector 16+11: Parallel I/O Controller B */
|
||||
|
||||
@@ -0,0 +1,314 @@
|
||||
/************************************************************************************
|
||||
* arch/arm/src/sam34/chip/sam4s_pinmap.h
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* 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 NuttX 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.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_SAM34_CHIP_SAM4S_PINMAP_H
|
||||
#define __ARCH_ARM_SRC_SAM34_CHIP_SAM4S_PINMAP_H
|
||||
|
||||
/************************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include "chip.h"
|
||||
#include "sam_gpio.h"
|
||||
|
||||
/************************************************************************************
|
||||
* Definitions
|
||||
************************************************************************************/
|
||||
|
||||
/* GPIO pin definitions *************************************************************/
|
||||
/* Alternate Pin Functions.
|
||||
*
|
||||
* Alternative pin selections are provided with a numeric suffix like _1, _2, etc.
|
||||
* Drivers, however, will use the pin selection without the numeric suffix.
|
||||
* Additional definitions are required in the board.h file. For example, if we
|
||||
* wanted the programmable clock output PCK0 on PA6, then the following definition
|
||||
* should appear in the board.h header file for that board:
|
||||
*
|
||||
* #define GPIO_PCK0 GPIO_PCK0_1
|
||||
*
|
||||
* The driver will then automatically configre PA6 as the PCK0 pin.
|
||||
*/
|
||||
|
||||
/* WARNING!!! WARNING!!! WARNING!!! WARNING!!! WARNING!!! WARNING!!! WARNING!!!
|
||||
* Additional effort is required to select specific GPIO options such as frequency,
|
||||
* open-drain/push-pull, and pull-up/down! Just the basics are defined for most
|
||||
* pins in this file.
|
||||
*/
|
||||
|
||||
/* 12-bit Analog-to-Digital Conververt (ADC) */
|
||||
|
||||
#define GPIO_ADC0_AD0 (GPIO_INPUT | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN17)
|
||||
#define GPIO_ADC0_AD1 (GPIO_INPUT | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN18)
|
||||
#define GPIO_ADC0_AD2 (GPIO_INPUT | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN19)
|
||||
#define GPIO_ADC0_AD3 (GPIO_INPUT | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN20)
|
||||
#define GPIO_ADC0_AD4 (GPIO_INPUT | GPIO_CFG_DEFAULT | PIO_PORT_PIOB | GPIO_PIN0)
|
||||
#define GPIO_ADC0_AD5 (GPIO_INPUT | GPIO_CFG_DEFAULT | PIO_PORT_PIOB | GPIO_PIN1)
|
||||
#define GPIO_ADC0_AD6 (GPIO_INPUT | GPIO_CFG_DEFAULT | PIO_PORT_PIOB | GPIO_PIN2)
|
||||
#define GPIO_ADC0_AD7 (GPIO_INPUT | GPIO_CFG_DEFAULT | PIO_PORT_PIOB | GPIO_PIN3)
|
||||
#define GPIO_ADC0_AD8 (GPIO_INPUT | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN21)
|
||||
#define GPIO_ADC0_AD9 (GPIO_INPUT | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN22)
|
||||
#define GPIO_ADC0_AD10 (GPIO_INPUT | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN13)
|
||||
#define GPIO_ADC0_AD11 (GPIO_INPUT | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN15)
|
||||
#define GPIO_ADC0_AD12 (GPIO_INPUT | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN12)
|
||||
#define GPIO_ADC0_AD13 (GPIO_INPUT | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN29)
|
||||
#define GPIO_ADC0_AD14 (GPIO_INPUT | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN30)
|
||||
#define GPIO_ADC0_ADTRG (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN8)
|
||||
|
||||
/* Digital-to-Analog Convert (DAC) */
|
||||
|
||||
#define GPIO_DAC0 (GPIO_OUTPUT | GPIO_CFG_DEFAULT | PIO_PORT_PIOB | GPIO_PIN13)
|
||||
#define GPIO_DAC1 (GPIO_OUTPUT | GPIO_CFG_DEFAULT | PIO_PORT_PIOB | GPIO_PIN14)
|
||||
#define GPIO_DAC_DATRG (GPIO_PERIPHC | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN2)
|
||||
|
||||
/* High-Speed Multimedia Card Interface (HSMCI) */
|
||||
|
||||
#define GPIO_MCI_CK (GPIO_PERIPHC | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN29)
|
||||
#define GPIO_MCI_DA (GPIO_PERIPHC | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN28)
|
||||
#define GPIO_MCI_DAT0 (GPIO_PERIPHC | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN30)
|
||||
#define GPIO_MCI_DAT1 (GPIO_PERIPHC | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN31)
|
||||
#define GPIO_MCI_DAT2 (GPIO_PERIPHC | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN26)
|
||||
#define GPIO_MCI_DAT3 (GPIO_PERIPHC | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN27)
|
||||
|
||||
/* Programmable Clock Output */
|
||||
|
||||
#define GPIO_PCK0_1 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN6)
|
||||
#define GPIO_PCK0_2 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOB | GPIO_PIN13)
|
||||
#define GPIO_PCK1_1 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN17)
|
||||
#define GPIO_PCK1_2 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN21)
|
||||
#define GPIO_PCK2_1 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN18)
|
||||
#define GPIO_PCK2_2 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN31)
|
||||
#define GPIO_PCK2_3 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOB | GPIO_PIN3)
|
||||
|
||||
/* Pulse Width Modulation (PWM) */
|
||||
|
||||
#define GPIO_PWM0_FI (GPIO_PERIPHC | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN9)
|
||||
#define GPIO_PWM0_H_1 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN0)
|
||||
#define GPIO_PWM0_H_2 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOB | GPIO_PIN0)
|
||||
#define GPIO_PWM0_H_3 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN11)
|
||||
#define GPIO_PWM0_H_4 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN23)
|
||||
#define GPIO_PWM0_H_5 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN18)
|
||||
#define GPIO_PWM0_L_1 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN19)
|
||||
#define GPIO_PWM0_L_2 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOB | GPIO_PIN5)
|
||||
#define GPIO_PWM0_L_3 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN0)
|
||||
#define GPIO_PWM0_L_4 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN13)
|
||||
#define GPIO_PWM1_H_1 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN1)
|
||||
#define GPIO_PWM1_H_2 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOB | GPIO_PIN1)
|
||||
#define GPIO_PWM1_H_3 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN12)
|
||||
#define GPIO_PWM1_H_4 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN24)
|
||||
#define GPIO_PWM1_H_5 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN19)
|
||||
#define GPIO_PWM1_L_1 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN15)
|
||||
#define GPIO_PWM1_L_2 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOB | GPIO_PIN12)
|
||||
#define GPIO_PWM1_L_3 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN20)
|
||||
#define GPIO_PWM1_L_4 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN1)
|
||||
#define GPIO_PWM2_H_1 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN2)
|
||||
#define GPIO_PWM2_H_2 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN13)
|
||||
#define GPIO_PWM2_H_3 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN25)
|
||||
#define GPIO_PWM2_H_4 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOB | GPIO_PIN4)
|
||||
#define GPIO_PWM2_H_5 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN20)
|
||||
#define GPIO_PWM2_L_1 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN30)
|
||||
#define GPIO_PWM2_L_2 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOB | GPIO_PIN13)
|
||||
#define GPIO_PWM2_L_3 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN2)
|
||||
#define GPIO_PWM2_L_4 (GPIO_PERIPHC | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN16)
|
||||
#define GPIO_PWM3_H_1 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN14)
|
||||
#define GPIO_PWM3_H_2 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN7)
|
||||
#define GPIO_PWM3_H_3 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOB | GPIO_PIN14)
|
||||
#define GPIO_PWM3_H_4 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN21)
|
||||
#define GPIO_PWM3_H_5 (GPIO_PERIPHC | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN17)
|
||||
#define GPIO_PWM3_L_1 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN22)
|
||||
#define GPIO_PWM3_L_2 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN3)
|
||||
#define GPIO_PWM3_L_3 (GPIO_PERIPHC | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN15)
|
||||
|
||||
/* Static Memory Controller (SMC) */
|
||||
|
||||
#define GPIO_SMC_A0 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN18)
|
||||
#define GPIO_SMC_A1 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN19)
|
||||
#define GPIO_SMC_A2 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN20)
|
||||
#define GPIO_SMC_A3 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN21)
|
||||
#define GPIO_SMC_A4 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN22)
|
||||
#define GPIO_SMC_A5 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN23)
|
||||
#define GPIO_SMC_A6 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN24)
|
||||
#define GPIO_SMC_A7 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN25)
|
||||
#define GPIO_SMC_A8 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN26)
|
||||
#define GPIO_SMC_A9 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN27)
|
||||
#define GPIO_SMC_A10 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN28)
|
||||
#define GPIO_SMC_A11 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN29)
|
||||
#define GPIO_SMC_A12 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN30)
|
||||
#define GPIO_SMC_A13 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN31)
|
||||
#define GPIO_SMC_A14 (GPIO_PERIPHC | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN18)
|
||||
#define GPIO_SMC_A15 (GPIO_PERIPHC | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN19)
|
||||
#define GPIO_SMC_A16 (GPIO_PERIPHC | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN20)
|
||||
#define GPIO_SMC_A17 (GPIO_PERIPHC | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN0)
|
||||
#define GPIO_SMC_A18 (GPIO_PERIPHC | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN1)
|
||||
#define GPIO_SMC_A19 (GPIO_PERIPHC | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN23)
|
||||
#define GPIO_SMC_A20 (GPIO_PERIPHC | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN24)
|
||||
#define GPIO_SMC_A21 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN16)
|
||||
#define GPIO_SMC_A22 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN17)
|
||||
#define GPIO_SMC_A23 (GPIO_PERIPHC | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN25)
|
||||
#define GPIO_SMC_D0 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN0)
|
||||
#define GPIO_SMC_D1 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN1)
|
||||
#define GPIO_SMC_D2 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN2)
|
||||
#define GPIO_SMC_D3 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN3)
|
||||
#define GPIO_SMC_D4 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN4)
|
||||
#define GPIO_SMC_D5 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN5)
|
||||
#define GPIO_SMC_D6 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN6)
|
||||
#define GPIO_SMC_D7 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN7)
|
||||
#define GPIO_SMC_NANDALE (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN16)
|
||||
#define GPIO_SMC_NANDCLE (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN17)
|
||||
#define GPIO_SMC_NANDOE (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN9)
|
||||
#define GPIO_SMC_NANDWE (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN10)
|
||||
#define GPIO_SMC_NCS0 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN14)
|
||||
#define GPIO_SMC_NCS1 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN15)
|
||||
#define GPIO_SMC_NCS2 (GPIO_PERIPHC | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN22)
|
||||
#define GPIO_SMC_NCS3 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN12)
|
||||
#define GPIO_SMC_NRD (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN11)
|
||||
#define GPIO_SMC_NWAIT (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN13)
|
||||
#define GPIO_SMC_NWE (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN8)
|
||||
|
||||
/* Serial Peripheral Interface (SPI) */
|
||||
|
||||
#define GPIO_SPI0_MISO (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN12)
|
||||
#define GPIO_SPI0_MOSI (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN13)
|
||||
#define GPIO_SPI0_NPCS0 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN11)
|
||||
#define GPIO_SPI0_NPCS1_1 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN31)
|
||||
#define GPIO_SPI0_NPCS1_2 (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOB | GPIO_PIN14)
|
||||
#define GPIO_SPI0_NPCS1_3 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN9)
|
||||
#define GPIO_SPI0_NPCS1_4 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN4)
|
||||
#define GPIO_SPI0_NPCS2_1 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN10)
|
||||
#define GPIO_SPI0_NPCS2_2 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN30)
|
||||
#define GPIO_SPI0_NPCS2_3 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOB | GPIO_PIN2)
|
||||
#define GPIO_SPI0_NPCS3_1 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN22)
|
||||
#define GPIO_SPI0_NPCS3_2 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN3)
|
||||
#define GPIO_SPI0_NPCS3_3 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN5)
|
||||
#define GPIO_SPI0_SPCK (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN14)
|
||||
|
||||
/* Synchronous Serial Controller (SSC) */
|
||||
|
||||
#define GPIO_SSC_RD (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN18)
|
||||
#define GPIO_SSC_RF (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN20)
|
||||
#define GPIO_SSC_RK (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN19)
|
||||
#define GPIO_SSC_TD (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN17)
|
||||
#define GPIO_SSC_TF (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN15)
|
||||
#define GPIO_SSC_TK (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN16)
|
||||
|
||||
/* Timer/Counters (TC) */
|
||||
|
||||
#define GPIO_TC0_TCLK (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN4)
|
||||
#define GPIO_TC0_TIOA (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN0)
|
||||
#define GPIO_TC0_TIOB (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN1)
|
||||
#define GPIO_TC1_TCLK (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN28)
|
||||
#define GPIO_TC1_TIOA (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN15)
|
||||
#define GPIO_TC1_TIOB (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN16)
|
||||
#define GPIO_TC2_TCLK (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN29)
|
||||
#define GPIO_TC2_TIOA (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN26)
|
||||
#define GPIO_TC2_TIOB (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN27)
|
||||
#define GPIO_TC3_TCLK (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN25)
|
||||
#define GPIO_TC3_TIOA (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN23)
|
||||
#define GPIO_TC3_TIOB (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN24)
|
||||
#define GPIO_TC4_TCLK (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN28)
|
||||
#define GPIO_TC4_TIOA (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN26)
|
||||
#define GPIO_TC4_TIOB (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN27)
|
||||
#define GPIO_TC5_TCLK (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN31)
|
||||
#define GPIO_TC5_TIOA (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN29)
|
||||
#define GPIO_TC5_TIOB (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOC | GPIO_PIN30)
|
||||
|
||||
/* Two Wire Interface (TWI) */
|
||||
|
||||
#define GPIO_TWI0_CK (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN4)
|
||||
#define GPIO_TWI0_D (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN3)
|
||||
#define GPIO_TWI1_CK (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOB | GPIO_PIN5)
|
||||
#define GPIO_TWI1_D (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOB | GPIO_PIN4)
|
||||
|
||||
/* Universal Asynchronous Receiver Transceiver (UART) */
|
||||
|
||||
#define GPIO_UART0_RXD (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN9)
|
||||
#define GPIO_UART0_TXD (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN10)
|
||||
#define GPIO_UART1_RXD (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOB | GPIO_PIN2)
|
||||
#define GPIO_UART1_TXD (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOB | GPIO_PIN3)
|
||||
|
||||
/* Universal Synchronous Asynchronous Receiver Transmitter (USART) */
|
||||
|
||||
#define GPIO_USART0_CTS (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN8)
|
||||
#define GPIO_USART0_RTS (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN7)
|
||||
#define GPIO_USART0_RXD (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN5)
|
||||
#define GPIO_USART0_SCK (GPIO_PERIPHB | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN2)
|
||||
#define GPIO_USART0_TXD (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN6)
|
||||
|
||||
#define GPIO_USART1_CTS (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN25)
|
||||
#define GPIO_USART1_DCD (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN26)
|
||||
#define GPIO_USART1_DSR (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN28)
|
||||
#define GPIO_USART1_DTR (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN27)
|
||||
#define GPIO_USART1_RI (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN29)
|
||||
|
||||
#define GPIO_USART1_RTS (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN24)
|
||||
#define GPIO_USART1_RXD (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN21)
|
||||
#define GPIO_USART1_SCK (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN23)
|
||||
#define GPIO_USART1_TXD (GPIO_PERIPHA | GPIO_CFG_DEFAULT | PIO_PORT_PIOA | GPIO_PIN22)
|
||||
|
||||
/************************************************************************************
|
||||
* Public Types
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Inline Functions
|
||||
************************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/************************************************************************************
|
||||
* Public Data
|
||||
************************************************************************************/
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
#define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Public Function Prototypes
|
||||
************************************************************************************/
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __ARCH_ARM_SRC_SAM34_CHIP_SAM4S_PINMAP_H */
|
||||
@@ -61,7 +61,7 @@
|
||||
#define sam_pmc_enableclk() sam_enableperipheral(SAM_PID_PMC)
|
||||
#define sam_eefc0_enableclk() sam_enableperipheral(SAM_PID_EEFC0)
|
||||
#define sam_eefc1_enableclk() sam_enableperipheral(SAM_PID_EEFC1)
|
||||
#define sam_uart_enableclk() sam_enableperipheral(SAM_PID_UART)
|
||||
#define sam_uart0_enableclk() sam_enableperipheral(SAM_PID_UART0)
|
||||
#define sam_smc_enableclk() sam_enableperipheral(SAM_PID_SMC)
|
||||
#define sam_pioa_enableclk() sam_enableperipheral(SAM_PID_PIOA)
|
||||
#define sam_piob_enableclk() sam_enableperipheral(SAM_PID_PIOB)
|
||||
@@ -91,7 +91,7 @@
|
||||
#define sam_pmc_disableclk() sam_disableperipheral(SAM_PID_PMC)
|
||||
#define sam_eefc0_disableclk() sam_disableperipheral(SAM_PID_EEFC0)
|
||||
#define sam_eefc1_disableclk() sam_disableperipheral(SAM_PID_EEFC1)
|
||||
#define sam_uart_disableclk() sam_disableperipheral(SAM_PID_UART)
|
||||
#define sam_uart0_disableclk() sam_disableperipheral(SAM_PID_UART0)
|
||||
#define sam_smc_disableclk() sam_disableperipheral(SAM_PID_SMC)
|
||||
#define sam_pioa_disableclk() sam_disableperipheral(SAM_PID_PIOA)
|
||||
#define sam_piob_disableclk() sam_disableperipheral(SAM_PID_PIOB)
|
||||
|
||||
@@ -56,6 +56,9 @@
|
||||
#elif defined(CONFIG_ARCH_CHIP_SAM4L)
|
||||
# include "chip/sam4l_usart.h"
|
||||
# include "sam4l_periphclks.h"
|
||||
#elif defined(CONFIG_ARCH_CHIP_SAM4S)
|
||||
# include "chip/sam3u_uart.h"
|
||||
# include "sam4s_periphclks.h"
|
||||
#else
|
||||
# error Unknown UART
|
||||
#endif
|
||||
@@ -85,40 +88,54 @@
|
||||
# undef CONFIG_SAM34_USART3
|
||||
#endif
|
||||
|
||||
/* Is there a serial console? It could be on the UART, or USARTn */
|
||||
/* Is there a serial console? It could be on UART0-1 or USART0-3 */
|
||||
|
||||
#if defined(CONFIG_UART0_SERIAL_CONSOLE) && defined(CONFIG_SAM34_UART0)
|
||||
# undef CONFIG_UART1_SERIAL_CONSOLE
|
||||
# undef CONFIG_USART0_SERIAL_CONSOLE
|
||||
# undef CONFIG_USART1_SERIAL_CONSOLE
|
||||
# undef CONFIG_USART2_SERIAL_CONSOLE
|
||||
# undef CONFIG_USART3_SERIAL_CONSOLE
|
||||
# define HAVE_CONSOLE 1
|
||||
#elif defined(CONFIG_UART1_SERIAL_CONSOLE) && defined(CONFIG_SAM34_UART1)
|
||||
# undef CONFIG_UART0_SERIAL_CONSOLE
|
||||
# undef CONFIG_USART0_SERIAL_CONSOLE
|
||||
# undef CONFIG_USART1_SERIAL_CONSOLE
|
||||
# undef CONFIG_USART2_SERIAL_CONSOLE
|
||||
# undef CONFIG_USART3_SERIAL_CONSOLE
|
||||
# define HAVE_CONSOLE 1
|
||||
#elif defined(CONFIG_USART0_SERIAL_CONSOLE) && defined(CONFIG_SAM34_USART0)
|
||||
# undef CONFIG_USART_SERIAL_CONSOLE
|
||||
# undef CONFIG_UART0_SERIAL_CONSOLE
|
||||
# undef CONFIG_UART1_SERIAL_CONSOLE
|
||||
# undef CONFIG_USART1_SERIAL_CONSOLE
|
||||
# undef CONFIG_USART2_SERIAL_CONSOLE
|
||||
# undef CONFIG_USART3_SERIAL_CONSOLE
|
||||
# define HAVE_CONSOLE 1
|
||||
#elif defined(CONFIG_USART1_SERIAL_CONSOLE) && defined(CONFIG_SAM34_USART1)
|
||||
# undef CONFIG_USART_SERIAL_CONSOLE
|
||||
# undef CONFIG_UART0_SERIAL_CONSOLE
|
||||
# undef CONFIG_UART1_SERIAL_CONSOLE
|
||||
# undef CONFIG_USART0_SERIAL_CONSOLE
|
||||
# undef CONFIG_USART2_SERIAL_CONSOLE
|
||||
# undef CONFIG_USART3_SERIAL_CONSOLE
|
||||
# define HAVE_CONSOLE 1
|
||||
#elif defined(CONFIG_USART2_SERIAL_CONSOLE) && defined(CONFIG_SAM34_USART2)
|
||||
# undef CONFIG_USART_SERIAL_CONSOLE
|
||||
# undef CONFIG_UART0_SERIAL_CONSOLE
|
||||
# undef CONFIG_UART1_SERIAL_CONSOLE
|
||||
# undef CONFIG_USART0_SERIAL_CONSOLE
|
||||
# undef CONFIG_USART1_SERIAL_CONSOLE
|
||||
# undef CONFIG_USART3_SERIAL_CONSOLE
|
||||
# define HAVE_CONSOLE 1
|
||||
#elif defined(CONFIG_USART3_SERIAL_CONSOLE) && defined(CONFIG_SAM34_USART3)
|
||||
# undef CONFIG_USART_SERIAL_CONSOLE
|
||||
# undef CONFIG_UART0_SERIAL_CONSOLE
|
||||
# undef CONFIG_UART1_SERIAL_CONSOLE
|
||||
# undef CONFIG_USART0_SERIAL_CONSOLE
|
||||
# undef CONFIG_USART1_SERIAL_CONSOLE
|
||||
# undef CONFIG_USART2_SERIAL_CONSOLE
|
||||
# define HAVE_CONSOLE 1
|
||||
#else
|
||||
# undef CONFIG_USART_SERIAL_CONSOLE
|
||||
# warning "No valid CONFIG_USARTn_SERIAL_CONSOLE Setting"
|
||||
# undef CONFIG_UART0_SERIAL_CONSOLE
|
||||
# undef CONFIG_UART1_SERIAL_CONSOLE
|
||||
# undef CONFIG_USART0_SERIAL_CONSOLE
|
||||
# undef CONFIG_USART1_SERIAL_CONSOLE
|
||||
# undef CONFIG_USART2_SERIAL_CONSOLE
|
||||
@@ -151,6 +168,12 @@
|
||||
# define SAM_CONSOLE_BITS CONFIG_UART0_BITS
|
||||
# define SAM_CONSOLE_PARITY CONFIG_UART0_PARITY
|
||||
# define SAM_CONSOLE_2STOP CONFIG_UART0_2STOP
|
||||
#elif defined(CONFIG_UART1_SERIAL_CONSOLE)
|
||||
# define SAM_CONSOLE_BASE SAM_UART1_BASE
|
||||
# define SAM_CONSOLE_BAUD CONFIG_UART1_BAUD
|
||||
# define SAM_CONSOLE_BITS CONFIG_UART1_BITS
|
||||
# define SAM_CONSOLE_PARITY CONFIG_UART1_PARITY
|
||||
# define SAM_CONSOLE_2STOP CONFIG_UART1_2STOP
|
||||
#elif defined(CONFIG_USART0_SERIAL_CONSOLE)
|
||||
# define SAM_CONSOLE_BASE SAM_USART0_BASE
|
||||
# define SAM_CONSOLE_BAUD CONFIG_USART0_BAUD
|
||||
@@ -189,7 +212,8 @@
|
||||
# define MR_CHRL_VALUE UART_MR_CHRL_7BITS /* 7 bits */
|
||||
#elif SAM_CONSOLE_BITS == 8
|
||||
# define MR_CHRL_VALUE UART_MR_CHRL_8BITS /* 8 bits */
|
||||
#elif SAM_CONSOLE_BITS == 9 && !defined(CONFIG_UART_SERIAL_CONSOLE)
|
||||
#elif SAM_CONSOLE_BITS == 9 && !defined(CONFIG_UART0_SERIAL_CONSOLE) && \
|
||||
!defined(CONFIG_UART1_SERIAL_CONSOLE)
|
||||
# define MR_CHRL_VALUE UART_MR_MODE9
|
||||
#else
|
||||
# error "Invlaid number of bits"
|
||||
@@ -270,7 +294,10 @@ void sam_lowsetup(void)
|
||||
/* Enable clocking for all selected UART/USARTs */
|
||||
|
||||
#ifdef CONFIG_SAM34_UART0
|
||||
sam_uart_enableclk();
|
||||
sam_uart0_enableclk();
|
||||
#endif
|
||||
#ifdef CONFIG_SAM34_UART1
|
||||
sam_uart1_enableclk();
|
||||
#endif
|
||||
#ifdef CONFIG_SAM34_USART0
|
||||
sam_usart0_enableclk();
|
||||
@@ -288,8 +315,8 @@ void sam_lowsetup(void)
|
||||
/* Configure UART pins for all selected UART/USARTs */
|
||||
|
||||
#ifdef CONFIG_SAM34_UART0
|
||||
(void)sam_configgpio(GPIO_UART_RXD);
|
||||
(void)sam_configgpio(GPIO_UART_TXD);
|
||||
(void)sam_configgpio(GPIO_UART0_RXD);
|
||||
(void)sam_configgpio(GPIO_UART0_TXD);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SAM34_USART0
|
||||
|
||||
+210
-412
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user