1 // *********************************************************************
    2 //   DPA IO Setup example                                              *
    3 // *********************************************************************
    4 // Copyright (c) IQRF Tech s.r.o.
    5 //
    6 // File:    $RCSfile: DpaIoSetup.c,v $
    7 // Version: $Revision: 1.10 $
    8 // Date:    $Date: 2017/10/19 07:50:19 $
    9 //
   10 // Revision history:
   11 //   2017/03/13  Release for DPA 3.00
   12 //   2015/08/05  Release for DPA 2.20
   13 //   2014/04/30  Release for DPA 2.10
   14 //
   15 // *********************************************************************
   16 
   17 // Online DPA documentation http://www.iqrf.org/DpaTechGuide/
   18 
   19 // Before uploading this example make sure:
   20 // 1. IO Setup is enabled at HWP Configuration
   21 // 2. Embedded IO peripheral is enabled at HWP Configuration
   22 // 3. External EEPROM upload is selected at IQRF IDE. Please note external EEPROM cannot be uploaded using RFPGM.
   23 
   24 // Default IQRF include (modify the path according to your setup)
   25 #include "IQRF.h"
   26 
   27 // Do not check for the Custom DPA Handler existence (we only wrote to the external EEPROM)
   28 #define NO_CUSTOM_DPA_HANDLER
   29 
   30 // Default DPA header (modify the path according to your setup)
   31 #include "DPA.h"
   32 // Default Custom DPA Handler header (modify the path according to your setup)
   33 #include "DPAcustomHandler.h"
   34 
   35 //############################################################################################
   36 
   37 // Example: set green LED output pin and set LED on for 1s and then off for 1s
   38 #pragma cdata[ __EEESTART + IOSETUP_EEEPROM_ADDR ] = \
   39 /* 1. Green LED IO is output */ \
   40 8,  PNUM_IO, CMD_IO_DIRECTION, 0xff, 0xff, /* PORTB.7 = LEDG = Output */ PNUM_IO_TRISB, 0x80, 0x00, \
   41 /* 2. Green LED on for 1s, Green LED off for 1s */ \
   42 17, PNUM_IO, CMD_IO_SET, 0xff, 0xff, \
   43   /* PORTB.7 = 1 => LEDG on */ PNUM_IO_PORTB, 0x80, 0x80, \
   44   /* delay 1s */ PNUM_IO_DELAY, 0xe8, 0x03, \
   45   /* PORTB.7 = 0 => LEDG off */ PNUM_IO_PORTB, 0x80, 0x00, \
   46   /* delay 1s */ PNUM_IO_DELAY, 0xe8, 0x03, \
   47 /* 3. End IO Setup  */ \
   48 0
   49 
   50 //############################################################################################