RTC auf true
drivers/MbedCRC.cpp@0:38ceb79fef03, 2018-11-28 (annotated)
- Committer:
- kevman
- Date:
- Wed Nov 28 15:10:15 2018 +0000
- Revision:
- 0:38ceb79fef03
RTC modified
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kevman | 0:38ceb79fef03 | 1 | /* mbed Microcontroller Library |
kevman | 0:38ceb79fef03 | 2 | * Copyright (c) 2018 ARM Limited |
kevman | 0:38ceb79fef03 | 3 | * |
kevman | 0:38ceb79fef03 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
kevman | 0:38ceb79fef03 | 5 | * you may not use this file except in compliance with the License. |
kevman | 0:38ceb79fef03 | 6 | * You may obtain a copy of the License at |
kevman | 0:38ceb79fef03 | 7 | * |
kevman | 0:38ceb79fef03 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
kevman | 0:38ceb79fef03 | 9 | * |
kevman | 0:38ceb79fef03 | 10 | * Unless required by applicable law or agreed to in writing, software |
kevman | 0:38ceb79fef03 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
kevman | 0:38ceb79fef03 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
kevman | 0:38ceb79fef03 | 13 | * See the License for the specific language governing permissions and |
kevman | 0:38ceb79fef03 | 14 | * limitations under the License. |
kevman | 0:38ceb79fef03 | 15 | */ |
kevman | 0:38ceb79fef03 | 16 | |
kevman | 0:38ceb79fef03 | 17 | #include <stddef.h> |
kevman | 0:38ceb79fef03 | 18 | #include "drivers/TableCRC.h" |
kevman | 0:38ceb79fef03 | 19 | #include "drivers/MbedCRC.h" |
kevman | 0:38ceb79fef03 | 20 | |
kevman | 0:38ceb79fef03 | 21 | namespace mbed { |
kevman | 0:38ceb79fef03 | 22 | /** \addtogroup drivers */ |
kevman | 0:38ceb79fef03 | 23 | /** @{*/ |
kevman | 0:38ceb79fef03 | 24 | |
kevman | 0:38ceb79fef03 | 25 | SingletonPtr<PlatformMutex> mbed_crc_mutex; |
kevman | 0:38ceb79fef03 | 26 | |
kevman | 0:38ceb79fef03 | 27 | /* Default values for different types of polynomials |
kevman | 0:38ceb79fef03 | 28 | */ |
kevman | 0:38ceb79fef03 | 29 | template<> |
kevman | 0:38ceb79fef03 | 30 | MbedCRC<POLY_32BIT_ANSI, 32>::MbedCRC(): |
kevman | 0:38ceb79fef03 | 31 | _initial_value(~(0x0)), _final_xor(~(0x0)), _reflect_data(true), _reflect_remainder(true), |
kevman | 0:38ceb79fef03 | 32 | _crc_table((uint32_t *)Table_CRC_32bit_ANSI) |
kevman | 0:38ceb79fef03 | 33 | { |
kevman | 0:38ceb79fef03 | 34 | mbed_crc_ctor(); |
kevman | 0:38ceb79fef03 | 35 | } |
kevman | 0:38ceb79fef03 | 36 | |
kevman | 0:38ceb79fef03 | 37 | template<> |
kevman | 0:38ceb79fef03 | 38 | MbedCRC<POLY_32BIT_REV_ANSI, 32>::MbedCRC(): |
kevman | 0:38ceb79fef03 | 39 | _initial_value(~(0x0)), _final_xor(~(0x0)), _reflect_data(false), _reflect_remainder(false), |
kevman | 0:38ceb79fef03 | 40 | _crc_table((uint32_t *)Table_CRC_32bit_Rev_ANSI) |
kevman | 0:38ceb79fef03 | 41 | { |
kevman | 0:38ceb79fef03 | 42 | mbed_crc_ctor(); |
kevman | 0:38ceb79fef03 | 43 | } |
kevman | 0:38ceb79fef03 | 44 | |
kevman | 0:38ceb79fef03 | 45 | template<> |
kevman | 0:38ceb79fef03 | 46 | MbedCRC<POLY_16BIT_IBM, 16>::MbedCRC(): |
kevman | 0:38ceb79fef03 | 47 | _initial_value(0), _final_xor(0), _reflect_data(true), _reflect_remainder(true), |
kevman | 0:38ceb79fef03 | 48 | _crc_table((uint32_t *)Table_CRC_16bit_IBM) |
kevman | 0:38ceb79fef03 | 49 | { |
kevman | 0:38ceb79fef03 | 50 | mbed_crc_ctor(); |
kevman | 0:38ceb79fef03 | 51 | } |
kevman | 0:38ceb79fef03 | 52 | |
kevman | 0:38ceb79fef03 | 53 | template<> |
kevman | 0:38ceb79fef03 | 54 | MbedCRC<POLY_16BIT_CCITT, 16>::MbedCRC(): |
kevman | 0:38ceb79fef03 | 55 | _initial_value(~(0x0)), _final_xor(0), _reflect_data(false), _reflect_remainder(false), |
kevman | 0:38ceb79fef03 | 56 | _crc_table((uint32_t *)Table_CRC_16bit_CCITT) |
kevman | 0:38ceb79fef03 | 57 | { |
kevman | 0:38ceb79fef03 | 58 | mbed_crc_ctor(); |
kevman | 0:38ceb79fef03 | 59 | } |
kevman | 0:38ceb79fef03 | 60 | |
kevman | 0:38ceb79fef03 | 61 | template<> |
kevman | 0:38ceb79fef03 | 62 | MbedCRC<POLY_7BIT_SD, 7>::MbedCRC(): |
kevman | 0:38ceb79fef03 | 63 | _initial_value(0), _final_xor(0), _reflect_data(false), _reflect_remainder(false), |
kevman | 0:38ceb79fef03 | 64 | _crc_table((uint32_t *)Table_CRC_7Bit_SD) |
kevman | 0:38ceb79fef03 | 65 | { |
kevman | 0:38ceb79fef03 | 66 | mbed_crc_ctor(); |
kevman | 0:38ceb79fef03 | 67 | } |
kevman | 0:38ceb79fef03 | 68 | |
kevman | 0:38ceb79fef03 | 69 | template<> |
kevman | 0:38ceb79fef03 | 70 | MbedCRC<POLY_8BIT_CCITT, 8>::MbedCRC(): |
kevman | 0:38ceb79fef03 | 71 | _initial_value(0), _final_xor(0), _reflect_data(false), _reflect_remainder(false), |
kevman | 0:38ceb79fef03 | 72 | _crc_table((uint32_t *)Table_CRC_8bit_CCITT) |
kevman | 0:38ceb79fef03 | 73 | { |
kevman | 0:38ceb79fef03 | 74 | mbed_crc_ctor(); |
kevman | 0:38ceb79fef03 | 75 | } |
kevman | 0:38ceb79fef03 | 76 | |
kevman | 0:38ceb79fef03 | 77 | /** @}*/ |
kevman | 0:38ceb79fef03 | 78 | } // namespace mbed |
kevman | 0:38ceb79fef03 | 79 |