|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
#include <stdbool.h>#include <stdint.h>Go to the source code of this file.
Macros | |
| #define | SD_CMD0_GO_IDLE 0U |
| #define | SD_CMD8_SEND_IF_COND 8U |
| #define | SD_CMD10_SEND_CID 10U |
| #define | SD_CMD55_APP_CMD 55U |
| #define | SD_CMD58_READ_OCR 58U |
| #define | SD_ACMD41_SD_SEND_OP_COND 41U |
| #define | SD_CMD8_ARG 0x000001AAU /* 2.7-3.6 V, check pattern 0xAA */ |
| #define | SD_ACMD41_HCS 0x40000000U /* host supports high capacity */ |
| #define | SD_R1_IDLE 0x01U |
| #define | SD_R1_ILLEGAL_COMMAND 0x04U |
| #define | SD_DATA_TOKEN 0xFEU |
| #define | SD_OCR_CCS 0x40000000U /* card capacity status: SDHC/SDXC */ |
Functions | |
| uint8_t | sd_crc7 (const uint8_t *data, uint8_t len) |
| void | sd_command_frame (uint8_t out[6], uint8_t index, uint32_t argument) |
| static bool | sd_is_r1 (uint8_t byte) |
| bool | sd_r7_ok (const uint8_t r7[4]) |
| bool | sd_cid_ok (const uint8_t cid[16]) |
| #define SD_ACMD41_HCS 0x40000000U /* host supports high capacity */ |
Definition at line 25 of file sd_spi.h.
Referenced by sd_nand_probe(), and test_command_frames().
| #define SD_ACMD41_SD_SEND_OP_COND 41U |
Definition at line 22 of file sd_spi.h.
Referenced by sd_nand_probe(), and test_command_frames().
| #define SD_CMD0_GO_IDLE 0U |
Definition at line 17 of file sd_spi.h.
Referenced by sd_nand_probe(), and test_command_frames().
| #define SD_CMD10_SEND_CID 10U |
Definition at line 19 of file sd_spi.h.
Referenced by sd_read_cid(), and test_command_frames().
| #define SD_CMD55_APP_CMD 55U |
Definition at line 20 of file sd_spi.h.
Referenced by sd_nand_probe(), and test_command_frames().
| #define SD_CMD58_READ_OCR 58U |
Definition at line 21 of file sd_spi.h.
Referenced by sd_nand_probe(), and test_command_frames().
| #define SD_CMD8_ARG 0x000001AAU /* 2.7-3.6 V, check pattern 0xAA */ |
Definition at line 24 of file sd_spi.h.
Referenced by sd_nand_probe(), sd_r7_ok(), and test_command_frames().
| #define SD_CMD8_SEND_IF_COND 8U |
Definition at line 18 of file sd_spi.h.
Referenced by sd_nand_probe(), and test_command_frames().
| #define SD_DATA_TOKEN 0xFEU |
Definition at line 29 of file sd_spi.h.
Referenced by sd_read_cid().
| #define SD_OCR_CCS 0x40000000U /* card capacity status: SDHC/SDXC */ |
Definition at line 30 of file sd_spi.h.
Referenced by sd_nand_probe().
| #define SD_R1_IDLE 0x01U |
Definition at line 27 of file sd_spi.h.
Referenced by sd_nand_probe(), and test_r1().
| #define SD_R1_ILLEGAL_COMMAND 0x04U |
| bool sd_cid_ok | ( | const uint8_t | cid[16] | ) |
Definition at line 31 of file sd_spi.c.
References sd_crc7().
Referenced by sd_nand_probe(), and test_cid().
| void sd_command_frame | ( | uint8_t | out[6], |
| uint8_t | index, | ||
| uint32_t | argument ) |
Definition at line 17 of file sd_spi.c.
References sd_crc7().
Referenced by sd_command(), sd_read_cid(), and test_command_frames().
| uint8_t sd_crc7 | ( | const uint8_t * | data, |
| uint8_t | len ) |
Definition at line 3 of file sd_spi.c.
Referenced by sd_cid_ok(), and sd_command_frame().
|
inlinestatic |
Definition at line 39 of file sd_spi.h.
Referenced by sd_command(), sd_read_cid(), and test_r1().
| bool sd_r7_ok | ( | const uint8_t | r7[4] | ) |
Definition at line 26 of file sd_spi.c.
References SD_CMD8_ARG.
Referenced by sd_nand_probe(), and test_r7().