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

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

?? csr_1.asm

?? 此文件是一個源程序代碼
?? ASM
?? 第 1 頁 / 共 2 頁
字號:
;;*****************************************************************************
;;*****************************************************************************
;;  FILENAME: CSR_1.asm
;;   Version: 1.1, Updated on 2005/10/13 at 09:13:22
;;  Generated by PSoC Designer ver 4.2  b1013 : 02 September, 2004
;;
;;  DESCRIPTION: CSR_1 User Module software implementation file
;;                for the 21xxx PSoC family of devices.
;;-----------------------------------------------------------------------------
;;  Copyright (c) Cypress MicroSystems 2000-2005. All Rights Reserved.
;;*****************************************************************************
;;*****************************************************************************

include "m8c.inc"
include "memory.inc"
include "CSR_1.inc"

;-----------------------------------------------
;  Global Symbols
;-----------------------------------------------

export _CSR_1_Start
export  CSR_1_Start
export _CSR_1_Stop
export  CSR_1_Stop
export _CSR_1_StartScan
export  CSR_1_StartScan
export _CSR_1_StopScan
export  CSR_1_StopScan
export _CSR_1_GetScanStatus
export  CSR_1_GetScanStatus
export _CSR_1_ClearSwitches
export  CSR_1_ClearSwitches
export _CSR_1_iReadSwitch
export  CSR_1_iReadSwitch

export _CSR_1_iGetPortPin
export  CSR_1_iGetPortPin
export _CSR_1_EnableSwitch
export  CSR_1_EnableSwitch
export _CSR_1_DisableSwitch
export  CSR_1_DisableSwitch
export _CSR_1_SetDacCurrent
export  CSR_1_SetDacCurrent
export _CSR_1_SetScanSpeed
export  CSR_1_SetScanSpeed

export  CSR_1_Switch_Table
export _CSR_1_Switch_Table

;-----------------------------------------------
; Variable Allocation
;-----------------------------------------------
AREA InterruptRAM (RAM, REL, CON)

 CSR_1_bBitMask:                        BLK  1  ; Temp bitmask byte

_CSR_1_bSwitchNum:                              ; Current switch to scan
 CSR_1_bSwitchNum:                      BLK  1

_CSR_1_bfStatus:                                ; Status byte
 CSR_1_bfStatus:                        BLK  1

_CSR_1_bScanStart:                              ; First switch to scan
 CSR_1_bScanStart:                      BLK  1

_CSR_1_bScanEnd:                                ; Last switch to scan
 CSR_1_bScanEnd:                        BLK  1

_CSR_1_iaSwResult:                              ; Array of ints, one entry for each switch
 CSR_1_iaSwResult:                      BLK  (2*CSR_1_TotalSwitchCount)

_CSR_1_bPWMPeriod:                              ; Last switch to scan
 CSR_1_bPWMPeriod:                      BLK  1

export  CSR_1_bfStatus
export _CSR_1_bfStatus
export  CSR_1_bSwitchNum
export _CSR_1_bSwitchNum
export  CSR_1_iaSwResult
export _CSR_1_iaSwResult

export  CSR_1_bScanStart
export _CSR_1_bScanStart
export  CSR_1_bScanEnd
export _CSR_1_bScanEnd

export  CSR_1_bPWMPeriod
export _CSR_1_bPWMPeriod

;@PSoC_UserCode_INIT@ (Do not change this line.)
;---------------------------------------------------
; Insert your custom declarations below this banner
;---------------------------------------------------

;------------------------
; User Includes
;------------------------


;------------------------
; User Constant Definitions
;------------------------


;------------------------
; User Variable Allocation
;------------------------


;---------------------------------------------------
; Insert your custom declarations above this banner
;---------------------------------------------------
;@PSoC_UserCode_END@ (Do not change this line.)

;------------------------
;  Constant Definitions
;------------------------

AREA UserModules (ROM, REL, CON)

LSB:  equ  1
MSB:  equ  0

;---------------------------------
; Tables below generated by Wizard
;---------------------------------

; The Switch Table consist of two bytes for each switch.  The first byte is the
; port number and the second is the bit mask for the bit.  (Not the bit number)
; For example an entry for port 2 bit 3 (P2[3])  would be "dw 0x0208"
;
; This table consist of 0xb switches.
 CSR_1_Switch_Table:
