Граф коммитов

1716 коммитов

Автор SHA1 Сообщение Дата
Ayke van Laethem
afd65e224a
bytealg: update to Go 1.22
A few non-generic functions like HashStrBytes have been kept for
backwards compatibility, so this package should continue to work with
older Go versions (as long as they support generics).
2024-01-17 13:39:57 +01:00
deadprogram
5f50c3b60b machine/samd51: add UART hardware flow control support
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-01-17 12:41:15 +01:00
deadprogram
cf39d8b2c8 targets: add ninafw pins and settings to Adafruit PyBadge board with AirLift Featherwing
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-01-15 19:34:05 -05:00
deadprogram
d92a31b440 targets: add ninafw pins and settings to Adafruit Metro M4 Airlift board
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-01-15 19:34:05 -05:00
deadprogram
8c90f4facf machine/pyportal: add needed values to board file for ninafw BLE support
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-01-06 22:46:47 +01:00
deadprogram
81c56c3ab8 machine, targets: ninafw support for arduino-nano33 and nano-rp2040 boards
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-01-05 19:04:12 +01:00
deadprogram
3d9a1ca22a machine/samd21: add hardware flow control for UART
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-01-05 17:56:45 +01:00
Scott Feldman
603a81f194 expose UART4 on wioterminal board
The right-hand grove port on the wioterminal can be used as UART, using
D0/D1 pins.  The pins D0/D1 are tied to SERCOM4, so this patch exposes a
UART4 for sercom4 access.

  RX = A0/D0 = PB08/SERCOM4.0 (port 4 pad 0)
  TX = A1/D1 = PB09/SERCOM4.1 (port 4 pad 1)

Tested with Lora E5 UART.

  uart : = machine.UART4
  tx := machine.D0
  rx := machine.D1

