
This can be very useful for some purposes: * It makes it possible to disable the UART in cases where it is not needed or needs to be disabled to conserve power. * It makes it possible to disable the serial output to reduce code size, which may be important for some chips. Sometimes, a few kB can be saved this way. * It makes it possible to override the default, for example you might want to use an actual UART to debug the USB-CDC implementation. It also lowers the dependency on having machine.Serial defined, which is often not defined when targeting a chip. Eventually, we might want to make it possible to write `-target=nrf52` or `-target=atmega328p` for example to target the chip itself with no board specific assumptions. The defaults don't change. I checked this by running `make smoketest` before and after and comparing the results.
30 строки
685 Б
Go
30 строки
685 Б
Go
// +build x9pro
|
|
|
|
package machine
|
|
|
|
// https://hackaday.io/project/144350-hacking-wearables-for-mental-health-and-more/details
|
|
const (
|
|
LED Pin = 4 // HR LED pin
|
|
UART_TX_PIN Pin = NoPin
|
|
UART_RX_PIN Pin = NoPin
|
|
SCL_PIN Pin = NoPin
|
|
SDA_PIN Pin = NoPin
|
|
SPI0_SCK_PIN Pin = 18
|
|
SPI0_SDI_PIN Pin = 19
|
|
SPI0_SDO_PIN Pin = 20
|
|
)
|
|
|
|
// LCD pins.
|
|
const (
|
|
OLED_CS Pin = 15 // chip select
|
|
OLED_RES Pin = 14 // reset pin
|
|
OLED_DC Pin = 13 // data/command
|
|
OLED_SCK Pin = 12 // SPI clock
|
|
OLED_SDO Pin = 11 // SPI SDO (chip-out, peripheral-in)
|
|
OLED_LED_POW Pin = 16
|
|
OLED_IC_POW Pin = 17
|
|
)
|
|
|
|
const HasLowFrequencyCrystal = true
|
|
|
|
var DefaultUART = UART0
|