1 /* 2 * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 #pragma once 7 #include <stdint.h> 8 #include <stddef.h> 9 10 #ifdef __cplusplus 11 extern "C" 12 { 13 #endif 14 15 16 /** 17 * @brief Return CRC7 of data, in the format used by SD protocol 18 * @param data array of data used to compute CRC 19 * @param size size of data in bytes 20 * @return CRC7 value 21 */ 22 uint8_t sdspi_crc7(const uint8_t *data, size_t size); 23 24 /** 25 * @brief Return CRC16 of data, in the format used by SD protocol 26 * @param data array of data used to compute CRC 27 * @param size size of data in bytes 28 * @return CRC16 value 29 */ 30 uint16_t sdspi_crc16(const uint8_t* data, size_t size); 31 32 33 #ifdef __cplusplus 34 } 35 #endif 36