?? at91sam7x256_usart.h
字號:
/* linux/include/asm-arm/arch-at91sam7x256/at91sam7x256_usart.h
*
* Hardware definition for the usart peripheral in the ATMEL at91sam7x256 processor
*
* Generated 11/02/2005 (15:17:30) 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 __AT91SAM7X256_USART_H
#define __AT91SAM7X256_USART_H
/* -------------------------------------------------------- */
/* USART ID definitions for AT91SAM7X256 */
/* -------------------------------------------------------- */
#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 */
/* -------------------------------------------------------- */
/* USART Base Address definitions for AT91SAM7X256 */
/* -------------------------------------------------------- */
#define AT91C_BASE_US1 0xFFFC4000 /**< US1 base address */
#define AT91C_BASE_US0 0xFFFC0000 /**< US0 base address */
/* -------------------------------------------------------- */
/* PIO definition for USART hardware peripheral */
/* -------------------------------------------------------- */
#define AT91C_PA4_CTS0 (1 << 4) /**< USART 0 Clear To Send */
#define AT91C_PA3_RTS0 (1 << 3) /**< USART 0 Ready To Send */
#define AT91C_PA0_RXD0 (1 << 0) /**< USART 0 Receive Data */
#define AT91C_PA2_SCK0 (1 << 2) /**< USART 0 Serial Clock */
#define AT91C_PA1_TXD0 (1 << 1) /**< USART 0 Transmit Data */
#define AT91C_PA9_CTS1 (1 << 9) /**< USART 1 Clear To Send */
#define AT91C_PB23_DCD1 (1 << 23) /**< USART 1 Data Carrier Detect */
#define AT91C_PB24_DSR1 (1 << 24) /**< USART 1 Data Set ready */
#define AT91C_PB25_DTR1 (1 << 25) /**< USART 1 Data Terminal ready */
#define AT91C_PB26_RI1 (1 << 26) /**< USART 1 Ring Indicator */
#define AT91C_PA8_RTS1 (1 << 8) /**< USART 1 Ready To Send */
#define AT91C_PA5_RXD1 (1 << 5) /**< USART 1 Receive Data */
#define AT91C_PA7_SCK1 (1 << 7) /**< USART 1 Serial Clock */
#define AT91C_PA6_TXD1 (1 << 6) /**< USART 1 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 */
#define AT91C_US_USMODE_RS485 0x1 /**< (USART) RS485 */
#define AT91C_US_USMODE_HWHSH 0x2 /**< (USART) Hardware Handshaking */
#define AT91C_US_USMODE_MODEM 0x3 /**< (USART) Modem */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -