STM8S/A Standard Peripherals Firmware Library: STM8S_EVAL_SPI_SD_Exported_Constants

STM8S/A

STM8S/A Standard Peripherals Firmware Library
STM8S_EVAL_SPI_SD_Exported_Constants

Defines

#define SD_ADDRESS_ERROR   0x20
#define SD_BLOCK_SIZE   0x200
 Block Size.
#define SD_CMD_CLR_WRITE_PROT   29
#define SD_CMD_ERASE   38
#define SD_CMD_ERASE_GRP_END   36
#define SD_CMD_ERASE_GRP_START   35
#define SD_CMD_GO_IDLE_STATE   0
 Commands: CMDxx = CMD-number | 0x40.
#define SD_CMD_PROG_CSD   27
#define SD_CMD_READ_MULT_BLOCK   18
#define SD_CMD_READ_SINGLE_BLOCK   17
#define SD_CMD_SD_ERASE_GRP_END   33
#define SD_CMD_SD_ERASE_GRP_START   32
#define SD_CMD_SEND_CID   10
#define SD_CMD_SEND_CSD   9
#define SD_CMD_SEND_OP_COND   1
#define SD_CMD_SEND_STATUS   13
#define SD_CMD_SEND_WRITE_PROT   30
#define SD_CMD_SET_BLOCK_COUNT   23
#define SD_CMD_SET_BLOCKLEN   16
#define SD_CMD_SET_WRITE_PROT   28
#define SD_CMD_STOP_TRANSMISSION   12
#define SD_CMD_UNTAG_ERASE_GROUP   37
#define SD_CMD_UNTAG_SECTOR   34
#define SD_CMD_WRITE_MULT_BLOCK   25
#define SD_CMD_WRITE_SINGLE_BLOCK   24
#define SD_COM_CRC_ERROR   0x08
#define SD_DATA_CRC_ERROR   0x0B
#define SD_DATA_OK   0x05
 Data response error.
#define SD_DATA_OTHER_ERROR   0xFF
#define SD_DATA_WRITE_ERROR   0x0D
#define SD_DUMMY_BYTE   0xFF
 Dummy byte.
#define SD_ERASE_RESET   0x02
#define SD_ERASE_SEQUENCE_ERROR   0x10
#define SD_ILLEGAL_COMMAND   0x04
#define SD_IN_IDLE_STATE   0x01
#define SD_NOT_PRESENT   ((uint8_t)0x00)
#define SD_PARAMETER_ERROR   0x40
#define SD_PRESENT   ((uint8_t)0x01)
 SD detection on its memory slot.
#define SD_RESPONSE_FAILURE   0xFF
#define SD_RESPONSE_NO_ERROR   0x00
 SD responses and error flags.
#define SD_START_DATA_MULTIPLE_BLOCK_READ   0xFE
#define SD_START_DATA_MULTIPLE_BLOCK_WRITE   0xFD
#define SD_START_DATA_SINGLE_BLOCK_READ   0xFE
 Start Data tokens: Tokens (necessary because at nop/idle (and CS active) only 0xff is on the data/command line)
#define SD_START_DATA_SINGLE_BLOCK_WRITE   0xFE
#define SD_STOP_DATA_MULTIPLE_BLOCK_WRITE   0xFD

Define Documentation

#define SD_ADDRESS_ERROR   0x20

Definition at line 142 of file stm8s_eval_spi_sd.h.

#define SD_BLOCK_SIZE   0x200

Block Size.

Definition at line 157 of file stm8s_eval_spi_sd.h.

Referenced by SD_ReadBuffer(), SD_WriteBlock(), and SD_WriteBuffer().

#define SD_CMD_CLR_WRITE_PROT   29

CMD29 = 0x5D

Definition at line 199 of file stm8s_eval_spi_sd.h.

#define SD_CMD_ERASE   38

CMD38 = 0x66

Definition at line 207 of file stm8s_eval_spi_sd.h.

#define SD_CMD_ERASE_GRP_END   36

CMD36 = 0x64

Definition at line 205 of file stm8s_eval_spi_sd.h.

#define SD_CMD_ERASE_GRP_START   35

CMD35 = 0x63

Definition at line 204 of file stm8s_eval_spi_sd.h.

#define SD_CMD_GO_IDLE_STATE   0

Commands: CMDxx = CMD-number | 0x40.

CMD0 = 0x40

Definition at line 185 of file stm8s_eval_spi_sd.h.

Referenced by SD_GoIdleState().

#define SD_CMD_PROG_CSD   27

CMD27 = 0x5B

Definition at line 197 of file stm8s_eval_spi_sd.h.

#define SD_CMD_READ_MULT_BLOCK   18

CMD18 = 0x52

Definition at line 193 of file stm8s_eval_spi_sd.h.

#define SD_CMD_READ_SINGLE_BLOCK   17

CMD17 = 0x51

Definition at line 192 of file stm8s_eval_spi_sd.h.

Referenced by SD_ReadBlock(), and SD_ReadBuffer().

#define SD_CMD_SD_ERASE_GRP_END   33

CMD33 = 0x61

Definition at line 202 of file stm8s_eval_spi_sd.h.

#define SD_CMD_SD_ERASE_GRP_START   32

CMD32 = 0x60

Definition at line 201 of file stm8s_eval_spi_sd.h.

#define SD_CMD_SEND_CID   10

CMD10 = 0x4A

Definition at line 188 of file stm8s_eval_spi_sd.h.

