Nut/OS  5.0.5
API Reference
stm32_crc.c File Reference
#include <cfg/os.h>
#include <cfg/clock.h>
#include <cfg/arch.h>
#include <cfg/arch/gpio.h>
#include <arch/cm3.h>
#include <arch/cm3/stm/stm32xxxx.h>
#include <arch/cm3/stm/stm32xxxx_rcc.h>
Include dependency graph for stm32_crc.c:

Functions

void CRC_ResetDR (void)
 Resets the CRC Data register (DR).
uint32_t CRC_CalcCRC (uint32_t Data)
 Computes the 32-bit CRC of a given data word(32-bit).
uint32_t CRC_CalcBlockCRC (uint32_t pBuffer[], uint32_t BufferLength)
 Computes the 32-bit CRC of a given buffer of data word(32-bit).
uint32_t CRC_GetCRC (void)
 Returns the current CRC value.
void CRC_SetIDRegister (uint8_t IDValue)
 Stores a 8-bit data in the Independent Data(ID) register.
uint8_t CRC_GetIDRegister (void)
 Returns the 8-bit data stored in the Independent Data(ID) register.
void CRC_Init (void)
 Init the CRC machine.

Function Documentation

void CRC_ResetDR ( void  )

Resets the CRC Data register (DR).

Parameters:
None
Return values:
:None

References CRC, and CRC_CR_RESET.

uint32_t CRC_CalcCRC ( uint32_t  Data)

Computes the 32-bit CRC of a given data word(32-bit).

Parameters:
Data,:data word(32-bit) to compute its CRC
Return values:
:32-bit CRC

References CRC.

uint32_t CRC_CalcBlockCRC ( uint32_t  pBuffer[],
uint32_t  BufferLength 
)

Computes the 32-bit CRC of a given buffer of data word(32-bit).

Parameters:
pBuffer,:pointer to the buffer containing the data to be computed
BufferLength,:length of the buffer to be computed
Return values:
:32-bit CRC

References CRC.

uint32_t CRC_GetCRC ( void  )

Returns the current CRC value.

Parameters:
None
Return values:
:32-bit CRC

References CRC.

void CRC_SetIDRegister ( uint8_t  IDValue)

Stores a 8-bit data in the Independent Data(ID) register.

Parameters:
IDValue,:8-bit value to be stored in the ID register
Return values:
:None

References CRC.

uint8_t CRC_GetIDRegister ( void  )

Returns the 8-bit data stored in the Independent Data(ID) register.

Parameters:
None
Return values:
:8-bit value of the ID register

References CRC.

void CRC_Init ( void  )

Init the CRC machine.

Parameters:
None
Return values:
:None

References CRC, CRC_CR_RESET, RCC, RCC_AHB1ENR_CRCEN, and RCC_AHBPeriph_CRC.