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

     1  //go:build tufty2040
     2  
     3  // This contains the pin mappings for the Badger 2040 Connect board.
     4  //
     5  // For more information, see: https://shop.pimoroni.com/products/tufty-2040
     6  // Also
     7  // - Tufty 2040 schematic: https://cdn.shopify.com/s/files/1/0174/1800/files/tufty_schematic.pdf?v=1655385675
     8  package machine
     9  
    10  const (
    11  	LED Pin = GPIO25
    12  
    13  	BUTTON_A    Pin = GPIO7
    14  	BUTTON_B    Pin = GPIO8
    15  	BUTTON_C    Pin = GPIO9
    16  	BUTTON_UP   Pin = GPIO22
    17  	BUTTON_DOWN Pin = GPIO6
    18  	BUTTON_USER Pin = GPIO23
    19  
    20  	LCD_BACKLIGHT Pin = GPIO2
    21  	LCD_CS        Pin = GPIO10
    22  	LCD_DC        Pin = GPIO11
    23  	LCD_WR        Pin = GPIO12
    24  	LCD_RD        Pin = GPIO13
    25  	LCD_DB0       Pin = GPIO14
    26  	LCD_DB1       Pin = GPIO15
    27  	LCD_DB2       Pin = GPIO16
    28  	LCD_DB3       Pin = GPIO17
    29  	LCD_DB4       Pin = GPIO18
    30  	LCD_DB5       Pin = GPIO19
    31  	LCD_DB6       Pin = GPIO20
    32  	LCD_DB7       Pin = GPIO21
    33  
    34  	VBUS_DETECT  Pin = GPIO24
    35  	BATTERY      Pin = GPIO29
    36  	USER_LED     Pin = GPIO25
    37  	LIGHT_SENSE  Pin = GPIO26
    38  	SENSOR_POWER Pin = GPIO27
    39  )
    40  
    41  // I2C pins
    42  const (
    43  	I2C0_SDA_PIN Pin = GPIO4
    44  	I2C0_SCL_PIN Pin = GPIO5
    45  
    46  	I2C1_SDA_PIN Pin = NoPin
    47  	I2C1_SCL_PIN Pin = NoPin
    48  )
    49  
    50  // SPI pins.
    51  const (
    52  	SPI0_SCK_PIN Pin = NoPin
    53  	SPI0_SDO_PIN Pin = NoPin
    54  	SPI0_SDI_PIN Pin = NoPin
    55  
    56  	SPI1_SCK_PIN Pin = NoPin
    57  	SPI1_SDO_PIN Pin = NoPin
    58  	SPI1_SDI_PIN Pin = NoPin
    59  )
    60  
    61  // Onboard crystal oscillator frequency, in MHz.
    62  const (
    63  	xoscFreq = 12 // MHz
    64  )
    65  
    66  // USB CDC identifiers
    67  const (
    68  	usb_STRING_PRODUCT      = "Tufty 2040"
    69  	usb_STRING_MANUFACTURER = "Pimoroni"
    70  )
    71  
    72  var (
    73  	usb_VID uint16 = 0x2e8a
    74  	usb_PID uint16 = 0x1002
    75  )
    76  
    77  // UART pins
    78  const (
    79  	UART0_TX_PIN = GPIO0
    80  	UART0_RX_PIN = GPIO1
    81  	UART_TX_PIN  = UART0_TX_PIN
    82  	UART_RX_PIN  = UART0_RX_PIN
    83  )
    84  
    85  var DefaultUART = UART0