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

     1  //go:build hifive1b
     2  
     3  package machine
     4  
     5  const (
     6  	D0  = P16
     7  	D1  = P17
     8  	D2  = P18
     9  	D3  = P19 // Green LED/PWM (PWM1_PWM1)
    10  	D4  = P20 // PWM (PWM1_PWM0)
    11  	D5  = P21 // Blue LED/PWM (PWM1_PWM2)
    12  	D6  = P22 // Red LED/PWM (PWM1_PWM3)
    13  	D7  = P16
    14  	D8  = NoPin // PWM?
    15  	D9  = P01
    16  	D10 = P02   // SPI1_CS0
    17  	D11 = P03   // SPI1_DQ0
    18  	D12 = P04   // SPI1_DQ1
    19  	D13 = P05   // SPI1_SCK
    20  	D14 = NoPin // not connected
    21  	D15 = P09   // does not seem to work?
    22  	D16 = P10   // PWM (PWM2_PWM0)
    23  	D17 = P11   // PWM (PWM2_PWM1)
    24  	D18 = P12   // SDA (I2C0_SDA)/PWM (PWM2_PWM2)
    25  	D19 = P13   // SDL (I2C0_SCL)/PWM (PWM2_PWM3)
    26  )
    27  
    28  const (
    29  	LED       = LED1
    30  	LED1      = LED_RED
    31  	LED2      = LED_GREEN
    32  	LED3      = LED_BLUE
    33  	LED_RED   = P22
    34  	LED_GREEN = P19
    35  	LED_BLUE  = P21
    36  )
    37  
    38  var DefaultUART = UART0
    39  
    40  const (
    41  	// TODO: figure out the pin numbers for these.
    42  	UART_TX_PIN = D1
    43  	UART_RX_PIN = D0
    44  )
    45  
    46  // SPI pins
    47  const (
    48  	SPI0_SCK_PIN = NoPin
    49  	SPI0_SDO_PIN = NoPin
    50  	SPI0_SDI_PIN = NoPin
    51  
    52  	SPI1_SCK_PIN = D13
    53  	SPI1_SDO_PIN = D11
    54  	SPI1_SDI_PIN = D12
    55  )
    56  
    57  // I2C pins
    58  const (
    59  	I2C0_SDA_PIN = D18
    60  	I2C0_SCL_PIN = D19
    61  )