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

     1  //go:build nicenano
     2  
     3  package machine
     4  
     5  const HasLowFrequencyCrystal = true
     6  
     7  // GPIO Pins
     8  const (
     9  	D006 = P0_06
    10  	D008 = P0_08
    11  	D017 = P0_17
    12  	D020 = P0_20
    13  	D022 = P0_22
    14  	D024 = P0_24
    15  	D100 = P1_00
    16  	D011 = P0_11
    17  	D104 = P1_04
    18  	D106 = P1_06
    19  
    20  	D004 = P0_04 // AIN2; P0.04 (AIN2) is used to read the voltage of the battery via ADC. It can’t be used for any other function.
    21  	D013 = P0_13 // VCC 3.3V; P0.13 on VCC shuts off the power to VCC when you set it to high; This saves on battery immensely for LEDs of all kinds that eat power even when off
    22  	D115 = P1_15
    23  	D113 = P1_13
    24  	D031 = P0_31 // AIN7
    25  	D029 = P0_29 // AIN5
    26  	D002 = P0_02 // AIN0
    27  
    28  	D111 = P1_11
    29  	D010 = P0_10 // NFC2
    30  	D009 = P0_09 // NFC1
    31  
    32  	D026 = P0_26
    33  	D012 = P0_12
    34  	D101 = P1_01
    35  	D102 = P1_02
    36  	D107 = P1_07
    37  )
    38  
    39  // Analog Pins
    40  const (
    41  	AIN2 = P0_04 // Battery
    42  	AIN7 = P0_31
    43  	AIN5 = P0_29
    44  	AIN0 = P0_02
    45  )
    46  
    47  const (
    48  	LED = P0_15
    49  )
    50  
    51  // UART0 pins (logical UART1)
    52  const (
    53  	UART_RX_PIN = P0_06
    54  	UART_TX_PIN = P0_08
    55  )
    56  
    57  // I2C pins
    58  const (
    59  	SDA_PIN = P0_17 // I2C0 external
    60  	SCL_PIN = P0_20 // I2C0 external
    61  )
    62  
    63  // SPI pins
    64  const (
    65  	SPI0_SCK_PIN = P0_22 // SCK
    66  	SPI0_SDO_PIN = P0_24 // SDO
    67  	SPI0_SDI_PIN = P1_00 // SDI
    68  )
    69  
    70  // USB CDC identifiers
    71  const (
    72  	usb_STRING_PRODUCT      = "nice!nano"
    73  	usb_STRING_MANUFACTURER = "Nice Keyboards"
    74  )
    75  
    76  var (
    77  	usb_VID uint16 = 0x239A
    78  	usb_PID uint16 = 0x0029
    79  )