github.com/tinygo-org/tinygo@v0.31.3-0.20240404173401-90b0bf646c27/src/machine/board_pinetime.go (about) 1 //go:build pinetime 2 3 package machine 4 5 // Board pins for the PineTime. 6 // Details: https://wiki.pine64.org/index.php/PineTime 7 8 // The PineTime has a low-frequency (32kHz) crystal oscillator on board. 9 const HasLowFrequencyCrystal = true 10 11 // LEDs simply expose the three brightness level LEDs on the PineTime. They can 12 // be useful for simple "hello world" style programs. 13 const ( 14 LED1 = LCD_BACKLIGHT_HIGH 15 LED2 = LCD_BACKLIGHT_MID 16 LED3 = LCD_BACKLIGHT_LOW 17 LED = LED1 18 ) 19 20 // The PineTime doesn't have a UART output. 21 // Additionally, leaving the UART on results in a pretty big current drain. 22 const ( 23 UART_TX_PIN Pin = NoPin 24 UART_RX_PIN Pin = NoPin 25 ) 26 27 // SPI pins for the PineTime. 28 const ( 29 SPI0_SCK_PIN Pin = 2 30 SPI0_SDO_PIN Pin = 3 31 SPI0_SDI_PIN Pin = 4 32 ) 33 34 // I2C pins for the PineTime. 35 const ( 36 SDA_PIN Pin = 6 37 SCL_PIN Pin = 7 38 ) 39 40 // Button pins. For some reason, there are two pins for the button. 41 const ( 42 BUTTON_IN Pin = 13 43 BUTTON_OUT Pin = 15 44 ) 45 46 // Pin for the vibrator. 47 const VIBRATOR_PIN Pin = 16 48 49 // LCD pins, using the naming convention of the official docs: 50 // http://files.pine64.org/doc/PineTime/PineTime%20Port%20Assignment%20rev1.0.pdf 51 const ( 52 LCD_SCK = SPI0_SCK_PIN 53 LCD_SDI = SPI0_SDO_PIN 54 LCD_RS Pin = 18 55 LCD_CS Pin = 25 56 LCD_RESET Pin = 26 57 LCD_BACKLIGHT_LOW Pin = 14 58 LCD_BACKLIGHT_MID Pin = 22 59 LCD_BACKLIGHT_HIGH Pin = 23 60 )