亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? psocradio.asm

?? CYRF6936 zigbee模塊設計的全部資料
?? ASM
?? 第 1 頁 / 共 2 頁
字號:
;--------------------------------------------------------------------------
;
;  Filename:    psocradio.asm
;
;  Description: User functions to access an SPI based radio on PSoC.
;
;--------------------------------------------------------------------------
; WirelessUSB LP Radio Driver Version 1.0
; $Revision: 3 $
;--------------------------------------------------------------------------
;
; Copyright 2005-2006, Cypress Semiconductor Corporation.
;
; This software is owned by Cypress Semiconductor Corporation (Cypress)
; and is protected by and subject to worldwide patent protection (United
; States and foreign), United States copyright laws and international
; treaty provisions. Cypress hereby grants to licensee a personal,
; non-exclusive, non-transferable license to copy, use, modify, create
; derivative works of, and compile the Cypress Source Code and derivative
; works for the sole purpose of creating custom software in support of
; licensee product to be used only in conjunction with a Cypress integrated
; circuit as specified in the applicable agreement. Any reproduction,
; modification, translation, compilation, or representation of this
; software except as specified above is prohibited without the express
; written permission of Cypress.
;
; Disclaimer: CYPRESS MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
; WITH REGARD TO THIS MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
; Cypress reserves the right to make changes without further notice to the
; materials described herein. Cypress does not assume any liability arising
; out of the application or use of any product or circuit described herein.
; Cypress does not authorize its products for use as critical components in
; life-support systems where a malfunction or failure may reasonably be
; expected to result in significant injury to the user. The inclusion of
; Cypress' product in a life-support systems application implies that the
; manufacturer assumes all risk of such use and in doing so indemnifies
; Cypress against all charges.
;
; Use may be limited by and subject to the applicable Cypress software
; license agreement.
;
;--------------------------------------------------------------------------

;--------------------------------------------------------------------------;
;                                                                          ;
;                      I N C L U D E   F I L E S                           ;
;                                                                          ;
;--------------------------------------------------------------------------;

                   INCLUDE "lpradio.inc"
                   INCLUDE "spim_radio.inc"
                   INCLUDE "psocgpioint.inc"
                   INCLUDE "lpregs.inc"
                   INCLUDE "irqmacros.inc"                


;--------------------------------------------------------------------------;
;                                                                          ;
;                            V A R I A B L E S                             ;
;                                                                          ;
;--------------------------------------------------------------------------;

                   AREA    bss

RadioWipPtr::      BLK     1       ; Working pointer.
RadioWipLen::      BLK     1       ; Working buffer length.
RadioPtr::         BLK     1       ; Parameter to SPI access routines - address.
RadioLen::         BLK     1       ; Parameter to SPI access routines - length.
RadioSpiTemp:      BLK     1       ; Local working temp.

;--------------------------------------------------------------------------;
;                                                                          ;
;                                 C O D E                                  ;
;                                                                          ;
;--------------------------------------------------------------------------;

                   AREA    UserModules (ROM, REL)

;
; Disable code compression.
;
                   DISABLE_CODE_COMPRESSION

;--------------------------------------------------------------------------
;
; Some comments on the operation of the SPI PSoC block:
;
; The SPIM_Radio_SPIM_SPI_COMPLETE and SPIM_Radio_SPIM_TX_BUFFER_EMPTY status
;  bits are self-clearing. After you've read SPIM_Radio_CONTROL_REG these
;  bits will be cleared. During a multibyte SPI transaction we use the 
;  SPIM_Radio_SPIM_TX_BUFFER_EMPTY status to pace the data, but at the end
;  of a transaction we use SPIM_Radio_SPIM_SPI_COMPLETE to determine that
;  we can de-assert the slave select.
;
; Although the hardware generates the SPIM_Radio_CONTROL_REG status
;  one full byte time before SPIM_Radio_SPIM_TX_BUFFER_EMPTY if you are
;  not reading the SPIM_Radio_CONTROL_REG register fast enough you might
;  see both of those status indications occur together, and after you've
;  read the SPIM_Radio_CONTROL_REG status it will clear and you will not see
;  it again. In the case that the SPI clock is very fast, or if interrupts 
;  are left enabled during the execution of these routines then it is very
;  possible to see both of these indications occur together.
;
; In order for these routines to allow interrupts to be enabled during their
;  execution they are structured to allow the assertion of the two status
;  bits SPIM_Radio_SPIM_SPI_COMPLETE and SPIM_Radio_SPIM_TX_BUFFER_EMPTY
;  on the same read of SPIM_Radio_CONTROL_REG. Although this is a real world
;  condition, you will only see it under stressed conditions.
;
; One other strangeness of the PSoC SPI block is that the
;  SPIM_Radio_SPIM_SPI_COMPLETE status ONLY INDICATES THE STATE OF THE
;  SHIFTER - it does not include the state of the holding register. This
;  means that when we need to poll SPIM_Radio_SPIM_SPI_COMPLETE at the
;  end of a transaction we need to make sure we see the status incdication
;  SPIM_Radio_SPIM_TX_BUFFER_EMPTY to know that the complete wasn't for
;  the previous byte.
;
;--------------------------------------------------------------------------

;--------------------------------------------------------------------------;
;                                                                          ;
;                      I N I T I A L I Z A T I O N                         ;
;                                                                          ;
;--------------------------------------------------------------------------;

.section
;--------------------------------------------------------------------------
;
; RadioReset: Hard reset of the FPGA.
;
; 'C' Call:        void RadioReset(void);
;
; Assembly Call:   A: none
;                  X: none
;
; Assembly Return: A: Garbage
;                  X: Garbage
;
_RadioReset::
 RadioReset::      UPDATE_PERM_IE_THROUGH_A
                                                       ; Deassert the Slave Select.
                   OR      REG[LP_nSS_Data_ADDR], LP_nSS_MASK
                   MOV     [RadioLen], 255             ; Start out assuming a big buffer.
                   MOV     A, MODE_OVERRIDE_ADR        ; Reset the Radio through the SPI (soft reset).
                   MOV     X, RST                      ; This way we don't have to worry
                   JMP     RadioWrite                  ;  about the reset wire.
                   
.endsection
.section
;-----------------------------------------------------------------------------
;
; RadioWriteSwapped:
;                  Write a single byte to an Radio register. This is the same as
;                  the "normal" RadioWrite, but the parameters are in A and X
;                  "swapped". This is because the C calling conventions make
;                  it much easier to set the registers up this way.
;
;                  This is an assembly call only with no external linkage.
;
; 'C' Call:        None.
;
; Assembly Call:   A: The value to write to the selected register.
;                  X: The register number to write.
;                  
;                  (For both the 'C' and assembly call the top two bits of
;                   the register number MUST be clear.)
;
; Assembly Return: A: Undefined
;                  X: Undefined
;
 RadioWriteSwapped::
                   SWAP    A, X                        ; Fall into RadioWrite.

;-----------------------------------------------------------------------------
;
; RadioWrite:      Write a single byte to an Radio register.
;
; 'C' Call:        void RadioWrite(RADIO_REG_ADDR regAddr, BYTE value);
;
; Assembly Call:   A: The register number to write.
;                  X: The value to write to the selected register.
;
;                  (For both the 'C' and assembly call the top two bits of
;                   the register number MUST be clear.)
;
; Assembly Return: A: Undefined
;                  X: Untouched
;
 RadioWrite::
_RadioWrite::      OR      A, bSPI_WRITE               ; Set the Write Bit.

;--------------------------------------------------------------------------------
;
; RadioRead:       Read a single byte from an Radio register.
;
; 'C' Call:        BYTE RadioRead(RADIO_REG_ADDR regAddr);
;
; Assembly Call:   A: The register number to read
;                  X: none
;
;                  (For both the 'C' and assembly call the top two bits of
;                   the register number MUST be clear.)
;
; Assembly Return: A: Value from register
;                  X: Undefined
;
; TODO:            Remove Empty/Complete race and IRQ disable.
;
 RadioRead::
_RadioRead::       CLEAR_TEMP_IE

                   AND     REG[LP_nSS_Data_ADDR],~LP_nSS_MASK
                   MOV     REG[SPIM_Radio_TX_BUFFER_REG],A
                                                       ; Write the address.
.WaitLoop1:        TST     REG[SPIM_Radio_CONTROL_REG],SPIM_Radio_SPIM_TX_BUFFER_EMPTY
                   JZ      .WaitLoop1
                   MOV     A,X                         ; For read this is garbage
                   MOV     REG[SPIM_Radio_TX_BUFFER_REG],A
                                                       ; Write the data.
.WaitLoop2:        TST     REG[SPIM_Radio_CONTROL_REG],SPIM_Radio_SPIM_TX_BUFFER_EMPTY
                   JZ      .WaitLoop2
.WaitLoop3:        TST     REG[SPIM_Radio_CONTROL_REG],SPIM_Radio_SPIM_SPI_COMPLETE
                   JZ      .WaitLoop3

                   MOV     A,REG[SPIM_Radio_RX_BUFFER_REG]
                                                       ; Get the return value.
                   OR      REG[LP_nSS_Data_ADDR],LP_nSS_MASK
                                                       ; Deassert the Slave Select

                   RET_RESTORE_IE_THROUGH_X

