github.com/tinygo-org/tinygo@v0.31.3-0.20240404173401-90b0bf646c27/src/machine/board_atmega328p.go (about)

     1  //go:build (avr && atmega328p) || arduino || arduino_nano
     2  
     3  package machine
     4  
     5  // Return the current CPU frequency in hertz.
     6  func CPUFrequency() uint32 {
     7  	return 16000000
     8  }
     9  
    10  const (
    11  	// Note: start at port B because there is no port A.
    12  	portB Pin = iota * 8
    13  	portC
    14  	portD
    15  )
    16  
    17  const (
    18  	PB0 = portB + 0
    19  	PB1 = portB + 1 // peripherals: Timer1 channel A
    20  	PB2 = portB + 2 // peripherals: Timer1 channel B
    21  	PB3 = portB + 3 // peripherals: Timer2 channel A
    22  	PB4 = portB + 4
    23  	PB5 = portB + 5
    24  	PB6 = portB + 6
    25  	PB7 = portB + 7
    26  	PC0 = portC + 0
    27  	PC1 = portC + 1
    28  	PC2 = portC + 2
    29  	PC3 = portC + 3
    30  	PC4 = portC + 4
    31  	PC5 = portC + 5
    32  	PC6 = portC + 6
    33  	PC7 = portC + 7
    34  	PD0 = portD + 0
    35  	PD1 = portD + 1
    36  	PD2 = portD + 2
    37  	PD3 = portD + 3 // peripherals: Timer2 channel B
    38  	PD4 = portD + 4
    39  	PD5 = portD + 5 // peripherals: Timer0 channel B
    40  	PD6 = portD + 6 // peripherals: Timer0 channel A
    41  	PD7 = portD + 7
    42  )