Referenced by SD_GetCIDRegister().

#define SD_CMD_SEND_CSD   9

CMD9 = 0x49

Definition at line 187 of file stm8s_eval_spi_sd.h.

Referenced by SD_GetCSDRegister().

#define SD_CMD_SEND_OP_COND   1

CMD1 = 0x41

Definition at line 186 of file stm8s_eval_spi_sd.h.

Referenced by SD_GoIdleState().

#define SD_CMD_SEND_STATUS   13

CMD13 = 0x4D

Definition at line 190 of file stm8s_eval_spi_sd.h.

Referenced by SD_GetStatus().

#define SD_CMD_SEND_WRITE_PROT   30

CMD30 = 0x5E

Definition at line 200 of file stm8s_eval_spi_sd.h.

#define SD_CMD_SET_BLOCK_COUNT   23

CMD23 = 0x57

Definition at line 194 of file stm8s_eval_spi_sd.h.

#define SD_CMD_SET_BLOCKLEN   16

CMD16 = 0x50

Definition at line 191 of file stm8s_eval_spi_sd.h.

#define SD_CMD_SET_WRITE_PROT   28

CMD28 = 0x5C

Definition at line 198 of file stm8s_eval_spi_sd.h.

#define SD_CMD_STOP_TRANSMISSION   12

CMD12 = 0x4C

Definition at line 189 of file stm8s_eval_spi_sd.h.

#define SD_CMD_UNTAG_ERASE_GROUP   37

CMD37 = 0x65

Definition at line 206 of file stm8s_eval_spi_sd.h.

#define SD_CMD_UNTAG_SECTOR   34

CMD34 = 0x62

Definition at line 203 of file stm8s_eval_spi_sd.h.

#define SD_CMD_WRITE_MULT_BLOCK   25

CMD25 = 0x59

Definition at line 196 of file stm8s_eval_spi_sd.h.

#define SD_CMD_WRITE_SINGLE_BLOCK   24

CMD24 = 0x58

Definition at line 195 of file stm8s_eval_spi_sd.h.

Referenced by SD_WriteBlock(), and SD_WriteBuffer().

#define SD_COM_CRC_ERROR   0x08

Definition at line 140 of file stm8s_eval_spi_sd.h.

#define SD_DATA_CRC_ERROR   0x0B

Definition at line 150 of file stm8s_eval_spi_sd.h.

Referenced by SD_GetDataResponse().

#define SD_DATA_OK   0x05

Data response error.

Definition at line 149 of file stm8s_eval_spi_sd.h.

Referenced by SD_GetDataResponse(), SD_WriteBlock(), and SD_WriteBuffer().

#define SD_DATA_OTHER_ERROR   0xFF

Definition at line 152 of file stm8s_eval_spi_sd.h.

Referenced by SD_GetDataResponse().

#define SD_DATA_WRITE_ERROR   0x0D

Definition at line 151 of file stm8s_eval_spi_sd.h.

Referenced by SD_GetDataResponse().

#define SD_ERASE_RESET   0x02

Definition at line 138 of file stm8s_eval_spi_sd.h.

#define SD_ERASE_SEQUENCE_ERROR   0x10

Definition at line 141 of file stm8s_eval_spi_sd.h.

#define SD_ILLEGAL_COMMAND   0x04

Definition at line 139 of file stm8s_eval_spi_sd.h.

#define SD_IN_IDLE_STATE   0x01

Definition at line 137 of file stm8s_eval_spi_sd.h.

Referenced by SD_GoIdleState().

#define SD_NOT_PRESENT   ((uint8_t)0x00)

Definition at line 179 of file stm8s_eval_spi_sd.h.

Referenced by main(), and SD_Detect().

#define SD_PARAMETER_ERROR   0x40

Definition at line 143 of file stm8s_eval_spi_sd.h.

#define SD_PRESENT   ((uint8_t)0x01)

SD detection on its memory slot.

Definition at line 178 of file stm8s_eval_spi_sd.h.

Referenced by SD_Detect().

#define SD_RESPONSE_NO_ERROR   0x00
#define SD_START_DATA_MULTIPLE_BLOCK_READ   0xFE

Data token start byte, Start Multiple Block Read

Definition at line 170 of file stm8s_eval_spi_sd.h.

#define SD_START_DATA_MULTIPLE_BLOCK_WRITE   0xFD

Data token start byte, Start Multiple Block Write

Definition at line 172 of file stm8s_eval_spi_sd.h.

#define SD_START_DATA_SINGLE_BLOCK_READ   0xFE

Start Data tokens: Tokens (necessary because at nop/idle (and CS active) only 0xff is on the data/command line)

Data token start byte, Start Single Block Read

Definition at line 169 of file stm8s_eval_spi_sd.h.

Referenced by SD_GetCIDRegister(), SD_GetCSDRegister(), SD_ReadBlock(), and SD_ReadBuffer().

#define SD_START_DATA_SINGLE_BLOCK_WRITE   0xFE

Data token start byte, Start Single Block Write

Definition at line 171 of file stm8s_eval_spi_sd.h.

Referenced by SD_WriteBuffer().

#define SD_STOP_DATA_MULTIPLE_BLOCK_WRITE   0xFD

Data toke stop byte, Stop Multiple Block Write

Definition at line 173 of file stm8s_eval_spi_sd.h.

STM8 Standard Peripherals Library: Footer

 

 

 

      For complete documentation on STM8 8-bit Microcontrollers platform visit www.st.com