.endsection
.section
;--------------------------------------------------------------------------------
;
; RadioReadRxStatusDebounced:
;                  Read a single byte from the RX_IRQ_STATUS_ADR register and
;                  debounce the update of the RXC and RXE bits. If only one of
;                  those two bits is set, read the register a second time and
;                  or them together. This second read happens in the same
;                  SPI transaction as a burst to the same address.
;
; 'C' Call:        BYTE RadioReadDebounced(RADIO_REG_ADDR regAddr);
;
; Assembly Call:   A: none
;                  X: none
;
;                  (For both the 'C' and assembly call the top two bits of
;                   the register number MUST be clear.)
;
; Assembly Return: A: Value from register
;                  X: Untouched
;
; TODO:            Remove Empty/Complete race and IRQ disable.
;
 RadioReadStatusDebounced::
_RadioReadStatusDebounced::
                   CLEAR_TEMP_IE
                   AND     REG[LP_nSS_Data_ADDR],~LP_nSS_MASK
                   MOV     REG[SPIM_Radio_TX_BUFFER_REG],A
                                                       ; Write the address.
.WaitLoop1:        TST     REG[SPIM_Radio_CONTROL_REG],SPIM_Radio_SPIM_TX_BUFFER_EMPTY
                   JZ      .WaitLoop1

                   MOV     REG[SPIM_Radio_TX_BUFFER_REG],A
                                                       ; Write the data.
.WaitLoop2:        TST     REG[SPIM_Radio_CONTROL_REG],SPIM_Radio_SPIM_TX_BUFFER_EMPTY
                   JZ      .WaitLoop2

.WaitLoop3:        TST     REG[SPIM_Radio_CONTROL_REG],SPIM_Radio_SPIM_SPI_COMPLETE
                   JZ      .WaitLoop3

;
; If the RXC and RXE (or TXC and TXE) bits are set the same then skip the debounce read.
;
                   MOV     A,REG[SPIM_Radio_RX_BUFFER_REG]
                   MOV     [RadioSpiTemp], A
                   AND     A, RXC_IRQ | RXE_IRQ
                   JZ      .Done
                   CMP     A, RXC_IRQ | RXE_IRQ
                   JZ      .Done
;
; The complete and error bits are different. Read a second time to make sure both bits
;  have updated.
;                   
                   MOV     REG[SPIM_Radio_TX_BUFFER_REG],A

.WaitLoop4:        TST     REG[SPIM_Radio_CONTROL_REG],SPIM_Radio_SPIM_TX_BUFFER_EMPTY
                   JZ      .WaitLoop4

.WaitLoop5:        TST     REG[SPIM_Radio_CONTROL_REG],SPIM_Radio_SPIM_SPI_COMPLETE
                   JZ      .WaitLoop5
                   MOV     A, REG[SPIM_Radio_RX_BUFFER_REG]
                   OR      [RadioSpiTemp], A

.Done:             MOV     A, [RadioSpiTemp]
                                                       ; Get the return value.
                   OR      REG[LP_nSS_Data_ADDR],LP_nSS_MASK
                                                       ; Deassert the Slave Select
                   RET_RESTORE_IE_THROUGH_X

