sdcard

package
v0.0.0-...-168ccc2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package sdcard provides low-level primitives to handle Secure Digital Card protocol. The sdmc and sdio subpacckages provide higher level interface for respectively SD Memory and SDIO cards.

Index

Constants

View Source
const (
	// Command fields
	CmdIdx   Command = 63 << 0  // Command index.
	HasResp  Command = 1 << 6   // Response expected.
	LongResp Command = 1 << 7   // Long response.
	RespIdx  Command = 15 << 10 // Response index.
	Busy     Command = 1 << 14  // Command can set D0 low to signal busy state.
	App      Command = 1 << 15  // Application command (hint, APP_CMD required).

	// Response types
	RespType = RespIdx | HasResp | LongResp
	R1       = 1<<10 | HasResp
	R2       = 2<<10 | HasResp | LongResp
	R3       = 3<<10 | HasResp
	R4       = 4<<10 | HasResp
	R5       = 5<<10 | HasResp
	R6       = 6<<10 | HasResp
	R7       = 7<<10 | HasResp
)

All Command constants are defined to be friendly to use with ARM PrimeCell Multimedia Card Interface (used by STM32, LPC and probably more MCUs). Do not add, delete, modify command fields without checking the stm32/hal/sdmmc and lpc/hal/sdmmc.

View Source
const (
	IncAddr IORWFlags = 1 << 0 // OP Code (CMD53)
	RAW     IORWFlags = 1 << 1 // Read after write (CMD52)
	Block   IORWFlags = 1 << 1 // Block mode (CMD53)
	Read    IORWFlags = 0 << 5 // Read data (CMD52, CMD53)
	Write   IORWFlags = 1 << 5 // Write data (CMD52, CMD53)

	WriteRead  = Write | RAW   // CMD52 only.
	BlockRead  = Read | Block  // CMD53 only.
	BlockWrite = Write | Block // CMD53 only.
)

Variables

View Source
var (
	// ErrCmdTimeout is returned by Host in case of command response timeout.
	ErrCmdTimeout = errors.New("sdio: cmd timeout")

	// 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.
	ErrBusyTimeout = errors.New("sdmc: busy timeout")
)

Functions

This section is empty.

Types

type BusWidth

type BusWidth byte

BusWidth describes SD data bus width.

const (
	Bus1 BusWidth = 0 // 1-lane SD data bus.
	Bus4 BusWidth = 2 // 4-lane SD data bus.
	Bus8 BusWidth = 3 // 8-lane SD data bus.
)

type BusWidths

type BusWidths byte
const (
	SDBus1 BusWidths = 1 << 0
	SDBus4 BusWidths = 1 << 2
	SPIBus BusWidths = 1 << 5 // Invalid, used by Host to report SPI bus.
)

type CID

type CID [4]uint32

CID - Card Identification Register

func (CID) CRC

func (cid CID) CRC() byte

CRC returns the 7-bit CRC field.

func (CID) MDT

func (cid CID) MDT() (year, month int)

MDT returns the manufacturing date.

func (CID) MID

func (cid CID) MID() byte

MID returns the manufacturer ID.

func (CID) OID

func (cid CID) OID() [2]byte

OID returns the OEM/Application ID.

func (CID) PNM

func (cid CID) PNM() [5]byte

PNM returns the product name.

func (CID) PRV

func (cid CID) PRV() byte

PRV returns the product revision.

func (CID) PSN

func (cid CID) PSN() uint32

PSN returns the product serial number.

type CSD

type CSD [4]uint32

CSD - Card Specific Data register

func (CSD) CCC

func (csd CSD) CCC() uint16

CCC returns SDMC command set as 12-bit bitfield.

func (CSD) COPY

func (csd CSD) COPY() bool

COPY reports whether the contents has been copied (not original).

func (CSD) CRC

func (csd CSD) CRC() byte

CRC returns the checksum for the CSD content.

func (CSD) C_SIZE

func (csd CSD) C_SIZE() int64

C_SIZE returns the user's data card capacity as number of 512 B blocks.

func (CSD) DSR_IMP

func (csd CSD) DSR_IMP() bool

DSR_IMP reports whether the configurable driver stage is integrated on the card and Driver Stage Register is implemented.

func (CSD) ERASE_BLK_EN

func (csd CSD) ERASE_BLK_EN() bool

ERASE_BLK_EN reports whether the memory card supports erasing of one or multiple 512 B blocks. If ERASE_BLK_EN is false it supports erasing of one or more sectors of SECTOR_SIZE * WRITE_BL_LEN bytes.

