foxBMS
1.6.0
The foxBMS Battery Management System API Documentation
|
crc module header More...
Go to the source code of this file.
Macros | |
#define | CRC_SEED_HIGH (0xBADC0DEDu) |
#define | CRC_SEED_LOW (0xDEADBEEFu) |
#define | CRC_DATA_CAPTURE_MODE_CLEAR_MASK (0xFFFFFFFCu) |
#define | CRC_FULL_CPU_MODE_SET_MASK (0x3u) |
#define | CRC_BYTE_SIZE_IN_BITS (8u) |
#define | CRC_REGISTER_SIZE_IN_BYTES (4u) |
#define | CRC_REGISTER_SIZE_IN_BITS (32u) |
#define | CRC_REVERSE_BYTES_ORDER (3u) |
Enumerations | |
enum | CRC_REGISTER_SIDE_e { CRC_REGISTER_LOW , CRC_REGISTER_HIGH } |
Functions | |
STD_RETURN_TYPE_e | CRC_CalculateCrc (uint64_t *pCrc, uint8_t *pData, uint32_t lengthInBytes) |
Computes CRC of data flow. More... | |
crc module header
SPDX-License-Identifier: BSD-3-Clause
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
We kindly request you to use one or more of the following phrases to refer to foxBMS in your hardware, software, documentation or advertising materials:
Uses the system CRC hardware for data integrity calculation
Definition in file crc.h.
#define CRC_DATA_CAPTURE_MODE_CLEAR_MASK (0xFFFFFFFCu) |
#define CRC_FULL_CPU_MODE_SET_MASK (0x3u) |
#define CRC_SEED_HIGH (0xBADC0DEDu) |
#define CRC_SEED_LOW (0xDEADBEEFu) |
enum CRC_REGISTER_SIDE_e |
STD_RETURN_TYPE_e CRC_CalculateCrc | ( | uint64_t * | pCrc, |
uint8_t * | pData, | ||
uint32_t | lengthInBytes | ||
) |
Computes CRC of data flow.
This function uses the hardware of the MCU. Data must be given in byte chunks.
[in] | pCrc | uint64_t pointer to the calculated CRC |
[in] | pData | uint8_t pointer to the start of the data flow |
[in] | lengthInBytes | length in bytes of the data flow |