github.com/tinygo-org/tinygo@v0.31.3-0.20240404173401-90b0bf646c27/src/machine/board_reelboard.go (about) 1 //go:build reelboard 2 3 package machine 4 5 const HasLowFrequencyCrystal = true 6 7 // Pins on the reel board 8 const ( 9 LED_RED Pin = 11 10 LED_GREEN Pin = 12 11 LED_BLUE Pin = 41 12 LED_YELLOW Pin = 13 13 LED1 Pin = LED_YELLOW 14 LED2 Pin = LED_RED 15 LED3 Pin = LED_GREEN 16 LED4 Pin = LED_BLUE 17 LED Pin = LED1 18 EPD_BUSY_PIN Pin = 14 19 EPD_RESET_PIN Pin = 15 20 EPD_DC_PIN Pin = 16 21 EPD_CS_PIN Pin = 17 22 EPD_SCK_PIN Pin = 19 23 EPD_SDO_PIN Pin = 20 24 POWER_SUPPLY_PIN Pin = 32 25 ) 26 27 // User "a" button on the reel board 28 const ( 29 BUTTON Pin = 7 30 ) 31 32 var DefaultUART = UART0 33 34 // UART pins 35 const ( 36 UART_TX_PIN Pin = 6 37 UART_RX_PIN Pin = 8 38 ) 39 40 // I2C pins 41 const ( 42 SDA_PIN Pin = 26 43 SCL_PIN Pin = 27 44 ) 45 46 // SPI pins 47 const ( 48 SPI0_SCK_PIN Pin = 47 49 SPI0_SDO_PIN Pin = 45 50 SPI0_SDI_PIN Pin = 46 51 ) 52 53 // PowerSupplyActive enables the supply voltages for nRF52840 and peripherals (true) or only for nRF52840 (false) 54 // This controls the TPS610981 boost converter. You must turn the power supply active in order to use the EPD and 55 // other onboard peripherals. 56 func PowerSupplyActive(active bool) { 57 POWER_SUPPLY_PIN.Configure(PinConfig{Mode: PinOutput}) 58 if active { 59 POWER_SUPPLY_PIN.High() 60 } else { 61 POWER_SUPPLY_PIN.Low() 62 } 63 } 64 65 // USB CDC identifiers 66 const ( 67 usb_STRING_PRODUCT = "PHYTEC reelboard" 68 usb_STRING_MANUFACTURER = "PHYTEC" 69 ) 70 71 var ( 72 usb_VID uint16 = 0x2FE3 73 usb_PID uint16 = 0x100 74 )