sdspi_crc.h 722 B

1234567891011121314151617181920212223242526272829303132333435
  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. #ifdef __cplusplus
  10. extern "C"
  11. {
  12. #endif
  13. /**
  14. * @brief Return CRC7 of data, in the format used by SD protocol
  15. * @param data array of data used to compute CRC
  16. * @param size size of data in bytes
  17. * @return CRC7 value
  18. */
  19. uint8_t sdspi_crc7(const uint8_t *data, size_t size);
  20. /**
  21. * @brief Return CRC16 of data, in the format used by SD protocol
  22. * @param data array of data used to compute CRC
  23. * @param size size of data in bytes
  24. * @return CRC16 value
  25. */
  26. uint16_t sdspi_crc16(const uint8_t* data, size_t size);
  27. #ifdef __cplusplus
  28. }
  29. #endif