📄 uart.inc
字号:
;;*****************************************************************************
;;*****************************************************************************
;; FILENAME: UART.inc
;; Version: 5.2, Updated on 2008/12/13 at 10:58:58
;; Generated by PSoC Designer ???
;;
;; DESCRIPTION: Assembler declarations for the UART user module for the
;; 22/24/25/26/27xxx PSoC family of devices.
;;-----------------------------------------------------------------------------
;; Copyright (c) Cypress MicroSystems 2000-2003. All Rights Reserved.
;;*****************************************************************************
;;*****************************************************************************
;--------------------------------------------------
; Constants for UART API's
;--------------------------------------------------
;mask value for global int reg bit for TX instance
UART_TX_INT_MASK: equ 0x40
UART_TX_INT_REG: equ 0x0e1 ;TX interrupt address
UART_RX_INT_MASK: equ 0x80 ;mask value for global int reg bit for RX instance
UART_RX_INT_REG: equ 0x0e1 ;RX interrupt address
UART_RXBUF_ENABLE: equ 0
; Interrupt control masks
UART_ENABLE_RX_INT: equ 0x01
UART_DISABLE_RX_INT: equ 0x00
UART_ENABLE_TX_INT: equ 0x02
UART_DISABLE_TX_INT: equ 0x00
UART_INT_MODE_TX_REG_EMPTY: equ 0x00
UART_INT_MODE_TX_COMPLETE: equ 0x01
UART_RX_IGNORE_BELOW: equ 0x20
UART_RX_BUFFER_SIZE: equ 0x10
UART_CMD_TERM: equ 0xd
UART_DELIMITER: equ 0x20
UART_BACKSPACE_ENABLE: equ 0x0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WARNING WARNING WARNING
; The following equates are for backwards
; compatibility only and should not be used
; for new designs.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;------------------------------------
; Parity masks
;------------------------------------
UART_PARITY_NONE: equ 00h
UART_PARITY_EVEN: equ 02h
UART_PARITY_ODD: equ 06h
;------------------------------------
; TX Status Register masks
;------------------------------------
UART_TX_COMPLETE: equ 20h
UART_TX_BUFFER_EMPTY: equ 10h
;------------------------------------
; RX Status Register masks
;------------------------------------
UART_RX_ACTIVE: equ 10h
UART_RX_COMPLETE: equ 08h
UART_RX_PARITY_ERROR: equ 80h
UART_RX_OVERRUN_ERROR: equ 40h
UART_RX_FRAMING_ERROR: equ 20h
UART_RX_NO_ERROR: equ E0h
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; END WARNING
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;------------------------------------
; Parity masks
;------------------------------------
UART_PARITY_NONE: equ 00h
UART_PARITY_EVEN: equ 02h
UART_PARITY_ODD: equ 06h
;------------------------------------
; TX Status Register masks
;------------------------------------
UART_TX_COMPLETE: equ 20h
UART_TX_BUFFER_EMPTY: equ 10h
;------------------------------------
; RX Status Register masks
;------------------------------------
UART_RX_ACTIVE: equ 10h
UART_RX_COMPLETE: equ 08h
UART_RX_REG_FULL: equ 08h
UART_RX_PARITY_ERROR: equ 80h
UART_RX_OVERRUN_ERROR: equ 40h
UART_RX_FRAMING_ERROR: equ 20h
UART_RX_ERROR: equ E0h
UART_RX_ENABLE: equ 01h
UART_RX_BUF_ERROR: equ F0h ; Mask for any Rx that may occur.
UART_RX_BUF_OVERRUN: equ 10h ; This indicates the software buffer has
; been over run.
UART_RX_BUF_CMDTERM: equ 01h ; Command terminator has been received.
UART_RX_NO_DATA: equ 01h
UART_RX_NO_ERROR: equ E0h
;--------------------------------------------------
; Registers Address Constants for UART
;--------------------------------------------------
;---------------------------------
; Registers used by TX
;---------------------------------
UART_TX_CONTROL_REG: equ 3bh ; Control register
UART_TX_SHIFT_REG: equ 38h ; TX Shift Register register
UART_TX_BUFFER_REG: equ 39h ; TX Buffer Register
UART_TX_FUNC_REG: equ 38h ; Function register
UART_TX_INPUT_REG: equ 39h ; Input register
UART_TX_OUTPUT_REG: equ 3ah ; Output register
;---------------------------------
; Registers used by RX
;---------------------------------
UART_RX_CONTROL_REG: equ 3fh ; Control register
UART_RX_SHIFT_REG: equ 3ch ; RX Shift Register register
UART_RX_BUFFER_REG: equ 3eh ; RX Buffer Register
UART_RX_FUNC_REG: equ 3ch ; Function register
UART_RX_INPUT_REG: equ 3dh ; Input register
UART_RX_OUTPUT_REG: equ 3eh ; Output register
; end of file UART.inc
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -