github.com/tinygo-org/tinygo@v0.31.3-0.20240404173401-90b0bf646c27/src/machine/machine_attiny85.go (about) 1 //go:build attiny85 2 3 package machine 4 5 import ( 6 "device/avr" 7 "runtime/volatile" 8 ) 9 10 const ( 11 PB0 Pin = iota 12 PB1 13 PB2 14 PB3 15 PB4 16 PB5 17 ) 18 19 // getPortMask returns the PORTx register and mask for the pin. 20 func (p Pin) getPortMask() (*volatile.Register8, uint8) { 21 // Very simple for the attiny85, which only has a single port. 22 return avr.PORTB, 1 << uint8(p) 23 }