package
0.0.0-20211205205814-168ccc21e67c
Repository: https://github.com/ziutek/emgo.git
Documentation: pkg.go.dev

# Packages

Package sdmc implements access to Secure Digital Memory Cards.

# Functions

ACMD41 (SD_SEND_OP_COND, R3) starts initialization/identification process.
ACMD42 (SET_CLR_CARD_DETECT, R1) enables/disables pull-up resistor on D3/CD.
ACMD51 (SEND_SCR, R1) reads SD Configuration Register.
ACMD6 (SET_BUS_WIDTH, R1) sets the data bus width.
BlockMode returns bits of DataMode that correspond to block data transfer with block size equal 1<<exp.
CMD0 (GO_IDLE_STATE) performs software reset and sets the card into Idle State.
CMD12 (STOP_TRANSMISSION, R1b) forces the card to stop transmission in Multiple Block Read Operation.
CMD13 (SEND_STATUS/SEND_TASK_STATUS, R1) reads Status or TaskStatus register.
CMD16 (SET_BLOCKLEN, R1) sets the block length (in bytes) for block commands.
CMD17 (READ_SINGLE_BLOCK, R1) reads a block of the size selected by CMD16.
CMD18 (READ_MULTIPLE_BLOCK, R1) works like CMD17 but does not stop the transmision after first data block.
CMD2 (ALL_SEND_CID, R2) gets Card Identification Data.
CMD24 (WRITE_BLOCK, R1) writes a block of the size selected by CMD16.
CMD25 (WRITE_MULTIPLE_BLOCK, R1) works like CMD24 but allows to transmit multiple block to the card until.
CMD3 (SEND_RELATIVE_ADDR, R6) asks the card to publishets a new Relative Card Address (RCA) and Card Status bits 23,22,19,12:0.
 CMD5 (IO_SEND_OP_COND, R4) inquires about the voltage range needed by the I/O card.
CMD52 (IO_RW_DIRECT, R5).
CMD53 (IO_RW_EXTENDED, R5).
CMD55 (APP_CMD, R1) indicates to the card that the next command is an application specific command.
CMD6 (SWITCH_FUNC, R1) switches or expands memory card functions.
CMD7 (SELECT_CARD/DESELECT_CARD, R1b) selects card with rca address (puts into Transfer State) and deselects all other (puts into Stand-by State).
CMD8 (SEND_IF_COND, R7) initializes SD Memory Cards compliant to the Physical Layer Specification Version 2.00 or later.
CMD9 (SEND_CSD, R2) reads Card Specific Data from card indentified by rca.
MakeDataBlocks allocates and initializes Data object that can store n 512-byte blocks.
MakeDataBytes allocates and initializes Data object that can store n bytes.

# Constants

Access mode (keep current).
Application command (hint, APP_CMD required).
Block mode (CMD53).
Block data transfer, block size: 1 B.
Block data transfer, block size: 128 B.
Block data transfer, block size: 16 B.
Block data transfer, block size: 16 KiB.
Block data transfer, block size: 1 KiB.
Block data transfer, block size: 2 B.
Block data transfer, block size: 256 B.
Block data transfer, block size: 2 KiB.
Block data transfer, block size: 32 B.
Block data transfer, block size: 4 B.
Block data transfer, block size: 4 KiB.
Block data transfer, block size: 512 B.
Block data transfer, block size: 64 B.
Block data transfer, block size: 8 B.
Block data transfer, block size: 8 KiB.
CMD53 only.
To iterate over block sizes.
CMD53 only.
1-lane SD data bus.
4-lane SD data bus.
8-lane SD data bus.
Command can set D0 low to signal busy state.
Command index.
Command system (keep current).
DDR50.
Default limit: 720 mW.
Default Speed or SDR12.
Default Command System.
Default Type B driver.
DOS FAT (floppy-like) without partition table.
UHS-I driver strength (keep current).
Dual Voltage Card (SDMC).
Hard disk-like file system with partition table.
Response expected.
Card Capacity Status (set fot SDHC, SDXC).
High Speed or SDR25.
OP Code (CMD53).
SDIO specific operation.
Long response.
Checks switchable function.
Switch card function.
Other/unknown.
Limit: 1440 mW.
Limit: 1800 mW.
Limit: 2160 mW.
Limit: 2880 mW.
Power limit (keep current).
Card in power up state (^Busy).
All Command constants are defined to be friendly to use with ARM PrimeCell Multimedia Card Interface (used by STM32, LPC and probably more MCUs).
All Command constants are defined to be friendly to use with ARM PrimeCell Multimedia Card Interface (used by STM32, LPC and probably more MCUs).
All Command constants are defined to be friendly to use with ARM PrimeCell Multimedia Card Interface (used by STM32, LPC and probably more MCUs).
All Command constants are defined to be friendly to use with ARM PrimeCell Multimedia Card Interface (used by STM32, LPC and probably more MCUs).
All Command constants are defined to be friendly to use with ARM PrimeCell Multimedia Card Interface (used by STM32, LPC and probably more MCUs).
All Command constants are defined to be friendly to use with ARM PrimeCell Multimedia Card Interface (used by STM32, LPC and probably more MCUs).
All Command constants are defined to be friendly to use with ARM PrimeCell Multimedia Card Interface (used by STM32, LPC and probably more MCUs).
Read after write (CMD52).
Read data (CMD52, CMD53).
Receive data from a card.
Response index.
Response types.
Read wait control using CK instead od D2.
Read wait start.
Read wait stop.
Switching to 1.8V.
SDR104.
SDR50.
Version 2.00.
Version 1.01.
Version 3.xx.
Send data to a card.
Invalid, used by Host to report SPI bus.
Stream or SDIO multibyte data transfer.
Type A driver.
Type C driver.
Type D driver.
Universal File Format.
UHS-II Card Status.
2.0-2.1 V (SDIO).
2.1-2.2 V (SDIO).
2.2-2.3 V (SDIO).
2.3-2.4 V (SDIO).
2.4-2.5 V (SDIO).
2.5-2.6 V (SDIO).
2.6-2.7 V (SDIO).
2.7-2.8 V.
2.8-2.9 V.
2.9-3.0 V.
3.0-3.1 V.
3.1-3.2 V.
3.2-3.3 V.
3.3-3.4 V.
3.4-3.5 V.
3.5-3.6 V.
Write data (CMD52, CMD53).
CMD52 only.
SDXC maximum performance.

# Variables

ErrBusyTimeout is returned by Host if it waited 1s for end of card busy state and for that reason it could not start a data transfer.
ErrCmdTimeout is returned by Host in case of command response timeout.

# Interfaces

# Type aliases

BusWidth describes SD data bus width.
CID - Card Identification Register.
CSD - Card Specific Data register.
Data can be used to access bytes sent/received using SD card data transfers.
DataMode describes data transfer mode.
SCR (SD CARD Configuration Register) is 8 byte register that can be read using ACMD51 and 8-byte block data transfer (it is not returned in response).