_CSR_1_Switch_Table:
	dw	0x0104	// Port 1 Bit 2
	dw	0x0110	// Port 1 Bit 4
	dw	0x0140	// Port 1 Bit 6
	dw	0x0001	// Port 0 Bit 0
	dw	0x0002	// Port 0 Bit 1
	dw	0x0004	// Port 0 Bit 2
	dw	0x0008	// Port 0 Bit 3
	dw	0x0010	// Port 0 Bit 4
	dw	0x0020	// Port 0 Bit 5
	dw	0x0040	// Port 0 Bit 6
	dw	0x0080	// Port 0 Bit 7


.SECTION
;-----------------------------------------------------------------------------
;  FUNCTION NAME: CSR_1_Start(void)
;
;  DESCRIPTION:
;  Initializes registers and turns on the comparitor.
;
;-----------------------------------------------------------------------------
;
;  ARGUMENTS:  
;    None
;
;  RETURNS:      None.   
;  SIDE EFFECTS: 
;    The A and X registers may be modified by this or future implementations
;    of this function.  The same is true for all RAM page pointer registers in
;    the Large Memory Model.  When necessary, it is the calling function's
;    responsibility to perserve their values across calls to fastcall16 
;    functions.
;
 CSR_1_Start:
_CSR_1_Start:
   RAM_PROLOGUE RAM_USE_CLASS_4
   RAM_SETPAGE_CUR >CSR_1_bPWMPeriod

IF (CSR_1_Method)
   // Period Method
   mov [CSR_1_bPWMPeriod], 0x10
   mov  reg[CSR_1_PWM_PERIOD_REG],0x10                ; Set period (default to 10 cycles)
   mov  reg[CSR_1_PWM_COMPARE_REG],0x0E               ; Set compare 
   mov  reg[DAC_D], 0x80                              ; Set Dac at medium level
ELSE
   // Frequency Method
   mov [CSR_1_bPWMPeriod], 0xFF
   mov  reg[CSR_1_PWM_PERIOD_REG],0xFF                ; Set period
   mov  reg[CSR_1_PWM_COMPARE_REG],0xFD               ; Set compare 
   mov  reg[DAC_D], 0x80                              ; Set Dac at medium level
ENDIF

   mov  reg[CMP_CR1],0x00                             ; CLDIS0 - synced comparator input enters mux

   mov   reg[DEC_CR0],0x00                            ; IGEN0 - output of comparator is not ANDed with a PWM

   or   reg[RDI0RI],0x03                              ; Connect Row 0 to GIO0[4]


   M8C_SetBank1
   mov  reg[DAC_CR],0x03                              ; Range high = 0x08, Reset on G00[4] = 0x02, Dac Enable = 0x01
   mov  reg[CMP_GO_EN],0x08                           ; GOO[4] out = 0x08, SEL0 - now sends output of IGEN0
   or   reg[GDI_O_OU],0x10                            ;  THIS SHOULD WORK IN THE XML  DEBUG

   mov  reg[MUX_CR0],0x00                             ; Make sure all switches are off by default
   mov  reg[MUX_CR1],0x00
   mov  reg[MUX_CR2],0x00
   mov  reg[MUX_CR3],0x00

   or   reg[CLK_CR3],0x04                             ; Use Sysclock direct for Column 0

   mov  reg[CSR_1_PWM_OUT_REG],0x3C                   ; Output PWM compare to row 0, TC to row 3
   
IF (CSR_1_Method)

   // Period Method
   mov  reg[CSR_1_PWM_IN_REG],0x1C                    ; Data = 0x10 (High) and Clock = 0x0C (Row_Input_0)
   mov  reg[CSR_1_CTR_INPUT_LSB_REG],0xFC             ; Data = 0xF0 (Row_input_3) and Clock = 0x0X (SysClk direct see output reg) 
   mov  reg[CSR_1_CTR_INPUT_MSB_REG],0x3C             ; Data = 0x30 (Chain from LSB) and Clock = 0x0C (SysClk direct see output reg)  
   mov  reg[CSR_1_CTR_OUTPUT_LSB_REG],0xC0            ; Use SysClk direct              
   mov  reg[CSR_1_CTR_OUTPUT_MSB_REG],0xC0            ; Use SysClk direct

ELSE

   // Frequency Method
   mov  reg[OSC_CR4],0x00                             ; Use Sysclock as input to VC3
   mov  reg[OSC_CR3],0xFF                             ; Set VC3 to 255
   mov  reg[CSR_1_PWM_IN_REG],0x11                    ; Data = 0x10 (High) and Clock = 0x01 (VC3)
   mov  reg[CSR_1_CTR_INPUT_LSB_REG],0xFC             ; Data = 0x80 (Row_input_3) and Clock = 0x0C (Row_Input_0) 
   mov  reg[CSR_1_CTR_INPUT_MSB_REG],0x3C             ; Data = 0x30 (Chain from LSB) and Clock = 0x0C (Row_Input_0)  
   mov  reg[CSR_1_CTR_OUTPUT_LSB_REG],0x00            ; Sync to SysClk and no outputs
   mov  reg[CSR_1_CTR_OUTPUT_MSB_REG],0x00            ; Sync to SysClk and no outputs

ENDIF

   and  reg[RDI0IS], ~0x80                            ; Make sure input 'A' to LUT3 is RO[3] 
   and  reg[RDI0LT1],~0xF0				
   or   reg[RDI0LT1],0x40                             ; Combine PWM compare and ~PWM TC running to GPIO: ~A&B (LUT3)
   and  reg[RDI0RO1],~0xF0
   or   reg[RDI0RO1],0x80                             ; Output LUT3 to global out odd 7
   or   reg[GDI_O_OU],0x80                            ; Drive global out odd 7 onto global in odd 7
   or   reg[RDI0RI],0xC0                              ; Row input 3 comes from global in odd 7
   and  reg[RDI0SYN],~0x08                            ; Row input 3 passes with synchronization

   M8C_SetBank0

   call  CSR_1_ClearSwitches                          ; Loop through all keys and deactivate
                                                      ; This also puts pin in proper mode.

   RAM_EPILOGUE RAM_USE_CLASS_4
   ret
.ENDSECTION




.SECTION
;-----------------------------------------------------------------------------
;  FUNCTION NAME: CSR_1_ClearSwitches(void)
;
;  DESCRIPTION:
;    Clears all switches to the non-sampling state.
;
;-----------------------------------------------------------------------------
;
;  ARGUMENTS:    None.
;  RETURNS:      None
;  SIDE EFFECTS: 
;    The A and X registers may be modified by this or future implementations
;    of this function.  The same is true for all RAM page pointer registers in
;    the Large Memory Model.  When necessary, it is the calling function's
;    responsibility to perserve their values across calls to fastcall16 
;    functions.
;
 CSR_1_ClearSwitches:
_CSR_1_ClearSwitches:
   RAM_PROLOGUE RAM_USE_CLASS_4
                                                      ; Loop through all keys and deactivate

   mov   A,CSR_1_TotalSwitchCount                     ; Check if key value in range.
   dec   A
.InitLoop:                                            ; Initialize all keys to be Disabled
   push  A
   call  CSR_1_iGetPortPin
   call  CSR_1_DisableSwitch
   pop   A
   dec   A
   jnc   .InitLoop

   RAM_EPILOGUE RAM_USE_CLASS_4
   ret
.ENDSECTION


.SECTION
;-----------------------------------------------------------------------------
;  FUNCTION NAME: CSR_1_Stop(void)
;
;  DESCRIPTION:
;  Stop the switch scanner, disable interrupts and remove power to the analog 
;  block. This function also resets all switches to there inactive state.
;
;-----------------------------------------------------------------------------
;
;  ARGUMENTS:    None.
;  RETURNS:      Nothing.
;  SIDE EFFECTS: 
;    The A and X registers may be modified by this or future implementations
;    of this function.  The same is true for all RAM page pointer registers in
;    the Large Memory Model.  When necessary, it is the calling function's
;    responsibility to perserve their values across calls to fastcall16 
;    functions.
;
 CSR_1_Stop:
_CSR_1_Stop:
   RAM_PROLOGUE RAM_USE_CLASS_4

   CSR_1_DisableInt_M                                 ; Disable scanner interrupts
   CSR_1_Stop_M                                       ; Disable PWM scanner
   mov   reg[CSR_1_ACE_CONTROL2_REG],0x00             ; Turn off Power to analog block

   call  CSR_1_ClearSwitches                          ; Loop through all keys and deactivate

   RAM_EPILOGUE RAM_USE_CLASS_4
   ret
.ENDSECTION

