📄 lpradio.lis
字号:
0000 ;--------------------------------------------------------------------------
0000 ;
0000 ; Filename: lpRadio.asm
0000 ;
0000 ; Description: User functions to access the LP radio configuration. These
0000 ; functions are the same for the both the streaming and
0000 ; non-streaming versions of the driver.
0000 ;
0000 ;--------------------------------------------------------------------------
0000 ; WirelessUSB LP Radio Driver Version 1.2
0000 ;--------------------------------------------------------------------------
0000 ;
0000 ; Copyright 2005-2006, Cypress Semiconductor Corporation.
0000 ;
0000 ; This software is owned by Cypress Semiconductor Corporation (Cypress)
0000 ; and is protected by and subject to worldwide patent protection (United
0000 ; States and foreign), United States copyright laws and international
0000 ; treaty provisions. Cypress hereby grants to licensee a personal,
0000 ; non-exclusive, non-transferable license to copy, use, modify, create
0000 ; derivative works of, and compile the Cypress Source Code and derivative
0000 ; works for the sole purpose of creating custom software in support of
0000 ; licensee product to be used only in conjunction with a Cypress integrated
0000 ; circuit as specified in the applicable agreement. Any reproduction,
0000 ; modification, translation, compilation, or representation of this
0000 ; software except as specified above is prohibited without the express
0000 ; written permission of Cypress.
0000 ;
0000 ; Disclaimer: CYPRESS MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
0000 ; WITH REGARD TO THIS MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
0000 ; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
0000 ; Cypress reserves the right to make changes without further notice to the
0000 ; materials described herein. Cypress does not assume any liability arising
0000 ; out of the application or use of any product or circuit described herein.
0000 ; Cypress does not authorize its products for use as critical components in
0000 ; life-support systems where a malfunction or failure may reasonably be
0000 ; expected to result in significant injury to the user. The inclusion of
0000 ; Cypress' product in a life-support systems application implies that the
0000 ; manufacturer assumes all risk of such use and in doing so indemnifies
0000 ; Cypress against all charges.
0000 ;
0000 ; Use may be limited by and subject to the applicable Cypress software
0000 ; license agreement.
0000 ;
0000 ;--------------------------------------------------------------------------
0000
0000 ;--------------------------------------------------------------------------;
0000 ; ;
0000 ; I N C L U D E F I L E S ;
0000 ; ;
0000 ;--------------------------------------------------------------------------;
0000
0001 LP_SPI: EQU 1 ; 1 = PSoC SPI
0000 ;LP_SPI: EQU 0 ; 0 = enCoRe II or PRoC-LP SPI
0000
0000
0000
0000 ;-----------------------------------------------------------------------------
0000 ;
0000 ; THREE_WIRE_SPI selects whether 3 or 4 wire SPI interface is used
0000 ;
0000 ;-----------------------------------------------------------------------------
0000 THREE_WIRE_SPI: EQU 0
0000
0000
0000 ;-----------------------------------------------------------------------------
0000 ;
0000 ; MUXED_IRQ selects whether MOSI is multiplexed with Radio's IRQ output
0000 ;
0000 ;-----------------------------------------------------------------------------
0000 MUXED_IRQ: EQU 0
0000
IF (MUXED_IRQ)
LP_IRQ_MASK: EQU SPIM_Radio_MOSI_MASK
ENDIF
;-----------------------------------------------------------------------------
;
; PORT_SHADOW_ENABLE - For Radio SPI Slave Select control (for PSoC Express)
;
; Some IO Drive Modes may cause side effects on the other 7-bits of the port
; containing the LP_nSS bit. Using "PORT_SHADOW_ENABLE" prevents this problem
; (via a RAM Shadow Register), but results in a larger and slower driver.
; See PSoC Technical Reference Manual, Section B.6.1.1 "Digital IO".
;
; PORT_SHADOW_ENABLE locates an 8-bit Port_0_Data_SHADE variable on Page 0
; (the same page as the Radio Driver variables).
;-----------------------------------------------------------------------------
0000 PORT_SHADOW_ENABLE: EQU 0 ; 0 = OR/AND direct to nSS port
0000 ;PORT_SHADOW_ENABLE: EQU 1 ; 1 = OR/AND to RAM, write RAM to port
0000
0000
0000 ;-----------------------------------------------------------------------------
0000 ;
0000 ; NOTES ON THE PSoC LARGE MEMORY MODEL (LMM) .vs. SMALL MEMORY MODEL (SMM)
0000 ;
0000 ; The file <memory.inc> indicates whether LMM or SMM is used.
0000 ; LMM is available for devices with more than 256 Bytes of RAM and the
0000 ; (Project,Settings,Compiler,Enable paging) box is checked in PSoC Designer.
0000 ; Checking the Enable paging box sets SYSTEM_LARGE_MEMORY_MODEL: equ 1
0000 ; in <memory.inc>.
0000 ;
0000 ; When using the Small Memory Model, the macros in <memory.inc> reduce to
0000 ; nothing, and the resulting LMM paging overhead in Radio Driver disappears.
0000 ;
0000 ; Using the LMM imposes certain assumptions on the user's application. See
0000 ; Cypress AN2218 for details, a "summary" is below, but please obtain and
0000 ; understand AN2218 before proceeding.
0000 ;
0000 ; 1) All internal radio driver variables are placed on Page 0.
0000 ; 2) Rx and Tx bulk data buffers may be placed on any Page.
0000 ; 3) Radio driver exit w/Page Mode bits UNCHANGED or set to NATIVE_PAGING
0000 ; 4) Radio driver exits with only STK_PP preserved, except for ISR exit.
0000 ;
0000 ; This is consistent with the ImageCraft compiler, however calls from
0000 ; assembly need to handle possible loss of Page Pointers and Page Mode
0000 ; changes to NATIVE_PAGING.
0000 ;
0000 ;-----------------------------------------------------------------------------
0000
0000 ;=============================================================================
0000 ;=============================================================================
0000 ;=============================================================================
0000 ;
0000 ;
0000 ; EVERYTHING beyond this point is NOT NORMALLY CHANGED BY USERS
0000 ;
0000 ;
0000 ;=============================================================================
0000 ;=============================================================================
0000 ;=============================================================================
0000
IF (LP_SPI)
ELSE ; enCoRe2 ; -------------------------------------------------
LP_IRQ_Data_ADDR: equ PRT1DR ; LP IRQ is on Port1
LP_nSS_Data_ADDR: equ PRT1DR ; LP nSS is on Port1
ENDIF ; -------------------------------------------------
00F7 CPU_F: EQU 0xF7
0000
0000 ; LP SPI Interface definitions:
0000 ;
003F mSPI_ADDRESS: EQU 03Fh
0080 bSPI_WRITE: EQU 080h
0040 bSPI_AUTO_INC: EQU 040h
0000
0000 ;
0000 ; RADIO_STATE definitions:
0000 ;
0000 RADIO_IDLE: EQU 00h
0080 RADIO_RX: EQU 80h
0020 RADIO_TX: EQU 20h
0040 RADIO_SOP: EQU SOFDET_IRQ
0008 RADIO_DATA: EQU RXB1_IRQ
0002 RADIO_COMPLETE: EQU RXC_IRQ ; Code assumes these two bits are BOTH
0001 RADIO_ERROR: EQU RXE_IRQ ; in the RX_CTRL_ADR register.
0000
0000 //
0000 // Return value for a RadioAbort completed successfully. Otherwise the return value
0000 // is the length of the packet received (without error).
0000 //
00FF RADIO_ABORT_SUCCESS: EQU 0xFF
0000
0000 ; ############################################################################
0000 ; END OF lpRadio.inc
0000 ; ############################################################################
0004 SPIM_Radio_bINT_MASK: equ 04h
0000 ; SPIM interrupt address
00E1 SPIM_Radio_INT_REG: equ 0e1h
0000
0000 ; Do not use, this equate will be removed in a future release
0004 bSPIM_Radio_INT_MASK: equ 04h
0000
0000 ;--------------------------------------------------
0000 ; Register constants and masks
0000 ;--------------------------------------------------
0000 SPIM_Radio_SPIM_MODE_0: equ 00h ;MODE 0 - Leading edge latches data - pos clock
0002 SPIM_Radio_SPIM_MODE_1: equ 02h ;MODE 1 - Leading edge latches data - neg clock
0004 SPIM_Radio_SPIM_MODE_2: equ 04h ;MODE 2 - Trailing edge latches data - pos clock
0006 SPIM_Radio_SPIM_MODE_3: equ 06h ;MODE 3 - Trailing edge latches data - neg clock
0080 SPIM_Radio_SPIM_LSB_FIRST: equ 80h ;LSB bit transmitted/received first
0000 SPIM_Radio_SPIM_MSB_FIRST: equ 00h ;MSB bit transmitted/received first
0000
0000 ;---------------------------
0000 ; SPI Status register masks
0000 ;---------------------------
0040 SPIM_Radio_SPIM_RX_OVERRUN_ERROR: equ 40h ;Overrun error in received data
0010 SPIM_Radio_SPIM_TX_BUFFER_EMPTY: equ 10h ;TX Buffer register is ready for next data byte
0008 SPIM_Radio_SPIM_RX_BUFFER_FULL: equ 08h ;RX Buffer register has received current data
0020 SPIM_Radio_SPIM_SPI_COMPLETE: equ 20h ;SPI Tx/Rx cycle has completed
0000
0000 ;--------------------------------------------------
0000 ; Registers used by SPIM_Radio
0000 ;--------------------------------------------------
002B SPIM_Radio_CONTROL_REG: equ 2bh ;Control register
0028 SPIM_Radio_SHIFT_REG: equ 28h ;TX Shift Register register
0029 SPIM_Radio_TX_BUFFER_REG: equ 29h ;TX Buffer Register
002A SPIM_Radio_RX_BUFFER_REG: equ 2ah ;RX Buffer Register
0028 SPIM_Radio_FUNCTION_REG: equ 28h ;Function register
0029 SPIM_Radio_INPUT_REG: equ 29h ;Input register
002A SPIM_Radio_OUTPUT_REG: equ 2ah ;Output register
0000
0000 ; end of file SPIM_Radio.inc
0000 nLED1_Data_ADDR: equ 0h
0100 nLED1_DriveMode_0_ADDR: equ 100h
0101 nLED1_DriveMode_1_ADDR: equ 101h
0003 nLED1_DriveMode_2_ADDR: equ 3h
0002 nLED1_GlobalSelect_ADDR: equ 2h
0102 nLED1_IntCtrl_0_ADDR: equ 102h
0103 nLED1_IntCtrl_1_ADDR: equ 103h
0001 nLED1_IntEn_ADDR: equ 1h
0020 nLED1_MASK: equ 20h
01D8 nLED1_MUXBusCtrl_ADDR: equ 1d8h
0000 ; nLED2 address and mask equates
0000 nLED2_Data_ADDR: equ 0h
0100 nLED2_DriveMode_0_ADDR: equ 100h
0101 nLED2_DriveMode_1_ADDR: equ 101h
0003 nLED2_DriveMode_2_ADDR: equ 3h
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -