remove some of API

This commit is contained in:
soypat
2024-01-14 22:50:42 -03:00
parent 97ef4986ba
commit 845bd6fe93
3 changed files with 53 additions and 20 deletions
+12 -3
View File
@@ -60,17 +60,17 @@ func TestCRC7(t *testing.T) {
}
cmdTests := []struct {
cmd byte
cmd command
arg uint32
wantCRC uint8
}{
{
cmd: CMD0_GO_IDLE_STATE,
cmd: cmdGoIdleState,
arg: 0,
wantCRC: 0x95,
},
{
cmd: CMD8_SEND_IF_COND,
cmd: cmdSendIfCond,
arg: 0x1AA,
wantCRC: 0x87,
},
@@ -84,3 +84,12 @@ func TestCRC7(t *testing.T) {
}
}
}
func putCmd(dst []byte, cmd command, arg uint32) {
dst[0] = byte(cmd) | (1 << 6)
dst[1] = byte(arg >> 24)
dst[2] = byte(arg >> 16)
dst[3] = byte(arg >> 8)
dst[4] = byte(arg)
dst[5] = crc7noshift(dst[:5]) | 1 // Stop bit added.
}