STM32F042-Drivers-Pub/crc.c

31 lines
365 B
C
Raw Normal View History

2024-05-02 10:18:04 +00:00
/*
* 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;
}