Add checks to return value of esp_intr_alloc to avoid drivers init
returning 0 when interrupt allocation fails.
Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
Add missing braces to comply with MISRA C:2012 Rule 15.6 and
also following Zephyr's style guideline.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Add power management support for Apollo3/Apollo3P UART, and
automatically enables device runtime power management
Signed-off-by: Zhengwei Wang <zwang@ambiq.com>
First commit to support serial driver running on r_sci_uart for Renesas
RA devices.
Signed-off-by: The Nguyen <the.nguyen.yf@renesas.com>
Signed-off-by: Duy Phuong Hoang. Nguyen <duy.nguyen.xa@renesas.com>
Add name to choice symbol, so that default value can be changed
downstream.
Developed-by: Andreas Rudolf <andreas.rudolf@husqvarnagroup.com>
Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
Instead of disabling code with a specific compilation switch, enable it
and apply `__maybe_unused` in the `ns16550_outword` and `ns16550_inword`
functions to make the codebase cleaner.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Correct the following typo in Kconfig and
the corresponding function.
- Kconfig.it8xxx2 from `BUADRATE` to `BAUDRATE`
- Correspoding function from `burdrate` to `baudrate`
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
When trying to build Zephyr with -Wignored-qualifiers this leads to a
compiler warning like:
zephyr/drivers/serial/uart_pl011_registers.h:40:1: error: type
qualifiers ignored on function return type [-Werror=ignored-qualifiers]
Since the return value is copied by the caller, making it const has no
effect and the compiler warns that this is being ignored. This enables
applications to build with additional compiler warnings turned on.
Signed-off-by: Benjamin Gwin <bgwin@google.com>
Code size can significantly reduced (220 bytes per instance) if data
structure (stored in RAM) is not initilized (can be moved to .bss).
Data for asynchronous API had two fields which can easily be moved
to the configuration structure (which is in ROM) because they do not
change duing runtime.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
When runtime configuration is not enable then we can determine at
compile time what are the hardware settings. Function which
translates zephyr values to nRF register values is not needed as
macros can do that at compile time.
This optimization saves almost 400 bytes of code.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Some UARTE instances may be clocked at higher speeds than 16MHz, so the
baudrate setting needs to be scaled accordingly. This patch parses the
`clocks` property and obtains the clock-frequency property of the
associated clock, assuming it is a fixed-clock. We should ideally have a
proper clock control subsystem where frequency can be queried using an
API, but we're far from there.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
As there is no LiteUART it is more fitting
to rename the uart driver. This way it is also
more coherent with the other drivers and will
match the conditions in the MAINTAINERS.yml.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
The enableRxRTS and enableTxCTS can only be configured when the
'UART_HAS_MODEM_SUPPORT' feature is enabled.
Uart has no 'error' IRQ on frdm_ke17z512, so update irq configuration
to configure the error interrupt when it exists.
Signed-off-by: Anke Xiao <anke.xiao@nxp.com>
Declare __stdout_hook_install in libc-hooks.h and use it in the console
drivers rather than redeclare it every time.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This is needed to avoid warnings about uninitialized
structure member, which was added in nrfx 3.6.
Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
Remove address-of operator ('&') when assigning `init_fn`
function pointer in `DEVICE_DT_INST_DEFINE` macro.
This change aims to maintain consistency among the drivers in
`drivers/serial`, ensuring that all function pointer assignments
follow the same pattern.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Add a zephyr/printk.h header for the __printk_hook functions, these are
currently manually declared by all console drivers for no good reason.
Move the documentation into the header and also unify the way that
console drivers call the function.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This patch adds support for the rx-invert and tx-invert device-tree
properties to the uart_lpc11u6x driver for USARTs 1, 2, 3 and 4.
Note that this feature is not supported by USART 0.
Signed-off-by: Simon Guinot <simon.guinot@sequanux.org>
The existing configuration of the ESP32 UART FIFO thresholds
was fixed, leading to inefficiencies in handling
Modbus RTU packages exceeding this size.
This commit introduces two new Kconfig options,
allowing users to adjust the esp32 fifo thresholds as needed.
fixes#74311
Signed-off-by: Omer Gozderesi <omer.gozderesi@enda.com>
config: esp32: configurable UART FIFO thresholds
The existing configuration of the ESP32 UART FIFO thresholds
was fixed, leading to inefficiencies in handling
Modbus RTU packages exceeding this size.
This commit introduces two new Kconfig options,
allowing users to adjust the esp32 fifo thresholds as needed.
fixes#74311
Signed-off-by: Omer Gozderesi <omer.gozderesi@enda.com>
- Defined 'api_configure' function outside of
'CONFIG_UART_USE_RUNTIME_CONFIGURE' macro because it is the only
configuration function and used in device initialization function.
- Removed unnecessary 'IF_ENABLED' part.
Signed-off-by: Furkan Akkiz <hasanfurkan.akkiz@analog.com>
Add support for the EK RA8M1 board
This board is using Renesas RA8M1 MCU.
Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
Signed-off-by: The Nguyen <the.nguyen.yf@renesas.com>
Update rx and tx ready function as per of its description.
For tx_ready if tx interrupt enabled AND tx fifo is not full
For rx_ready if rx interrupt enalbed AND rx fifo not empty
Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
After enabling interrupts, serial_esp32_usb_irq_tx_enable() calls the
interrupt handler to handle any old events that occurred while interrupts
were disabled. However, this happens in the callers context, so if an
interrupt arrives during the call, it will call the interrupt handler again
resulting in corruption if the interrupt handler is not reentrant.
Fixes#74569
Signed-off-by: Eric Holmberg <eric.holmberg@northriversystems.co.nz>
drivers/serial/uart_async_to_irq.c: In function 'get_rx_timeout':
drivers/serial/uart_async_to_irq.c:51:26:
warning: 'cfg.baudrate' may be used uninitialized
51 | baudrate = cfg.baudrate;
| ~~~~~~~~~^~~~~~~~~~~~~~
drivers/serial/uart_async_to_irq.c:45:28: note: 'cfg' declared here
45 | struct uart_config cfg;
Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
Removed PM device runtime support from drivers in PD_SYS domain.
Update the rest device drivers to call pm_device_runtime_get/put()
functions when CONFIG_PM_DEVICE_RUNTIME is enabled.
Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
Changes to bring support for esp32c6 SoC.
- clock control
- gpio
- pinctrl
- serial
- timer
Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
These headers have been deprecated for > 2 full releases,
let's remove them to keep them out of v3.7.0 LTS.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Simple cosmetic change to convert all the source commands
to rsource so that includes are relative to driver/serial.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>