aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/machine/machine_generic.go
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2020-05-19 22:30:46 +0200
committerRon Evans <[email protected]>2021-04-06 20:36:10 +0200
commit72acda22b0a8d137405e41e9ed54cbfbcce7b26f (patch)
treebaed2cc5aa5bd3f4582a6ef4aa439928acdf38f9 /src/machine/machine_generic.go
parentf880950c3efbd005d2e171a5fd1c879a3221367c (diff)
downloadtinygo-72acda22b0a8d137405e41e9ed54cbfbcce7b26f.tar.gz
tinygo-72acda22b0a8d137405e41e9ed54cbfbcce7b26f.zip
machine: refactor PWM support
This commit refactors PWM support in the machine package to be more flexible. The new API can be used to produce tones at a specific frequency and control servos in a portable way, by abstracting over counter widths and prescalers.
Diffstat (limited to 'src/machine/machine_generic.go')
-rw-r--r--src/machine/machine_generic.go18
1 files changed, 0 insertions, 18 deletions
diff --git a/src/machine/machine_generic.go b/src/machine/machine_generic.go
index f59f7316b..d482e0e3e 100644
--- a/src/machine/machine_generic.go
+++ b/src/machine/machine_generic.go
@@ -84,24 +84,6 @@ func (adc ADC) Get() uint16 {
//export __tinygo_adc_read
func adcRead(pin Pin) uint16
-// InitPWM enables support for PWM peripherals.
-func InitPWM() {
- // Nothing to do here.
-}
-
-// Configure configures a PWM pin for output.
-func (pwm PWM) Configure() error {
- return nil
-}
-
-// Set turns on the duty cycle for a PWM pin using the provided value.
-func (pwm PWM) Set(value uint16) {
- pwmSet(pwm.Pin, value)
-}
-
-//export __tinygo_pwm_set
-func pwmSet(pin Pin, value uint16)
-
// I2C is a generic implementation of the Inter-IC communication protocol.
type I2C struct {
Bus uint8