align api for PortMaskSet, PortMaskClear

This commit is contained in:
Olaf Flebbe
2022-05-26 18:11:00 +02:00
committed by Ron Evans
parent 48242ba8d6
commit 3dd502a928
+4 -4
View File
@@ -88,8 +88,8 @@ const (
PinSPI
)
func (p Pin) PortMaskSet() (*volatile.Register32, uint32) {
return &rp.SIO.GPIO_OUT_SET, 1 << p
func (p Pin) PortMaskSet() (*uint32, uint32) {
return (*uint32)(unsafe.Pointer(&rp.SIO.GPIO_OUT_SET)), 1 << p
}
// set drives the pin high
@@ -98,8 +98,8 @@ func (p Pin) set() {
rp.SIO.GPIO_OUT_SET.Set(mask)
}
func (p Pin) PortMaskClear() (*volatile.Register32, uint32) {
return &rp.SIO.GPIO_OUT_CLR, 1 << p
func (p Pin) PortMaskClear() (*uint32, uint32) {
return (*uint32)(unsafe.Pointer(&rp.SIO.GPIO_OUT_CLR)), 1 << p
}
// clr drives the pin low