diff options
Diffstat (limited to 'cmd/sbc_harness/uf2.h')
-rw-r--r-- | cmd/sbc_harness/uf2.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/cmd/sbc_harness/uf2.h b/cmd/sbc_harness/uf2.h new file mode 100644 index 0000000..bf9e032 --- /dev/null +++ b/cmd/sbc_harness/uf2.h @@ -0,0 +1,27 @@ +/* sbc_harness/uf2.h - Universal Flashing Format + * + * Copyright (C) 2025 Luke T. Shumaker <lukeshu@lukeshu.com> + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +#ifndef _SBC_HARNESS_FS_HARNESS_UF2_H_ +#define _SBC_HARNESS_FS_HARNESS_UF2_H_ + +#include <stddef.h> /* for size_t */ +#include <stdint.h> /* for uint{n}_t */ + +#include <libhw/generic/io.h> +#include <libmisc/private.h> + +struct uf2_decoder { + BEGIN_PRIVATE(UF2_H); + bool seen_err; + size_t dat_len; + uint8_t dat[512]; + uint32_t bnum; + uint32_t bcnt; + END_PRIVATE(UF2_H); +}; +LO_IMPLEMENTATION_H(io_writer, struct uf2_decoder, uf2_decoder); + +#endif /* _SBC_HARNESS_FS_HARNESS_UF2_H_ */ |