Skip to content

Commit e3f945a

Browse files
committed
machine: refactor PWM support
This commit lays the groundwork and refactors the SAM D21 implementation.
1 parent 098f900 commit e3f945a

File tree

8 files changed

+351
-165
lines changed

8 files changed

+351
-165
lines changed

src/machine/machine.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ func (p Pin) Low() {
3737
p.Set(false)
3838
}
3939

40-
type PWM struct {
41-
Pin Pin
42-
}
43-
4440
type ADC struct {
4541
Pin Pin
4642
}

src/machine/machine_atmega328p.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ func (p Pin) getPortMask() (*volatile.Register8, uint8) {
2121
}
2222
}
2323

24+
type PWM struct {
25+
Pin Pin
26+
}
27+
2428
// InitPWM initializes the registers needed for PWM.
2529
func InitPWM() {
2630
// use waveform generation

0 commit comments

Comments
 (0)