Debian Codegraph @

src/include/spi_sdcard.h

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #ifndef _SPI_SDCARD_H_
4 #define _SPI_SDCARD_H_
5
6 #include <stddef.h>
7
8 struct spi_sdcard {
9 int type;
10 struct spi_slave slave;
11 };
12
13 int spi_sdcard_init(struct spi_sdcard *card,
14 const unsigned int bus,
15 const unsigned int cs);
16
17 int spi_sdcard_single_read(const struct spi_sdcard *card,
18 size_t block_address,
19 void *buff);
20
21 int spi_sdcard_multiple_read(const struct spi_sdcard *card,
22 size_t start_block_address,
23 size_t end_block_address,
24 void *buff);
25
26 int spi_sdcard_single_write(const struct spi_sdcard *card,
27 size_t block_address,
28 void *buff);
29
30 int spi_sdcard_read(const struct spi_sdcard *card,
31 void *dest,
32 size_t offset,
33 size_t count);
34
35 int spi_sdcard_multiple_write(const struct spi_sdcard *card,
36 size_t start_block_address,
37 size_t end_block_address,
38 void *buff);
39
40 int spi_sdcard_erase(const struct spi_sdcard *card,
41 size_t start_block_address,
42 size_t end_block_address);
43
44 int spi_sdcard_erase_all(const struct spi_sdcard *card);
45
46 /* get the sdcard size in bytes */
47 size_t spi_sdcard_size(const struct spi_sdcard *card);
48
49 #endif /* _SPI_SDCARD_H_ */