afe_639.inc

来自「汽车无钥进入系统设计,基于PIC单片机16F639,包括电路图和源码」· INC 代码 · 共 947 行 · 第 1/5 页

INC
947
字号
;------------------------------------------------------------------------------+
AFE.SendCMDAGCPresON macro
	banksel SPI.BufferH
	movlw	AFE.CMDAGCOn
	movwf	SPI.BufferH
	call	SPI.Write
	endm
;------------------------------------------------------------------------------+
;                                                                              |
;    AFE.SendCMDAGCPresOFF()                                                   |
;                                                                              |
;------------------------------------------------------------------------------+
;                                                                              |
;    This macro sends a AGC Preserve Off command to the AFE by using the       |
;    SPI-Bus.                                                                  |
;                                                                              |
;                                                                              |
;                                                                              |
;    Used SFRs:                                                                |
;                                                                              |
;                                                                              |
;    Calls subroutines:                                                        |
;    SPI.Write                                                                 |
;                                                                              |
;                                                                              |
;    Stacklevel: 1                                                             |
;                                                                              |
;                                                                              |
;    Example:                                                                  |
;    AFE.SendCMDAGCPresOFF                                                     |
;                                                                              |
;                                                                              |
;    Description:                                                              |
;        This sends the command                                                |
;                                                                              |
;------------------------------------------------------------------------------+
AFE.SendCMDAGCPresOFF macro
	banksel SPI.BufferH
	movlw	AFE.CMDAGCOff
	movwf	SPI.BufferH
	call	SPI.Write
	endm
;------------------------------------------------------------------------------+
;                                                                              |
;    AFE.SendCMDSoftReset()                                                    |
;                                                                              |
;------------------------------------------------------------------------------+
;                                                                              |
;    This macro sends a SoftReset on command to the AFE by using the SPI-Bus.  |
;                                                                              |
;                                                                              |
;                                                                              |
;    Used SFRs:                                                                |
;                                                                              |
;                                                                              |
;    Calls subroutines:                                                        |
;    SPI.Write                                                                 |
;                                                                              |
;                                                                              |
;    Stacklevel: 1                                                             |
;                                                                              |
;                                                                              |
;    Example:                                                                  |
;    AFE.SendCMDSoftReset                                                      |
;                                                                              |
;                                                                              |
;    Description:                                                              |
;        This sends the command                                                |
;                                                                              |
;------------------------------------------------------------------------------+
AFE.SendCMDSoftReset macro
	banksel SPI.BufferH
	movlw	AFE.CMDSR
	movwf	SPI.BufferH
	call	SPI.Write
	endm
;------------------------------------------------------------------------------+
;                                                                              |
;    AFE.EnableChannelX()                                                      |
;                                                                              |
;------------------------------------------------------------------------------+
;                                                                              |
;    This macro enables the LF Channel X 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.EnableChannelX                                                        |
;                                                                              |
;                                                                              |
;    Description:                                                              |
;        This enables Channel X                                                |
;                                                                              |
;------------------------------------------------------------------------------+
AFE.EnableChannelX macro
	banksel	AFE.ConfMap
	movf	AFE.ConfMap,w
	andlw	b'11111110'
	movwf	AFE.ConfMap
	movlw	0x00
	call	AFE.WriteRegister
	AFE.updateColumnParity
	endm
;------------------------------------------------------------------------------+
;                                                                              |
;    AFE.EnableChannelY()                                                      |
;                                                                              |
;------------------------------------------------------------------------------+
;                                                                              |
;    This macro enables the LF Channel Y 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.EnableChannelY                                                        |
;                                                                              |
;                                                                              |
;    Description:                                                              |
;        This enables Channel Y                                                |
;                                                                              |
;------------------------------------------------------------------------------+
AFE.EnableChannelY macro
	banksel	AFE.ConfMap
	movf	AFE.ConfMap,w
	andlw	b'11111101'
	movwf	AFE.ConfMap
	movlw	0x00
	call	AFE.WriteRegister
	AFE.updateColumnParity
	endm
;------------------------------------------------------------------------------+
;                                                                              |
;    AFE.EnableChannelZ()                                                      |
;                                                                              |
;------------------------------------------------------------------------------+
;                                                                              |
;    This macro enables 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                                                             |
;                                                                              |

⌨️ 快捷键说明

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