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

📄 afe_639.inc

📁 汽车无钥进入系统设计,基于PIC单片机16F639,包括电路图和源码
💻 INC
📖 第 1 页 / 共 5 页
字号:
	movf	AFE.ConfMap,w
	iorlw	0x02
	movwf	AFE.ConfMap
	movlw	0x00
	call	AFE.WriteRegister
	AFE.updateColumnParity
	endm
;------------------------------------------------------------------------------+
;                                                                              |
;    AFE.DisableChannelZ()                                                     |
;                                                                              |
;------------------------------------------------------------------------------+
;                                                                              |
;    This macro disables the LF Channel Z at the AFE.                          |
;                                                                              |
;                                                                              |
;                                                                              |
;    Used SFRs: FSR                                                            |
;                                                                              |
;                                                                              |
;    Calls subroutines:                                                        |
;    AFE.WriteRegister                                                         |
;        AFE.CalcParity                                                        |
;        SPI.Write                                                             |
;    AFE.updateColumnParity                                                    |
;        AFE.WriteRegister                                                     |
;            AFE.CalcParity                                                    |
;            SPI.Write                                                         |
;        AFE.CalcColumnParity                                                  |
;                                                                              |
;                                                                              |
;    Stacklevel: 2                                                             |
;                                                                              |
;                                                                              |
;    Example:                                                                  |
;    AFE.EnableChannelZ                                                        |
;                                                                              |
;                                                                              |
;    Description:                                                              |
;        This enables Channel Z                                                |
;                                                                              |
;------------------------------------------------------------------------------+
AFE.DisableChannelZ macro	;save some code with bsf :)
	banksel	AFE.ConfMap
	movf	AFE.ConfMap,w
	iorlw	0x04
	movwf	AFE.ConfMap
	movlw	0x00
	call	AFE.WriteRegister
	AFE.updateColumnParity
	endm
;------------------------------------------------------------------------------+
;                                                                              |
;    AFE.setOutputData()                                                       |
;                                                                              |
;------------------------------------------------------------------------------+
;                                                                              |
;    This macro sets the LFData output to data mode.                           |
;                                                                              |
;                                                                              |
;                                                                              |
;    Used SFRs: FSR                                                            |
;                                                                              |
;                                                                              |
;    Calls subroutines:                                                        |
;    AFE.WriteRegister                                                         |
;        AFE.CalcParity                                                        |
;        SPI.Write                                                             |
;    AFE.updateColumnParity                                                    |
;        AFE.WriteRegister                                                     |
;            AFE.CalcParity                                                    |
;            SPI.Write                                                         |
;        AFE.CalcColumnParity                                                  |
;                                                                              |
;                                                                              |
;    Stacklevel: 2                                                             |
;                                                                              |
;                                                                              |
;    Example:                                                                  |
;    AFE.setOutputData                                                         |
;                                                                              |
;                                                                              |
;    Description:                                                              |
;        This sets the LFData output to data mode                              |
;                                                                              |
;------------------------------------------------------------------------------+
AFE.setOutputData	macro
	banksel AFE.ConfMap
	bcf		(AFE.ConfMap+1),7
	bcf		(AFE.ConfMap+1),6
	movlw	0x01
	call	AFE.WriteRegister
	AFE.updateColumnParity
	endm
;------------------------------------------------------------------------------+
;                                                                              |
;    AFE.setOutputClk()                                                        |
;                                                                              |
;------------------------------------------------------------------------------+
;                                                                              |
;    This macro sets the LFData output to clock mode.                          |
;    The clock signal of the carrier frequency will now drive the LFdata pin.  |
;                                                                              |
;                                                                              |
;                                                                              |
;    Used SFRs: FSR                                                            |
;                                                                              |
;                                                                              |
;    Calls subroutines:                                                        |
;    AFE.WriteRegister                                                         |
;        AFE.CalcParity                                                        |
;        SPI.Write                                                             |
;    AFE.updateColumnParity                                                    |
;        AFE.WriteRegister                                                     |
;            AFE.CalcParity                                                    |
;            SPI.Write                                                         |
;        AFE.CalcColumnParity                                                  |
;                                                                              |
;                                                                              |
;    Stacklevel: 2                                                             |
;                                                                              |
;                                                                              |
;    Example:                                                                  |
;    AFE.setOutputClk                                                          |
;                                                                              |
;                                                                              |
;    Description:                                                              |
;        This sets the LFData output to clock mode                             |
;                                                                              |
;------------------------------------------------------------------------------+
AFE.setOutputClk	macro
	banksel AFE.ConfMap
	bcf		(AFE.ConfMap+1),7
	bsf		(AFE.ConfMap+1),6
	movlw	0x01
	call	AFE.WriteRegister
	AFE.updateColumnParity
	endm
;------------------------------------------------------------------------------+
;                                                                              |
;    AFE.setOutputRSSI()                                                       |
;                                                                              |
;------------------------------------------------------------------------------+
;                                                                              |
;    This macro sets the LFData output to RSSI mode.                           |
;    The LFdata pin will put out a current proportional to the signal strength |
;    of the LF-Field.                                                          |
;                                                                              |
;                                                                              |
;                                                                              |
;    Used SFRs: FSR                                                            |
;                                                                              |
;                                                                              |
;    Calls subroutines:                                                        |
;    AFE.WriteRegister                                                         |
;        AFE.CalcParity                                                        |
;        SPI.Write                                                             |
;    AFE.updateColumnParity                                                    |
;        AFE.WriteRegister                                                     |
;            AFE.CalcParity                                                    |
;            SPI.Write                                                         |
;        AFE.CalcColumnParity                                                  |
;                                                                              |
;                                                                              |
;    Stacklevel: 2                                                             |
;                                                                              |
;                                                                              |
;    Example:                                                                  |
;    AFE.setOutputRSSI                                                         |
;                                                                              |
;                                                                              |
;    Description:                                                              |
;        This sets the LFData output to RSSI mode                              |
;                                                                              |
;------------------------------------------------------------------------------+
AFE.setOutputRSSI	macro
	banksel AFE.ConfMap
	bsf		(AFE.ConfMap+1),7
	movlw	0x01
	call	AFE.WriteRegister
	AFE.updateColumnParity
	endm
;------------------------------------------------------------------------------+
;                                                                              |
;    AFE.setXTuningCap( w )                                                    |
;                                                                              |
;------------------------------------------------------------------------------+
;                                                                              |
;    This macro sets the value for the tuning capacitors at channel X.         |
;    The input value must not exceed 63.                                       |

⌨️ 快捷键说明

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