.SECTION
;-----------------------------------------------------------------------------
;  FUNCTION NAME: CSR_1_iGetPortPin(BYTE bSwitch)
;
;  DESCRIPTION:
;      Returns the port and pin mask from a given key number.  This function
;      uses the table CSR_1_Switch_Table to retreive this information.
;-----------------------------------------------------------------------------
;
;  ARGUMENTS:    
;        A => Switch Number  ( 0 to n )
;  RETURNS:    
;        A  <=  Switch Bitmap
;        X  <=  Port Number
;
;  SIDE EFFECTS: 
;    The A and X registers may be modified by this or future implementations
;    of this function.  The same is true for all RAM page pointer registers in
;    the Large Memory Model.  When necessary, it is the calling function's
;    responsibility to perserve their values across calls to fastcall16 
;    functions.
;
 CSR_1_iGetPortPin:
_CSR_1_iGetPortPin:

  RAM_PROLOGUE RAM_USE_CLASS_1
   asl    A                                      ; multiply key by 2 since table is 2 bytes per key
   mov    X,A                                    ; Copy index*2 in x for next value
   index  CSR_1_Switch_Table                     ; A contains the port value
   swap   A,X                                    ; Place port value in X and index*2 in A
   inc    A                                      ; Advance to next value (bitMask) 
   index  CSR_1_Switch_Table                     ; A contains bitMask, X has port number

   RAM_EPILOGUE RAM_USE_CLASS_1
   ret

.ENDSECTION


