Midnight Sun Firmware
Loading...
Searching...
No Matches
bootloader_crc32.h
1#pragma once
2
3/************************************************************************************************
4 * @file bootloader_crc32.h
5 *
6 * @brief Header file for the CRC32 calculations in the bootloader
7 *
8 * @date 2025-01-08
9 * @author Midnight Sun Team #24 - MSXVI
10 ************************************************************************************************/
11
12/* Standard library Headers */
13#include <stddef.h>
14#include <stdint.h>
15#include <string.h>
16
17/* Inter-component Headers */
18
19/* Intra-component Headers */
20#include "bootloader_error.h"
21
29#define BYTES_TO_WORD(bytes) (bytes / 4)
30
31#define ALLIGNMENT_SIZE 4
37
44uint32_t boot_crc32_calculate(const uint32_t *buffer, size_t buffer_len);
45
52void boot_align_to_32bit_words(uint8_t *buffer, size_t *buffer_len);
53
uint32_t boot_crc32_calculate(const uint32_t *buffer, size_t buffer_len)
Calculate a CRC32 on a provided data buffer.
Definition: bootloader_crc32.c:43
BootloaderError boot_crc32_init(void)
Initialize the CRC hardware component.
Definition: bootloader_crc32.c:23
void boot_align_to_32bit_words(uint8_t *buffer, size_t *buffer_len)
Align a provided data buffer to the 4-byte boundary.
Definition: bootloader_crc32.c:51
BootloaderError
Bootloader error definitions.
Definition: bootloader_error.h:28