func (CSD) FILE_FORMAT

func (csd CSD) FILE_FORMAT() FileFormat

FILE_FORMAT returns the file format on the card (3-bit field: the MS bit represents format group, two LS bits represents format).

func (CSD) NSAC

func (csd CSD) NSAC() int

NSAC returns the worst case for the clock-dependent factor of the data access time [clk].

func (CSD) PERM_WRITE_PROTECT

func (csd CSD) PERM_WRITE_PROTECT() bool

PERM_WRITE_PROTECT reports whether the entrie card content is permanently protected against overwriting or erasing.

func (CSD) R2W_FACTOR

func (csd CSD) R2W_FACTOR() int

R2W_FACTOR returns the typical block program time as a multiple of the read access time.

func (CSD) READ_BLK_MISALIGN

func (csd CSD) READ_BLK_MISALIGN() bool

READ_BLK_MISALIGN reports whether the data block to be read by one command can be spread over more than one physical block of the memory device.

func (CSD) READ_BL_LEN

func (csd CSD) READ_BL_LEN() int

READ_BL_LEN returns the maximum read data block length (bytes).

func (CSD) READ_BL_PARTIAL

func (csd CSD) READ_BL_PARTIAL() bool

READ_BL_PARTIAL reports whether Partial Block Read is allowed.

func (CSD) SECTOR_SIZE

func (csd CSD) SECTOR_SIZE() int

SECTOR_SIZE returns the size of an erasable sector as number of blocks of WRITE_BL_LEN bytes.

func (CSD) TAAC

func (csd CSD) TAAC() int

TAAC returns asynchronous part of the data access time [ns].

func (CSD) TMP_WRITE_PROTECT

func (csd CSD) TMP_WRITE_PROTECT() bool

TMP_WRITE_PROTECT reports whether the entrie card content is temporarily protected against overwriting or erasing.

func (CSD) TRAN_SPEED

func (csd CSD) TRAN_SPEED() int

TRAN_SPEED returns the maximum data transfer rate per one data line kb/s.

func (CSD) Version

func (csd CSD) Version() int

func (CSD) WP_GRP_ENABLE

func (csd CSD) WP_GRP_ENABLE() bool

WP_GRP_ENABLE reports whether the write protection is possible

func (CSD) WP_GRP_SIZE

func (csd CSD) WP_GRP_SIZE() int

WP_GRP_SIZE returns the size of a write protected group.

func (CSD) WRITE_BLK_MISALIGN

func (csd CSD) WRITE_BLK_MISALIGN() bool

WRITE_BLK_MISALIGN reports whether the data block to be written by one command can be spread over more than one physical block of the memory device.

func (CSD) WRITE_BL_LEN

func (csd CSD) WRITE_BL_LEN() int

WRITE_BL_LEN returns the maximum write data block length (bytes).

func (CSD) WRITE_BL_PARTIAL

func (csd CSD) WRITE_BL_PARTIAL() bool

WRITE_BL_PARTIAL reports whether the partial block sizes can be used in block write commands

type CardStatus

type CardStatus uint32
const (
	AKE_SEQ_ERROR      CardStatus = 1 << 3
	APP_CMD            CardStatus = 1 << 5
	FX_EVENT           CardStatus = 1 << 6
	READY_FOR_DATA     CardStatus = 1 << 8
	CURRENT_STATE      CardStatus = 15 << 9
	StateIdle          CardStatus = 0 << 9
	StateReady         CardStatus = 1 << 9
	StateIdent         CardStatus = 2 << 9
	StateStby          CardStatus = 3 << 9
	StateTran          CardStatus = 4 << 9
	StateData          CardStatus = 5 << 9
	StateRcv           CardStatus = 6 << 9
	StatePrg           CardStatus = 7 << 9
	StateDis           CardStatus = 8 << 9
	StateIOOnly        CardStatus = 15 << 9
	ERASE_RESET        CardStatus = 1 << 13
	CARD_ECC_DISABLED  CardStatus = 1 << 14
	WP_ERASE_SKIP      CardStatus = 1 << 15
	CSD_OVERWRITE      CardStatus = 1 << 16
	ERROR              CardStatus = 1 << 19
	CC_ERROR           CardStatus = 1 << 20
	CARD_ECC_FAILED    CardStatus = 1 << 21
	ILLEGAL_COMMAND    CardStatus = 1 << 22
	COM_CRC_ERROR      CardStatus = 1 << 23
	LOCK_UNLOCK_FAILED CardStatus = 1 << 24
	CARD_IS_LOCKED     CardStatus = 1 << 25
	WP_VIOLATION       CardStatus = 1 << 26
	ERASE_PARAM        CardStatus = 1 << 27
	ERASE_SEQ_ERROR    CardStatus = 1 << 28
	BLOCK_LEN_ERROR    CardStatus = 1 << 29
	ADDRESS_ERROR      CardStatus = 1 << 30
	OUT_OF_RANGE       CardStatus = 1 << 31
)

