TI-OpenThread  1.08.02.01
Macros | Typedefs | Functions
CC1352P_2_LAUNCHXL/thread/temp_sensor/platform/nv/crc.h File Reference

Detailed Description

Functions and types for CRC checks.

Generated on Thu Nov 16 17:30:33 2017 by pycrc v0.9.1, https://pycrc.org using the configuration:

This file defines the functions crc_init(), crc_update() and crc_finalize().

The crc_init() function returns the inital crc value and must be called before the first call to crc_update(). Similarly, the crc_finalize() function must be called after the last call to crc_update(), before the crc is being used. is being used.

The crc_update() function can be called any number of times (including zero times) in between the crc_init() and crc_finalize() calls.

This pseudo-code shows an example usage of the API:

crc_t crc;
unsigned char data[MAX_DATA_LEN];
size_t data_len;
crc = crc_init();
while ((data_len = read_data(data, MAX_DATA_LEN)) > 0) {
crc = crc_update(crc, data, data_len);
}
crc = crc_finalize(crc);
#include <stdlib.h>
#include <stdint.h>
+ Include dependency graph for CC1352P_2_LAUNCHXL/thread/temp_sensor/platform/nv/crc.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CRC_ALGO_TABLE_DRIVEN   1
 

Typedefs

typedef uint8_t crc_t
 

Functions

static crc_t crc_finalize (crc_t crc)
 
static crc_t crc_init (void)
 
crc_t crc_update (crc_t crc, const void *data, size_t data_len)
 

Macro Definition Documentation

§ CRC_ALGO_TABLE_DRIVEN

#define CRC_ALGO_TABLE_DRIVEN   1

The definition of the used algorithm.

This is not used anywhere in the generated code, but it may be used by the application code to call algorithm-specific code, if desired.

Typedef Documentation

§ crc_t

typedef uint8_t crc_t

The type of the CRC values.

This type must be big enough to contain at least 8 bits.

Function Documentation

§ crc_init()

static crc_t crc_init ( void  )
inlinestatic

Calculate the initial crc value.

Returns
The initial crc value.

References crc_update().

§ crc_update()

crc_t crc_update ( crc_t  crc,
const void *  data,
size_t  data_len 
)

Update the crc value with new data.

Parameters
[in]crcThe current crc value.
[in]dataPointer to a buffer of data_len bytes.
[in]data_lenNumber of bytes in the data buffer.
Returns
The updated crc value.

Referenced by crc_init().

§ crc_finalize()

static crc_t crc_finalize ( crc_t  crc)
inlinestatic

Calculate the final crc value.

Parameters
[in]crcThe current crc value.
Returns
The final crc value.
© Copyright 1995-2020, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale