
Instead of trying to modify periperhals directly, external functions are called. For example, __tinygo_gpio_set sets a GPIO pin to a specified value (high or low). It is expected that binaries made this way will be linked with some extra libraries that implement support for these functions. One particularly interesting case is this experimental board simulator: https://github.com/aykevl/tinygo-play Compiling code to WebAssembly with the correct build tag for a board will enable this board to be simulated in the browser. Atmel/Microchip based SAMD boards are not currently supported, because their I2C/SPI support is somewhat uncommon and harder to support in the machine API. They may require a modification to the machine API for proper support.
7 строки
101 Б
Go
7 строки
101 Б
Go
// +build stm32
|
|
|
|
package machine
|
|
|
|
// Peripheral abstraction layer for the stm32.
|
|
|
|
type PinMode uint8
|