Note: must also cross Tx/Rx wires in grove cable.  See
https://www.lucadentella.it/en/2022/01/29/wio-terminal-porta-grove-di-destra-e-moduli-uart/
2023-12-31 10:54:11 +01:00
Elias Naur
cfc32794a7 os/user: add bare-bones implementation of the os/user package
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2023-12-30 10:56:23 +01:00
Ayke van Laethem
8d2a07b927 main: add -serial=rtt support 2023-12-23 08:14:35 -05:00
deadprogram
ffe6dfd21b machine/nano-rp2040: add UART1 and correct mappings for NINA via UART.
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-12-20 16:51:21 -05:00
deadprogram
cf21380264 machine/serial, rp2040: add support for hardware flow control
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-12-20 16:48:12 -05:00
deadprogram
534b3b0c0b net: update to latest main branch with accept fix
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-12-19 08:16:40 +01:00
Scott Feldman
a511f18c64
stub out more types/funcs to compile against golang.org/x/net/internal/socket (#4037)
* stub out more types/funcs to compile against golang.org/x/net/internal/socket

These are changes need to compile github.com/domainr/dnsr/ with TinyGo.
See issue https://github.com/tinygo-org/net/issues/14.

These change are mostly to fix missing symbols in src/crypto/tls and
src/net.  Missing types and functions are cut-and-pasted from go1.21.4.
Functions are stubbed out returning errors.New("not implemented").

DNRS is compiled by running tinygo test:

   sfeldma@nuc:~/work/dnsr$ tinygo test -target=wasi

With this patch, and a corresponding patch for tinygo-org/net to fixup
src/net, you should get a clean compile.
2023-12-17 15:32:53 +01:00
deadprogram
731bd5cd1b net: update to latest main branch with TCPListener
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-12-09 12:11:04 +01:00
deadprogram
4acf59546e modules: update net submodule to latest commit with http Client Transport interface
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-12-09 09:48:29 +01:00
deadprogram
b58b7c59ae runtime: stub out Breakpoint() function
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-12-08 21:10:26 +01:00
deadprogram
a1a2d1ab81 modules: switch to main branch of net submodule
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-12-06 13:11:44 +01:00
Scott Feldman
07591178cd move syscall constants for networking into net space to avoid windows build issue 2023-12-06 13:11:44 +01:00
Scott Feldman
43bdc888dd move IPPROTO_TLS to netdev to avoid src/syscall dependency 2023-12-06 13:11:44 +01:00
Scott Feldman
4229e670ce Add network device driver model, netdev
This PR adds a network device driver model called netdev. There will be a companion PR for TinyGo drivers to update the netdev drivers and network examples. This PR covers the core "net" package.

An RFC for the work is here: #tinygo-org/drivers#487. Some things have changed from the RFC, but nothing major.

The "net" package is a partial port of Go's "net" package, version 1.19.3. The src/net/README file has details on what is modified from Go's "net" package.

Most "net" features are working as they would in normal Go. TCP/UDP/TLS protocol support is there. As well as HTTP client and server support. Standard Go network packages such as golang.org/x/net/websockets and Paho MQTT client work as-is. Other packages are likely to work as-is.

Testing results are here (https://docs.google.com/spreadsheets/d/e/2PACX-1vT0cCjBvwXf9HJf6aJV2Sw198F2ief02gmbMV0sQocKT4y4RpfKv3dh6Jyew8lQW64FouZ8GwA2yjxI/pubhtml?gid=1013173032&single=true).
2023-12-06 13:11:44 +01:00
deadprogram
76a7ad2a3e modules: add tinygo net package as submodule
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-12-06 13:11:44 +01:00
deadprogram
e4f551ac7f src/net: remove existing files to replace with submodule
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-12-06 13:11:44 +01:00
Yurii Soldak
338590cc75 machine/atmega: uart double speed mode
Less errors and higher throughput.
Example: default / slow mode is problematic for 115200 on 16Mhz CPU.
2023-12-05 16:29:51 +01:00
deadprogram
c6add1e769 machine/esp32c3: implement RNG
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-12-04 09:34:20 +01:00
deadprogram
c6609a02fa machine/esp32c3: move i2c implementation into separate file to skip m5stamp-c3 since it does not appear to expose those pins
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-12-03 22:05:08 +01:00
deadprogram
19fb1bfafc machine/esp32c3: corrected implementation for error handling and when to expect NACK
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-12-03 22:05:08 +01:00
deadprogram
f91b6ad0df machine/esp32c3: handle defaults for I2C configuration
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-12-03 22:05:08 +01:00
Dmitriy
94459cefe5 machine/esp32c3: implement i2c for esp32-c3 2023-12-03 22:05:08 +01:00
Yurii Soldak
2919fa8b14 machine/atmega: bufferSize = 32
to save memory on 2k ram targets
also updates sizediff tool to show ram differences
2023-12-03 12:55:22 +01:00
Yurii Soldak
6420e90124 machine/atmega328pb: refactor to enable extra uart 2023-12-02 13:26:59 +01:00
deadprogram
e065da20cb targets: add Adafruit qtpy-esp32c3 board support
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-11-28 23:57:30 +01:00
deadprogram
d7c77b6761 machine/esp32c3: implement USB_SERIAL for USBCDC communication
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-11-28 23:05:07 +01:00
sago35
2b215955ca machine/usb: add support for ISERIAL descriptor 2023-11-07 00:11:40 +01:00
Elliott Sales de Andrade
ce25f00769 Bump wasi-libc to SDK 20
The version 17 SDK adds `getpagesize`, so use it instead of hardcoding a
number (even if their implementation is _also_ a hardcoded number.)
2023-11-04 23:32:42 +01:00
Shane O'Donovan
cca32e67a9 reflect: stub FuncOf() 2023-11-04 22:44:56 +01:00
Christian Ege
5355473dce
doc: fix a typo in the rtcinterrupt example (#3981)
docs: fix a typo in the rtcinterrupt example, also provide a link to the interrupt online doc
2023-11-02 18:13:22 +01:00
deadprogram
938ce22307 machine/stm32: implement DeviceID() with unique ID per processor
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-10-27 17:44:53 +02:00
Kenneth Bell
9fb5a5b9a4 nrf,sam,rp2040: add machine.HardwareID function 2023-10-27 13:25:32 +02:00
deadprogram
fa4ca63ff2 machine/spi: use interface to ensure uniformity for all machine implementations
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-10-17 13:41:32 +02:00
Ron Evans
935a293106
machine/i2c: add interface check and implementation where missing for SetBaudRate() (#3406)
* machine/i2c: add interface check and placeholder implementation where missing for SetBaudRate()
2023-10-14 13:17:24 +02:00
Anuraag Agrawal
c2f1965e03
Fix bitstring order in precise GC docs (#3947)
docs: Fix bitstring order in precise GC docs
2023-10-13 08:57:30 +02:00
Ayke van Laethem
5cd8ba2421 all: refactor goenv.Version to add the git sha1 if needed
Previously all (except one!) usage of goenv.Version manually added the
git sha1 hash, leading to duplicate code. I've moved this to do it all
in one place, to avoid this duplication.
2023-10-04 16:20:32 +02:00
ayan george
c9721197d5 bulid: Rename Makefile to GNUmakefile
Prior to this commit, the build instructions were encoded in Makefiles
that contained GNU extensions that are unique to GNU Make and
incompatible with older implementations.

Thie commit renames all Makefiles to GNUmakefile which clearly denotes
that the file contains GNU extensions.

GNU Make actually first looks for a GNUmakefile, then makefile, THEN
Makefile so in addition to simply being more correct and portable, it
saves a few unnecessary failed attempts to open the correct build
file.
2023-10-01 14:55:34 +02:00
sago35
3ad2530ee7 atsamd21, atsamd51: add support for USB INTERRUPT OUT 2023-09-16 09:30:05 +02:00
deadprogram
c4de195f04 machine/rp2040: always use the USB device enum fix, even in chips that supposedly have the HW fix.
Additionally, correct the amount of time spent waiting after USB reset, based on advice from @sago35

Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-09-12 08:41:58 +02:00
Timothy Rule
75aca0f5ee
Board support for Adafruit Gemma M0 (#3903)
machine, targets: Board support for Adafruit Gemma M0
2023-09-11 11:11:26 +02:00
Damian Gryski
0042bf62a5 compiler,reflect: add support for [...]T -> []T in reflect 2023-09-10 13:05:18 +02:00
deadprogram
9d6eb1ff06 machine/usb/adc/midi: improve implementation to include several new messages
such as program changes and pitch bend. Also add error handling for invalid
parameter values such as MIDI channel. This however makes a somewhat breaking
change to the current implementation, in that we now use the typical MIDI user
system of counting MIDI channels from 1-16 instead of from 0-15 as the lower
level USB-MIDI API itself expects.

Also add constant values for continuous controller messages, rename SendCC
function, and add SysEx function.

Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-09-07 08:41:57 +02:00
Ayke van Laethem
4643401a1d runtime: refactor markGlobals to findGlobals
Instead of markGlobals calling markRoots unconditionally (which doesn't
make sense for -gc=none and -gc=leaking), provide markRoots as a
callback function.

This is in preparation for -gc=boehm, where the previous design is even
more awkward and a callback makes far more sense.

I've tested the size impact using `make smoketest XTENSA=0`. There is
none, except for two cases:

  * One with `-opt=0` so const-propagation for the callback didn't take
    place.
  * One other on AVR, I don't know why but as it's only 16 bytes in a
    very specific case I'm going to assume it's just a random change in
    compiler output that caused a size difference.
2023-09-05 00:42:01 +02:00