func (CardStatus) Format

func (cs CardStatus) Format(f fmt.State, _ rune)

type CmdSupport

type CmdSupport byte
const (
	HasCMD20    CmdSupport = 1 << 0
	HasCMD23    CmdSupport = 1 << 1
	HasCMD48_49 CmdSupport = 1 << 2
	HasCMD58_59 CmdSupport = 1 << 3
)

type Command

type Command uint16

func ACMD41

func ACMD41(ocr OCR) (Command, uint32)

ACMD41 (SD_SEND_OP_COND, R3) starts initialization/identification process.

func ACMD42

func ACMD42(pullUp bool) (Command, uint32)

ACMD42 (SET_CLR_CARD_DETECT, R1) enables/disables pull-up resistor on D3/CD.

func ACMD51

func ACMD51() (Command, uint32)

ACMD51 (SEND_SCR, R1) reads SD Configuration Register.

func ACMD6

func ACMD6(bw BusWidth) (Command, uint32)

ACMD6 (SET_BUS_WIDTH, R1) sets the data bus width.

func CMD0

func CMD0() (Command, uint32)

CMD0 (GO_IDLE_STATE) performs software reset and sets the card into Idle State.

func CMD12

func CMD12() (Command, uint32)

CMD12 (STOP_TRANSMISSION, R1b) forces the card to stop transmission in Multiple Block Read Operation.

func CMD13

func CMD13(rca uint16, reg StatusReg) (Command, uint32)

CMD13 (SEND_STATUS/SEND_TASK_STATUS, R1) reads Status or TaskStatus register.

func CMD16

func CMD16(blen int) (Command, uint32)

CMD16 (SET_BLOCKLEN, R1) sets the block length (in bytes) for block commands.

func CMD17

func CMD17(addr uint) (Command, uint32)

CMD17 (READ_SINGLE_BLOCK, R1) reads a block of the size selected by CMD16.

func CMD18

func CMD18(addr uint) (Command, uint32)

CMD18 (READ_MULTIPLE_BLOCK, R1) works like CMD17 but does not stop the transmision after first data block. Instead the card continuously transfers data blocks until it receives CMD12 (STOP_TRANSMISSION) command.

func CMD2

func CMD2() (Command, uint32)

CMD2 (ALL_SEND_CID, R2) gets Card Identification Data.

func CMD24

func CMD24(addr uint) (Command, uint32)

CMD24 (WRITE_BLOCK, R1) writes a block of the size selected by CMD16.

func CMD25

func CMD25(addr uint) (Command, uint32)

CMD25 (WRITE_MULTIPLE_BLOCK, R1) works like CMD24 but allows to transmit multiple block to the card until. To signal the end of transfer host have to send CMD12 (STOP_TRANSMISSION) command.

func CMD3

func CMD3() (Command, uint32)

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

func CMD5

func CMD5(ocr OCR) (Command, uint32)

 CMD5 (IO_SEND_OP_COND, R4) inquires about the voltage range needed by the I/O card.

func CMD52

func CMD52(f, addr int, flags IORWFlags, val byte) (Command, uint32)

CMD52 (IO_RW_DIRECT, R5)

func CMD53

func CMD53(f, addr int, flags IORWFlags, n int) (Command, uint32)

CMD53 (IO_RW_EXTENDED, R5)

func CMD55

func CMD55(rca uint16) (Command, uint32)

CMD55 (APP_CMD, R1) indicates to the card that the next command is an application specific command.

func CMD6

func CMD6(sf SwitchFunc) (Command, uint32)

CMD6 (SWITCH_FUNC, R1) switches or expands memory card functions.

func CMD7

func CMD7(rca uint16) (Command, uint32)

CMD7 (SELECT_CARD/DESELECT_CARD, R1b) selects card with rca address (puts into Transfer State) and deselects all other (puts into Stand-by State).

func CMD8

func CMD8(vhs VHS, checkPattern byte) (Command, uint32)

