亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区| 亚洲一级二级在线| 91精品国产综合久久精品app| 国内精品久久久久影院薰衣草| 亚洲免费高清视频在线| 久久久久久久久久久久电影| 51精品秘密在线观看| 欧美在线你懂的| 色综合天天综合色综合av| 91在线观看地址| 国产精品影视网| 蜜桃视频在线一区| 久久99国产精品久久99果冻传媒| 国产喂奶挤奶一区二区三区| 欧美videos中文字幕| 国产亚洲欧美在线| 中文字幕日韩欧美一区二区三区| 亚洲欧美aⅴ...| 日韩电影免费在线看| 国产福利一区在线观看| 91在线你懂得| 欧美一级黄色大片| 国产日韩欧美精品电影三级在线| 亚洲天堂中文字幕| 免费成人在线观看| 国产盗摄一区二区| 色综合夜色一区| 91麻豆精品国产91久久久久| 日韩一级成人av| 亚洲国产精品t66y| 一级女性全黄久久生活片免费| 午夜电影一区二区三区| 日本麻豆一区二区三区视频| 国产乱码精品一品二品| 91欧美一区二区| 日韩无一区二区| 国产清纯美女被跳蛋高潮一区二区久久w| 国产成人99久久亚洲综合精品| 91麻豆免费在线观看| 日韩欧美国产一区二区三区| 国产精品久久久久三级| 免费成人在线播放| 91免费视频网址| 国产欧美日韩视频一区二区| 亚洲国产婷婷综合在线精品| 国产乱一区二区| 717成人午夜免费福利电影| 国产偷国产偷亚洲高清人白洁 | 欧美日韩一区二区三区高清| 在线视频欧美区| 精品少妇一区二区三区在线播放| 久久精品视频网| 日韩国产高清在线| 粉嫩一区二区三区性色av| 欧美日韩精品一区二区| 国产日韩欧美精品在线| 免费久久精品视频| 91麻豆免费看| 国产清纯美女被跳蛋高潮一区二区久久w| 亚洲激情自拍偷拍| 国产伦理精品不卡| 日韩三级高清在线| 亚洲成人动漫在线免费观看| 91亚洲大成网污www| 日韩欧美二区三区| 日韩综合在线视频| 欧洲一区二区三区免费视频| 中文字幕第一区| 国产一区二区三区免费观看| 91精品国产色综合久久| 一区二区三区高清| 欧洲精品视频在线观看| 国产欧美一区二区三区在线老狼| 免费日本视频一区| 欧美二区三区的天堂| 免播放器亚洲一区| 2021中文字幕一区亚洲| 久久精品国产99| 26uuu精品一区二区在线观看| 亚洲欧美精品午睡沙发| 色婷婷国产精品综合在线观看| 国产蜜臀97一区二区三区| 国产成人在线免费观看| 国产性色一区二区| jlzzjlzz欧美大全| 亚洲欧美在线高清| 91麻豆国产香蕉久久精品| 怡红院av一区二区三区| 欧美三级电影一区| 青青青爽久久午夜综合久久午夜| 欧美一区二区三区四区五区 | 天堂一区二区在线| 日韩网站在线看片你懂的| 久久99久国产精品黄毛片色诱| 欧美va亚洲va香蕉在线| 99天天综合性| 天堂影院一区二区| 亚洲美女区一区| 日韩欧美的一区| 色婷婷综合久久久久中文一区二区 | 国产精品女人毛片| 99精品国产视频| 精品一区二区av| 亚洲最新视频在线观看| 3d动漫精品啪啪一区二区竹菊| 麻豆精品在线播放| 亚洲欧洲韩国日本视频| 91精品国产一区二区三区| av一区二区三区四区| 精油按摩中文字幕久久| 美国av一区二区| 男人的j进女人的j一区| 亚洲一区二区三区在线| 亚洲欧洲av色图| 欧美激情艳妇裸体舞| 26uuu另类欧美亚洲曰本| 7777精品伊人久久久大香线蕉| 99视频一区二区三区| 国产乱对白刺激视频不卡| 日韩高清在线一区| 亚洲国产精品嫩草影院| 国产精品久99| 亚洲情趣在线观看| 中文字幕一区二区三区四区| 日本一区二区三区免费乱视频| 日韩视频一区二区三区在线播放 | 精品一区二区三区不卡| 国产精品中文字幕日韩精品| 国产白丝网站精品污在线入口| 国产精品亚洲成人| 国产一区二区免费在线| 国产精品一区二区三区99| 精品影院一区二区久久久| 六月丁香综合在线视频| 精品一区二区三区影院在线午夜| 久久精品国产免费| 精品一二三四区| 夫妻av一区二区| 国产成人免费在线观看不卡| 粉嫩aⅴ一区二区三区四区| 丁香六月久久综合狠狠色| 色综合久久综合中文综合网| 欧美日韩国产高清一区二区三区 | 欧美色倩网站大全免费| 91精品国产综合久久小美女| 久久综合久久鬼色| 午夜av一区二区| av色综合久久天堂av综合| 欧亚洲嫩模精品一区三区| 欧美一区二区私人影院日本| 国产欧美日韩中文久久| 亚洲午夜一区二区三区| 国产精品一级在线| 欧美日韩卡一卡二| 国产拍揄自揄精品视频麻豆| 亚洲精品欧美在线| 中文字幕亚洲一区二区va在线| 精品国产区一区| 欧美一区国产二区| 天天综合天天做天天综合| 欧美中文一区二区三区| 亚洲五码中文字幕| 欧美浪妇xxxx高跟鞋交| 日韩av一区二| 精品奇米国产一区二区三区| 九九国产精品视频| 欧美国产日韩精品免费观看| 福利91精品一区二区三区| 国产精品成人午夜| 色美美综合视频| 亚洲自拍偷拍网站| 9色porny自拍视频一区二区| 国产精品狼人久久影院观看方式| 麻豆精品国产传媒mv男同| 日韩欧美国产电影| 人人超碰91尤物精品国产| 欧美一级日韩免费不卡| 一区二区视频在线看| 看片网站欧美日韩| 久久久久9999亚洲精品| 国产成人精品影视| 中文字幕av一区二区三区免费看| 成人动漫一区二区在线| 亚洲免费观看高清| 91精品国产高清一区二区三区 | 欧美国产综合色视频| 91看片淫黄大片一级在线观看| 一级做a爱片久久| 日韩一区二区三区四区五区六区| 久久99国内精品| 2019国产精品| 欧美日韩成人综合| 精品一区二区三区免费毛片爱| 欧美国产1区2区| 日韩一区二区三区在线视频| www.成人在线| 天天色综合天天| 久久久噜噜噜久久中文字幕色伊伊| 成人app在线观看| 国产高清在线精品|