-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspi_pio.go
46 lines (39 loc) · 1.17 KB
/
spi_pio.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Code generated by pioasm; DO NOT EDIT.
//go:build rp2040
package piolib
import (
pio "github.com/tinygo-org/pio/rp2-pio"
)
// spi_cpha0
const spi_cpha0WrapTarget = 0
const spi_cpha0Wrap = 1
var spi_cpha0Instructions = []uint16{
// .wrap_target
0x6101, // 0: out pins, 1 side 0 [1]
0x5101, // 1: in pins, 1 side 1 [1]
// .wrap
}
const spi_cpha0Origin = -1
func spi_cpha0ProgramDefaultConfig(offset uint8) pio.StateMachineConfig {
cfg := pio.DefaultStateMachineConfig()
cfg.SetWrap(offset+spi_cpha0WrapTarget, offset+spi_cpha0Wrap)
cfg.SetSidesetParams(1, false, false)
return cfg;
}
// spi_cpha1
const spi_cpha1WrapTarget = 0
const spi_cpha1Wrap = 2
var spi_cpha1Instructions = []uint16{
// .wrap_target
0x6021, // 0: out x, 1 side 0
0xb101, // 1: mov pins, x side 1 [1]
0x4001, // 2: in pins, 1 side 0
// .wrap
}
const spi_cpha1Origin = -1
func spi_cpha1ProgramDefaultConfig(offset uint8) pio.StateMachineConfig {
cfg := pio.DefaultStateMachineConfig()
cfg.SetWrap(offset+spi_cpha1WrapTarget, offset+spi_cpha1Wrap)
cfg.SetSidesetParams(1, false, false)
return cfg;
}