CMD8 (SEND_IF_COND, R7) initializes SD Memory Cards compliant to the Physical Layer Specification Version 2.00 or later.

func CMD9

func CMD9(rca uint16) (Command, uint32)

CMD9 (SEND_CSD, R2) reads Card Specific Data from card indentified by rca.

type Data

type Data []uint64

Data can be used to access bytes sent/received using SD card data transfers. It ensures 8-byte alignment required by Host.SetupData method. The bit order of its 64-bit elements is hardware depend. Use Bytes method to return Data as correctly ordered string of bytes. Additionally it helps to operate on typical 512 byte blocks.

func MakeDataBlocks

func MakeDataBlocks(n int) Data

MakeDataBlocks allocates and initializes Data object that can store n 512-byte blocks.

func MakeDataBytes

func MakeDataBytes(n int) Data

MakeDataBytes allocates and initializes Data object that can store n bytes.

func (Data) Block

func (d Data) Block(n int) Data

Block returns slice of d that contains n-th 512-byte block.

func (Data) BlockSlice

func (d Data) BlockSlice(m, n int) Data

Block returns the slice of d that contains n-m 512-byte blocks from m to n.

func (Data) Bytes

func (d Data) Bytes() []byte

Bytes returns d as []byte.

func (Data) NumBlocks

func (d Data) NumBlocks() int

NumBlocks returns the number of full 512-byte blocks that can fit into d.

type DataMode

type DataMode int16

DataMode describes data transfer mode.

const (
	Send       DataMode = 0 << 1  // Send data to a card.
	Recv       DataMode = 1 << 1  // Receive data from a card.
	Stream     DataMode = 1 << 2  // Stream or SDIO multibyte data transfer.
	Block1     DataMode = 0 << 4  // Block data transfer, block size: 1 B.
	Block2     DataMode = 1 << 4  // Block data transfer, block size: 2 B.
	Block4     DataMode = 2 << 4  // Block data transfer, block size: 4 B.
	Block8     DataMode = 3 << 4  // Block data transfer, block size: 8 B.
	Block16    DataMode = 4 << 4  // Block data transfer, block size: 16 B.
	Block32    DataMode = 5 << 4  // Block data transfer, block size: 32 B.
	Block64    DataMode = 6 << 4  // Block data transfer, block size: 64 B.
	Block128   DataMode = 7 << 4  // Block data transfer, block size: 128 B.
	Block256   DataMode = 8 << 4  // Block data transfer, block size: 256 B.
	Block512   DataMode = 9 << 4  // Block data transfer, block size: 512 B.
	Block1K    DataMode = 10 << 4 // Block data transfer, block size: 1 KiB.
	Block2K    DataMode = 11 << 4 // Block data transfer, block size: 2 KiB.
	Block4K    DataMode = 12 << 4 // Block data transfer, block size: 4 KiB.
	Block8K    DataMode = 13 << 4 // Block data transfer, block size: 8 KiB.
	Block16K   DataMode = 14 << 4 // Block data transfer, block size: 16 KiB.
	BlockStep  DataMode = 1 << 4  // To iterate over block sizes.
	RWaitStart DataMode = 1 << 8  // Read wait start.
	RWaitStop  DataMode = 1 << 9  // Read wait stop.
	RWaitCK    DataMode = 1 << 10 // Read wait control using CK instead od D2.
	IO         DataMode = 1 << 11 // SDIO specific operation.
)

Do not use DataMode(exp<<4) to specify block size, instead use BlockMode function. You can also use Block* constants directly instead of exp and iterate over block sizes this way:

for bm := sdcard.Block512; bm >= sdcard.Block1; bm -= sdcard.BlockStep {
	bs := bm.BlockSize()
	...
}

func BlockMode

func BlockMode(exp int) DataMode

BlockMode returns bits of DataMode that correspond to block data transfer with block size equal 1<<exp.

func (DataMode) BlockSize

func (dm DataMode) BlockSize() int

BlockSize returns size of block in bytes in case of block mode or -1 in case of stream mode.

type FileFormat

type FileFormat byte
const (
	HardDisk  FileFormat = 0 // Hard disk-like file system with partition table.
	DOSFloppy FileFormat = 1 // DOS FAT (floppy-like) without partition table.
	UFF       FileFormat = 2 // Universal File Format.
	OtherFF   FileFormat = 3 // Other/unknown.
)

type Host

type Host interface {
	// SetClock sets SD/SPI clock frequency. If pwrsave is true the host can
	// disable clock in case of inactive bus.
	SetClock(freqhz int, pwrsave bool)

	// SetBusWidth sets the SD bus width. Returns supported bus widths. SD host
	// returns combination of SDBus1 and SDBus4. SPI host returns SPIBus.
	SetBusWidth(width BusWidth) BusWidths

	// SendCmd sends the cmd to the card and receives its response, if any.
	// Short response is returned in r[0], long is returned in r[0:3] (r[0]
	// contains the least significant bits, r[3] contains the most significant
	// bits). If preceded by SetupData, SendCmd waits up to 1s for end of busy
	// state and performs the data transfer.
	SendCmd(cmd Command, arg uint32) (r Response)

	// SetupData setups the data transfer for subsequent command.
	SetupData(mode DataMode, buf []uint64, nbytes int)

	// Wait waits for deassertion of busy signal on DATA0 line (READY_FOR_DATA
	// state). It returns false if the deadline has passed. Wait can not be used
	// while transfer is in progress.
	Wait(deadline int64) bool

	// Err returns and clears the host internal error. The internal error, if
	// not nil, prevents any subsequent operations. Host should convert its
	// internal command timeout error to ErrCmdTimeout.
	Err(clear bool) error
}

type IORWFlags

type IORWFlags byte

type IOStatus

type IOStatus byte
const (
	IO_OUT_OF_RANGE    IOStatus = 1 << 0
	IO_FUNCTION_NUMBER IOStatus = 1 << 1
	IO_ERROR           IOStatus = 1 << 3
	IO_CURRENT_STATE   IOStatus = 3 << 4
	IO_DIS             IOStatus = 0 << 4
	IO_CMD             IOStatus = 1 << 4
	IO_TRN             IOStatus = 2 << 4
	IO_ILLEGAL_COMMAND IOStatus = 1 << 6
	IO_COM_CRC_ERROR   IOStatus = 1 << 7
)

func (IOStatus) Format

func (ios IOStatus) Format(f fmt.State, _ rune)

type OCR

type OCR uint32
const (
	DVC   OCR = 1 << 7  // Dual Voltage Card (SDMC)
	V21   OCR = 1 << 8  // 2.0-2.1 V (SDIO)
	V22   OCR = 1 << 9  // 2.1-2.2 V (SDIO)
	V23   OCR = 1 << 10 // 2.2-2.3 V (SDIO)
	V24   OCR = 1 << 11 // 2.3-2.4 V (SDIO)
	V25   OCR = 1 << 12 // 2.4-2.5 V (SDIO)
	V26   OCR = 1 << 13 // 2.5-2.6 V (SDIO)
	V27   OCR = 1 << 14 // 2.6-2.7 V (SDIO)
	V28   OCR = 1 << 15 // 2.7-2.8 V
	V29   OCR = 1 << 16 // 2.8-2.9 V
	V30   OCR = 1 << 17 // 2.9-3.0 V
	V31   OCR = 1 << 18 // 3.0-3.1 V
	V32   OCR = 1 << 19 // 3.1-3.2 V
	V33   OCR = 1 << 20 // 3.2-3.3 V
	V34   OCR = 1 << 21 // 3.3-3.4 V
	V35   OCR = 1 << 22 // 3.4-3.5 V
	V36   OCR = 1 << 23 // 3.5-3.6 V
	S18   OCR = 1 << 24 // Switching to 1.8V
	XPC   OCR = 1 << 18 // SDXC maximum performance
	UHSII OCR = 1 << 29 // UHS-II Card Status
	HCXC  OCR = 1 << 30 // Card Capacity Status (set fot SDHC, SDXC).
	PWUP  OCR = 1 << 31 // Card in power up state (^Busy).
)

type Response

type Response [4]uint32

func (Response) R1

func (r Response) R1() CardStatus

func (Response) R2CID

func (r Response) R2CID() CID

func (Response) R2CSD

func (r Response) R2CSD() CSD

func (Response) R3

func (r Response) R3() OCR

R3 contains Operating Condition Register.

func (Response) R4

func (r Response) R4() (ocr OCR, mem bool, numIO int)

R4 contains OCR, memory present flag and number of I/O functions.

func (Response) R5

func (r Response) R5() (val byte, status IOStatus)

R5

func (Response) R6

func (r Response) R6() (rca uint16, status CardStatus)

R6 contains Relative Card Address and Card Status bits 23, 22, 19, 12:0.

func (Response) R7

func (r Response) R7() (vhs VHS, pattern byte)

