/* * Copyright (c) 2020 Raspberry Pi (Trading) Ltd. * * SPDX-License-Identifier: BSD-3-Clause *//* ... */#ifndef_PICO_BINARY_INFO_STRUCTURE_H#define_PICO_BINARY_INFO_STRUCTURE_H// NOTE: This file may be included by non SDK code, so does not use SDK includes// NOTE: ALL CHANGES MUST BE BACKWARDS COMPATIBLE#ifdef__cplusplusextern"C"{#endif#include<stdint.h>#ifndef__packed#define__packed__attribute__((packed))#endiftypedefstruct_binary_info_corebinary_info_t;#defineBINARY_INFO_TYPE_RAW_DATA1#defineBINARY_INFO_TYPE_SIZED_DATA2#defineBINARY_INFO_TYPE_BINARY_INFO_LIST_ZERO_TERMINATED3#defineBINARY_INFO_TYPE_BSON4#defineBINARY_INFO_TYPE_ID_AND_INT5#defineBINARY_INFO_TYPE_ID_AND_STRING6// traditional block device#defineBINARY_INFO_TYPE_BLOCK_DEVICE7#defineBINARY_INFO_TYPE_PINS_WITH_FUNC8#defineBINARY_INFO_TYPE_PINS_WITH_NAME9#defineBINARY_INFO_TYPE_NAMED_GROUP10#defineBINARY_INFO_TYPE_PTR_INT32_WITH_NAME11#defineBINARY_INFO_TYPE_PTR_STRING_WITH_NAME12#defineBINARY_INFO_TYPE_PINS64_WITH_FUNC13#defineBINARY_INFO_TYPE_PINS64_WITH_NAME14// note plan is to reserve c1 = 0->31 for "collision tags"; i.e.// for which you should always use random IDs with the binary_info,// giving you 4 + 8 + 32 = 44 bits to avoid collisions#defineBINARY_INFO_MAKE_TAG(c1,c2)((((uint)c2&0xffu)<<8u)|((uint)c1&0xffu))// Raspberry Pi defined. do not use#defineBINARY_INFO_TAG_RASPBERRY_PIBINARY_INFO_MAKE_TAG('R','P')#defineBINARY_INFO_ID_RP_PROGRAM_NAME0x02031c86#defineBINARY_INFO_ID_RP_PROGRAM_VERSION_STRING0x11a9bc3a#defineBINARY_INFO_ID_RP_PROGRAM_BUILD_DATE_STRING0x9da22254#defineBINARY_INFO_ID_RP_BINARY_END0x68f465de#defineBINARY_INFO_ID_RP_PROGRAM_URL0x1856239a#defineBINARY_INFO_ID_RP_PROGRAM_DESCRIPTION0xb6a07c19#defineBINARY_INFO_ID_RP_PROGRAM_FEATURE0xa1f4b453#defineBINARY_INFO_ID_RP_PROGRAM_BUILD_ATTRIBUTE0x4275f0d3#defineBINARY_INFO_ID_RP_SDK_VERSION0x5360b3ab#defineBINARY_INFO_ID_RP_PICO_BOARD0xb63cffbb#defineBINARY_INFO_ID_RP_BOOT2_NAME0x7f8882e127 defines#ifPICO_ON_DEVICE#definebi_ptr_of(x)x*#else#definebi_ptr_of(x)uint32_t#endiftypedefstruct__packed_binary_info_core{uint16_ttype;uint16_ttag;...}binary_info_core_t;typedefstruct__packed_binary_info_raw_data{struct_binary_info_corecore;uint8_tbytes[1];...}binary_info_raw_data_t;typedefstruct__packed_binary_info_sized_data{struct_binary_info_corecore;uint32_tlength;uint8_tbytes[1];...}binary_info_sized_data_t;typedefstruct__packed_binary_info_list_zero_terminated{struct_binary_info_corecore;bi_ptr_of(binary_info_t)list;...}binary_info_list_zero_terminated_t;typedefstruct__packed_binary_info_id_and_int{struct_binary_info_corecore;uint32_tid;int32_tvalue;...}binary_info_id_and_int_t;typedefstruct__packed_binary_info_id_and_string{struct_binary_info_corecore;uint32_tid;bi_ptr_of(constchar)value;...}binary_info_id_and_string_t;typedefstruct__packed_binary_info_ptr_int32_with_name{struct_binary_info_corecore;int32_tid;bi_ptr_of(constint)value;bi_ptr_of(constchar)label;...}binary_info_ptr_int32_with_name_t;typedefstruct__packed_binary_info_ptr_string_with_name{struct_binary_info_corecore;int32_tid;bi_ptr_of(constchar)value;bi_ptr_of(constchar)label;uint32_tlen;...}binary_info_ptr_string_with_name_t;typedefstruct__packed_binary_info_block_device{struct_binary_info_corecore;bi_ptr_of(constchar)name;// optional static name (independent of what is formatted)uint32_taddress;uint32_tsize;bi_ptr_of(binary_info_t)extra;// additional infouint16_tflags;...}binary_info_block_device_t;#defineBI_PINS_ENCODING_RANGE1#defineBI_PINS_ENCODING_MULTI2typedefstruct__packed_binary_info_pins_with_func{struct_binary_info_corecore;// p4_5 : p3_5 : p2_5 : p1_5 : p0_5 : func_4 : 010_3 //individual pins p0,p1,p2,p3,p4 ... if fewer than 5 then duplicate p// phi_5 : plo_5 : func_4 : 001_3 // pin range plo-phi inclusiveuint32_tpin_encoding;...}binary_info_pins_with_func_t;typedefstruct__packed_binary_info_pins64_with_func{struct_binary_info_corecore;// p6_8 : p5_8 : p4_8 : p3_8 : p2_8 : p1_8 : p0_8 : func_5 : 010_3 //individual pins p0,p1,p2 ... if fewer than 7 then duplicate p// phi_8 : plo_8 : func_5 : 001_3 // pin range plo-phi inclusiveuint64_tpin_encoding;...}binary_info_pins64_with_func_t;typedefstruct__packed_binary_info_pins_with_name{struct_binary_info_corecore;uint32_tpin_mask;bi_ptr_of(constchar)label;...}binary_info_pins_with_name_t;typedefstruct__packed_binary_info_pins64_with_name{struct_binary_info_corecore;uint64_tpin_mask;bi_ptr_of(constchar)label;...}binary_info_pins64_with_name_t;#defineBI_NAMED_GROUP_SHOW_IF_EMPTY0x0001// default is to hide#defineBI_NAMED_GROUP_SEPARATE_COMMAS0x0002// default is newlines#defineBI_NAMED_GROUP_SORT_ALPHA0x0004// default is no sort#defineBI_NAMED_GROUP_ADVANCED0x0008// if set, then only shown in say info -atypedefstruct__packed_binary_info_named_group{struct_binary_info_corecore;uint32_tparent_id;uint16_tflags;uint16_tgroup_tag;uint32_tgroup_id;bi_ptr_of(constchar)label;...}binary_info_named_group_t;enum{BINARY_INFO_BLOCK_DEV_FLAG_READ=1<<0,// if not readable, then it is basically hidden, but tools may choose to avoid overwriting itBINARY_INFO_BLOCK_DEV_FLAG_WRITE=1<<1,BINARY_INFO_BLOCK_DEV_FLAG_REFORMAT=1<<2,// may be reformatted..BINARY_INFO_BLOCK_DEV_FLAG_PT_UNKNOWN=0<<4,// unknown free to lookBINARY_INFO_BLOCK_DEV_FLAG_PT_MBR=1<<4,// expect MBRBINARY_INFO_BLOCK_DEV_FLAG_PT_GPT=2<<4,// expect GPTBINARY_INFO_BLOCK_DEV_FLAG_PT_NONE=3<<4,// no partition table...};#ifdef__cplusplus}extern "C" { ... }#endif/* ... */#endif
Details
Show: from
Types: Columns:
All items filtered out
All items filtered out
This file uses the notable symbols shown below. Click anywhere in the file to view more details.