Remove support for 7/8 bit CRC polynomials for K64F

pull/6708/head
Steven Cartmell 2018-04-27 16:45:06 +01:00
parent 5847f0c975
commit df93c0151c
2 changed files with 35 additions and 29 deletions

View File

@ -1,3 +1,20 @@
/** \addtogroup hal */
/** @{*/
/* mbed Microcontroller Library
* Copyright (c) 2018 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef MBED_CRC_HAL_API_H
#define MBED_CRC_HAL_API_H
@ -24,6 +41,15 @@ typedef enum crc_polynomial {
extern "C" {
#endif
/**
* \defgroup hal_crc Hardware CRC
*
* The Hardware CRC HAL API provides a low-level interface to the Hardware CRC
* module of a target platform.
*
* @{
*/
/** Determine if the current platform supports hardware CRC for given polynomial
*
* The purpose of this function is to inform the CRC Platform API whether the
@ -122,9 +148,13 @@ void hal_crc_compute_partial(const uint8_t *data, const size_t size);
*/
uint32_t hal_crc_get_result(void);
/**@}*/
#ifdef __cplusplus
};
#endif
#endif // DEVICE_CRC
#endif // MBED_CRC_HAL_API_H
/**@}*/

View File

@ -11,12 +11,13 @@ bool hal_crc_is_supported(const uint32_t polynomial)
{
switch (polynomial)
{
case POLY_8BIT_CCITT:
case POLY_7BIT_SD:
case POLY_16BIT_CCITT:
case POLY_16BIT_IBM:
case POLY_32BIT_ANSI:
return true;
case POLY_8BIT_CCITT:
case POLY_7BIT_SD:
return false;
default:
return false;
}
@ -70,34 +71,9 @@ void hal_crc_compute_partial_start(const uint32_t polynomial)
break;
}
case POLY_8BIT_CCITT:
{
width = kCrcBits16;
config.polynomial = polynomial;
config.seed = 0U;
config.reflectIn = false;
config.reflectOut = false;
config.complementChecksum = false;
config.crcBits = width;
config.crcResult = kCrcFinalChecksum;
default:
MBED_ASSERT("Configuring Mbed CRC with unsupported polynomial");
break;
}
case POLY_7BIT_SD:
{
width = kCrcBits16;
config.polynomial = polynomial;
config.seed = 0U;
config.reflectIn = false;
config.reflectOut = false;
config.complementChecksum = false;
config.crcBits = width;
config.crcResult = kCrcFinalChecksum;
break;
}
}
CRC_Init(CRC0, &config);