1 // *********************************************************************
    2 //   General public DPA header file                                    *
    3 // *********************************************************************
    4 // Copyright (c) IQRF Tech s.r.o.
    5 //
    6 // File:    $RCSfile: DPA.h,v $
    7 // Version: $Revision: 1.209 $
    8 // Date:    $Date: 2017/08/29 13:12:44 $
    9 //
   10 // Revision history:
   11 //   2017/08/14  Release for DPA 3.01
   12 //   2017/03/13  Release for DPA 3.00
   13 //   2016/09/12  Release for DPA 2.28
   14 //   2016/04/14  Release for DPA 2.27
   15 //   2016/03/03  Release for DPA 2.26
   16 //   2016/01/21  Release for DPA 2.25
   17 //   2015/12/01  Release for DPA 2.24
   18 //   2015/10/23  Release for DPA 2.23
   19 //   2015/09/25  Release for DPA 2.22
   20 //   2015/09/03  Release for DPA 2.21
   21 //   2015/08/05  Release for DPA 2.20
   22 //   2014/10/31  Release for DPA 2.10
   23 //   2014/04/30  Release for DPA 2.00
   24 //   2013/10/03  Release for DPA 1.00
   25 //
   26 // *********************************************************************
   27 
   28 // Online DPA documentation http://www.iqrf.org/DpaTechGuide/
   29 
   30 #ifndef _DPA_HEADER_
   31 #define _DPA_HEADER_
   32 
   33 //############################################################################################
   34 
   35 // DPA version
   36 #define DPA_VERSION_MASTER      0x0301
   37 
   38 #ifdef __CC5X__
   39 // Compiled only at CC5X
   40 #if __CC5X__ < 3507
   41 #error Insufficient CC5X compiler version, V3.5G is minimum
   42 #endif
   43 
   44 #if IQRFOS < 400
   45 #error IQRF OS 4.00+ is required
   46 #endif
   47 
   48 // Bank for custom variables
   49 #pragma rambank = UserBank_01
   50 
   51 // Main DPA API entry address (also start of the licensed FLASH) 
   52 #define DPA_API_ADDRESS             __LICENSED_FLASH
   53 
   54 // Main DPA entry address
   55 #define MAIN_DPA_ADDRESS            ( DPA_API_ADDRESS + 4 )
   56 
   57 // Main DPA API entry address stub
   58 #define DPA_API_ADDRESS_ENTRY       0x3A08
   59 
   60 // Address of the DPA Custom Handler
   61 #define CUSTOM_HANDLER_ADDRESS      0x3A20
   62 
   63 // Address of the DPA Custom Handler end + 1
   64 #define CUSTOM_HANDLER_ADDRESS_END  0x3D80
   65 
   66 // DPA API entry function
   67 uns8  DpaApiEntry( uns8 par1, uns8 par2, uns8 apiIndex );
   68 
   69 // DPA API codes
   70 #define DPA_API_RFTX_DPAPACKET              0
   71 #define DPA_API_READ_CONFIG_BYTE            1
   72 #define DPA_API_SEND_TO_IFACEMASTER         2
   73 #define DPA_API_COORDINATOR_RFTX_DPAPACKET  3
   74 #define DPA_API_LOCAL_REQUEST               4
   75 #define DPA_API_SET_PERIPHERAL_ERROR        5
   76 #define DPA_API_SET_RF_DEFAULTS             6
   77 
   78 // Used buffer size symbols
   79 #define sizeofBufferAUX                     sizeof( bufferAUX )
   80 #define sizeofBufferCOM                     sizeof( bufferCOM )
   81 
   82 #define STRUCTATTR
   83 
   84 #else //__CC5X__
   85 // Not compiled at CC5X
   86 
   87 // Define CC5X types
   88 typedef uint8_t   uns8;
   89 typedef uint16_t  uns16;
   90 
   91 // Fake buffer sizes
   92 #define sizeofBufferAUX 64
   93 #define sizeofBufferCOM 64
   94 
   95 // Disables alignment of members of structures
   96 #define STRUCTATTR  __attribute__((packed))
   97 
   98 #endif  // __CC5X__
   99 
  100 // Indexes of configuration bytes used by DpaApiReadConfigByte( index )
  101 // Checksum
  102 #define CFGIND_CHECKSUM         0x00
  103 // Embedded peripherals
  104 #define CFGIND_DPA_PERIPHERALS  0x01
  105 // DPA configuration flags
  106 #define CFGIND_DPA_FLAGS        0x05
  107 // Main RF channel, used by the subordinate network
  108 #define CFGIND_CHANNEL_2ND_A    0x06
  109 // Second RF channel, used by the subordinate network
  110 #define CFGIND_CHANNEL_2ND_B    0x07
  111 // TX power
  112 #define CFGIND_TXPOWER          0x08
  113 // RX filter used by checkRF()
  114 #define CFGIND_RXFILTER         0x09
  115 // toutRF for LP mode
  116 #define CFGIND_DPA_LP_TOUTRF    0x0A
  117 // UART interface baud rate
  118 #define CFGIND_DPA_UART_IFACE_SPEED 0x0B
  119 // Alternate DSM channel
  120 #define CFGIND_ALTERNATE_DSM_CHANNEL 0x0C
  121 // Main RF channel
  122 #define CFGIND_CHANNEL_A        0x11
  123 // Second RF channel
  124 #define CFGIND_CHANNEL_B        0x12
  125 
  126 // 0: checks only mandatory precondition in order to prevent critical side-effects
  127 // 1: as above plus checks meaningful parameter conditions
  128 // 2: full implemented parameter checking (default)
  129 #ifndef PARAM_CHECK_LEVEL
  130 #define PARAM_CHECK_LEVEL 2
  131 #endif
  132 
  133 // "foursome" at IFace structure
  134 typedef struct
  135 {
  136   // Node address low byte
  137   uns8  NADRlow;
  138   // Node address high byte
  139   uns8  NADRhigh;
  140   // Peripheral number
  141   uns8  PNUM;
  142   // Peripheral command
  143   uns8  PCMD;
  144   // HWPID
  145   uns16 HWPID;
  146 } STRUCTATTR TDpaIFaceHeader;
  147 
  148 // Maximum command PCMD value (except reserved 0x3F = CMD_GET_PER_INFO)
  149 #define PCMD_MAX                    0x7f
  150 // Bit mask at PCMD that indicates DPA Response message
  151 #define RESPONSE_FLAG               0x80
  152 
  153 // IQMESH coordinator address
  154 #define COORDINATOR_ADDRESS         0x00
  155 // IQMESH broadcast address
  156 #define BROADCAST_ADDRESS           0xff
  157 // IQMESH temporary address, assigned by remote bonding before authorization is done
  158 #define TEMPORARY_ADDRESS           0xfe
  159 // Address of the local device addressed by IFace
  160 #define LOCAL_ADDRESS               0xfc
  161 // Maximum IQMESH network device address
  162 #define MAX_ADDRESS                 ( 240 - 1 )
  163 
  164 // Time slots lengths in 10 ms
  165 #define MIN_STD_TIMESLOT    4   
  166 #define MAX_STD_TIMESLOT    6
  167 
  168 #define MIN_LP_TIMESLOT     8
  169 #define MAX_LP_TIMESLOT     11
  170 
  171 #ifdef DPA_LP
  172 #define MIN_TIMESLOT        MIN_LP_TIMESLOT 
  173 #define MAX_TIMESLOT        MAX_LP_TIMESLOT 
  174 #else
  175 #define MIN_TIMESLOT        MIN_STD_TIMESLOT    
  176 #define MAX_TIMESLOT        MAX_STD_TIMESLOT
  177 #endif
  178 
  179 // Long diagnostics slot time
  180 #define LONG_DIAG_TIMESLOT  20 
  181 
  182 // Maximum number of DPA PData bytes ( minus 8 = 6B foursome + 8b error code + 8b DpaValue )
  183 #define DPA_MAX_DATA_LENGTH         ( sizeofBufferCOM - sizeof( TDpaIFaceHeader ) - 2 * sizeof( uns8 ) )
  184 
  185 // Maximum number of peripherals info that can fit in the message
  186 #define MAX_PERIPHERALS_PER_BLOCK_INFO  ( DPA_MAX_DATA_LENGTH / sizeof( TPeripheralInfoAnswer ) )
  187 
  188 // Standard peripheral numbers
  189 #define PNUM_COORDINATOR    0x00
  190 #define PNUM_NODE           0x01
  191 #define PNUM_OS             0x02
  192 #define PNUM_EEPROM         0x03
  193 #define PNUM_EEEPROM        0x04
  194 #define PNUM_RAM            0x05
  195 #define PNUM_LEDR           0x06
  196 #define PNUM_LEDG           0x07
  197 #define PNUM_SPI            0x08
  198 #define PNUM_IO             0x09
  199 #define PNUM_THERMOMETER    0x0A
  200 #define PNUM_PWM            0x0B
  201 #define PNUM_UART           0x0C
  202 #define PNUM_FRC            0x0D
  203 
  204 // Number of the 1st user peripheral
  205 #define PNUM_USER           0x20
  206 // Number of the last user peripheral
  207 #define PNUM_USER_MAX       0x3E
  208 // Maximum peripheral number
  209 #define PNUM_MAX            0x7F
  210 
  211 // Fake peripheral number used to flag DPA response with error sent by RF
  212 #define PNUM_ERROR_FLAG 0xFE
  213 // Special peripheral used for enumeration
  214 #define PNUM_ENUMERATION    0xFF
  215 
  216 // DPA Commands for embedded peripherals
  217 #define CMD_COORDINATOR_ADDR_INFO  0
  218 #define CMD_COORDINATOR_DISCOVERED_DEVICES 1
  219 #define CMD_COORDINATOR_BONDED_DEVICES 2
  220 #define CMD_COORDINATOR_CLEAR_ALL_BONDS 3
  221 #define CMD_COORDINATOR_BOND_NODE 4
  222 #define CMD_COORDINATOR_REMOVE_BOND 5
  223 #define CMD_COORDINATOR_REBOND_NODE 6
  224 #define CMD_COORDINATOR_DISCOVERY 7
  225 #define CMD_COORDINATOR_SET_DPAPARAMS 8
  226 #define CMD_COORDINATOR_SET_HOPS 9
  227 #define CMD_COORDINATOR_DISCOVERY_DATA 10
  228 #define CMD_COORDINATOR_BACKUP 11
  229 #define CMD_COORDINATOR_RESTORE 12
  230 #define CMD_COORDINATOR_AUTHORIZE_BOND 13
  231 #define CMD_COORDINATOR_BRIDGE 14
  232 #define CMD_COORDINATOR_READ_REMOTELY_BONDED_MID 15
  233 #define CMD_COORDINATOR_CLEAR_REMOTELY_BONDED_MID 16
  234 #define CMD_COORDINATOR_ENABLE_REMOTE_BONDING 17
  235 
  236 #define CMD_NODE_READ 0
  237 #define CMD_NODE_REMOVE_BOND 1
  238 #define CMD_NODE_READ_REMOTELY_BONDED_MID 2
  239 #define CMD_NODE_CLEAR_REMOTELY_BONDED_MID 3
  240 #define CMD_NODE_ENABLE_REMOTE_BONDING 4
  241 #define CMD_NODE_REMOVE_BOND_ADDRESS 5
  242 #define CMD_NODE_BACKUP 6
  243 #define CMD_NODE_RESTORE 7
  244 
  245 #define CMD_OS_READ 0
  246 #define CMD_OS_RESET 1
  247 #define CMD_OS_READ_CFG 2
  248 #define CMD_OS_RFPGM 3
  249 #define CMD_OS_SLEEP 4
  250 #define CMD_OS_BATCH 5
  251 #define CMD_OS_SET_SECURITY 6
  252 #define CMD_OS_RESTART 8
  253 #define CMD_OS_WRITE_CFG_BYTE 9
  254 #define CMD_OS_LOAD_CODE 10
  255 #define CMD_OS_SELECTIVE_BATCH 11
  256 #define CMD_OS_WRITE_CFG 15
  257 
  258 #define CMD_RAM_READ 0
  259 #define CMD_RAM_WRITE 1
  260 
  261 #define CMD_EEPROM_READ CMD_RAM_READ
  262 #define CMD_EEPROM_WRITE CMD_RAM_WRITE
  263 
  264 #define CMD_EEEPROM_XREAD ( CMD_RAM_READ + 2 )
  265 #define CMD_EEEPROM_XWRITE ( CMD_RAM_WRITE + 2 )
  266 
  267 #define CMD_LED_SET_OFF 0
  268 #define CMD_LED_SET_ON 1
  269 #define CMD_LED_GET 2
  270 #define CMD_LED_PULSE 3
  271 
  272 #define CMD_SPI_WRITE_READ 0
  273 
  274 #define CMD_IO_DIRECTION  0
  275 #define CMD_IO_SET  1
  276 #define CMD_IO_GET  2
  277 
  278 #define CMD_THERMOMETER_READ 0
  279 
  280 #define CMD_PWM_SET 0
  281 
  282 #define CMD_UART_OPEN 0
  283 #define CMD_UART_CLOSE 1
  284 #define CMD_UART_WRITE_READ 2
  285 #define CMD_UART_CLEAR_WRITE_READ 3
  286 
  287 #define CMD_FRC_SEND 0
  288 #define CMD_FRC_EXTRARESULT 1
  289 #define CMD_FRC_SEND_SELECTIVE 2
  290 #define CMD_FRC_SET_PARAMS 3
  291 
  292 #define CMD_GET_PER_INFO  0x3f
  293 
  294 // DPA peripheral type
  295 typedef enum
  296 {
  297   PERIPHERAL_TYPE_DUMMY = 0x00,
  298   PERIPHERAL_TYPE_COORDINATOR = 0x01,
  299   PERIPHERAL_TYPE_NODE = 0x02,
  300   PERIPHERAL_TYPE_OS = 0x03,
  301   PERIPHERAL_TYPE_EEPROM = 0x04,
  302   PERIPHERAL_TYPE_BLOCK_EEPROM = 0x05,
  303   PERIPHERAL_TYPE_RAM = 0x06,
  304   PERIPHERAL_TYPE_LED = 0x07,
  305   PERIPHERAL_TYPE_SPI = 0x08,
  306   PERIPHERAL_TYPE_IO = 0x09,
  307   PERIPHERAL_TYPE_UART = 0x0a,
  308   PERIPHERAL_TYPE_THERMOMETER = 0x0b,
  309   PERIPHERAL_TYPE_ADC = 0x0c,
  310   PERIPHERAL_TYPE_PWM = 0x0d,
  311   PERIPHERAL_TYPE_FRC = 0x0e,
  312   // Starts peripheral type number interval for user peripherals
  313   PERIPHERAL_TYPE_USER_AREA = 0x80
  314 } TDpaPeripheralType;
  315 
  316 // Peripheral extended information
  317 typedef enum
  318 {
  319   PERIPHERAL_TYPE_EXTENDED_DEFAULT = 0b00,
  320   PERIPHERAL_TYPE_EXTENDED_READ = 0b01,
  321   PERIPHERAL_TYPE_EXTENDED_WRITE = 0b10,
  322   PERIPHERAL_TYPE_EXTENDED_READ_WRITE = PERIPHERAL_TYPE_EXTENDED_READ | PERIPHERAL_TYPE_EXTENDED_WRITE
  323 } TDpaPeripheralTypeExtended;
  324 
  325 // Response packet error codes
  326 typedef enum
  327 {
  328   // No error
  329   STATUS_NO_ERROR = 0,
  330 
  331   // General fail
  332   ERROR_FAIL = 1,
  333   // Incorrect PCMD
  334   ERROR_PCMD = 2,
  335   // Incorrect PNUM or PCMD
  336   ERROR_PNUM = 3,
  337   // Incorrect Address value when addressing memory type peripherals
  338   ERROR_ADDR = 4,
  339   // Incorrect Data length
  340   ERROR_DATA_LEN = 5,
  341   // Incorrect Data
  342   ERROR_DATA = 6,
  343   // Incorrect HWPID used
  344   ERROR_HWPID = 7,
  345   // Incorrect NADR
  346   ERROR_NADR = 8,
  347   // IFACE data consumed by Custom DPA Handler
  348   ERROR_IFACE_CUSTOM_HANDLER = 9,
  349   // Custom DPA Handler is missing
  350   ERROR_MISSING_CUSTOM_DPA_HANDLER = 10,
  351 
  352   // Beginning of the user code error interval
  353   ERROR_USER_FROM = 0x20,
  354   // End of the user code error interval
  355   ERROR_USER_TO = 0x3f,
  356 
  357   // Bit/flag reserved for a future use
  358   STATUS_RESERVED_FLAG = 0x40,
  359   // Bit to flag asynchronous response from [N]
  360   STATUS_ASYNC_RESPONSE = 0x80,
  361   // Error code used to mark confirmation
  362   STATUS_CONFIRMATION = 0xff
  363 } TErrorCodes;
  364 
  365 // Embedded FRC commands
  366 typedef enum
  367 {
  368   FRC_Prebonding = 0x00,
  369   FRC_UART_SPI_data = 0x01,
  370   FRC_AcknowledgedBroadcastBits = 0x02,
  371 
  372   FRC_Temperature = 0x80,
  373   FRC_AcknowledgedBroadcastBytes = 0x81,
  374   FRC_MemoryRead = 0x82,
  375   FRC_MemoryReadPlus1 = 0x83,
  376   FRC_FrcResponseTime = 0x84,
  377 } TFRCommands;
  378 
  379 // Intervals of user FRC codes
  380 #define FRC_USER_BIT_FROM     0x40
  381 #define FRC_USER_BIT_TO       0x7F
  382 #define FRC_USER_BYTE_FROM    0xC0
  383 #define FRC_USER_BYTE_TO      0xDF
  384 #define FRC_USER_2BYTE_FROM   0xF0
  385 #define FRC_USER_2BYTE_TO     0xFF
  386 
  387 typedef enum
  388 {
  389   // No HWPID specified
  390   HWPID_Default = 0,
  391   // Use this type to override HWPID check
  392   HWPID_DoNotCheck = 0xFfFf
  393 } THWPIDs;
  394 
  395 // RAM peripheral block definitions
  396 #define PERIPHERAL_RAM_LENGTH       48
  397 
  398 // Start address of EEPROM peripheral in the real EEPROM
  399 #ifndef COORDINATOR_CUSTOM_HANDLER // Node
  400 #define PERIPHERAL_EEPROM_START     ( (uns8)0x00 )
  401 #else // Coordinator
  402 #define PERIPHERAL_EEPROM_START     ( (uns8)0x80 )
  403 #endif
  404 
  405 // Length of the real serial EEEPROM from the EEEPROM DPA peripheral write point of view
  406 #define EEEPROM_REAL_LENGTH                 0x4000
  407 
  408 // Starting address of the Autoexec DPA storage at external EEPROM
  409 #define AUTOEXEC_EEEPROM_ADDR               0x0000
  410 // Length of the autoexec memory block
  411 #define AUTOEXEC_LENGTH                     sizeofBufferAUX
  412 
  413 // Starting address of the IO Setup DPA storage at external EEPROM
  414 #define IOSETUP_EEEPROM_ADDR                ( AUTOEXEC_EEEPROM_ADDR + AUTOEXEC_LENGTH )
  415 // Length of the IO setup memory block
  416 #define IOSETUP_LENGTH                      sizeofBufferAUX
  417 
  418 // ---------------------------------------------------------
  419 
  420 // Enumerate peripherals structure
  421 typedef struct
  422 {
  423   uns16 DpaVersion;
  424   uns8  UserPerNr;
  425   uns8  EmbeddedPers[PNUM_USER / 8];
  426   uns16 HWPID;
  427   uns16 HWPIDver;
  428   uns8  Flags;
  429   uns8  UserPer[( PNUM_MAX - PNUM_USER + 1 + 7 ) / 8];
  430 } STRUCTATTR TEnumPeripheralsAnswer;
  431 
  432 #define FlagUserPer(UserPersArray,UserPerNumber)    UserPersArray[((UserPerNumber)-PNUM_USER) / 8] |= (uns8)0x01 << (((UserPerNumber)-PNUM_USER) % 8);
  433 
  434 // Get peripheral info structure (CMD_GET_PER_INFO)
  435 typedef struct
  436 {
  437   uns8  PerTE;
  438   uns8  PerT;
  439   uns8  Par1;
  440   uns8  Par2;
  441 } STRUCTATTR TPeripheralInfoAnswer;
  442 
  443 // Error DPA response (PNUM_ERROR_FLAG)
  444 typedef struct
  445 {
  446   uns8  ErrN;
  447   uns8  PNUMoriginal;
  448 } STRUCTATTR TErrorAnswer;
  449 
  450 // Structure returned by CMD_COORDINATOR_ADDR_INFO
  451 typedef struct
  452 {
  453   uns8  DevNr;
  454   uns8  DID;
  455 } STRUCTATTR TPerCoordinatorAddrInfo_Response;
  456 
  457 // Structure for CMD_COORDINATOR_BOND_NODE
  458 typedef struct
  459 {
  460   uns8  ReqAddr;
  461   uns8  BondingMask;
  462 } STRUCTATTR TPerCoordinatorBondNode_Request;
  463 
  464 // Structure returned by CMD_COORDINATOR_BOND_NODE
  465 typedef struct
  466 {
  467   uns8  BondAddr;
  468   uns8  DevNr;
  469 } STRUCTATTR TPerCoordinatorBondNode_Response;
  470 
  471 // Structure for CMD_COORDINATOR_REMOVE_BOND or CMD_COORDINATOR_REBOND_NODE
  472 typedef struct
  473 {
  474   uns8  BondAddr;
  475 } STRUCTATTR TPerCoordinatorRemoveRebondBond_Request;
  476 
  477 // Structure returned by CMD_COORDINATOR_REMOVE_BOND or CMD_COORDINATOR_REBOND_NODE
  478 typedef struct
  479 {
  480   uns8  DevNr;
  481 } STRUCTATTR TPerCoordinatorRemoveRebondBond_Response;
  482 
  483 // Structure for CMD_COORDINATOR_DISCOVERY
  484 typedef struct
  485 {
  486   uns8  TxPower;
  487   uns8  MaxAddr;
  488 } STRUCTATTR TPerCoordinatorDiscovery_Request;
  489 
  490 // Structure returned by CMD_COORDINATOR_DISCOVERY
  491 typedef struct
  492 {
  493   uns8  DiscNr;
  494 } STRUCTATTR TPerCoordinatorDiscovery_Response;
  495 
  496 // Structure for and also returned by CMD_COORDINATOR_SET_DPAPARAMS
  497 typedef struct
  498 {
  499   uns8  DpaParam;
  500 } STRUCTATTR TPerCoordinatorSetDpaParams_Request_Response;
  501 
  502 // Structure for and also returned by CMD_COORDINATOR_SET_HOPS
  503 typedef struct
  504 {
  505   uns8  RequestHops;
  506   uns8  ResponseHops;
  507 } STRUCTATTR TPerCoordinatorSetHops_Request_Response;
  508 
  509 // Structure for CMD_COORDINATOR_DISCOVERY_DATA
  510 typedef struct
  511 {
  512   uns16 Address;
  513 } STRUCTATTR TPerCoordinatorDiscoveryData_Request;
  514 
  515 // Structure returned by CMD_COORDINATOR_DISCOVERY_DATA
  516 typedef struct
  517 {
  518   uns8  DiscoveryData[48];
  519 } STRUCTATTR TPerCoordinatorDiscoveryData_Response;
  520 
  521 // Structure for CMD_COORDINATOR_BACKUP and CMD_NODE_BACKUP
  522 typedef struct
  523 {
  524   uns8  Index;
  525 } STRUCTATTR TPerCoordinatorNodeBackup_Request;
  526 
  527 // Structure returned by CMD_COORDINATOR_BACKUP and CMD_NODE_BACKUP
  528 typedef struct
  529 {
  530   uns8  NetworkData[49];
  531 } STRUCTATTR TPerCoordinatorNodeBackup_Response;
  532 
  533 // Structure for CMD_COORDINATOR_RESTORE and CMD_NODE_RESTORE
  534 typedef struct
  535 {
  536   uns8  NetworkData[49];
  537 } STRUCTATTR TPerCoordinatorNodeRestore_Request;
  538 
  539 // Structure for CMD_COORDINATOR_AUTHORIZE_BOND
  540 typedef struct
  541 {
  542   uns8  ReqAddr;
  543   uns8  MID[4];
  544 } STRUCTATTR TPerCoordinatorAuthorizeBond_Request;
  545 
  546 // Structure returned by CMD_COORDINATOR_AUTHORIZE_BOND
  547 typedef struct
  548 {
  549   uns8  BondAddr;
  550   uns8  DevNr;
  551 } STRUCTATTR TPerCoordinatorAuthorizeBond_Response;
  552 
  553 // Structure for CMD_COORDINATOR_BRIDGE
  554 typedef struct
  555 {
  556   TDpaIFaceHeader subHeader;
  557   uns8  subPData[DPA_MAX_DATA_LENGTH - sizeof( TDpaIFaceHeader )];
  558 } STRUCTATTR TPerCoordinatorBridge_Request;
  559 
  560 // Structure returned by CMD_COORDINATOR_BRIDGE
  561 typedef struct
  562 {
  563   TDpaIFaceHeader subHeader;
  564   uns8  subRespCode;
  565   uns8  subDpaValue;
  566   uns8  subPData[DPA_MAX_DATA_LENGTH - sizeof( TDpaIFaceHeader ) - 2 * sizeof( uns8 )];
  567 } STRUCTATTR TPerCoordinatorBridge_Response;
  568 
  569 // Structure for CMD_COORDINATOR_ENABLE_REMOTE_BONDING and CMD_NODE_ENABLE_REMOTE_BONDING
  570 typedef struct
  571 {
  572   uns8  BondingMask;
  573   uns8  Control;
  574   uns8  UserData[4];
  575 } STRUCTATTR TPerCoordinatorNodeEnableRemoteBonding_Request;
  576 
  577 // Structure for TPerCoordinatorNodeReadRemotelyBondedMID_Response
  578 typedef struct
  579 {
  580   uns8  MID[4];
  581   uns8  UserData[4];
  582 } STRUCTATTR TPrebondedNode;
  583 
  584 // Structure returned by CMD_COORDINATOR_READ_REMOTELY_BONDED_MID and CMD_NODE_READ_REMOTELY_BONDED_MID
  585 typedef struct
  586 {
  587   TPrebondedNode  PrebondedNodes[DPA_MAX_DATA_LENGTH / sizeof( TPrebondedNode )];
  588 } STRUCTATTR TPerCoordinatorNodeReadRemotelyBondedMID_Response;
  589 
  590 // Structure returned by CMD_NODE_READ
  591 typedef struct
  592 {
  593   uns8  ntwADDR;
  594   uns8  ntwVRN;
  595   uns8  ntwZIN;
  596   uns8  ntwDID;
  597   uns8  ntwPVRN;
  598   uns16 ntwUSERADDRESS;
  599   uns16 ntwID;
  600   uns8  ntwVRNFNZ;
  601   uns8  ntwCFG;
  602   uns8  Flags;
  603 } STRUCTATTR TPerNodeRead_Response;
  604 
  605 // Structure returned by CMD_OS_READ
  606 typedef struct
  607 {
  608   uns8  ModuleId[4];
  609   uns8  OsVersion;
  610   uns8  McuType;
  611   uns16 OsBuild;
  612   uns8  Rssi;
  613   uns8  SupplyVoltage;
  614   uns8  Flags;
  615   uns8  SlotLimits;
  616 } STRUCTATTR TPerOSRead_Response;
  617 
  618 // Structure returned by CMD_OS_READ_CFG
  619 typedef struct
  620 {
  621   uns8  Checksum;
  622   uns8  Configuration[31];
  623   uns8  RFPGM;
  624   uns8  Undocumented[1];
  625 } STRUCTATTR TPerOSReadCfg_Response;
  626 
  627 // Structure for CMD_OS_WRITE_CFG
  628 typedef struct
  629 {
  630   uns8  Checksum;
  631   uns8  Configuration[31];
  632   uns8  RFPGM;
  633 } STRUCTATTR TPerOSWriteCfg_Request;
  634 
  635 // Structures for CMD_OS_WRITE_CFG_BYTE
  636 typedef struct
  637 {
  638   uns8  Address;
  639   uns8  Value;
  640   uns8  Mask;
  641 } STRUCTATTR TPerOSWriteCfgByteTriplet;
  642 
  643 // Structure for CMD_OS_WRITE_CFG_BYTE
  644 typedef struct
  645 {
  646   TPerOSWriteCfgByteTriplet Triplets[DPA_MAX_DATA_LENGTH / sizeof( TPerOSWriteCfgByteTriplet )];
  647 } STRUCTATTR TPerOSWriteCfgByte_Request;
  648 
  649 // Structure for CMD_OS_SET_SECURITY
  650 typedef struct
  651 {
  652   uns8  Type;
  653   uns8  Data[16];
  654 } STRUCTATTR TPerOSSetSecurity_Request;
  655 
  656 // Structure for CMD_OS_LOAD_CODE
  657 typedef struct
  658 {
  659   uns8  Flags;
  660   uns16 Address;
  661   uns16 Length;
  662   uns16 CheckSum;
  663 } STRUCTATTR TPerOSLoadCode_Request;
  664 
  665 // Structure for CMD_OS_SLEEP
  666 typedef struct
  667 {
  668   uns16 Time;
  669   uns8  Control;
  670 } STRUCTATTR TPerOSSleep_Request;
  671 
  672 // Structure for CMD_OS_SELECTIVE_BATCH
  673 typedef struct
  674 {
  675   uns8  SelectedNodes[30];
  676   uns8  Requests[DPA_MAX_DATA_LENGTH - 30];
  677 } STRUCTATTR TPerOSSelectiveBatch_Request;
  678 
  679 // Structure for general memory request
  680 typedef struct
  681 {
  682   // Address of data to write or read
  683   uns8  Address;
  684 
  685   union
  686   {
  687     // Memory read request
  688     struct
  689     {
  690       // Length of data to read
  691       uns8  Length;
  692     } Read;
  693 
  694     // Size of Address field
  695 #define MEMORY_WRITE_REQUEST_OVERHEAD   ( sizeof( uns8 ) )
  696 
  697     // Memory write request
  698     struct
  699     {
  700       uns8  PData[DPA_MAX_DATA_LENGTH - MEMORY_WRITE_REQUEST_OVERHEAD];
  701     } Write;
  702 
  703   } ReadWrite;
  704 } STRUCTATTR TPerMemoryRequest;
  705 
  706 // Structure for general extended memory request
  707 typedef struct
  708 {
  709   // Address of data to write or read
  710   uns16 Address;
  711 
  712   union
  713   {
  714     // Memory read request
  715     struct
  716     {
  717       // Length of data to read
  718       uns8  Length;
  719     } Read;
  720 
  721     // Size of Address field
  722 #define XMEMORY_WRITE_REQUEST_OVERHEAD  ( sizeof( uns16 ) )
  723 
  724     // Memory write request
  725     struct
  726     {
  727       uns8  PData[DPA_MAX_DATA_LENGTH - XMEMORY_WRITE_REQUEST_OVERHEAD];
  728     } Write;
  729 
  730   } ReadWrite;
  731 } STRUCTATTR TPerXMemoryRequest;
  732 
  733 // Structure for CMD_IO requests
  734 typedef struct
  735 {
  736   uns8  Port;
  737   uns8  Mask;
  738   uns8  Value;
  739 } STRUCTATTR TPerIOTriplet;
  740 
  741 typedef struct
  742 {
  743   uns8  Header; // == PNUM_IO_DELAY
  744   uns16 Delay;
  745 } STRUCTATTR TPerIODelay;
  746 
  747 // Union for CMD_IO_SET and CMD_IO_DIRECTION requests
  748 typedef union
  749 {
  750   TPerIOTriplet Triplets[DPA_MAX_DATA_LENGTH / sizeof( TPerIOTriplet )];
  751   TPerIODelay   Delays[DPA_MAX_DATA_LENGTH / sizeof( TPerIODelay )];
  752 } STRUCTATTR TPerIoDirectionAndSet_Request;
  753 
  754 // Structure returned by CMD_THERMOMETER_READ
  755 typedef struct
  756 {
  757   int8  IntegerValue;
  758   int16 SixteenthValue;
  759 } STRUCTATTR TPerThermometerRead_Response;
  760 
  761 // Structure for CMD_PWM_SET
  762 typedef struct
  763 {
  764   uns8  Prescaler;
  765   uns8  Period;
  766   uns8  Duty;
  767 } STRUCTATTR TPerPwmSet_Request;
  768 
  769 // Structure for CMD_UART_OPEN
  770 typedef struct
  771 {
  772   uns8  BaudRate;
  773 } STRUCTATTR TPerUartOpen_Request;
  774 
  775 // Structure for CMD_UART_[CLEAR_]WRITE_READ and CMD_SPI_WRITE_READ
  776 typedef struct
  777 {
  778   uns8  ReadTimeout;
  779   uns8  WrittenData[DPA_MAX_DATA_LENGTH - sizeof( uns8 )];
  780 } STRUCTATTR TPerUartSpiWriteRead_Request;
  781 
  782 // Structure for CMD_FRC_SEND
  783 typedef struct
  784 {
  785   uns8  FrcCommand;
  786   uns8  UserData[30];
  787 } STRUCTATTR TPerFrcSend_Request;
  788 
  789 // Structure for CMD_FRC_SEND_SELECTIVE
  790 typedef struct
  791 {
  792   uns8  FrcCommand;
  793   uns8  SelectedNodes[30];
  794   uns8  UserData[25];
  795 } STRUCTATTR TPerFrcSendSelective_Request;
  796 
  797 // Structure returned by CMD_FRC_SEND and CMD_FRC_SEND_SELECTIVE
  798 typedef struct
  799 {
  800   uns8  Status;
  801   uns8  FrcData[DPA_MAX_DATA_LENGTH - sizeof( uns8 )];
  802 } STRUCTATTR TPerFrcSend_Response;
  803 
  804 // Structure for request and response of CMD_FRC_SET_PARAMS
  805 typedef struct
  806 {
  807   uns8  FRCresponseTime;
  808 } STRUCTATTR TPerFrcSetParams_RequestResponse;
  809 
  810 // Interface and CMD_COORDINATOR_BRIDGE confirmation structure
  811 typedef struct
  812 {
  813   // Number of hops
  814   uns8  Hops;
  815   // Time slot length in 10ms
  816   uns8  TimeSlotLength;
  817   // Number of hops for response
  818   uns8  HopsResponse;
  819 } STRUCTATTR TIFaceConfirmation;
  820 
  821 // ---------------------------------------------------------
  822 
  823 // DPA Message data structure (packet w/o NADR, PNUM, PCMD, HWPID)
  824 typedef union
  825 {
  826   // General DPA request
  827   struct
  828   {
  829     uns8    PData[DPA_MAX_DATA_LENGTH];
  830   } Request;
  831 
  832   // General DPA response
  833   struct
  834   {
  835     uns8    PData[DPA_MAX_DATA_LENGTH];
  836   } Response;
  837 
  838   // Enumerate peripherals structure
  839   TEnumPeripheralsAnswer EnumPeripheralsAnswer;
  840 
  841   // Get peripheral info structure (CMD_GET_PER_INFO)
  842   TPeripheralInfoAnswer PeripheralInfoAnswer;
  843 
  844   // Get peripheral info structure (CMD_GET_PER_INFO) for more peripherals
  845   TPeripheralInfoAnswer PeripheralInfoAnswers[MAX_PERIPHERALS_PER_BLOCK_INFO];
  846 
  847   // Error DPA response (PNUM_ERROR_FLAG)
  848   TErrorAnswer ErrorAnswer;
  849 
  850   // Structure returned by CMD_COORDINATOR_ADDR_INFO
  851   TPerCoordinatorAddrInfo_Response PerCoordinatorAddrInfo_Response;
  852 
  853   // Structure for CMD_COORDINATOR_BOND_NODE
  854   TPerCoordinatorBondNode_Request PerCoordinatorBondNode_Request;
  855 
  856   // Structure returned by CMD_COORDINATOR_BOND_NODE
  857   TPerCoordinatorBondNode_Response PerCoordinatorBondNode_Response;
  858 
  859   // Structure for CMD_COORDINATOR_REMOVE_BOND or CMD_COORDINATOR_REBOND_NODE
  860   TPerCoordinatorRemoveRebondBond_Request PerCoordinatorRemoveRebondBond_Request;
  861 
  862   // Structure returned by CMD_COORDINATOR_REMOVE_BOND or CMD_COORDINATOR_REBOND_NODE
  863   TPerCoordinatorRemoveRebondBond_Response PerCoordinatorRemoveRebondBond_Response;
  864 
  865   // Structure for CMD_COORDINATOR_DISCOVERY
  866   TPerCoordinatorDiscovery_Request PerCoordinatorDiscovery_Request;
  867 
  868   // Structure returned by CMD_COORDINATOR_DISCOVERY
  869   TPerCoordinatorDiscovery_Response PerCoordinatorDiscovery_Response;
  870 
  871   // Structure for and also returned by CMD_COORDINATOR_SET_DPAPARAMS
  872   TPerCoordinatorSetDpaParams_Request_Response PerCoordinatorSetDpaParams_Request_Response;
  873 
  874   // Structure for and also returned by CMD_COORDINATOR_SET_HOPS
  875   TPerCoordinatorSetHops_Request_Response PerCoordinatorSetHops_Request_Response;
  876 
  877   // Structure for CMD_COORDINATOR_DISCOVERY_DATA
  878   TPerCoordinatorDiscoveryData_Request PerCoordinatorDiscoveryData_Request;
  879 
  880   // Structure returned by CMD_COORDINATOR_DISCOVERY_DATA
  881   TPerCoordinatorDiscoveryData_Response PerCoordinatorDiscoveryData_Response;
  882 
  883   // Structure for CMD_COORDINATOR_BACKUP and CMD_NODE_BACKUP
  884   TPerCoordinatorNodeBackup_Request PerCoordinatorNodeBackup_Request;
  885 
  886   // Structure returned by CMD_COORDINATOR_BACKUP and CMD_NODE_BACKUP
  887   TPerCoordinatorNodeBackup_Response PerCoordinatorNodeBackup_Response;
  888 
  889   // Structure for CMD_COORDINATOR_RESTORE and CMD_NODE_RESTORE
  890   TPerCoordinatorNodeRestore_Request PerCoordinatorNodeRestore_Request;
  891 
  892   // Structure for CMD_COORDINATOR_AUTHORIZE_BOND
  893   TPerCoordinatorAuthorizeBond_Request PerCoordinatorAuthorizeBond_Request;
  894 
  895   // Structure returned by CMD_COORDINATOR_AUTHORIZE_BOND
  896   TPerCoordinatorAuthorizeBond_Response PerCoordinatorAuthorizeBond_Response;
  897 
  898   // Structure for CMD_COORDINATOR_BRIDGE
  899   TPerCoordinatorBridge_Request PerCoordinatorBridge_Request;
  900 
  901   // Structure returned by CMD_COORDINATOR_BRIDGE
  902   TPerCoordinatorBridge_Response PerCoordinatorBridge_Response;
  903 
  904   // Structure for CMD_COORDINATOR_ENABLE_REMOTE_BONDING and CMD_NODE_ENABLE_REMOTE_BONDING
  905   TPerCoordinatorNodeEnableRemoteBonding_Request PerCoordinatorNodeEnableRemoteBonding_Request;
  906 
  907   // Structure returned by CMD_COORDINATOR_READ_REMOTELY_BONDED_MID and CMD_NODE_READ_REMOTELY_BONDED_MID
  908   TPerCoordinatorNodeReadRemotelyBondedMID_Response PerCoordinatorNodeReadRemotelyBondedMID_Response;
  909 
  910   // Structure returned by CMD_NODE_READ
  911   TPerNodeRead_Response PerNodeRead_Response;
  912 
  913   // Structure returned by CMD_OS_READ
  914   TPerOSRead_Response PerOSRead_Response;
  915 
  916   // Structure returned by CMD_OS_READ_CFG
  917   TPerOSReadCfg_Response PerOSReadCfg_Response;
  918 
  919   // Structure for CMD_OS_WRITE_CFG
  920   TPerOSWriteCfg_Request PerOSWriteCfg_Request;
  921 
  922   // Structure for CMD_OS_WRITE_CFG_BYTE
  923   TPerOSWriteCfgByte_Request PerOSWriteCfgByte_Request;
  924 
  925   // Structure for CMD_OS_SET_SECURITY
  926   TPerOSSetSecurity_Request PerOSSetSecurity_Request;
  927 
  928   // Structure for CMD_OS_LOAD_CODE
  929   TPerOSLoadCode_Request PerOSLoadCode_Request;
  930 
  931   // Structure for CMD_OS_SLEEP
  932   TPerOSSleep_Request PerOSSleep_Request;
  933 
  934   // Structure for CMD_OS_SELECTIVE_BATCH
  935   TPerOSSelectiveBatch_Request PerOSSelectiveBatch_Request;
  936 
  937   // Structure for general memory request
  938   TPerMemoryRequest MemoryRequest;
  939 
  940   // Structure for general extended memory request
  941   TPerXMemoryRequest XMemoryRequest;
  942 
  943   // Structure for CMD_IO requests
  944   TPerIoDirectionAndSet_Request PerIoDirectionAndSet_Request;
  945 
  946   // Structure returned by CMD_THERMOMETER_READ
  947   TPerThermometerRead_Response PerThermometerRead_Response;
  948 
  949   // Structure for CMD_PWM_SET
  950   TPerPwmSet_Request PerPwmSet_Request;
  951 
  952   // Structure for CMD_UART_OPEN
  953   TPerUartOpen_Request PerUartOpen_Request;
  954 
  955   // Structure for CMD_UART_[CLEAR_]WRITE_READ and CMD_SPI_WRITE_READ
  956   TPerUartSpiWriteRead_Request PerUartSpiWriteRead_Request;
  957 
  958   // Structure for CMD_FRC_SEND
  959   TPerFrcSend_Request PerFrcSend_Request;
  960 
  961   // Structure returned by CMD_FRC_SEND and CMD_FRC_SEND_SELECTIVE
  962   TPerFrcSend_Response PerFrcSend_Response;
  963 
  964   // Structure for CMD_FRC_SEND_SELECTIVE
  965   TPerFrcSendSelective_Request PerFrcSendSelective_Request;
  966 
  967   // Structure for request and response of CMD_FRC_SET_PARAMS
  968   TPerFrcSetParams_RequestResponse PerFrcSetParams_RequestResponse;
  969 
  970   // Interface and CMD_COORDINATOR_BRIDGE confirmation structure
  971   TIFaceConfirmation IFaceConfirmation;
  972 } TDpaMessage;
  973 
  974 // Custom DPA Handler events
  975 #define DpaEvent_DpaRequest               0
  976 #define DpaEvent_Interrupt                1
  977 #define DpaEvent_Idle                     2
  978 #define DpaEvent_Init                     3
  979 #define DpaEvent_Notification             4
  980 #define DpaEvent_AfterRouting             5
  981 #define DpaEvent_BeforeSleep              6
  982 #define DpaEvent_AfterSleep               7
  983 #define DpaEvent_Reset                    8
  984 #define DpaEvent_DisableInterrupts        9
  985 #define DpaEvent_FrcValue                 10
  986 #define DpaEvent_ReceiveDpaResponse       11
  987 #define DpaEvent_IFaceReceive             12
  988 #define DpaEvent_ReceiveDpaRequest        13
  989 #define DpaEvent_BeforeSendingDpaResponse 14
  990 #define DpaEvent_PeerToPeer               15
  991 #define DpaEvent_AuthorizePreBonding      16
  992 #define DpaEvent_UserDpaValue             17
  993 #define DpaEvent_FrcResponseTime          18
  994 #define DpaEvent_BondingButton            19
  995 
  996 #define DpaEvent_LAST                     DpaEvent_BondingButton
  997 
  998 // Types of the diagnostic DPA Value that is returned inside DPA response 
  999 typedef enum
 1000 {
 1001   DpaValueType_RSSI = 0,
 1002   DpaValueType_SupplyVoltage = 1,
 1003   DpaValueType_System = 2,
 1004   DpaValueType_User = 3
 1005 } TDpaValueType;
 1006 
 1007 // Type (color) of LED peripheral
 1008 typedef enum
 1009 {
 1010   LED_COLOR_RED = 0,
 1011   LED_COLOR_GREEN = 1,
 1012   LED_COLOR_BLUE = 2,
 1013   LED_COLOR_YELLOW = 3,
 1014   LED_COLOR_WHITE = 4,
 1015   LED_COLOR_UNKNOWN = 0xff
 1016 } TLedColor;
 1017 
 1018 // Baud rates
 1019 typedef enum
 1020 {
 1021   DpaBaud_1200 = 0x00,
 1022   DpaBaud_2400 = 0x01,
 1023   DpaBaud_4800 = 0x02,
 1024   DpaBaud_9600 = 0x03,
 1025   DpaBaud_19200 = 0x04,
 1026   DpaBaud_38400 = 0x05,
 1027   DpaBaud_57600 = 0x06,
 1028   DpaBaud_115200 = 0x07,
 1029   DpaBaud_230400 = 0x08
 1030 } TBaudRates;
 1031 
 1032 // Useful PNUM_IO definitions
 1033 typedef enum
 1034 {
 1035   PNUM_IO_PORTA = 0x00,
 1036   PNUM_IO_TRISA = 0x00,
 1037   PNUM_IO_PORTB = 0x01,
 1038   PNUM_IO_TRISB = 0x01,
 1039   PNUM_IO_PORTC = 0x02,
 1040   PNUM_IO_TRISC = 0x02,
 1041   PNUM_IO_PORTE = 0x04,
 1042   PNUM_IO_TRISE = 0x04,
 1043   PNUM_IO_WPUB = 0x11,
 1044   PNUM_IO_WPUE = 0x14,
 1045   PNUM_IO_DELAY = 0xff
 1046 } PNUM_IO_Definitions;
 1047 
 1048 #ifdef __CC5X__
 1049 
 1050 // DPA message at bufferRF
 1051 TDpaMessage DpaRfMessage @bufferRF;
 1052 
 1053 // Actual allocation of the RAM Peripheral memory block @ UserBank_02
 1054 bank12 uns8  PeripheralRam[PERIPHERAL_RAM_LENGTH];
 1055 
 1056 // Actual DPA message parameters at memory
 1057 #define _NADR           RX
 1058 #define _NADRhigh       RTAUX
 1059 #define _PNUM           PNUM
 1060 #define _PCMD           PCMD
 1061 #define _DpaDataLength  DLEN
 1062 #define _DpaMessage     DpaRfMessage
 1063 
 1064 // Return actual DPA user routine event
 1065 #define GetDpaEvent()   userReg0
 1066 
 1067 // To test for enumeration peripherals request
 1068 #define IsDpaEnumPeripheralsRequestNoSize() ( _PNUM == PNUM_ENUMERATION && _PCMD == CMD_GET_PER_INFO )
 1069 
 1070 #if PARAM_CHECK_LEVEL >= 2
 1071 #define IsDpaEnumPeripheralsRequest() ( IsDpaEnumPeripheralsRequestNoSize() && _DpaDataLength == 0 )
 1072 #else
 1073 #define IsDpaEnumPeripheralsRequest() IsDpaEnumPeripheralsRequestNoSize()
 1074 #endif
 1075 
 1076 // To test for peripherals information request
 1077 #define IsDpaPeripheralInfoRequestNoSize()  ( _PNUM != PNUM_ENUMERATION && _PCMD == CMD_GET_PER_INFO )
 1078 
 1079 #if PARAM_CHECK_LEVEL >= 2
 1080 #define IsDpaPeripheralInfoRequest()  ( IsDpaPeripheralInfoRequestNoSize() && _DpaDataLength == 0 )
 1081 #else
 1082 #define IsDpaPeripheralInfoRequest()  IsDpaPeripheralInfoRequestNoSize()
 1083 #endif
 1084 
 1085 // Optimized macro for both testing enumeration peripherals ELSE peripherals information. See examples
 1086 #define IfDpaEnumPeripherals_Else_PeripheralInfo_Else_PeripheralRequestNoSize() if ( _PCMD == CMD_GET_PER_INFO ) if ( _PNUM == PNUM_ENUMERATION )
 1087 
 1088 #if PARAM_CHECK_LEVEL >= 2
 1089 #define IfDpaEnumPeripherals_Else_PeripheralInfo_Else_PeripheralRequest() if ( _DpaDataLength == 0 && _PCMD == CMD_GET_PER_INFO ) if ( _PNUM == PNUM_ENUMERATION )
 1090 #else
 1091 #define IfDpaEnumPeripherals_Else_PeripheralInfo_Else_PeripheralRequest() IfDpaEnumPeripherals_Else_PeripheralInfo_Else_PeripheralRequestNoSize()
 1092 #endif
 1093 
 1094 // Stores DPA Params inside DPA request/response
 1095 #define _DpaParams                    PPAR
 1096 // Get DPA Value type out of the DPA Params
 1097 #define DpaValueType()                ( _DpaParams & 0b11 )
 1098 
 1099 // Traffic indication active: from the store in case of DPA request
 1100 bit IsDpaTrafficIndication            @_DpaParams.2;
 1101 // Long diagnostic time slot request: from the store in case of DPA request
 1102 bit IsDpaLongTimeslot                 @_DpaParams.3;
 1103 
 1104 // Include assembler definitions
 1105 #include "HexCodes.h"
 1106 
 1107 // Next code must start at the IQRF APPLICATION routine entry point
 1108 #pragma origin __APPLICATION_ADDRESS
 1109 
 1110 #endif  // __CC5X__
 1111 #endif  // _DPA_HEADER_
 1112 //############################################################################################