⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 afe_639.inc

📁 汽车无钥进入系统设计,基于PIC单片机16F639,包括电路图和源码
💻 INC
📖 第 1 页 / 共 5 页
字号:
;                                                                              |
;                                                                              |
;    Parameters:                                                               |
;    w - The value of the tuning capacitor                                     |
;                                                                              |
;                                                                              |
;                                                                              |
;    Used SFRs: FSR                                                            |
;                                                                              |
;                                                                              |
;    Calls subroutines:                                                        |
;    AFE.WriteRegister                                                         |
;        AFE.CalcParity                                                        |
;        SPI.Write                                                             |
;    AFE.updateColumnParity                                                    |
;        AFE.WriteRegister                                                     |
;            AFE.CalcParity                                                    |
;            SPI.Write                                                         |
;        AFE.CalcColumnParity                                                  |
;                                                                              |
;                                                                              |
;    Stacklevel: 2                                                             |
;                                                                              |
;                                                                              |
;    Example:                                                                  |
;    movlw   D'33'                                                             |
;    AFE.setXTuningCap                                                         |
;                                                                              |
;                                                                              |
;    Description:                                                              |
;        This sets the tuning capacitor of channel X to 33pF(typ)              |
;                                                                              |
;------------------------------------------------------------------------------+
AFE.setXTuningCap	macro	;make function out of it? Let's have a look at the running Code. The Stacklevel may be more critical
	banksel AFE.Buffer
	movwf	AFE.Buffer
	movf	(AFE.ConfMap+1),w
	andlw	B'11000000'
	iorwf	AFE.Buffer,w
	movwf	(AFE.ConfMap+1)
	movlw	0x01
	call	AFE.WriteRegister
	AFE.updateColumnParity
	endm
;------------------------------------------------------------------------------+
;                                                                              |
;    AFE.setYTuningCap( w )                                                    |
;                                                                              |
;------------------------------------------------------------------------------+
;                                                                              |
;    This macro sets the value for the tuning capacitors at channel Y.         |
;    The input value must not exceed 63.                                       |
;                                                                              |
;                                                                              |
;    Parameters:                                                               |
;    w - The value of the tuning capacitor                                     |
;                                                                              |
;                                                                              |
;                                                                              |
;    Used SFRs: FSR                                                            |
;                                                                              |
;                                                                              |
;    Calls subroutines:                                                        |
;    AFE.WriteRegister                                                         |
;        AFE.CalcParity                                                        |
;        SPI.Write                                                             |
;    AFE.updateColumnParity                                                    |
;        AFE.WriteRegister                                                     |
;            AFE.CalcParity                                                    |
;            SPI.Write                                                         |
;        AFE.CalcColumnParity                                                  |
;                                                                              |
;                                                                              |
;    Stacklevel: 2                                                             |
;                                                                              |
;                                                                              |
;    Example:                                                                  |
;    movlw   D'33'                                                             |
;    AFE.setYTuningCap                                                         |
;                                                                              |
;                                                                              |
;    Description:                                                              |
;        This sets the tuning capacitor of channel Y to 33pF(typ)              |
;                                                                              |
;------------------------------------------------------------------------------+
AFE.setYTuningCap	macro
	banksel AFE.Buffer
	movwf	AFE.Buffer
	movf	(AFE.ConfMap+2),w
	andlw	B'11000000'
	iorwf	AFE.Buffer,w
	movwf	(AFE.ConfMap+2)
	movlw	0x02
	call	AFE.WriteRegister
	AFE.updateColumnParity
	endm
;------------------------------------------------------------------------------+
;                                                                              |
;    AFE.setZTuningCap( w )                                                    |
;                                                                              |
;------------------------------------------------------------------------------+
;                                                                              |
;    This macro sets the value for the tuning capacitors at channel Z.         |
;    The input value must not exceed 63.                                       |
;                                                                              |
;                                                                              |
;    Parameters:                                                               |
;    w - The value of the tuning capacitor                                     |
;                                                                              |
;                                                                              |
;                                                                              |
;    Used SFRs: FSR                                                            |
;                                                                              |
;                                                                              |
;    Calls subroutines:                                                        |
;    AFE.WriteRegister                                                         |
;        AFE.CalcParity                                                        |
;        SPI.Write                                                             |
;    AFE.updateColumnParity                                                    |
;        AFE.WriteRegister                                                     |
;            AFE.CalcParity                                                    |
;            SPI.Write                                                         |
;        AFE.CalcColumnParity                                                  |
;                                                                              |
;                                                                              |
;    Stacklevel: 2                                                             |
;                                                                              |
;                                                                              |
;    Example:                                                                  |
;    movlw   D'33'                                                             |
;    AFE.setZTuningCap                                                         |
;                                                                              |
;                                                                              |
;    Description:                                                              |
;        This sets the tuning capacitor of channel Z to 33pF(typ)              |
;                                                                              |
;------------------------------------------------------------------------------+
AFE.setZTuningCap	macro
	banksel AFE.Buffer
	movwf	AFE.Buffer
	movf	(AFE.ConfMap+3),w
	andlw	B'11000000'
	iorwf	AFE.Buffer,w
	movwf	(AFE.ConfMap+3)
	movlw	0x03
	call	AFE.WriteRegister
	AFE.updateColumnParity
	endm
;------------------------------------------------------------------------------+
;                                                                              |
;    AFE.setXSensitivity( w )                                                  |
;                                                                              |
;------------------------------------------------------------------------------+
;                                                                              |
;    This macro sets the attenuation for channel X.                            |
;    The input value must not exceed 15.                                       |
;                                                                              |
;                                                                              |
;    Parameters:                                                               |
;    w - Half the value of the attenuation in dB                               |
;                                                                              |
;                                                                              |
;                                                                              |
;    Used SFRs: FSR                                                            |
;                                                                              |
;                                                                              |
;    Calls subroutines:                                                        |
;    AFE.WriteRegister                                                         |
;        AFE.CalcParity                                                        |
;        SPI.Write                                                             |
;    AFE.updateColumnParity                                                    |
;        AFE.WriteRegister                                                     |
;            AFE.CalcParity                                                    |
;            SPI.Write                                                         |
;        AFE.CalcColumnParity                                                  |
;                                                                              |
;                                                                              |
;    Stacklevel: 2                                                             |
;                                                                              |
;                                                                              |
;    Example:                                                                  |
;    movlw   D'12'                                                             |
;    AFE.setXSensitivity                                                       |
;                                                                              |
;                                                                              |
;    Description:                                                              |
;        This sets the attenuation for channel X to

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -