STM32F042-Drivers-Pub/crc.c
Francesco Gritti fe64f5342d initial commit
2024-05-02 12:18:04 +02:00

31 lines
365 B
C

/*
* crc.c
*
* Created on: Apr 17, 2024
* Author: Francesco Gritti
*/
#include "mcu.h"
void crc_reset (void) {
CRC->CR |= CRC_CR_RESET;
}
u32 crc_compute (u32* start_address, u32* end_address) {
for (; start_address < end_address; start_address++) {
CRC->DR = *start_address;
}
return CRC->DR;
}
u32 crc_get (void) {
return CRC->DR;
}