;*************************************************
;	Macros de LCD
;*************************************************

;#DEFINE	LCD_PinRs	PORTA,0
;#DEFINE	LCD_PinEnable	PORTA,1
;#DEFINE	LCD_BusDatos	PORTB

LCD_CursorIncr	equ	b'00000110'
LCD_Linea1	equ	b'10000000'
LCD_Linea2	equ	b'11000000'
LCD_OFF		equ	b'00001000'
LCD_CursorON	equ	b'00001110'
LCD_CursorOFF	equ	b'00001100'
LCD_Borra	equ	b'00000001'
LCD_2Li4Bits5x7	equ 	b'00101000'

;LCD_Init	MACRO	PortCtrl,P_Rs,P_En,PortDato,D7,D6,D5,D4
;	Banco1
;	bcf	PortCtrol,P_Rs
;	bcf	PortCtrol,P_En
;	Banco0
;ENDM

LCD_Cmd	MACRO	Comando
	movlw	Comando
	call	LCD_EnviaComando
	ENDM

LCD_Pos MACRO Fila,Columna
	movlw	80+Fila*40+Columna
	call	LCD_EnviaComando
	ENDM
	
;LCD_Enhe MACRO
;	movlw	b'11101110'
;	goto	LCD_Caracter
;	ENDM
;
;LCD_Grado MACRO
;	movlw	b'11011111'
;	goto	LCD_Caracter
;	ENDM

LCD_CP	MACRO	caracter
	movlw	caracter
	call	LCD_Caracter
	ENDM

LCD_Espacios	MACRO	cantidad
	movlw	cantidad
	call	LCD_EnviaBlancos
	ENDM

LCD_Msg	MACRO	msg
	movlw	(msg-Mensajes-1)
	call	LCD_Mensaje
	ENDM
;***************************************************
;	Macros de Retardo
;***************************************************
Ret_us	MACRO	micsec
	movlw	(micsec-4)/4
	call	Retardo_us
	ENDM

Ret_ms	MACRO	milsec
	movlw	milsec	
	call	Retardo_ms
	ENDM
;****************************************************
;	Macro de Conversion de Binario a BCD
;****************************************************
Bin_BCD	MACRO	Binario
	movlw	Binario
	call	BinToBCD
	ENDM