7#ifndef _PICO_BINARY_INFO_STRUCTURE_H
8#define _PICO_BINARY_INFO_STRUCTURE_H
21#define __packed __attribute__((packed))
26#define BINARY_INFO_TYPE_RAW_DATA 1
27#define BINARY_INFO_TYPE_SIZED_DATA 2
28#define BINARY_INFO_TYPE_BINARY_INFO_LIST_ZERO_TERMINATED 3
29#define BINARY_INFO_TYPE_BSON 4
30#define BINARY_INFO_TYPE_ID_AND_INT 5
31#define BINARY_INFO_TYPE_ID_AND_STRING 6
33#define BINARY_INFO_TYPE_BLOCK_DEVICE 7
34#define BINARY_INFO_TYPE_PINS_WITH_FUNC 8
35#define BINARY_INFO_TYPE_PINS_WITH_NAME 9
36#define BINARY_INFO_TYPE_NAMED_GROUP 10
37#define BINARY_INFO_TYPE_PTR_INT32_WITH_NAME 11
38#define BINARY_INFO_TYPE_PTR_STRING_WITH_NAME 12
39#define BINARY_INFO_TYPE_PINS64_WITH_FUNC 13
40#define BINARY_INFO_TYPE_PINS64_WITH_NAME 14
45#define BINARY_INFO_MAKE_TAG(c1, c2) ((uint16_t)((((c2)&0xffu)<<8u)|((c1)&0xffu)))
48#define BINARY_INFO_TAG_RASPBERRY_PI BINARY_INFO_MAKE_TAG('R','P')
50#define BINARY_INFO_ID_RP_PROGRAM_NAME 0x02031c86
51#define BINARY_INFO_ID_RP_PROGRAM_VERSION_STRING 0x11a9bc3a
52#define BINARY_INFO_ID_RP_PROGRAM_BUILD_DATE_STRING 0x9da22254
53#define BINARY_INFO_ID_RP_BINARY_END 0x68f465de
54#define BINARY_INFO_ID_RP_PROGRAM_URL 0x1856239a
55#define BINARY_INFO_ID_RP_PROGRAM_DESCRIPTION 0xb6a07c19
56#define BINARY_INFO_ID_RP_PROGRAM_FEATURE 0xa1f4b453
57#define BINARY_INFO_ID_RP_PROGRAM_BUILD_ATTRIBUTE 0x4275f0d3
58#define BINARY_INFO_ID_RP_SDK_VERSION 0x5360b3ab
59#define BINARY_INFO_ID_RP_PICO_BOARD 0xb63cffbb
60#define BINARY_INFO_ID_RP_BOOT2_NAME 0x7f8882e1
63#define bi_ptr_of(x) x *
65#define bi_ptr_of(x) uint32_t
85} binary_info_raw_data_t;
94} binary_info_sized_data_t;
102} binary_info_list_zero_terminated_t;
111} binary_info_id_and_int_t;
120} binary_info_id_and_string_t;
130} binary_info_ptr_int32_with_name_t;
141} binary_info_ptr_string_with_name_t;
153} binary_info_block_device_t;
155#define BI_PINS_ENCODING_RANGE 1
156#define BI_PINS_ENCODING_MULTI 2
166} binary_info_pins_with_func_t;
176} binary_info_pins64_with_func_t;
185} binary_info_pins_with_name_t;
194} binary_info_pins64_with_name_t;
196#define BI_NAMED_GROUP_SHOW_IF_EMPTY 0x0001
197#define BI_NAMED_GROUP_SEPARATE_COMMAS 0x0002
198#define BI_NAMED_GROUP_SORT_ALPHA 0x0004
199#define BI_NAMED_GROUP_ADVANCED 0x0008
214} binary_info_named_group_t;
217 BINARY_INFO_BLOCK_DEV_FLAG_READ = 1 << 0,
218 BINARY_INFO_BLOCK_DEV_FLAG_WRITE = 1 << 1,
219 BINARY_INFO_BLOCK_DEV_FLAG_REFORMAT = 1 << 2,
221 BINARY_INFO_BLOCK_DEV_FLAG_PT_UNKNOWN = 0 << 4,
222 BINARY_INFO_BLOCK_DEV_FLAG_PT_MBR = 1 << 4,
223 BINARY_INFO_BLOCK_DEV_FLAG_PT_GPT = 2 << 4,
224 BINARY_INFO_BLOCK_DEV_FLAG_PT_NONE = 3 << 4,
Binary info entry describing a block device in the binary.
Definition structure.h:146
struct _binary_info_core core
Common binary info header.
Definition structure.h:147
uint32_t address
Start address of the block device in flash.
Definition structure.h:149
bi_ptr_of(const char) name
optional static name (independent of what is formatted)
bi_ptr_of(binary_info_t) extra
additional info
uint16_t flags
Block device capability flags (BINARY_INFO_BLOCK_DEV_FLAG_*)
Definition structure.h:152
uint32_t size
Size of the block device in bytes.
Definition structure.h:150
Common header fields shared by all binary info entries.
Definition structure.h:74
uint16_t tag
Namespace tag identifying the entry's owner.
Definition structure.h:76
uint16_t type
Binary info entry type (one of BINARY_INFO_TYPE_*)
Definition structure.h:75
Binary info entry associating a 32-bit integer value with an ID.
Definition structure.h:107
struct _binary_info_core core
Common binary info header.
Definition structure.h:108
uint32_t id
Identifier for the value (one of BINARY_INFO_ID_*)
Definition structure.h:109
int32_t value
The integer value associated with the ID.
Definition structure.h:110
Binary info entry associating a string value with an ID.
Definition structure.h:116
uint32_t id
Identifier for the value (one of BINARY_INFO_ID_*)
Definition structure.h:118
bi_ptr_of(const char) value
Pointer to the null-terminated string value.
struct _binary_info_core core
Common binary info header.
Definition structure.h:117
Binary info entry holding a null-terminated list of binary info pointers.
Definition structure.h:99
bi_ptr_of(binary_info_t) list
Pointer to the null-terminated list of binary info entries.
struct _binary_info_core core
Common binary info header.
Definition structure.h:100
Binary info entry defining a named group of related binary info entries.
Definition structure.h:207
uint32_t group_id
Unique identifier for this group.
Definition structure.h:212
uint16_t group_tag
Tag namespace used by entries within this group.
Definition structure.h:211
bi_ptr_of(const char) label
Pointer to the null-terminated group label.
uint16_t flags
Display flags for the group (BI_NAMED_GROUP_*)
Definition structure.h:210
uint32_t parent_id
ID of the parent group (0 for top-level)
Definition structure.h:209
struct _binary_info_core core
Common binary info header.
Definition structure.h:208
Binary info entry describing one or more GPIO pins and their assigned function, supporting pin number...
Definition structure.h:171
struct _binary_info_core core
Common binary info header.
Definition structure.h:172
uint64_t pin_encoding
Encoded pin numbers and function for more than 32 pins (see BI_PINS_ENCODING_* for format)
Definition structure.h:175
Binary info entry associating a human-readable label with a set of GPIO pins (up to 64)
Definition structure.h:190
bi_ptr_of(const char) label
Pointer to the null-terminated pin label.
struct _binary_info_core core
Common binary info header.
Definition structure.h:191
uint64_t pin_mask
Bitmask of GPIO pins covered by this entry (up to 64 pins)
Definition structure.h:192
Binary info entry describing one or more GPIO pins and their assigned function, supporting pin number...
Definition structure.h:161
struct _binary_info_core core
Common binary info header.
Definition structure.h:162
uint32_t pin_encoding
Encoded pin numbers and function (see BI_PINS_ENCODING_* for format)
Definition structure.h:165
Binary info entry associating a human-readable label with a set of GPIO pins.
Definition structure.h:181
struct _binary_info_core core
Common binary info header.
Definition structure.h:182
bi_ptr_of(const char) label
Pointer to the null-terminated pin label.
uint32_t pin_mask
Bitmask of GPIO pins covered by this entry.
Definition structure.h:183
Binary info entry holding a pointer to a named 32-bit integer variable.
Definition structure.h:125
bi_ptr_of(const int) value
Pointer to the integer variable.
bi_ptr_of(const char) label
Pointer to the null-terminated display label.
int32_t id
Identifier for the variable.
Definition structure.h:127
struct _binary_info_core core
Common binary info header.
Definition structure.h:126
Binary info entry holding a pointer to a named string variable.
Definition structure.h:135
bi_ptr_of(const char) value
Pointer to the string variable.
int32_t id
Identifier for the variable.
Definition structure.h:137
bi_ptr_of(const char) label
Pointer to the null-terminated display label.
struct _binary_info_core core
Common binary info header.
Definition structure.h:136
uint32_t len
Maximum length of the string buffer.
Definition structure.h:140
Binary info entry carrying raw, uninterpreted byte data.
Definition structure.h:82
uint8_t bytes[1]
Raw byte payload (variable length)
Definition structure.h:84
struct _binary_info_core core
Common binary info header.
Definition structure.h:83
Binary info entry carrying a length-prefixed byte buffer.
Definition structure.h:90
struct _binary_info_core core
Common binary info header.
Definition structure.h:91
uint32_t length
Number of bytes in the payload.
Definition structure.h:92
uint8_t bytes[1]
Byte payload (variable length)
Definition structure.h:93