Loading...
Searching...
No Matches
hdr.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2018 Kaspar Schleiser <kaspar@schleiser.de>
3 * 2018 Inria
4 * 2018 Freie Universität Berlin
5 *
6 * This file is subject to the terms and conditions of the GNU Lesser
7 * General Public License v2.1. See the file LICENSE in the top level
8 * directory for more details.
9 */
10
32#ifndef RIOTBOOT_HDR_H
33#define RIOTBOOT_HDR_H
34
35#ifdef __cplusplus
36extern "C" {
37#endif
38
39#include <stdint.h>
40
45#define RIOTBOOT_MAGIC 0x544f4952 /* "RIOT" */
46
51typedef struct {
52 uint32_t magic_number;
53 uint32_t version;
54 uint32_t start_addr;
55 uint32_t chksum;
65void riotboot_hdr_print(const riotboot_hdr_t *riotboot_hdr);
66
75int riotboot_hdr_validate(const riotboot_hdr_t *riotboot_hdr);
76
84uint32_t riotboot_hdr_checksum(const riotboot_hdr_t *riotboot_hdr);
85
86#ifdef __cplusplus
87}
88#endif
89
90#endif /* RIOTBOOT_HDR_H */
int riotboot_hdr_validate(const riotboot_hdr_t *riotboot_hdr)
Validate image header.
void riotboot_hdr_print(const riotboot_hdr_t *riotboot_hdr)
Print formatted riotboot_hdr_t to STDIO.
uint32_t riotboot_hdr_checksum(const riotboot_hdr_t *riotboot_hdr)
Calculate header checksum.
Structure to store image header - All members are little endian.
Definition hdr.h:51
uint32_t start_addr
Address after the allocated space for the header.
Definition hdr.h:54
uint32_t magic_number
Header magic number (always "RIOT")
Definition hdr.h:52
uint32_t chksum
Checksum of riotboot_hdr
Definition hdr.h:55
uint32_t version
Integer representing the partition version
Definition hdr.h:53