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

592 коммитов

Автор SHA1 Сообщение Дата
sago35
7ca45d61fc machine/rp2040: correct issue with spi pin validation 2023-03-07 21:11:57 +09:00
Ayke van Laethem
4ec1e58aa6 all: use unsafe.Add instead of unsafe.Pointer(uintptr(...) + ...)
We have an optimization for this specific pattern, but it's really just
a hack. With the addition of unsafe.Add in Go 1.17 we can directly
specify the intent instead and eventually remove this special case.

The code is also easier to read.
2023-03-03 16:55:13 +01:00
Ron Evans
6e1b8a54aa
machine/stm32, nrf: flash API (#3472)
machine/stm32, nrf: implement machine.Flash

Implements the machine.Flash interface using the same definition as the tinyfs BlockDevice.

This implementation covers the stm32f4, stm32l4, stm32wlx, nrf51, nrf52, and nrf528xx processors.
2023-02-27 13:55:38 +01:00
Bjoern Poetzschke
cfe971d723 Rearrange switch case for get pin cfg 2023-02-24 08:53:51 +01:00
John Clark
bad7bfc4d5 Pins D4 & D5 are I2C1. Use pins D2 & D3 for I2C0.
Signed-off-by: John Clark <inindev@gmail.com>
2023-02-24 02:20:26 +01:00
deadprogram
ad1da7d26f machine/rp2040: correct issue with spi pin validation
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-02-24 01:05:58 +01:00
deadprogram
6df303ff19 machine/rp2040: correct issue with i2c pin validation
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-02-24 01:05:58 +01:00
Patricio Whittingslow
96b70fd619
rp2040: provide better errors for invalid pins on i2c and spi (#3443)
machine/rp2040: provide better errors for invalid pins on i2c and spi
2023-02-23 13:26:14 +01:00
Yurii Soldak
4d0dfbd6fd rp2040: rtc delayed interrupt 2023-02-23 09:23:37 +01:00
deadprogram
1065f06e57 machine/lorae5: add needed definition for UART2
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-02-20 14:15:31 +01:00
deadprogram
e066e67baf machine/rp2040: change calling order for device enumeration fix to do first
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-02-19 08:32:39 +01:00
Andy Shinn
9296332151 fix bad qt py pin assignment 2023-02-19 00:39:41 +01:00
sago35
e21ab04fad
machine/usb/hid: add MediaKey support (#3436)
machine/usb/hid: add MediaKey support
2023-02-18 01:27:15 +01:00
John Clark
45c8817ddd Support for the Espressif ESP32-C3-DevKit-RUST-1 development board
Signed-off-by: John Clark <inindev@gmail.com>
2023-01-29 22:50:12 +01:00
John Clark
1adfdf8fa5 Support for Makerfabs ESP32C3SPI35 TFT Touchscreen board
Signed-off-by: John Clark <inindev@gmail.com>
2023-01-26 20:16:11 +01:00
Olivier Fauchon
eec915170d stm32wl: Fix incomplete RNG initialisation 2023-01-24 16:16:56 +01:00
Ayke van Laethem
159317a5fe all: remove remaining +build lines 2023-01-17 23:35:53 +01:00
Marcus Sorensen
e7ba07dd5a
Add PDM support for circuitplay-bluefruit (#3359)
machine/nrf52840: add PDM support

Signed-off-by: Marcus Sorensen <marcus@turboio.com>
2023-01-17 12:32:01 +01:00
Thomas Richner
05ec4e6bd0 Support for Adafruit Feather M0 Express board 2023-01-11 10:07:11 +01:00
John Clark
aa12579864 Add SPI support for for the ESP32-C3 device.
Signed-off-by: John Clark <inindev@gmail.com>
2023-01-10 15:52:25 +01:00
sago35
5f3534fe72 machine/usb: change to not send before endpoint initialization 2023-01-08 08:44:27 +01:00
irieda
a7ff2731b9
Add USB HID joystick support (#3366)
machine/usb: add USB HID joystick support
2023-01-07 22:30:40 +01:00
sago35
70c4e1cf96 machine/usb: improve buffer size definition 2023-01-07 17:57:19 +01:00
BCG
481aba6536 board: Adafruit KB2040 (https://www.adafruit.com/product/5302) 2022-12-22 11:49:31 +01:00
Jesús Espino
e71e289e8b
Add basic atmega32u support (#3337)
machine/atmega32u: add support for arduino leonardo
2022-12-20 16:57:55 +01:00
sago35
6cdc718bfb rp2040: drop deprecated build tags 2022-12-20 15:53:02 +01:00
sago35
70c94c6d01 rp2040: add version check for RP2040-E5 2022-12-20 15:53:02 +01:00
sago35
762a6f1256 rp2040: fix usb device enumeration (RP2040-E5) 2022-12-20 15:53:02 +01:00
Yurii Soldak
8d4d3c6201 build: drop deprecated build tags 2022-12-19 23:20:11 +01:00
Jesús Espino
d304e6706b
Adding support for waveshare rp2040-zero (#3321)
machine: adding support for waveshare rp2040-zero
2022-12-19 12:15:03 +01:00
sago35
c90ff1e1cf rp2040: fix interrupt issue (2) 2022-12-19 08:43:56 +01:00
sago35
0f6dfedcfd rp2040: fix interrupt issue 2022-12-17 12:52:19 +01:00
sago35
398c284480 usbhid: change usage-maximum to 0xFF 2022-12-15 18:24:54 +01:00
sago35
5293d3e5f0 atsame5x: reduce heap allocation 2022-12-01 22:27:12 +01:00
deadprogram
1d52e6be29 machine/nrf51: add ADC implementation
Signed-off-by: deadprogram <ron@hybridgroup.com>
2022-11-26 20:17:11 +01:00
sago35
acb2391439 atsame5x: fix extendedID handling 2022-11-25 17:57:16 +01:00
sago35
baca8a643e xiao-rp2040: add pin definitions 2022-11-23 09:01:48 +01:00
goropikari
a329f56ec2 Fix xiao rp2040 pin variable assignment
According to official infomation(https://wiki.seeedstudio.com/XIAO-RP2040/), D9 and D10 are corresponding to GPIO4 and GPIO3, respectively.
2022-11-21 11:49:18 +01:00
deadprogram
217449df07 machine/stm32f1, stm32f4: fix ADC by clearing the correct bit for rank after each read
Signed-off-by: deadprogram <ron@hybridgroup.com>
2022-11-21 08:53:21 +01:00
deadprogram
a7fc65861d machine/stm32: always set ADC pins to pullups floating
Signed-off-by: deadprogram <ron@hybridgroup.com>
2022-11-21 08:53:21 +01:00
Matt Johnston
12a41dc791 Add basic GPIO support for rp2040 PIO 2022-10-27 11:47:47 +02:00
soypat
dd3ad57efb avoid allocating clock on heap 2022-10-26 23:27:28 +02:00
deadprogram
d56c9f5533 machine/usb: add back New() with deprecation comment to use Port() instead
Signed-off-by: deadprogram <ron@hybridgroup.com>
2022-10-17 14:46:18 +02:00
deadprogram
3d7f24e26c machine/usb: rename 'New()' to 'Port()' to have the API better match the singleton that is actually being returned
Signed-off-by: deadprogram <ron@hybridgroup.com>
2022-10-17 14:46:18 +02:00
Kenneth Bell
8f33721b88 usb: remove allocs in ISR 2022-10-13 23:37:34 +02:00
Kenneth Bell
2688d9d733 rp2040: remove mem allocation in GPIO ISR 2022-10-07 11:46:12 +01:00
Ayke van Laethem
f52ecf3054 machine: use NoPin constant where appropriate
In some cases, regular integers were used. But we have a constant to
explicitly say these pins are undefined: `NoPin`. So use this.

A better solution would be to not require these constants, like with the
proposal in https://github.com/tinygo-org/tinygo/issues/3152. This
change is just a slight improvement over the current state.
2022-09-26 20:44:47 +02:00
Ayke van Laethem
107b1c2906 machine: do not expose RESET_MAGIC_VALUE
This is a constant for internal use only, but was (unintentionally?)
exported. In addition, it doesn't follow the Go naming convention.
This change simply renames the constant so that it is unexported.
2022-09-25 12:38:12 +02:00
Ayke van Laethem
8b078a9e8f machine: remove level triggered pin interrupts
This removes level-triggered interrupts.

While working on https://github.com/tinygo-org/tinygo/pull/3170, I found
these level triggered interrupt constants. Apart from them being
inconsistent with each other (PinLowLevel vs PinLevelLow) I don't think
they are actually used anywhere. In addition, I removed the
PinNoInterrupt constant on the esp32c3. This makes the esp32c3 pass the
tests in #3170.

I looked into level-triggered interrupts and I really couldn't find a
good justification for them:

  - They were added to the esp32c3 and the rp2040 together with other
    pin interrupt types, meaning they were probably just added because
    the chip supports the feature and not because they were actually
    needed.
  - Level interrupts aren't supported in TinyGo for any other chip, and
    I haven't seen anybody ask for this feature.
  - They aren't supported in the nrf series chips _at all_, and with a
    quick search I found only very little demand for them in general.
  - I tried to see whether there is any good use case for them, but I
    couldn't really find one (where an edge triggered interrupt wouldn't
    work just as well). If there is one where level triggered interrupts
    are a real advantage over edge triggered interrupts, please let me
    know.

Of course, we shouldn't remove a feature lightly. But in this case, I
can't think of an advantage of having this feature. I can think of
downsides: more maintenance and having to specify their behavior in the
machine package documentation.
In general, I would like to keep the machine package clean and only
support things that have a proven use case.
2022-09-24 22:58:22 +02:00
Ayke van Laethem
9a9106a297 esp32c3: remove unused UARTStopBits constants 2022-09-21 18:16:29 +02:00