machine/rp2040: add PWM implementation (#2015)

machine/rp2040: add PWM implementation
This commit is contained in:
Patricio Whittingslow
2021-09-01 11:58:13 -03:00
committed by GitHub
parent 2d224ae049
commit a7c53cce06
3 changed files with 398 additions and 0 deletions
+3
View File
@@ -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)