aboutsummaryrefslogtreecommitdiff
path: root/ports/stm32/machine_uart.c
AgeCommit message (Collapse)Author
2021-02-21stm32/uart: Add support for LPUART1 on L0, L4, H7 and WB MCUs.Chris Mason
Add LPUART1 as a standard UART. No low power features are supported, yet. LPUART1 is enabled as the next available UART after the standard U(S)ARTs: STM32WB: LPUART1 = UART(2) STM32L0: LPUART1 = UART(6) STM32L4: LPUART1 = UART(6) STM32H7: LPUART1 = UART(9) On all ports: LPUART1 = machine.UART('LP1') LPUART1 is enabled by defining MICROPY_HW_LPUART1_TX and MICROPY_HW_LPUART1_RX in mpconfigboard.h. Signed-off-by: Chris Mason <c.mason@inchipdesign.com.au>
2020-12-07stm32: Add support for a board to reserve certain peripherals.Damien George
Allows reserving CAN, I2C, SPI, Timer and UART peripherals. If reserved the peripheral cannot be accessed from Python. Signed-off-by: Damien George <damien@micropython.org>
2020-09-08stm32/uart: Allow static IRQ handler registration.Jim Mussared
This will allow the HCI UART to use a non-heap mp_irq_obj_t, which avoids needing to make a root pointer for it.
2020-09-04lib/utils/mpirq: Add mp_irq_init func, and clean up unused init method.Damien George
mp_irq_init() is useful when the IRQ object is allocated by the caller. The mp_irq_methods_t.init method is not used anywhere so has been removed. Signed-off-by: Damien George <damien@micropython.org>
2020-06-01stm32/machine_uart: Allow re-init'ing a static UART object.Damien George
Just disallow changing the rxbuf which will be some static RAM (can't free it and soft-reset would lose any dynamically allocated buffer).
2020-06-01stm32/machine_uart: Retain attached-to-repl setting when init'ing UART.Damien George
2020-04-05all: Use MP_ERROR_TEXT for all error messages.Jim Mussared
2020-02-28all: Reformat C and Python source code with tools/codeformat.py.Damien George
This is run with uncrustify 0.70.1, and black 19.10b0.
2020-02-13py: Add mp_raise_msg_varg helper and use it where appropriate.Damien George
This commit adds mp_raise_msg_varg(type, fmt, ...) as a helper for nlr_raise(mp_obj_new_exception_msg_varg(type, fmt, ...)). It makes the C-level API for raising exceptions more consistent, and reduces code size on most ports: bare-arm: +28 +0.042% minimal x86: +100 +0.067% unix x64: -56 -0.011% unix nanbox: -300 -0.068% stm32: -204 -0.054% PYBV10 cc3200: +0 +0.000% esp8266: -64 -0.010% GENERIC esp32: -104 -0.007% GENERIC nrf: -136 -0.094% pca10040 samd: +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
2019-12-27py: Introduce MP_ROM_NONE macro for ROM to refer to None object.Damien George
This helps to prevent mistakes, and allows easily changing the ROM value of None if needed.
2019-07-17stm32: Add initial support for STM32WBxx MCUs.Damien George
This new series of MCUs is similar to the L4 series with an additional Cortex-M0 coprocessor. The firmware for the wireless stack must be managed separately and MicroPython does not currently interface to it. Supported features so far include: RTC, UART, USB, internal flash filesystem.
2019-07-05stm32: Add initial support for STM32L0xx MCUs.Damien George
2019-05-07stm32/machine_uart: Change default UART timeout to 0, for non blocking.Damien George
It's more common to need non-blocking behaviour when reading from a UART, rather than having a large timeout like 1000ms (the original behaviour). With a large timeout it's 1) likely that the function will read forever if characters keep trickling it; or 2) the function will unnecessarily wait when characters come sporadically, eg at a REPL prompt.
2019-05-02stm32: Add support for F413 MCUs.Chris Mason
Includes: - Support for CAN3. - Support for UART9 and UART10. - stm32f413xg.ld and stm32f413xh.ld linker scripts. - stm32f413_af.csv alternate function mapping. - startup_stm32f413xx.s because F413 has different interrupt vector table. - Memory configuration with: 240K filesystem, 240K heap, 16K stack.
2019-02-12ports: Convert legacy uppercase macro names to lowercase.Damien George
2018-12-29stm32: Implement UART.irq() method with initial support for RX idle IRQ.Tobias Badertscher
2018-12-10stm32/uart: Add ability to have a static built-in UART object.Damien George
A static UART is useful for internal peripherals that require a UART and need to persist outside the soft-reset loop.
2018-12-10stm32/uart: Move config of char_width/char_mask to uart.c.Damien George
2018-12-10stm32/uart: For UART init, pass in params directly, not via HAL struct.Damien George
To provide a cleaner and more abstract C-level interface to the UART.
2018-12-10stm32/uart: Remove HAL's UART_HandleTypeDef from UART object struct.Damien George
This UART_HandleTypeDef is quite large (around 70 bytes in RAM needed for each UART object) and is not needed: instead the state of the peripheral held in its registers provides all the required information.
2018-12-10stm32/uart: Factor out code to set RX buffer to function uart_set_rxbuf.Damien George
2018-12-10stm32/uart: Factor out code from machine_uart.c that computes baudrate.Damien George
2018-12-10stm32: Split out UART Python bindings from uart.c to machine_uart.c.Damien George