patterns/uf2: Added Family ID enum to uf2.hexpat, Added missing description pragmas and other minor fixes (#282)

* patterns/uf2: add family ID enum

* patterns/uf2: Fix enum spacing

* patterns: add missing description pragmas and README entries, etc.

* patterns/uf2: add reference for Family ID enum
This commit is contained in:
applecuckoo
2024-08-03 20:47:40 +12:00
committed by GitHub
parent 196011ead9
commit c5aaac25dd
12 changed files with 85 additions and 10 deletions

View File

@@ -1,4 +1,4 @@
#pragma description TODO
#pragma description Apple binary property list
import std.math;
import std.core;

View File

@@ -1,7 +1,7 @@
// https://github.com/ggerganov/ggml/blob/master/docs/gguf.md
// https://github.com/openxla/iree/blob/main/runtime/src/iree/io/formats/gguf/gguf_parser.c
#pragma description GGUF v3 File Format Patter
#pragma description GGUF v3 File Format Pattern
#pragma authors @leonjza, jessie @ imhex discord
#pragma pattern_limit 300000
@@ -212,4 +212,4 @@ struct gguf_file_t {
u8 tensor_data[];
};
gguf_file_t GGUF @ 0x00;
gguf_file_t GGUF @ 0x00;

View File

@@ -1,5 +1,5 @@
/**
* @file <gltf.pat> ImHex Pattern for glTF binary files.
* @file <gltf.hexpat> ImHex Pattern for glTF binary files.
*
* Copyright (c) 2023 H. Utku Maden <utkumaden@hotmail.com>
*
@@ -22,7 +22,9 @@
* SOFTWARE.
*/
#pragma description TODO
#pragma author H. Utku Maden
#pragma description GL Transmission Format binary 3D model file (.glb)
#pragma MIME model/gltf-binary
import std.mem;
import std.io;

View File

@@ -6,6 +6,9 @@
//
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma author Nicolás Alvarez
#pragma description Apple pbz compressed file
import std.mem;
import type.magic;

View File

@@ -1,5 +1,5 @@
#pragma description PKM (PacKMan) files containing ETC (Ericsson Texture Compression)
#pragma author applecuckoo
#pragma description PKM (PacKMan) files containing ETC (Ericsson Texture Compression)
#pragma endian big
enum PKMFormat : u16 {

View File

@@ -1,6 +1,6 @@
#pragma author Fl3ch4
#pragma description TODO
#pragma MIME image/webp
#pragma description RAS image files
#pragma MIME image/x-sun-raster
#pragma endian big

View File

@@ -39,6 +39,62 @@ enum UF2_TagTypeEnum : u32 {
DeviceTypeIdentifier = 0xC8A729
};
// reference: https://microsoft.github.io/uf2/utils/uf2families.json
enum UF2_FamilyID : u32 {
ATMEGA32 = 0x16573617,
SAML21 = 0x1851780a,
NRF52 = 0x1b57745f,
ESP32 = 0x1c5f21b0,
STM32L1 = 0x1e1f432d,
STM32L0 = 0x202e3a91,
STM32WL = 0x21460ff0,
LPC55 = 0x2abc77ec,
STM32G0 = 0x300f5633,
GD32F350 = 0x31d228c6,
STM32L5 = 0x04240bdf,
STM32G4 = 0x4c71240a,
MIMXRT10XX = 0x4fb2d5bd,
STM32F7 = 0x53b80f00,
SAMD51 = 0x55114460,
STM32F4 = 0x57755a57,
FX2 = 0x5a18069b,
STM32F2 = 0x5d1a0a2e,
STM32F1 = 0x5ee21072,
NRF52833 = 0x621e937a,
STM32F0 = 0x647824b6,
SAMD21 = 0x68ed2b88,
STM32F3 = 0x6b846188,
STM32F407 = 0x6d0922fa,
STM32H7 = 0x6db66082,
STM32WB = 0x70d16653,
KL32L2 = 0x7f83e793,
STM32F407VG = 0x8fb060fe,
NRF52840 = 0xada52840,
ESP32S2 = 0xbfdd4eee,
ESP32S3 = 0xc47e5767,
ESP32C3 = 0xd42ba06c,
ESP32C2 = 0x2b88d29c,
ESP32H2 = 0x332726f6,
ESP32C6 = 0x540ddf62,
ESP32P4 = 0x3d308e94,
ESP32C5 = 0xf71c0343,
ESP32C61 = 0x77d850c4,
RP2040 = 0xe48bff56,
STM32L4 = 0x00ff6919,
GD32VF103 = 0x9af03e33,
CSK4 = 0x4f6ace52,
CSK6 = 0x6e7348a8,
M0SENSE = 0x11de784a,
MaixPlayU4 = 0x4b684d71,
RZA1LU = 0x9517422f,
STM32F411xE = 0x2dc309c5,
NRF52832xxAA = 0x72721d4e,
NRF52832xxAB = 0x6f752678,
AT32F415 = 0xa0c97b8e,
CH32V = 0x699b62ec,
};
fn formatTagType(UF2_TagType type) {
u32 value = (type.bytes[0] << 16) | (type.bytes[1] << 8) | (type.bytes[2]);
@@ -75,7 +131,7 @@ struct UF2_Block {
u32 numBlocks;
if (flags.FamilyIDPresent)
u32 familyId;
UF2_FamilyID familyId;
else
u32 fileSize;

View File

@@ -1,4 +1,4 @@
#pragma description TODO
#pragma description USB Descriptor
import std.core;
import std.io;

View File

@@ -19,6 +19,8 @@
// Made with help from a (since deleted) GPSBabel definition
// https://github.com/GPSBabel/gpsbabel/blob/gpsbabel_1_8_0/wintec_tes.cc
#pragma description Wintec TES GPS log
#include "std/mem.pat"
#include "std/string.pat"

View File

@@ -1,3 +1,6 @@
#pragma author LolHacksRule
#pragma description Exient XGS Engine Pak files
import std.mem;
import std.core;
import type.time;

View File

@@ -1,3 +1,6 @@
#pragma author LolHacksRule
#pragma description Exient XGS Engine Texture
import type.magic;
//By LolHacksRule