31 lines
365 B
C
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;
|
||
|
}
|