at91sam9261_usart.h
来自「最新版IAR FOR ARM(EWARM)5.11中的代码例子」· C头文件 代码 · 共 251 行 · 第 1/2 页
H
251 行
/* linux/include/asm-arm/arch-at91sam9261/at91sam9261_usart.h
*
* Hardware definition for the usart peripheral in the ATMEL at91sam9261 processor
*
* Generated 12/07/2006 (13:13:27) AT91 SW Application Group from V
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __AT91SAM9261_USART_H
#define __AT91SAM9261_USART_H
/* -------------------------------------------------------- */
/* USART ID definitions for AT91SAM9261 */
/* -------------------------------------------------------- */
#ifndef AT91C_ID_US0
#define AT91C_ID_US0 6 /**< USART 0 id */
#endif /* AT91C_ID_US0 */
#ifndef AT91C_ID_US1
#define AT91C_ID_US1 7 /**< USART 1 id */
#endif /* AT91C_ID_US1 */
#ifndef AT91C_ID_US2
#define AT91C_ID_US2 8 /**< USART 2 id */
#endif /* AT91C_ID_US2 */
/* -------------------------------------------------------- */
/* USART Base Address definitions for AT91SAM9261 */
/* -------------------------------------------------------- */
#define AT91C_BASE_US0 0xFFFB0000 /**< US0 base address */
#define AT91C_BASE_US1 0xFFFB4000 /**< US1 base address */
#define AT91C_BASE_US2 0xFFFB8000 /**< US2 base address */
/* -------------------------------------------------------- */
/* PIO definition for USART hardware peripheral */
/* -------------------------------------------------------- */
#define AT91C_PC11_CTS0 (1 << 11) /**< USART0 Clear To Send */
#define AT91C_PC10_RTS0 (1 << 10) /**< USART0 Ready To Send */
#define AT91C_PC9_RXD0 (1 << 9) /**< USART0 Receive Data */
#define AT91C_PC10_SCK0 (1 << 10) /**< USART0 Serial Clock */
#define AT91C_PC8_TXD0 (1 << 8) /**< USART0 Transmit Data */
#define AT91C_PA13_CTS1 (1 << 13) /**< USART1 Clear To Send */
#define AT91C_PA12_RTS1 (1 << 12) /**< USART1 Ready To Send */
#define AT91C_PC13_RXD1 (1 << 13) /**< USART1 Receive Data */
#define AT91C_PA11_SCK1 (1 << 11) /**< USART1 Serial Clock */
#define AT91C_PC12_TXD1 (1 << 12) /**< USART1 Transmit Data */
#define AT91C_PA16_CTS2 (1 << 16) /**< USART2 Clear To Send */
#define AT91C_PA15_RTS2 (1 << 15) /**< USART2 Ready To Send */
#define AT91C_PC15_RXD2 (1 << 15) /**< USART2 Receive Data */
#define AT91C_PA14_SCK2 (1 << 14) /**< USART2 Serial Clock */
#define AT91C_PC14_TXD2 (1 << 14) /**< USART2 Transmit Data */
/* -------------------------------------------------------- */
/* Register offset definition for USART hardware peripheral */
/* -------------------------------------------------------- */
#define US_CR (0x0000) /**< Control Register */
#define US_MR (0x0004) /**< Mode Register */
#define US_IER (0x0008) /**< Interrupt Enable Register */
#define US_IDR (0x000C) /**< Interrupt Disable Register */
#define US_IMR (0x0010) /**< Interrupt Mask Register */
#define US_CSR (0x0014) /**< Channel Status Register */
#define US_RHR (0x0018) /**< Receiver Holding Register */
#define US_THR (0x001C) /**< Transmitter Holding Register */
#define US_BRGR (0x0020) /**< Baud Rate Generator Register */
#define US_RTOR (0x0024) /**< Receiver Time-out Register */
#define US_TTGR (0x0028) /**< Transmitter Time-guard Register */
#define US_FIDI (0x0040) /**< FI_DI_Ratio Register */
#define US_NER (0x0044) /**< Nb Errors Register */
#define US_IF (0x004C) /**< IRDA_FILTER Register */
#define US_RPR (0x0100) /**< Receive Pointer Register */
#define US_RCR (0x0104) /**< Receive Counter Register */
#define US_TPR (0x0108) /**< Transmit Pointer Register */
#define US_TCR (0x010C) /**< Transmit Counter Register */
#define US_RNPR (0x0110) /**< Receive Next Pointer Register */
#define US_RNCR (0x0114) /**< Receive Next Counter Register */
#define US_TNPR (0x0118) /**< Transmit Next Pointer Register */
#define US_TNCR (0x011C) /**< Transmit Next Counter Register */
#define US_PTCR (0x0120) /**< PDC Transfer Control Register */
#define US_PTSR (0x0124) /**< PDC Transfer Status Register */
/* -------------------------------------------------------- */
/* Bitfields definition for USART hardware peripheral */
/* -------------------------------------------------------- */
/* --- Register US_CR */
#define AT91C_US_RSTRX (0x1 << 2 ) /**< (USART) Reset Receiver */
#define AT91C_US_RSTTX (0x1 << 3 ) /**< (USART) Reset Transmitter */
#define AT91C_US_RXEN (0x1 << 4 ) /**< (USART) Receiver Enable */
#define AT91C_US_RXDIS (0x1 << 5 ) /**< (USART) Receiver Disable */
#define AT91C_US_TXEN (0x1 << 6 ) /**< (USART) Transmitter Enable */
#define AT91C_US_TXDIS (0x1 << 7 ) /**< (USART) Transmitter Disable */
#define AT91C_US_RSTSTA (0x1 << 8 ) /**< (USART) Reset Status Bits */
#define AT91C_US_STTBRK (0x1 << 9 ) /**< (USART) Start Break */
#define AT91C_US_STPBRK (0x1 << 10) /**< (USART) Stop Break */
#define AT91C_US_STTTO (0x1 << 11) /**< (USART) Start Time-out */
#define AT91C_US_SENDA (0x1 << 12) /**< (USART) Send Address */
#define AT91C_US_RSTIT (0x1 << 13) /**< (USART) Reset Iterations */
#define AT91C_US_RSTNACK (0x1 << 14) /**< (USART) Reset Non Acknowledge */
#define AT91C_US_RETTO (0x1 << 15) /**< (USART) Rearm Time-out */
#define AT91C_US_DTREN (0x1 << 16) /**< (USART) Data Terminal ready Enable */
#define AT91C_US_DTRDIS (0x1 << 17) /**< (USART) Data Terminal ready Disable */
#define AT91C_US_RTSEN (0x1 << 18) /**< (USART) Request to Send enable */
#define AT91C_US_RTSDIS (0x1 << 19) /**< (USART) Request to Send Disable */
/* --- Register US_MR */
#define AT91C_US_USMODE (0xF << 0 ) /**< (USART) Usart mode */
#define AT91C_US_USMODE_NORMAL 0x0 /**< (USART) Normal */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?