SAMD20: A little more USART logic
This commit is contained in:
parent
de8f9e979c
commit
3b0e6526a1
@ -181,11 +181,12 @@
|
||||
|
||||
#define PM_APBCMASK_PAC2 (1 << 0) /* Bit 0: PAC2 */
|
||||
#define PM_APBCMASK_EVSYS (1 << 1) /* Bit 1: EVSYS */
|
||||
#define PM_APBCMASK_SERCOM0 (1 << 2) /* Bit 2: SERCOM0 */
|
||||
#define PM_APBCMASK_SERCOM1 (1 << 3) /* Bit 3: SERCOM1 */
|
||||
#define PM_APBCMASK_SERCOM2 (1 << 4) /* Bit 4: SERCOM2 */
|
||||
#define PM_APBCMASK_SERCOM3 (1 << 5) /* Bit 5: SERCOM3 */
|
||||
#define PM_APBCMASK_SERCOM4 (1 << 6) /* Bit 6: SERCOM4 */
|
||||
#define PM_APBCMASK_SERCOM(n) (1 << ((n)+2))
|
||||
# define PM_APBCMASK_SERCOM0 (1 << 2) /* Bit 2: SERCOM0 */
|
||||
# define PM_APBCMASK_SERCOM1 (1 << 3) /* Bit 3: SERCOM1 */
|
||||
# define PM_APBCMASK_SERCOM2 (1 << 4) /* Bit 4: SERCOM2 */
|
||||
# define PM_APBCMASK_SERCOM3 (1 << 5) /* Bit 5: SERCOM3 */
|
||||
# define PM_APBCMASK_SERCOM4 (1 << 6) /* Bit 6: SERCOM4 */
|
||||
#define PM_APBCMASK_SERCOM5 (1 << 7) /* Bit 7: SERCOM5 */
|
||||
#define PM_APBCMASK_TC0 (1 << 8) /* Bit 8: TC0 */
|
||||
#define PM_APBCMASK_TC1 (1 << 9) /* Bit 9: TC1 */
|
||||
|
@ -43,6 +43,7 @@
|
||||
#include <assert.h>
|
||||
|
||||
#include "chip/sam_pinmap.h"
|
||||
#include "chip/sam_gclk.h"
|
||||
#include "chip/sam_usart.h"
|
||||
|
||||
#include <arch/board/board.h>
|
||||
@ -64,6 +65,7 @@ const struct sam_usart_config_s g_usart0config =
|
||||
.parity = CONFIG_USART0_PARITY,
|
||||
.bits = CONFIG_USART0_BITS,
|
||||
.irq = SAM_IRQ_SERCOM0,
|
||||
.gclk = (BOARD_SERCOM0_SRCGCLKGEN >> GCLK_CLKCTRL_GEN_SHIFT),
|
||||
.stopbits2 = CONFIG_USART0_2STOP,
|
||||
.baud = CONFIG_USART0_BAUD,
|
||||
.pad0 = BOARD_SERCOM0_PINMAP_PAD0,
|
||||
@ -82,6 +84,7 @@ const struct sam_usart_config_s g_usart1config =
|
||||
.parity = CONFIG_USART1_PARITY,
|
||||
.bits = CONFIG_USART1_BITS,
|
||||
.irq = SAM_IRQ_SERCOM1,
|
||||
.gclk = (BOARD_SERCOM1_SRCGCLKGEN >> GCLK_CLKCTRL_GEN_SHIFT),
|
||||
.stopbits2 = CONFIG_USART1_2STOP,
|
||||
.baud = CONFIG_USART1_BAUD,
|
||||
.pad0 = BOARD_SERCOM1_PINMAP_PAD0,
|
||||
@ -100,6 +103,7 @@ const struct sam_usart_config_s g_usart2config =
|
||||
.parity = CONFIG_USART2_PARITY,
|
||||
.bits = CONFIG_USART2_BITS,
|
||||
.irq = SAM_IRQ_SERCOM2,
|
||||
.gclk = (BOARD_SERCOM2_SRCGCLKGEN >> GCLK_CLKCTRL_GEN_SHIFT),
|
||||
.stopbits2 = CONFIG_USART2_2STOP,
|
||||
.baud = CONFIG_USART2_BAUD,
|
||||
.pad0 = BOARD_SERCOM2_PINMAP_PAD0,
|
||||
@ -118,6 +122,7 @@ const struct sam_usart_config_s g_usart3config =
|
||||
.parity = CONFIG_USART3_PARITY,
|
||||
.bits = CONFIG_USART3_BITS,
|
||||
.irq = SAM_IRQ_SERCOM3,
|
||||
.gclk = (BOARD_SERCOM3_SRCGCLKGEN >> GCLK_CLKCTRL_GEN_SHIFT),
|
||||
.stopbits2 = CONFIG_USART3_2STOP,
|
||||
.baud = CONFIG_USART3_BAUD,
|
||||
.pad0 = BOARD_SERCOM3_PINMAP_PAD0,
|
||||
@ -136,6 +141,7 @@ const struct sam_usart_config_s g_usart4config =
|
||||
.parity = CONFIG_USART4_PARITY,
|
||||
.bits = CONFIG_USART4_BITS,
|
||||
.irq = SAM_IRQ_SERCOM4,
|
||||
.gclk = (BOARD_SERCOM4_SRCGCLKGEN >> GCLK_CLKCTRL_GEN_SHIFT),
|
||||
.stopbits2 = CONFIG_USART4_2STOP,
|
||||
.baud = CONFIG_USART4_BAUD,
|
||||
.pad0 = BOARD_SERCOM4_PINMAP_PAD0,
|
||||
@ -154,6 +160,7 @@ const struct sam_usart_config_s g_usart5config =
|
||||
.parity = CONFIG_USART5_PARITY,
|
||||
.bits = CONFIG_USART5_BITS,
|
||||
.irq = SAM_IRQ_SERCOM5,
|
||||
.gclk = (BOARD_SERCOM5_SRCGCLKGEN >> GCLK_CLKCTRL_GEN_SHIFT),
|
||||
.stopbits2 = CONFIG_USART5_2STOP,
|
||||
.baud = CONFIG_USART5_BAUD,
|
||||
.pad0 = BOARD_SERCOM5_PINMAP_PAD0,
|
||||
|
@ -82,6 +82,7 @@ struct sam_usart_config_s
|
||||
uint8_t parity; /* 0=none, 1=odd, 2=even */
|
||||
uint8_t bits; /* Number of bits (5-9) */
|
||||
uint8_t irq; /* SERCOM IRQ number */
|
||||
uint8_t gclk; /* Source GCLK generator */
|
||||
bool isconsole; /* True: The USART is the console device */
|
||||
bool stopbits2; /* True: Configure with 2 stop bits instead of 1 */
|
||||
uint32_t baud; /* Configured baud */
|
||||
|
@ -343,12 +343,15 @@
|
||||
|
||||
/* EDBG/CDC USART on SERCOM3 */
|
||||
|
||||
#define BOARD_SERCOM3_SRCGCLKGEN GCLK_CLKCTRL_GEN0
|
||||
#define BOARD_SERCOM3_MUXCONFIG (USART_CTRLA_RXPAD3 | USART_CTRLA_TXPAD2)
|
||||
#define BOARD_SERCOM3_PINMAP_PAD0 0
|
||||
#define BOARD_SERCOM3_PINMAP_PAD1 0
|
||||
#define BOARD_SERCOM3_PINMAP_PAD2 PORT_SERCOM3_PAD2_1
|
||||
#define BOARD_SERCOM3_PINMAP_PAD3 PORT_SERCOM3_PAD3_1
|
||||
|
||||
#define BOARD_SERCOM3_FREQUENCY BOARD_GCLK0_FREQUENCY
|
||||
|
||||
/* LED definitions ******************************************************************/
|
||||
/* There are three LEDs on board the SAMD20 Xplained Pro board: The EDBG
|
||||
* controls two of the LEDs, a power LED and a status LED. There is only
|
||||
|
@ -1,42 +0,0 @@
|
||||
############################################################################
|
||||
# configs/z16f2800100zcog/pashello/appconfig
|
||||
#
|
||||
# Copyright (C) 2011 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.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
# Path to example in apps/examples containing the user_start entry point
|
||||
|
||||
CONFIGURED_APPS += examples/pashello
|
||||
|
||||
# Path to the Pascal p-code runtime interpreter module
|
||||
|
||||
CONFIGURED_APPS += interpreters/pcode
|
Loading…
Reference in New Issue
Block a user