• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 #pragma once
15 #include <stdint.h>
16 #include <stddef.h>
17 
18 #ifdef __cplusplus
19 extern "C"
20 {
21 #endif
22 
23 
24 /**
25  * @brief Return CRC7 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 CRC7 value
29  */
30 uint8_t sdspi_crc7(const uint8_t *data, size_t size);
31 
32 /**
33  * @brief Return CRC16 of data, in the format used by SD protocol
34  * @param data array of data used to compute CRC
35  * @param size size of data in bytes
36  * @return CRC16 value
37  */
38 uint16_t sdspi_crc16(const uint8_t* data, size_t size);
39 
40 
41 #ifdef __cplusplus
42 }
43 #endif
44