mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-20 20:39:06 +00:00
machine/rp2040: add PWM implementation (#2015)
machine/rp2040: add PWM implementation
This commit is contained in:
committed by
GitHub
parent
2d224ae049
commit
a7c53cce06
@@ -81,6 +81,7 @@ const (
|
||||
PinInputPullup
|
||||
PinAnalog
|
||||
PinUART
|
||||
PinPWM
|
||||
PinI2C
|
||||
PinSPI
|
||||
)
|
||||
@@ -181,6 +182,8 @@ func (p Pin) Configure(config PinConfig) {
|
||||
p.pulloff()
|
||||
case PinUART:
|
||||
p.setFunc(fnUART)
|
||||
case PinPWM:
|
||||
p.setFunc(fnPWM)
|
||||
case PinI2C:
|
||||
// IO config according to 4.3.1.3 of rp2040 datasheet.
|
||||
p.setFunc(fnI2C)
|
||||
|
||||
Reference in New Issue
Block a user