.SECTION
;-----------------------------------------------------------------------------
;  FUNCTION NAME: CSR_1_EnableSwitch(BYTE bSwitchMask, BYTE bPort)
;
;  DESCRIPTION:
;    Configures switch to be an input to be measure duirng next measurement
;    cycle.  This function does not clear the last switch.
;    Place key port in Analog Hi-Z mode and enables the correct mux input.
;-----------------------------------------------------------------------------
;
;  ARGUMENTS:    
;          X =>  Port Number for given key
;          A =>  Bit mask for given switch
;
;  RETURNS:      none    
;
;  SIDE EFFECTS: 
;    The A and X registers may be modified by this or future implementations

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
综合欧美一区二区三区| 国产蜜臀av在线一区二区三区 | 亚洲成av人在线观看| 日韩精品一区二区三区swag | 亚洲一区自拍偷拍| 久久精品人人爽人人爽| 在线91免费看| 91麻豆文化传媒在线观看| 精品午夜久久福利影院| 午夜精品久久久久久久久久| 国产精品嫩草影院av蜜臀| 欧美一二区视频| 欧美性生活影院| 91麻豆免费视频| 国产黑丝在线一区二区三区| 蜜臀av性久久久久蜜臀av麻豆| 一区二区三区欧美在线观看| 欧美国产欧美综合| 精品少妇一区二区三区在线视频| 精品视频一区三区九区| 岛国精品一区二区| 精品无人区卡一卡二卡三乱码免费卡| 亚洲午夜在线观看视频在线| 亚洲视频中文字幕| 中文一区一区三区高中清不卡| 欧美不卡一二三| 日韩一区二区免费视频| 欧美喷潮久久久xxxxx| 在线一区二区三区做爰视频网站| 成人aaaa免费全部观看| 国产.欧美.日韩| 国产精华液一区二区三区| 国产酒店精品激情| 国产福利91精品一区| 国内不卡的二区三区中文字幕| 男人的j进女人的j一区| 日本视频在线一区| 日本不卡一区二区三区高清视频| 水蜜桃久久夜色精品一区的特点| 亚洲国产成人av网| 亚洲aⅴ怡春院| 视频在线观看一区| 日韩av在线免费观看不卡| 日本美女一区二区三区视频| 蜜臀av在线播放一区二区三区 | 麻豆成人免费电影| 狠狠色丁香婷婷综合| 国产一区二区三区不卡在线观看| 国产精品123区| aaa国产一区| 欧美在线|欧美| 91精品在线一区二区| 日韩视频一区二区在线观看| 日韩欧美一区二区久久婷婷| 久久―日本道色综合久久| 国产欧美一区二区在线| 综合av第一页| 午夜精品免费在线观看| 男女男精品视频网| 国产成人综合网站| 91在线视频网址| 欧美日韩不卡一区| 精品成人私密视频| 国产精品视频九色porn| 亚洲精品国产a久久久久久| 五月天丁香久久| 狠狠色狠狠色合久久伊人| 成人免费精品视频| 欧美日韩一区国产| 精品国产免费一区二区三区四区| 亚洲国产经典视频| 一区二区三区久久久| 久久精品国内一区二区三区| 成人黄色片在线观看| 欧美图片一区二区三区| 91 com成人网| 国产精品网站导航| 视频一区欧美日韩| 高清在线不卡av| 欧美日韩免费观看一区三区| 久久亚洲一区二区三区明星换脸| 日韩一区欧美一区| 久久99精品国产麻豆婷婷 | www.成人在线| 91精品国产综合久久小美女| 国产精品私房写真福利视频| 亚洲成av人片| 99久久精品免费精品国产| 欧美大胆一级视频| 亚洲激情在线播放| 国内不卡的二区三区中文字幕 | 国产欧美综合色| 五月婷婷另类国产| 久久99精品国产麻豆婷婷| 欧美丰满嫩嫩电影| 91在线观看高清| 日韩精品资源二区在线| 亚洲私人黄色宅男| 日韩国产欧美在线播放| 成人午夜视频在线| 日韩午夜在线观看| 亚洲免费资源在线播放| 国产999精品久久久久久| 91福利精品视频| 中文久久乱码一区二区| 久久99热99| 在线91免费看| 亚洲一区在线观看视频| 99久久夜色精品国产网站| 欧美精品一区视频| 日韩精品五月天| 欧美亚日韩国产aⅴ精品中极品| 中文字幕的久久| 激情深爱一区二区| 91精品国产入口在线| 一区二区三区中文字幕精品精品| 高清不卡在线观看av| 欧美高清性hdvideosex| 国模冰冰炮一区二区| 亚洲最新在线观看| www.亚洲激情.com| 久久久精品欧美丰满| 精品一区二区三区视频| 91精品国产高清一区二区三区蜜臀| 亚洲女女做受ⅹxx高潮| www.性欧美| 综合在线观看色| av欧美精品.com| 国产精品美日韩| 粉嫩13p一区二区三区| 久久久久国产精品麻豆ai换脸| 黄色精品一二区| 久久日韩精品一区二区五区| 久久精品国产99| 精品盗摄一区二区三区| 黄网站免费久久| 国产欧美视频在线观看| 国产精品白丝jk黑袜喷水| 久久精品一区蜜桃臀影院| 国产一区二区0| 久久久久国色av免费看影院| 国产成人aaaa| 成人欧美一区二区三区| 99久久精品一区| 亚洲一区成人在线| 欧美乱熟臀69xxxxxx| 免费不卡在线视频| 久久一夜天堂av一区二区三区| 国产精品资源在线| 成人午夜免费av| 日韩精品久久久久久| 一区二区三区中文在线| 久久老女人爱爱| 波多野结衣91| 国产欧美va欧美不卡在线| 成人天堂资源www在线| 亚洲欧美区自拍先锋| 欧美日韩高清一区二区三区| 麻豆精品国产91久久久久久| 久久久91精品国产一区二区三区| 国产suv一区二区三区88区| 成人免费在线观看入口| 欧美日本在线看| 国产精品系列在线观看| 亚洲精品日日夜夜| 欧美一区二区三区四区五区| 国产一区二区久久| 国产精品二区一区二区aⅴ污介绍| 日本韩国一区二区三区视频| 日韩成人精品在线观看| 中文字幕精品—区二区四季| 在线视频欧美区| 久久99蜜桃精品| 亚洲精品日日夜夜| 欧美成人一区二区三区| 99久久综合色| 美国三级日本三级久久99| 国产精品不卡一区二区三区| 91麻豆精品国产自产在线观看一区| 国产激情一区二区三区| 欧美一区中文字幕| 国产精品私人影院| 欧美疯狂性受xxxxx喷水图片| 国产呦精品一区二区三区网站| 亚洲天堂中文字幕| 日韩一级视频免费观看在线| 成人久久18免费网站麻豆| 日韩高清在线电影| 亚洲欧美在线高清| 欧美精品一区二区三区蜜桃| 色婷婷综合久色| 国产美女娇喘av呻吟久久| 亚洲自拍都市欧美小说| 国产日韩欧美不卡在线| 欧美裸体bbwbbwbbw| 色综合久久久久久久| 懂色av一区二区三区免费看| 日韩黄色在线观看| 一区二区三区在线看| 中文字幕欧美日本乱码一线二线|