type SCR

type SCR uint64

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).

func (SCR) CMD_SUPPORT

func (scr SCR) CMD_SUPPORT() CmdSupport

CMD_SUPPORT returns the bitfield that describes support for CMD20, CMD23, CMD48, CMD49, CMD58, CMD59.

func (SCR) DATA_STAT_AFTER_ERASE

func (scr SCR) DATA_STAT_AFTER_ERASE() int

DATA_STAT_AFTER_ERASE returns data status after erase: 0 or 1.

func (SCR) EX_SECURITY

func (scr SCR) EX_SECURITY() int

EX_SECURITY returns Extended Security indicator.

func (SCR) SCR_STRUCTURE

func (scr SCR) SCR_STRUCTURE() int

SCR_STRUCTURE returns SCR structure version.

func (SCR) SD_BUS_WIDTHS

func (scr SCR) SD_BUS_WIDTHS() BusWidths

SD_BUS_WIDTHS returns the bitfield that describes supported data bus widths.

func (SCR) SD_SECURITY

func (scr SCR) SD_SECURITY() SDSecurity

SD_SECURITY returns CPRM Security Specification Version.

func (SCR) SD_SPEC

func (scr SCR) SD_SPEC() int

SD_SPEC returns the version of SD Memory Card (SDMC) specification.

func (SCR) SD_SPEC3

func (scr SCR) SD_SPEC3() int

SD_SPEC3 returns 1 for SDMC spec. version >= 3.00.

func (SCR) SD_SPEC4

func (scr SCR) SD_SPEC4() int

SD_SPEC4 returns 1 for SDMC spec. version >= 4.00.

func (SCR) SD_SPECX

func (scr SCR) SD_SPECX() int

SD_SPECX returns 1 for SDMC spec. version 5.xx, 2 for version 6.xx.

type SDSecurity

type SDSecurity byte
const (
	NoSecurity      SDSecurity = 0
	SecurityNotUsed SDSecurity = 1
	SecuritySDSC    SDSecurity = 2 // Version 1.01
	SecuritySDHC    SDSecurity = 3 // Version 2.00
	SecuritySDXC    SDSecurity = 4 // Version 3.xx
)

type StatusReg

type StatusReg byte
const (
	Status     StatusReg = 0
	TaskStatus StatusReg = 1
)

type SwitchFunc

type SwitchFunc uint32
const (
	AccessMode   SwitchFunc = 0x00000F // Access mode (keep current).
	DefaultSpeed SwitchFunc = 0x000000 // Default Speed or SDR12.
	HighSpeed    SwitchFunc = 0x000001 // High Speed or SDR25.
	SDR50        SwitchFunc = 0x000002 // SDR50.
	SDR104       SwitchFunc = 0x000003 // SDR104.
	DDR50        SwitchFunc = 0x000004 // DDR50.

	CommandSystem SwitchFunc = 0x0000F0 // Command system (keep current).
	DefaultSystem SwitchFunc = 0x000000 // Default Command System.
	OTP           SwitchFunc = 0x000030
	ASSD          SwitchFunc = 0x000040
	VendorSpec    SwitchFunc = 0x0000E0

	Driver       SwitchFunc = 0x000F00 // UHS-I driver strength (keep current).
	DefaultTypeB SwitchFunc = 0x000000 // Default Type B driver.
	TypeA        SwitchFunc = 0x000100 // Type A driver.
	TypeC        SwitchFunc = 0x000200 // Type C driver.
	TypeD        SwitchFunc = 0x000300 // Type D driver.

	PowerLimit SwitchFunc = 0x00F000 // Power limit (keep current).
	Default720 SwitchFunc = 0x000000 // Default limit: 720 mW.
	Power1440  SwitchFunc = 0x001000 // Limit: 1440 mW.
	Power2160  SwitchFunc = 0x002000 // Limit: 2160 mW.
	Power2880  SwitchFunc = 0x003000 // Limit: 2880 mW.
	Power1800  SwitchFunc = 0x004000 // Limit: 1800 mW.

	ModeCheck  SwitchFunc = 0 << 31 // Checks switchable function.
	ModeSwitch SwitchFunc = 1 << 31 // Switch card function.
)

type VHS

type VHS byte
const (
	V27_36 VHS = 1 << 0
	LVR    VHS = 1 << 1
)

Directories

Path Synopsis
Package sdmc implements access to Secure Digital Memory Cards.
Package sdmc implements access to Secure Digital Memory Cards.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL