Ron Evans
c16e07469b
machine/samd21,samd51: remove use of binary package to avoid reflection and reduce binary size
...
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-09-24 19:41:34 +02:00
Ron Evans
f5fd49bb74
machine/samd21: use PinMode for SPI SERCOM peripheral to allow for more configuration options on boards like Arduino Nano33-IoT that have many predefined pin mappings
...
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-09-17 21:28:05 +02:00
Ayke van Laethem
d2856bd6bd
nrf: improve SPI write-only speed, by making use of double buffering
...
The SPI peripheral in the nrf chips support double buffering, which
makes it possible to keep sending continuously. This change introduces
double buffering on the nrf chips, which should improve SPI performance.
Tested on the pca10040 (nrf52832).
2019-09-17 17:51:13 +02:00
cn
9d35c1197f
machine/stm32f103xx/nucleo-f103rb: add support for NUCLEO-F103RB STM32F1-based board
...
Compared to the already supported stm32f103xx "bluepill" board this:
- features 128 KiB flash memory size ("RB" suffix) instead of 64 KiB, see `targets/stm32f103rb.ld`
- has onboard ST-LINK/V2-1 programmer and debugger requiring different OpenOCD configuration file
- uses USART2 connected to ST-LINK/V2-1 debugger as virtual COM port over USB for `putchar()`
- has a user-accessible button besides the reset button
2019-09-17 13:26:26 +02:00
cn
688dd81400
machine/stm32f103xx: allow board specific UART usage
...
Motivation: The bluepill uses USART1 as UART0 but other boards like the
STM32 Nucleo boards (and disco as well) use USART2 for USB COM port.
To avoid duplication of code the same pattern as in `machine_atsamd21.go`
is applied where only UART-specific code is moved to `board_*.go`.
2019-09-17 10:28:03 +02:00
cn
efd9cf72ba
machine/stm32f103xx: add machine.Pin.Get method for reading GPIO values
...
Writing pin values was already possible but reading was missing.
2019-09-16 13:24:21 +02:00
cn
500ee8067d
machine/stm32f103xx: fix SPI frequency selection
...
The SPI frequency is broken since b8c326d710
added I2C interface and changed the unrelated `PCLK2 = HCLK/4` initialization
to `PCLK2 = HCLK/1` (but I2C uses PCLK1 anyways).
This commit changes all baud rate prescalers to be /4 compared to before.
Note: it is not possible to find an equivalent for 125 KHz SPI speed,
it will be too fast (`f = 72 MHz / 256`)
2019-09-16 11:08:59 +02:00
Ron Evans
02c4020228
machine/atsamd51: add support for ATSAMD51 processor using Adafruit ItsyBitsy-M4 board
...
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-09-14 17:56:14 +02:00
Ron Evans
7d481c179f
machine/atsamd21: uses different required magic values for BOSSA and UF2 bootloaders
...
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-09-14 16:18:30 +02:00
Ron Evans
69aaea44a0
machine/atsamd21: Add support for bootloader reset/programming and correct error in receiving endpoint 0 data for CDC Set Line Coding changes, implementing system reset on switch to 1200 baud connection speed with DTR false.
...
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-09-14 16:18:30 +02:00
Ron Evans
e26f0b35e3
machine/atsamd21: correct order of params for USB CDC descriptor
...
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-09-06 14:24:32 +02:00
Ron Evans
4ee26fd54b
machine/atsamd21: correct issue with invalid first reading coming from ADC
...
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-09-06 14:22:24 +02:00
BCG
8a5fa51f60
Updated SPI pins so that they are configurable, enabling multiple SPI sercoms for ATSAMD21
2019-08-28 11:19:52 +02:00
Ayke van Laethem
9846c062b3
targets: add support for GameBoy Advance
...
Only tested in an emulator (mGBA). Almost nothing is supported, but
drawing to the screen works.
2019-08-05 09:19:49 +02:00
Ayke van Laethem
54169c714f
all: use baremetal build tag
...
This simplifies adding more baremetal targets, like a GameBoy Advance,
or baremetal x86 for unikernels.
2019-08-04 17:12:07 +02:00
Ron Evans
fc9188a298
machine/samd21/arduino-nano33: adds support for Arduino Nano33 IoT along with mapping to NINA-W102 WiFi chip.
...
Also adds DTR and RTS functions along with timeouts to USBCDC functions to prevent lockups.
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-07-07 18:09:05 +02:00
Ayke van Laethem
ffa38b183b
all: add HiFive1 rev B board with RISC-V architecture
...
This page has been a big help in adding support for this new chip:
https://wiki.osdev.org/HiFive-1_Bare_Bones
2019-07-07 14:03:24 +02:00
Daniel Esteban
1fd0c8d48c
adds PowerSupplyActive to enable supply voltages to nRF52840 and ( #430 )
...
* machine/reelboard: adds PowerSupplyActive to enable supply voltages to nRF52840 and
peripherals.
2019-06-30 12:23:44 +02:00
Daniel Esteban
d34bb7e708
add reelboard pins for the epaper display and the reset pin ( #429 )
...
* machine/reelboard: added descriptive pin names for the epaper display and the reset pin
2019-06-30 09:57:07 +02:00
Ayke van Laethem
4ecd478d82
machine: add generic board support on non-baremetal hardware
...
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.
2019-06-28 10:00:14 +02:00
Ayke van Laethem
f2c205a008
machine: update ringbuffer to use runtime/volatile.Register8
...
This avoids the //go:volatile pragma, which will be removed soon.
There were no changes to the output of the smoke tests.
2019-06-06 19:46:49 +02:00
Ayke van Laethem
9673ad3774
all: move Register{8,16,32} values into runtime/volatile
...
This avoids duplication of code. None of the smoke tests have changed
their output.
2019-06-06 19:46:49 +02:00
Ron Evans
2504754325
machine/samd21: use HasBits() method to simplify bit comparisons
...
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-05-27 18:43:11 +02:00
Ron Evans
be491abc46
machine/stm32: use HasBits() method to simplify bit comparisons
...
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-05-27 18:43:11 +02:00
Ron Evans
31189deb3b
machine/avr: use HasBits() method to simplify bit comparisons
...
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-05-27 18:43:11 +02:00
Ayke van Laethem
94b8214529
machine: refactor pins to be of Pin type
2019-05-26 20:48:50 +02:00
Ron Evans
9f8340a970
machine/nrf: refactor to use volatile package/API
...
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-05-24 15:44:33 +02:00
k-brk
0f6873cf02
machine/stm32f103xx: fix i2c 2 byte read
2019-05-24 15:26:06 +02:00
Ayke van Laethem
3568254593
machine/atsamd21: fix analog pin mode
2019-05-23 20:37:10 +02:00
Ron Evans
e4d53daa02
machine/stm32: refactor to use new volatile package for all register access
...
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-05-21 15:08:43 +02:00
Ron Evans
de032cddd2
machine/sam: Refactor all machine/runtime code to use new volatile package/API
...
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-05-19 19:53:11 +02:00
Ron Evans
51c6b972bf
machine/feather-m0: correct board build tag and add placeholders for I2S interface
...
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-05-19 19:52:14 +02:00
Anthony Elder
4cd151faf5
Add Feather M0 Board ( #356 )
...
* Add Feather M0 Board
2019-05-19 17:10:17 +02:00
Martin Treml
fc2ed2bdd0
[Board] Adafruit Trinket ( #333 )
...
* Add support for Adafruit Trinket-M0 board
2019-05-14 19:30:39 +02:00
Ayke van Laethem
e0cf74e638
avr: use register wrappers that use runtime/volatile.*Uint8 calls
...
This avoids the //go:volatile pragma on types in Go source code, at
least for AVR targets.
2019-05-14 12:24:01 +02:00
Anthony Elder
8d3f19bc84
Fix I2C signalStop in readLastByte for Microbit ( #344 )
...
* Fix I2C signalStop in readLastByte for Microbit
2019-05-13 14:30:25 +02:00
Ron Evans
d90f1947d9
machine/samd21: Initial implementation of I2S hardware interface using Circuit Playground Express
...
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-05-12 21:51:07 +02:00
Daniel Esteban
fb952a722a
Remove microbit matrix ( #319 )
...
* Remove matrix code from bbc:microbit, and move it to a driver
2019-05-05 16:25:50 +02:00
Ron Evans
b2e96fc35a
machine/atsamd21: select internal ground for ADC and scale result correctly to 16-bit
...
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-04-22 07:59:35 +02:00
Ron Evans
8d3b5a58d1
machine/atsamd21: correct pad/pin handling when using both UART and USBCDC interfaces at same time
...
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-04-17 22:50:08 +02:00
Yusuke Mitsuki
1322f404a6
stm32: add support for the STM32F4Discovery
...
Signed-off-by: Yusuke Mitsuki <mickey.happygolucky@gmail.com>
2019-04-13 13:32:05 +02:00
Ron Evans
85f2ef40f8
machine/itsybitsy-m0: set pins and pin mode mapping for i2c0 bus
...
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-04-05 15:25:11 +02:00
Ron Evans
ae4ead8690
machine/circuitplay: correct pin and pin mode mapping for both i2c0 (external) and i2c1 (internal) buses
...
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-04-05 14:31:26 +02:00
Ron Evans
9d6df2b4c7
machine/samd21: implement ADC
...
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-03-06 17:01:16 +01:00
Ron Evans
665c3bdaa6
machine/samd21: implement SPI interface for currently supported SAMD21 boards
...
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-03-04 21:47:09 +01:00
Ron Evans
3538ba943c
machine/samd21: move definitions for I2C interfaces into board files, since pin connections on each SAMD21-based board implementation can differ
...
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-03-04 20:54:13 +01:00
Ron Evans
543696eafc
machine/samd21: correct get/setPinCfg and get/setPMux functions for PORTB pins
...
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-03-04 20:53:07 +01:00
Ron Evans
4424fe087d
machine/circuitplay_express: add basic support for Adafruit Circuit Playground express pin mappings
...
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-02-24 23:01:22 +01:00
Ron Evans
34939ab422
machine/atsamd21: add GPIO_INPUT_PULLUP and GPIO_INPUT_PULLDOWN GPIO pin config options
...
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-02-24 21:20:59 +01:00
Ron Evans
c56b2a45fa
machine/samd21: handle PINMUX and PINCFG registers correctly for PORTB pins
...
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-02-24 17:43:11 +01:00