STM32F0xx Standard Peripherals Firmware Library: CRC_8BitsCRCMessage

STM32F0xx Standard Peripherals Library

STM32F0xx Standard Peripherals Firmware Library

Defines

#define BUFFER_SIZE   (countof(CRCBuffer) - 1)
#define countof(a)   (uint8_t)(sizeof(a) / sizeof(*(a)))

Functions

static uint8_t CRC_8BitsCompute (uint8_t *data, uint32_t size)
 Compute CRC value for input message.
static void CRC_Config (uint8_t poly)
 Configure CRC peripheral to use 8-bit polynomials.
void HardFault_Handler (void)
 This function handles Hard Fault exception.
int main (void)
 Main program.
void NMI_Handler (void)
 This function handles NMI exception.
void PendSV_Handler (void)
 This function handles PendSVC exception.
void SVC_Handler (void)
 This function handles SVCall exception.
void SysTick_Handler (void)
 This function handles SysTick Handler.

Variables

uint8_t ComputedCRC = 0
uint8_t CRCBuffer [] = "STM32F0xx CortexM0 Device running on STM32072B-EVAL"
uint8_t ExpectedCRC = 0xAF

Define Documentation

#define BUFFER_SIZE   (countof(CRCBuffer) - 1)

Definition at line 43 of file STM32F0xx_StdPeriph_Examples/CRC/CRC_8BitsCRCMessage/main.c.

Referenced by main().

#define countof (   a)    (uint8_t)(sizeof(a) / sizeof(*(a)))

Function Documentation

static uint8_t CRC_8BitsCompute ( uint8_t *  data,
uint32_t  size 
) [static]

Compute CRC value for input message.

Parameters:
data,:pointer at uint8_t
size,:the size of the input message
Return values:
Thecomputed CRC value

Definition at line 130 of file STM32F0xx_StdPeriph_Examples/CRC/CRC_8BitsCRCMessage/main.c.

Referenced by main().

static void CRC_Config ( uint8_t  poly) [static]

Configure CRC peripheral to use 8-bit polynomials.

Parameters:
poly,:the CRC polynomial
Return values:
None

Definition at line 106 of file STM32F0xx_StdPeriph_Examples/CRC/CRC_8BitsCRCMessage/main.c.

Referenced by main().

void HardFault_Handler ( void  )

This function handles Hard Fault exception.

Parameters:
None
Return values:
None

Definition at line 66 of file STM32F0xx_StdPeriph_Examples/CRC/CRC_8BitsCRCMessage/stm32f0xx_it.c.

int main ( void  )

Main program.

Parameters:
None
Return values:
None

< At this stage the microcontroller clock setting is already configured, this is done through SystemInit() function which is called from startup file (startup_stm32f0xx.s) before to branch to application main. To reconfigure the default setting of SystemInit() function, refer to system_stm32f0xx.c file

Definition at line 64 of file STM32F0xx_StdPeriph_Examples/CRC/CRC_8BitsCRCMessage/main.c.

References BUFFER_SIZE, ComputedCRC, CRC_8BitsCompute(), CRC_Config(), CRCBuffer, and ExpectedCRC.

void NMI_Handler ( void  )

This function handles NMI exception.

Parameters:
None
Return values:
None

Definition at line 57 of file STM32F0xx_StdPeriph_Examples/CRC/CRC_8BitsCRCMessage/stm32f0xx_it.c.

void PendSV_Handler ( void  )

This function handles PendSVC exception.

Parameters:
None
Return values:
None

Definition at line 88 of file STM32F0xx_StdPeriph_Examples/CRC/CRC_8BitsCRCMessage/stm32f0xx_it.c.

void SVC_Handler ( void  )

This function handles SVCall exception.

Parameters:
None
Return values:
None

Definition at line 79 of file STM32F0xx_StdPeriph_Examples/CRC/CRC_8BitsCRCMessage/stm32f0xx_it.c.

void SysTick_Handler ( void  )

This function handles SysTick Handler.

Parameters:
None
Return values:
None

Definition at line 97 of file STM32F0xx_StdPeriph_Examples/CRC/CRC_8BitsCRCMessage/stm32f0xx_it.c.


Variable Documentation

uint8_t CRCBuffer[] = "STM32F0xx CortexM0 Device running on STM32072B-EVAL"
STM32L1xx Standard Peripherals Library: Footer

 

 

 For complete documentation on STM32 Microcontrollers visit www.st.com/STM32