.endsection

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩激情在线| 粉嫩高潮美女一区二区三区| 1区2区3区国产精品| 久久亚洲欧美国产精品乐播| 日韩欧美三级在线| 久久精品人人做| 国产肉丝袜一区二区| 久久久精品欧美丰满| 日本一区二区不卡视频| 亚洲色图丝袜美腿| 亚洲一区二区三区自拍| 欧美aaaaa成人免费观看视频| 午夜精品久久久久久| 久久99日本精品| 福利一区福利二区| 色综合久久久网| 欧美私人免费视频| 欧美大片在线观看一区二区| 久久综合九色综合欧美98| 欧美一区二区精品在线| 精品免费99久久| 中文字幕一区二区三区蜜月 | 亚洲成人av一区| 五月激情六月综合| 国产美女一区二区| 日本久久电影网| 欧美一区二区三区视频| 日本一区二区三区dvd视频在线| 国产精品免费丝袜| 亚洲成a人片在线不卡一二三区| 日韩在线播放一区二区| 九九国产精品视频| 91一区二区在线| 日韩欧美一卡二卡| 亚洲免费观看高清完整| 久久福利视频一区二区| 成人av午夜影院| 欧美一区二区三区性视频| 国产婷婷色一区二区三区在线| 亚洲女人的天堂| 久久国产福利国产秒拍| 欧美亚洲图片小说| 国产精品欧美综合在线| 日本一不卡视频| 91蝌蚪porny| 久久人人超碰精品| 亚洲一区二区三区四区五区中文| 国产精品一卡二卡| 91精品福利在线一区二区三区| 国产欧美精品一区二区色综合朱莉| 夜夜精品视频一区二区| 成人一区二区在线观看| 精品美女在线观看| 日本视频在线一区| 欧美日韩亚洲综合在线| 日韩美女久久久| 国产成人日日夜夜| 日韩欧美国产午夜精品| 五月天中文字幕一区二区| 99re8在线精品视频免费播放| 日韩午夜激情电影| 日本美女一区二区三区视频| 欧美视频中文字幕| 亚洲免费资源在线播放| 粉嫩蜜臀av国产精品网站| 久久久久9999亚洲精品| 九色综合狠狠综合久久| 日韩精品一区二区三区视频播放| 亚洲二区在线观看| 欧美性一区二区| 亚洲午夜免费电影| 欧美中文一区二区三区| 亚洲国产视频一区二区| 欧美天天综合网| 午夜电影网一区| 91精品国产高清一区二区三区| 三级成人在线视频| 日韩欧美黄色影院| 韩国女主播一区二区三区| 久久综合九色综合欧美就去吻 | 久久久久久电影| 国产乱理伦片在线观看夜一区| 久久影院视频免费| 国产丶欧美丶日本不卡视频| 久久婷婷综合激情| 高清beeg欧美| 亚洲精品免费在线播放| 91成人免费网站| 天天综合色天天| 久久亚区不卡日本| 成人激情综合网站| 亚洲一区国产视频| 欧美精品一区二区久久婷婷| 国产精品99久久久久久宅男| 久久久久久**毛片大全| 成年人国产精品| 五月天婷婷综合| 久久久亚洲精品石原莉奈| 91小视频在线观看| 日韩中文字幕1| 亚洲国产经典视频| 欧美精品一二三| 国产精品77777| 亚洲一二三区不卡| 337p粉嫩大胆色噜噜噜噜亚洲| 成人av资源下载| 无码av中文一区二区三区桃花岛| 精品蜜桃在线看| 色婷婷一区二区三区四区| 日本系列欧美系列| 亚洲视频你懂的| 欧美成人猛片aaaaaaa| eeuss鲁片一区二区三区在线观看| 亚洲成人免费观看| 国产人妖乱国产精品人妖| 91捆绑美女网站| 国产成人小视频| 免费看黄色91| 伊人一区二区三区| 国产人成一区二区三区影院| 欧美精品aⅴ在线视频| 成人免费av资源| 免费观看30秒视频久久| 午夜精品久久久久久久久| 中文字幕第一区| 日韩欧美不卡在线观看视频| 日本精品视频一区二区三区| 韩国一区二区视频| 日本怡春院一区二区| 亚洲男人电影天堂| 国产女人18水真多18精品一级做 | 欧美一二三在线| 欧美熟乱第一页| 91成人在线精品| 不卡av在线免费观看| 国产精品一区专区| 麻豆成人久久精品二区三区红 | 国产欧美一区二区在线| 日韩一级高清毛片| 欧美日本一区二区三区| 色天使色偷偷av一区二区| 99精品偷自拍| 99re8在线精品视频免费播放| 国产成人免费视频网站 | 国产精品成人网| 国产三级一区二区三区| 欧美电视剧免费全集观看| 日韩一区国产二区欧美三区| 欧洲精品在线观看| 一本久久综合亚洲鲁鲁五月天 | 国产高清视频一区| 国产精一区二区三区| 精品制服美女久久| 精品写真视频在线观看| 精品一区二区av| 国产在线看一区| 国产成人av电影| 91欧美一区二区| 在线观看视频一区二区欧美日韩| 色婷婷av一区二区| 欧美美女网站色| 日韩欧美你懂的| 欧美高清在线一区二区| 国产精品精品国产色婷婷| 最新国产の精品合集bt伙计| 中文字幕欧美一区| 亚洲一区二区三区在线| 青娱乐精品视频在线| 国内一区二区在线| 99久久精品情趣| 欧美日韩国产欧美日美国产精品| 7777精品伊人久久久大香线蕉的 | 亚洲欧美日韩在线| 日韩中文字幕亚洲一区二区va在线| 青青青爽久久午夜综合久久午夜| 国模无码大尺度一区二区三区| 成人美女视频在线观看| 在线观看成人免费视频| 日韩精品一区二区三区老鸭窝| 久久精品视频一区二区| 一区二区三区不卡视频在线观看| 日本伊人午夜精品| 成人h精品动漫一区二区三区| 欧美图区在线视频| 国产女主播一区| 亚洲电影你懂得| a在线欧美一区| 欧美一区日韩一区| 国产精品三级av| 美女网站一区二区| 色婷婷香蕉在线一区二区| 26uuu另类欧美亚洲曰本| 亚洲女人小视频在线观看| 狠狠色丁香婷婷综合久久片| 91色乱码一区二区三区| 2019国产精品| 丝袜美腿成人在线| 99久久精品费精品国产一区二区| 欧美mv和日韩mv的网站| 一区二区三区欧美久久|