board: Adafruit MacroPad RP2040

This commit is contained in:
BCG
2022-02-14 00:13:00 -05:00
committed by Ron Evans
parent 644356c220
commit 52ffd6aa98
5 changed files with 89 additions and 1 deletions
+8
View File
@@ -88,12 +88,20 @@ const (
PinSPI
)
func (p Pin) PortMaskSet() (*volatile.Register32, uint32) {
return &rp.SIO.GPIO_OUT_SET, 1 << p
}
// set drives the pin high
func (p Pin) set() {
mask := uint32(1) << p
rp.SIO.GPIO_OUT_SET.Set(mask)
}
func (p Pin) PortMaskClear() (*volatile.Register32, uint32) {
return &rp.SIO.GPIO_OUT_CLR, 1 << p
}
// clr drives the pin low
func (p Pin) clr() {
mask := uint32(1) << p