Digi XBee(R) ANSI C Host Library
ebl_file.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012 Digi International Inc.,
3  * All rights not expressly granted are reserved.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
7  * You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343
10  * =======================================================================
11  */
18 #ifndef __XBEE_EBL_FILE_H
19 #define __XBEE_EBL_FILE_H
20 
21 #include "xbee/platform.h"
22 
23 #define IMAGE_INFO_MAXLEN 32
24 
25 #define EBLTAG_HEADER 0x0000
26 
28 #define IMAGE_SIGNATURE_EM250 0xE250
29 #define IMAGE_SIGNATURE_EM260 0xE260
31 #define IMAGE_SIGNATURE_EM350 0xE350
33 
35 typedef struct em3xx_header_t {
40  uint8_t reserved0[32];
44  uint8_t reserved1;
47  uint8_t reserved2[2];
50  uint8_t reserved3[60];
52 
54 typedef struct em2xx_header_t {
57  uint8_t reserved0[2];
61  uint8_t reserved1[16];
63  uint8_t reserved2[4];
65 
67 typedef union ebl_file_header_t {
68  struct {
71  uint8_t reserved[2];
73  } common;
74  em2xx_header_t em2xx;
75  em3xx_header_t em3xx;
77 
79 typedef struct micro_info_t {
80  uint8_t type;
81  const char *description;
82 } micro_info_t;
83 #define MICRO_INFO_END { 0xFF, NULL }
84 
86 typedef struct platform_info_t {
87  uint8_t type;
88  const micro_info_t *micro_info_table;
90 #define PLATFORM_INFO_END { 0xFF, NULL }
91 
94 extern const platform_info_t platform_info[];
95 
107 
117 const char *ebl_phy_desc( uint8_t phy_info);
118 
135 int ebl_header_dump( const void *buffer, uint16_t flags);
136 #define EBL_HEADER_DUMP_TARGET_DESC (1<<0)
137 #define EBL_HEADER_DUMP_PHY_DESC (1<<1)
138 #define EBL_HEADER_DUMP_EMBER_VER (1<<2)
139 #define EBL_HEADER_DUMP_TIMESTAMP (1<<3)
140 #define EBL_HEADER_DUMP_IMAGE_INFO (1<<4)
141 #define EBL_HEADER_DUMP_EVERYTHING 0xFFFF
142 
143 // If compiling in Dynamic C, automatically #use the appropriate C file.
144 #ifdef __DC__
145  #use "xbee_ebl_file.c"
146 #endif
147 
148 #endif // __XBEE_EBL_FILE_H
unsigned long uint32_t
32-bit unsigned integer
Definition: platform_config.h:43
uint8_t znet_build
EmberZNet build.
Definition: ebl_file.h:45
uint8_t image_info[32]
string
Definition: ebl_file.h:49
uint32_t timestamp_le
.ebl file build time; seconds since 1/1/1970
Definition: ebl_file.h:48
uint16_t signature_be
Set to IMAGE_SIGNATURE_EM350 (0xE350)
Definition: ebl_file.h:39
Header for EM3XX-based firmware images.
Definition: ebl_file.h:35
Common header for Hardware Abstraction Layer.
uint16_t version_be
Version of the ebl format.
Definition: ebl_file.h:38
Union of header formats for all Ember firmware images.
Definition: ebl_file.h:67
uint16_t signature_be
Set to IMAGE_SIGNATURE_EM250 (0xE250) or IMAGE_SIGNATURE_EM260 (0xE260)
Definition: ebl_file.h:59
const platform_info_t platform_info[]
Table of tables used to decode plat_info and micro_info fields from .EBL file header.
Definition: xbee_ebl_file.c:54
unsigned short uint16_t
16-bit unsigned integer
Definition: platform_config.h:41
uint16_t length_be
Set to 60.
Definition: ebl_file.h:56
unsigned char uint8_t
8-bit unsigned integer
Definition: platform_config.h:39
uint16_t ebltag_be
Set to EBLTAG_HEADER (0x0000)
Definition: ebl_file.h:55
uint16_t length_be
Set to 140.
Definition: ebl_file.h:37
const char * ebl_phy_desc(uint8_t phy_info)
Returns a description of the PHY based on the phy_info field in the em3xx_header_t structure...
Definition: xbee_ebl_file.c:89
Header for EM2XX-based firmware images.
Definition: ebl_file.h:54
uint16_t signature_be
One of the IMAGE_SIGNATURE_* macros.
Definition: ebl_file.h:72
uint16_t ebltag_be
Set to EBLTAG_HEADER (0x0000)
Definition: ebl_file.h:69
uint8_t micro_info
type of micro
Definition: ebl_file.h:42
Structure used to hold table of plat_info values from EM3XX header.
Definition: ebl_file.h:86
int ebl_header_dump(const void *buffer, uint16_t flags)
Prints a description of the .EBL file header.
Definition: xbee_ebl_file.c:184
uint32_t timestamp_be
.ebl file build time; seconds since 1/1/1970
Definition: ebl_file.h:60
uint8_t znet_release
EmberZNet release (0x46 = 4.6.x)
Definition: ebl_file.h:46
const char * ebl_target_desc(uint8_t plat_info, uint8_t micro_info)
Returns a description of the platform based on the plat_info and micro_info fields in the em3xx_heade...
Definition: xbee_ebl_file.c:63
uint8_t plat_info
type of platform
Definition: ebl_file.h:41
uint16_t length_be
Header length.
Definition: ebl_file.h:70
uint8_t phy_info
type of phy
Definition: ebl_file.h:43
Structure used to hold table of micro_info values from EM3XX header.
Definition: ebl_file.h:79
uint16_t ebltag_be
Set to EBLTAG_HEADER (0x0000)
Definition: ebl_file.h:36