Go to the documentation of this file.
61 #define DATA_BLOCK_LEN (512u)
62 #define MAX_RESPONSE_LEN (18u)
66 #define DEBUG_MSG(X) printf((X))
#define BIT_CCS
Definition: sd.c:49
struct no_os_spi_desc * spi_desc
Definition: sd.h:81
#define DEBUG_MSG(X)
Definition: sd.h:68
int32_t no_os_spi_write_and_read(struct no_os_spi_desc *desc, uint8_t *data, uint16_t bytes_number)
Write and read data to/from SPI.
Definition: no_os_spi.c:159
#define BIT_APPLICATION_CMD
Definition: sd.c:50
#define CSD_LEN
Definition: sd.c:66
Header file of SPI Interface.
#define MASK_ADDR_IN_BLOCK
Definition: sd.c:75
uint8_t cmd
Definition: sd.h:105
struct no_os_spi_desc * spi_desc
Definition: sd.h:90
Header file of Delay functions.
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:54
int32_t sd_write(struct sd_desc *desc, uint8_t *data, uint64_t address, uint64_t len)
Definition: sd.c:463
uint8_t response[MAX_RESPONSE_LEN]
Definition: sd.h:109
#define START_1_BLOCK_TOKEN
Definition: sd.c:78
#define MASK_RESPONSE_TOKEN
Definition: sd.c:81
#define STOP_TRANSMISSION_TOKEN
Definition: sd.c:80
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
#define START_N_BLOCK_TOKEN
Definition: sd.c:79
uint8_t buff[18]
Definition: sd.h:96
#define MASK_BLOCK_NUMBER
Definition: sd.c:76
#define R1_IDLE_STATE
Definition: sd.c:59
#define WAIT_RESP_TIMEOUT
Definition: sd.c:56
Contains the elements needed to build a command.
Definition: sd.h:103
#define ACMD(x)
Definition: sd.c:53
uint64_t memory_size
Definition: sd.h:92
#define DATA_BLOCK_BITS
Definition: sd.c:74
int32_t sd_init(struct sd_desc **sd_desc, const struct sd_init_param *param)
Definition: sd.c:523
int32_t sd_remove(struct sd_desc *desc)
Definition: sd.c:634
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
#define CMD(x)
Definition: sd.c:52
int32_t sd_read(struct sd_desc *desc, uint8_t *data, uint64_t address, uint64_t len)
Definition: sd.c:412
#define CMD8_ARG
Definition: sd.c:71
uint8_t high_capacity
Definition: sd.h:94
#define R1_LEN
Definition: sd.c:62
#define STUFF_ARG
Definition: sd.c:70
#define ACMD41_ARG
Definition: sd.c:72
int32_t sd_read(struct sd_desc *sd_desc, uint8_t *data, uint64_t address, uint64_t len)
Definition: sd.c:412
Structure that stores data about the SD card configurations.
Definition: sd.h:88
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:69
Header file for SD card interface over SPI.
Configuration structure sent in the function sd_init.
Definition: sd.h:79
#define NULL
Definition: wrapper.h:64
#define R3_LEN
Definition: sd.c:64
uint32_t response_len
Definition: sd.h:111
#define CMD0_RETRY_NUMBER
Definition: sd.c:55
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
int32_t sd_remove(struct sd_desc *desc)
Definition: sd.c:634
#define MAX_RESPONSE_LEN
Definition: sd.h:62
#define R1_READY_STATE
Definition: sd.c:58
uint32_t arg
Definition: sd.h:107
#define CMD_LEN
Definition: sd.c:68
int32_t sd_init(struct sd_desc **sd_desc, const struct sd_init_param *init_param)
Definition: sd.c:523
int32_t sd_write(struct sd_desc *sd_desc, uint8_t *data, uint64_t address, uint64_t len)
Definition: sd.c:463
#define CRC_LEN
Definition: sd.c:67
#define DATA_BLOCK_LEN
Definition: sd.h:61
#define MASK_ERROR_TOKEN
Definition: sd.c:82