tinygo/src/machine
Ayke van Laethem b67351babe machine: define Serial as the default output
Previously, the machine.UART0 object had two meanings:

  - it was the first UART on the chip
  - it was the default output for println

These two meanings conflict, and resulted in workarounds like:

  - Defining UART0 to refer to the USB-CDC interface (atsamd21,
    atsamd51, nrf52840), even though that clearly isn't an UART.
  - Defining NRF_UART0 to avoid a conflict with UART0 (which was
    redefined as a USB-CDC interface).
  - Defining aliases like UART0 = UART1, which refer to the same
    hardware peripheral (stm32).

This commit changes this to use a new machine.Serial object for the
default serial port. It might refer to the first or second UART
depending on the board, or even to the USB-CDC interface. Also, UART0
now really refers to the first UART on the chip, no longer to a USB-CDC
interface.

The changes in the runtime package are all just search+replace. The
changes in the machine package are a mixture of search+replace and
manual modifications.

This commit does not affect binary size, in fact it doesn't affect the
resulting binary at all.
2021-05-13 16:43:37 +02:00
..
adc.go accept configuration struct for ADC parameters (#1533) 2021-01-31 14:54:27 -06:00
board_arduino.go avr: use standard pin numbering 2020-05-12 08:16:34 +02:00
board_arduino_mega1280.go Arduino Mega 1280 support 2021-04-12 11:03:13 +02:00
board_arduino_mega2560.go machine: fix atmega2560 mapping for pins D2 and D5 2020-07-05 21:18:20 +02:00
board_arduino_mkr1000.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_arduino_nano.go avr: use standard pin numbering 2020-05-12 08:16:34 +02:00
board_arduino_nano33.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_arduino_nano33_baremetal.go machine: make UART objects pointer receivers 2021-05-13 16:43:37 +02:00
board_arduino_zero.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_atmega328p.go avr: use standard pin numbering 2020-05-12 08:16:34 +02:00
board_atsamd21.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_atsame54-xpro.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_bluepill.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_circuitplay_bluefruit.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_circuitplay_express.go machine: refactor PWM support 2021-04-06 20:36:10 +02:00
board_circuitplay_express_baremetal.go machine: make UART objects pointer receivers 2021-05-13 16:43:37 +02:00
board_clue_alpha.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_digispark.go
board_esp32-coreboard-v2.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_fe310.go
board_feather-m0.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_feather-m4-can.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_feather-m4.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_feather-m4_baremetal.go machine: make UART objects pointer receivers 2021-05-13 16:43:37 +02:00
board_feather-nrf52840.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_feather-stm32f405.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_grandcentral-m4.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_grandcentral-m4_baremetal.go machine: make UART objects pointer receivers 2021-05-13 16:43:37 +02:00
board_hifive1b.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_hifive1b_baremetal.go machine: make machine.I2C0 and similar objects pointers 2021-03-29 02:02:04 +02:00
board_itsybitsy-m0.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_itsybitsy-m4.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_itsybitsy-m4_baremetal.go machine: make UART objects pointer receivers 2021-05-13 16:43:37 +02:00
board_itsybitsy-nrf52840.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_k210.go all: changeover to eliminate all direct use of master/slave terminology 2020-07-23 22:45:23 +02:00
board_lgt92.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_maixbit.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_maixbit_baremetal.go machine: make machine.I2C0 and similar objects pointers 2021-03-29 02:02:04 +02:00
board_matrixportal-m4.go matrixportal-m4: Add support for board Adafruit Matrix Portal M4 (#1529) 2020-12-11 10:00:41 +01:00
board_matrixportal-m4_baremetal.go machine: make UART objects pointer receivers 2021-05-13 16:43:37 +02:00
board_metro-m4-airlift.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_metro-m4-airlift_baremetal.go machine: make UART objects pointer receivers 2021-05-13 16:43:37 +02:00
board_microbit-v2.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_microbit.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_nicenano.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_nodemcu.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_nrf52840-mdk-usb-dongle.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_nrf52840-mdk.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_nucleof103rb.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_nucleof722ze.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_nucleol031k6.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_nucleol432kc.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_nucleol552ze.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_p1am-100.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_p1am-100_baremetal.go machine: make UART objects pointer receivers 2021-05-13 16:43:37 +02:00
board_particle_argon.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_particle_boron.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_particle_xenon.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_pca10031.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_pca10040.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_pca10056.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_pca10059.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_pinetime-devkit0.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_pybadge.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_pybadge_baremetal.go machine: make UART objects pointer receivers 2021-05-13 16:43:37 +02:00
board_pygamer.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_pyportal.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_pyportal_baremetal.go machine: make UART objects pointer receivers 2021-05-13 16:43:37 +02:00
board_qtpy.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_reelboard.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_stm32f4disco.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_teensy36.go machine: make UART objects pointer receivers 2021-05-13 16:43:37 +02:00
board_teensy40.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_trinket.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_wioterminal.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_wioterminal_baremetal.go machine: make UART objects pointer receivers 2021-05-13 16:43:37 +02:00
board_x9pro.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
board_xiao.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
buffer.go Working on NXP/Teensy support 2020-07-08 21:58:15 +02:00
i2c.go stm32: add nucleo-l031k6 support 2021-04-07 17:20:19 +02:00
i2s.go all: changeover to eliminate all direct use of master/slave terminology 2020-07-23 22:45:23 +02:00
machine.go machine: move PinMode to central location 2021-05-06 13:59:12 +02:00
machine_atmega.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
machine_atmega328p.go machine: refactor PWM support 2021-04-06 20:36:10 +02:00
machine_atmega328pb.go Add SPI support for Atmega based chips. 2021-02-10 12:56:48 +01:00
machine_atmega1280.go Make fmt-check happy again 2021-04-17 00:01:37 +02:00
machine_atmega1284p.go Add SPI support for Atmega based chips. 2021-02-10 12:56:48 +01:00
machine_atmega2560.go Add SPI support for Atmega based chips. 2021-02-10 12:56:48 +01:00
machine_atsamd21.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
machine_atsamd21e18.go
machine_atsamd21g18.go Use runtime/volatile.T.ReplaceBits 2020-07-14 06:08:08 +02:00
machine_atsamd51.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
machine_atsamd51g19.go machine: refactor PWM support 2021-04-06 20:36:10 +02:00
machine_atsamd51j19.go machine: refactor PWM support 2021-04-06 20:36:10 +02:00
machine_atsamd51j20.go machine: refactor PWM support 2021-04-06 20:36:10 +02:00
machine_atsamd51p19.go machine: refactor PWM support 2021-04-06 20:36:10 +02:00
machine_atsamd51p20.go atsamd51: fix PWM support in atsamd51p20 2021-04-21 15:02:47 +02:00
machine_atsame5x_can.go atsame5x: add support for CAN 2021-05-10 12:27:10 +02:00
machine_atsame51j19.go atsame51: add initial support for feather-m4-can 2021-04-16 17:49:46 +02:00
machine_atsame54p20.go atsame54: add initial support for atsame54-xpro 2021-04-15 15:43:37 +02:00
machine_attiny85.go avr: unify GPIO pin/port code 2020-05-22 13:17:04 +02:00
machine_avr.go machine: move PinMode to central location 2021-05-06 13:59:12 +02:00
machine_esp32.go machine: make UART objects pointer receivers 2021-05-13 16:43:37 +02:00
machine_esp8266.go machine: make UART objects pointer receivers 2021-05-13 16:43:37 +02:00
machine_fe310.go machine: make UART objects pointer receivers 2021-05-13 16:43:37 +02:00
machine_gameboyadvance.go machine: move PinMode to central location 2021-05-06 13:59:12 +02:00
machine_generic.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
machine_k210.go machine: make UART objects pointer receivers 2021-05-13 16:43:37 +02:00
machine_mimxrt1062.go machine: move PinMode to central location 2021-05-06 13:59:12 +02:00
machine_mimxrt1062_uart.go teensy40: move txBuffer allocation to UART declaration 2021-03-13 07:34:44 +01:00
machine_nrf.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
machine_nrf51.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
machine_nrf52.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
machine_nrf528xx.go machine: refactor PWM support 2021-04-06 20:36:10 +02:00
machine_nrf52833.go machine: define Serial as the default output 2021-05-13 16:43:37 +02:00
machine_nrf52840.go machine: make UART objects pointer receivers 2021-05-13 16:43:37 +02:00
machine_nrf52840_usb.go machine: make USBCDC global a pointer 2021-05-13 16:43:37 +02:00
machine_nrf52840_usb_reset_none.go machine/nrf52840+nxpmk66f18: rename files to match naming format for all other boards/machines 2021-02-26 00:32:33 +01:00
machine_nrf52840_usb_reset_uf2.go machine/nrf52840+nxpmk66f18: rename files to match naming format for all other boards/machines 2021-02-26 00:32:33 +01:00
machine_nxpmk66f18.go machine: move PinMode to central location 2021-05-06 13:59:12 +02:00
machine_nxpmk66f18_uart.go machine: make UART objects pointer receivers 2021-05-13 16:43:37 +02:00
machine_stm32.go machine: move PinMode to central location 2021-05-06 13:59:12 +02:00
machine_stm32_i2c_reva.go machine: make machine.I2C0 and similar objects pointers 2021-03-29 02:02:04 +02:00
machine_stm32_i2c_revb.go stm32: add nucleo-l031k6 support 2021-04-07 17:20:19 +02:00
machine_stm32_moder_gpio.go stm32: make SPI CLK fast to fix data issue 2021-04-13 07:38:30 +02:00
machine_stm32_spi.go stm32: support SPI on L4 series 2021-04-21 21:09:41 +02:00
machine_stm32_uart.go stm32: separate altfunc selection for UART Tx/Rx 2021-03-23 08:33:59 +01:00
machine_stm32f4.go machine/stm32f4: refactor common code and add new build tag stm32f4 (#1332) 2020-09-01 11:31:41 +02:00
machine_stm32f7.go Nucleo f722ze (#1526) 2020-12-15 06:51:35 +01:00
machine_stm32f7x2.go machine: make machine.I2C0 and similar objects pointers 2021-03-29 02:02:04 +02:00
machine_stm32f103.go Patch Cleanup 2021-05-03 18:16:46 +02:00
machine_stm32f405.go stm32: support SPI on L4 series 2021-04-21 21:09:41 +02:00
machine_stm32f407.go stm32: support SPI on L4 series 2021-04-21 21:09:41 +02:00
machine_stm32l0.go machine: make UART objects pointer receivers 2021-05-13 16:43:37 +02:00
machine_stm32l0x1.go stm32: add nucleo-l031k6 support 2021-04-07 17:20:19 +02:00
machine_stm32l0x2.go stm32: add nucleo-l031k6 support 2021-04-07 17:20:19 +02:00
machine_stm32l4.go stm32: support SPI on L4 series 2021-04-21 21:09:41 +02:00
machine_stm32l4x2.go machine: make machine.I2C0 and similar objects pointers 2021-03-29 02:02:04 +02:00
machine_stm32l5.go stm32-l5: corrected alt function and other review comments 2021-02-16 12:48:52 +01:00
machine_stm32l5x2.go machine: make machine.I2C0 and similar objects pointers 2021-03-29 02:02:04 +02:00
pwm.go machine: refactor PWM support 2021-04-06 20:36:10 +02:00
spi.go stm32: support SPI on L4 series 2021-04-21 21:09:41 +02:00
uart.go machine: make UART objects pointer receivers 2021-05-13 16:43:37 +02:00
usb.go machine: make USBCDC global a pointer 2021-05-13 16:43:37 +02:00