Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

atsamd21, atsamd51: add support for USB INTERRUPT OUT #3908

Merged
merged 1 commit into from
Sep 16, 2023

Conversation

sago35
Copy link
Member

@sago35 sago35 commented Sep 14, 2023

This PR adds INTERRUPT OUT support to the following microcontrollers

  • atsamd21
  • atsamd51

Setting of INTERRUPT OUT is almost the same as BULK OUT.
The only difference is the parameter at setEPCFG().

Note that rp2040 and nrf52840 were already supported.

@sago35
Copy link
Member Author

sago35 commented Sep 14, 2023

Once this PR is merged, Vial-support will work on atsamd21 and atsamd51.

https://github.com/sago35/tinygo-keyboard

@github-actions
Copy link

github-actions bot commented Sep 14, 2023

Size difference with the dev branch:

Binary size difference
 before   after   diff
  11896   11896      0   0.00%  tinygo build -size short -o ./build/test.hex -target=nano-33-ble ./examples/apds9960/proximity/main.go
   8204    8204      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/at24cx/main.go
   7724    7724      0   0.00%  tinygo build -size short -o ./build/test.hex -target=bluepill ./examples/ds1307/sram/main.go
  22052   22052      0   0.00%  tinygo build -size short -o ./build/test.hex -target=bluepill ./examples/ds1307/time/main.go
   4712    4712      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/easystepper/main.go
   7116    7116      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/gc9a01/main.go
   5688    5688      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/hd44780/customchar/main.go
   5652    5652      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/hd44780/text/main.go
  14908   14908      0   0.00%  tinygo build -size short -o ./build/test.hex -target=nano-33-ble ./examples/hts221/main.go
  16864   16864      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/hub75/main.go
  14264   14264      0   0.00%  tinygo build -size short -o ./build/test.hex -target=nano-33-ble ./examples/lps22hb/main.go
  26220   26220      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/lsm303agr/main.go
  22928   22928      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/microbitmatrix/main.go
  22896   22896      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit-v2 ./examples/microbitmatrix/main.go
  12292   12292      0   0.00%  tinygo build -size short -o ./build/test.hex -target=pico ./examples/pca9685/main.go
   6156    6156      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/pcd8544/setbuffer/main.go
   5168    5168      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/pcd8544/setpixel/main.go
   2889    2889      0   0.00%  tinygo build -size short -o ./build/test.hex -target=arduino ./examples/servo
  56576   56576      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/sht3x/main.go
  56548   56548      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/shtc3/main.go
   6516    6516      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/ssd1306/i2c_128x32/main.go
   6004    6004      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/ssd1306/spi_128x64/main.go
   5772    5772      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/ssd1331/main.go
   6464    6464      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/st7735/main.go
   6360    6360      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/st7789/main.go
  10408   10408      0   0.00%  tinygo build -size short -o ./build/test.hex -target=circuitplay-bluefruit ./examples/tone
   6528    6528      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/waveshare-epd/epd2in13/main.go
   6080    6080      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/waveshare-epd/epd2in13x/main.go
   6356    6356      0   0.00%  tinygo build -size short -o ./build/test.hex -target=microbit ./examples/waveshare-epd/epd4in2/main.go
   5452    5452      0   0.00%  tinygo build -size short -o ./build/test.bin -target=m5stamp-c3          ./examples/ws2812
  61904   61904      0   0.00%  tinygo build -size short -o ./build/test.hex -target=feather-nrf52840 ./examples/is31fl3731/main.go
   1565    1565      0   0.00%  tinygo build -size short -o ./build/test.hex -target=arduino   ./examples/ws2812
    896     896      0   0.00%  tinygo build -size short -o ./build/test.hex -target=digispark ./examples/ws2812
   7464    7464      0   0.00%  tinygo build -size short -o ./build/test.hex -target=nucleo-f103rb ./examples/shiftregister/main.go
   8372    8372      0   0.00%  tinygo build -size short -o ./build/test.hex -target=hifive1b ./examples/ssd1351/main.go
  12136   12136      0   0.00%  tinygo build -size short -o ./build/test.hex -target=pico ./examples/qmi8658c/main.go
   9432    9432      0   0.00%  tinygo build -size short -o ./build/test.hex -target=nucleo-l432kc ./examples/aht20/main.go
   9068    9068      0   0.00%  tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/xpt2046/main.go
  14572   14572      0   0.00%  tinygo build -size short -o ./build/test.hex -target=nucleo-wl55jc ./examples/sx126x/lora_rxtx/
  25932   25932      0   0.00%  tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/ssd1289/main.go
  11348   11348      0   0.00%  tinygo build -size short -o ./build/test.hex -target=pico ./examples/irremote/main.go
  11356   11356      0   0.00%  tinygo build -size short -o ./build/test.hex -target=badger2040 ./examples/uc8151/main.go
  10464   10464      0   0.00%  tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/scd4x/main.go
  81564   81564      0   0.00%  tinygo build -size short -o ./build/test.hex -target=nucleo-wl55jc ./examples/lora/lorawan/atcmd/
  15792   15792      0   0.00%  tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/as560x/main.go
   9952    9952      0   0.00%  tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/mpu6886/main.go
  13404   13428     24   0.18%  tinygo build -size short -o ./build/test.hex -target=pybadge ./examples/amg88xx
  64844   64868     24   0.04%  tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/flash/console/qspi
  10220   10244     24   0.23%  tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/basic
  29212   29236     24   0.08%  tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/pyportal_boing
  10248   10272     24   0.23%  tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/scroll
 263676  263700     24   0.01%  tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/slideshow
   8092    8116     24   0.30%  tinygo build -size short -o ./build/test.hex -target=pybadge ./examples/shifter/main.go
   9536    9560     24   0.25%  tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/touch/resistive/fourwire/main.go
  12532   12556     24   0.19%  tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/touch/resistive/pyportal_touchpaint/main.go
  72216   72240     24   0.03%  tinygo build -size short -o ./build/test.hex -target=feather-m4 ./examples/sdcard/console/
  82812   82836     24   0.03%  tinygo build -size short -o ./build/test.hex -target=wioterminal ./examples/rtl8720dn/webclient/
  72156   72180     24   0.03%  tinygo build -size short -o ./build/test.hex -target=wioterminal ./examples/rtl8720dn/webserver/
  98932   98956     24   0.02%  tinygo build -size short -o ./build/test.hex -target=wioterminal ./examples/rtl8720dn/mqttsub/
  60524   60548     24   0.04%  tinygo build -size short -o ./build/test.hex -target=feather-m4 ./examples/i2csoft/adt7410/
  10400   10424     24   0.23%  tinygo build -size short -o ./build/test.elf -target=wioterminal ./examples/axp192/m5stack-core2-blinky/
  60976   61008     32   0.05%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/adt7410/main.go
   9796    9828     32   0.33%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/adxl345/main.go
   8924    8956     32   0.36%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/apa102/main.go
  10636   10668     32   0.30%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/apa102/itsybitsy-m0/main.go
   8484    8516     32   0.38%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bh1750/main.go
   7708    7740     32   0.42%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/blinkm/main.go
  63436   63468     32   0.05%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bmi160/main.go
  28092   28124     32   0.11%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bmp180/main.go
  63496   63528     32   0.05%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bmp280/main.go
  12460   12492     32   0.26%  tinygo build -size short -o ./build/test.hex -target=trinket-m0 ./examples/bmp388/main.go
  69116   69148     32   0.05%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/ds3231/main.go
  25048   25080     32   0.13%  tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/espat/espconsole/main.go
  25248   25280     32   0.13%  tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/espat/esphub/main.go
  25056   25088     32   0.13%  tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/espat/espstation/main.go
  68852   68884     32   0.05%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/flash/console/spi
  68108   68140     32   0.05%  tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/gps/i2c/main.go
  68536   68568     32   0.05%  tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/gps/uart/main.go
   8576    8608     32   0.37%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/hcsr04/main.go
  10744   10776     32   0.30%  tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/hd44780i2c/main.go
  11052   11084     32   0.29%  tinygo build -size short -o ./build/test.hex -target=xiao ./examples/ili9341/basic
  11128   11160     32   0.29%  tinygo build -size short -o ./build/test.hex -target=xiao ./examples/ili9341/scroll
  12152   12184     32   0.26%  tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/lis3dh/main.go
  12648   12680     32   0.25%  tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/lsm6ds3/main.go
  11084   11116     32   0.29%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mag3110/main.go
  10300   10332     32   0.31%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mcp23017/main.go
  10732   10764     32   0.30%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mcp23017-multiple/main.go
  10024   10056     32   0.32%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mcp3008/main.go
  67092   67124     32   0.05%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mcp2515/main.go
   8636    8668     32   0.37%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mma8653/main.go
   8420    8452     32   0.38%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mpu6050/main.go
  75132   75164     32   0.04%  tinygo build -size short -o ./build/test.hex -target=p1am-100 ./examples/p1am/main.go
  17368   17400     32   0.18%  tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/thermistor/main.go
  10952   10984     32   0.29%  tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/tm1637/main.go
  15880   15912     32   0.20%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/vl53l1x/main.go
  13904   13936     32   0.23%  tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/vl6180x/main.go
 137536  137568     32   0.02%  tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/wifinina/ntpclient/main.go
 137544  137576     32   0.02%  tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/wifinina/udpstation/main.go
 137804  137836     32   0.02%  tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/wifinina/tcpclient/main.go
 137936  137968     32   0.02%  tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/wifinina/webclient/main.go
   7120    7152     32   0.45%  tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/ws2812
  32360   32392     32   0.10%  tinygo build -size short -o ./build/test.hex -target=trinket-m0 ./examples/bme280/main.go
  16816   16848     32   0.19%  tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/microphone/main.go
  11484   11516     32   0.28%  tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/buzzer/main.go
  13104   13136     32   0.24%  tinygo build -size short -o ./build/test.hex -target=trinket-m0 ./examples/veml6070/main.go
   7012    7044     32   0.46%  tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/l293x/simple/main.go
   8996    9028     32   0.36%  tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/l293x/speed/main.go
   6980    7012     32   0.46%  tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/l9110x/simple/main.go
   9552    9584     32   0.34%  tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/l9110x/speed/main.go
  13364   13396     32   0.24%  tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/lis2mdl/main.go
   8516    8548     32   0.38%  tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/max72xx/main.go
  77496   77528     32   0.04%  tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/dht/main.go
  70960   70992     32   0.05%  tinygo build -size short -o ./build/test.hex -target=xiao ./examples/pcf8563/alarm/
   7492    7524     32   0.43%  tinygo build -size short -o ./build/test.hex -target=xiao ./examples/pcf8563/clkout/
  70632   70664     32   0.05%  tinygo build -size short -o ./build/test.hex -target=xiao ./examples/pcf8563/time/
  70904   70936     32   0.05%  tinygo build -size short -o ./build/test.hex -target=xiao ./examples/pcf8563/timer/
   9052    9084     32   0.35%  tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/ina260/main.go
   8968    9000     32   0.36%  tinygo build -size short -o ./build/test.uf2 -target=circuitplay-express ./examples/makeybutton/main.go
   9732    9764     32   0.33%  tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/ds18b20/main.go
   8124    8156     32   0.39%  tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/ttp229/main.go
3476594 3478842   2248   0.00%   sum

@sago35
Copy link
Member Author

sago35 commented Sep 14, 2023

If this PR is merge, pybadge/gobadge can also use tinygo-keyboard with vial.

@sago35 sago35 added this to the v0.30.0 milestone Sep 14, 2023
@deadprogram
Copy link
Member

Great work @sago35 thank you! Now merging.

@deadprogram deadprogram merged commit 3ad2530 into dev Sep 16, 2023
22 checks passed
@deadprogram deadprogram deleted the usb-interrupt-out branch September 16, 2023 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants