;   ***************************************************************
;   * Copyright (C) 2008, Embed Inc (http://www.embedinc.com)     *
;   *                                                             *
;   * Permission to copy this file is granted as long as this     *
;   * copyright notice is included in its entirety at the         *
;   * beginning of the file, whether the file is copied in whole  *
;   * or in part and regardless of whether other information is   *
;   * added to the copy.                                          *
;   *                                                             *
;   * The contents of this file may be used in any way,           *
;   * commercial or otherwise.  This file is provided "as is",    *
;   * and Embed Inc makes no claims of suitability for a          *
;   * particular purpose nor assumes any liability resulting from *
;   * its use.                                                    *
;   ***************************************************************
;
;   Include file for the QQ2 PIC application.
;
;   *** INSERT DESCRIPTION OF THE APPLICATION HERE ***
;
/include "qq2lib.ins.aspic"
;
;   Application configuration parameters
;
gbank    equ     0           ;direct register bank for global variables
; gbankadr equ     0           ;adr within globals bank (access bank on PIC18)
;
;   Derived constants.
;
gbankadr equ     bankadr(gbank) ;adr within globals bank (access bank on PIC18)
;
;**********
;
;   Global flag bits.
;
/flag    sin                 ;a serial line input byte is available
/flag    sout                ;serial output can accept another byte
;
;**********
;
;   I/O pin declarations.
;
;   The ports are initialized in the PORT module according to the I/O
;   bit definitions here.
;
/inbit   ex1     porta 0     ;example input bit, port A bit 0
/outbit  ex2     porta 1 0   ;example output bit, port A bit 1, initial value = 0

/inbit   button  portb 0 pup ;user button example, internal pullup enabled
/inbit   tx      portc 6     ;UART output, must be declared as input
/inbit   rx      portc 7     ;UART input, must be declared as input
;
;***********************************************************************
;
;   Macro PUTBYTE <bval>
;
;   Send the byte BVAL to the host.  This is a simple convenience wrapper
;   that sets REG0 to the byte value, then calls UART_PUT.  REG0 is trashed.
;
putbyte  macro   bval
         movlw   (bval)      ;get the byte value into W
         movwf   reg0        ;pass it in REG0
         gcall   uart_put    ;send it to the host
         endm