![]() |
no-OS
|
Header file for SD card interface over SPI. More...
Classes | |
| struct | sd_init_param |
| Configuration structure sent in the function sd_init. More... | |
| struct | sd_desc |
| Structure that stores data about the SD card configurations. More... | |
| struct | cmd_desc |
| Contains the elements needed to build a command. More... | |
Macros | |
| #define | DATA_BLOCK_LEN (512u) |
| #define | MAX_RESPONSE_LEN (18u) |
| #define | DEBUG_MSG(X) |
Functions | |
| int32_t | sd_init (struct sd_desc **sd_desc, const struct sd_init_param *init_param) |
| int32_t | sd_remove (struct sd_desc *desc) |
| int32_t | sd_read (struct sd_desc *desc, uint8_t *data, uint64_t address, uint64_t len) |
| int32_t | sd_write (struct sd_desc *desc, uint8_t *data, uint64_t address, uint64_t len) |
Header file for SD card interface over SPI.
Copyright 2019(c) Analog Devices, Inc.
SPDX-License-Identifier: BSD-3-Clause
This interface supports byte read and write operations for SD cards that that meet the following conditions:
| #define DATA_BLOCK_LEN (512u) |
| #define DEBUG_MSG | ( | X | ) |
| #define MAX_RESPONSE_LEN (18u) |
| int32_t sd_init | ( | struct sd_desc ** | sd_desc, |
| const struct sd_init_param * | param ) |
Initialize an instance of SD card and stores it to the parameter desc
| sd_desc | - Pointer where to store the instance of the SD |
| param | - Contains an initialized SPI descriptor |
| int32_t sd_read | ( | struct sd_desc * | sd_desc, |
| uint8_t * | data, | ||
| uint64_t | address, | ||
| uint64_t | len ) |
Read data of size len from the specified address and store it in data. This operation returns only when the read is complete
| sd_desc | - Instance of the SD card |
| data | - Where data will be read |
| address | - Address in memory from where data will be read |
| len | - Length in bytes of data to be read |
| int32_t sd_remove | ( | struct sd_desc * | desc | ) |
Remove the initialize instance of SD card.
| desc | - Instance of the SD card |
| int32_t sd_write | ( | struct sd_desc * | sd_desc, |
| uint8_t * | data, | ||
| uint64_t | address, | ||
| uint64_t | len ) |
Write data of size len to the specified address This operation returns only when the write is complete
| sd_desc | - Instance of the SD card |
| data | - Data to write |
| address | - Address in memory where data will be written |
| len | - Length of data in bytes |