Fix multiple minor issues which trigger build warnings with clang,
including:
* label followed by a declaration is a C23 extension
* duplicate 'const' declaration specifier (DEVICE_API already has const)
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The configuration passed to lora_config() is not supposed to be modified by
the driver. Make it const to save on RAM.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Add a generic software PWM driver as a fallback
when no dedicated hardware PWM pins are available.
This implementation leverages a single hardware
timer interrupt as a time base to derive an
arbitrary number of software-controlled PWM channels.
The period is the same for all channels.
This enables use of LED brightness and blink APIs.
Tested on Nucleo H563ZI with this overlay:
/ {
status_leds: status_leds {
compatible = "pwm-leds";
status_led_1: status_led_1 {
pwms = <&soft_pwm 0 PWM_MSEC(10) PWM_POLARITY_NORMAL>;
label = "1";
};
};
soft_pwm: soft_pwm {
compatible = "zephyr,pwm-bitbang";
#pwm-cells = <3>;
timer = <&tim6_counter>;
pwm-gpios = <&gpiob 0 GPIO_ACTIVE_HIGH>;
};
};
&timers6 {
status = "okay";
st,prescaler = <24999>;
tim6_counter: counter {
status = "okay";
};
};
Assisted-by: GitHub Copilot:claude-opus-4.6
Signed-off-by: Stefan Gloor <stefan.gloor@siemens.com>
Add a comprehensive driver for the Microchip PAC194x/195x family of
multi-channel power monitors. This driver supports VBUS, VSENSE,
and power accumulation measurements.
Key features and implementation details:
- Support for PAC1941/42/43/44 (9V FSR) and PAC1951/52/53/54 (32V FSR).
- Efficient I2C handling: uses per-channel burst reads to optimize
bus bandwidth based on enabled channels.
- Flexible Refresh Modes: introduced SENSOR_ATTR_REFRESH_MODE to
allow users to choose between AUTO_WAIT (synchronous),
AUTO_NOWAIT (asynchronous/latched), and MANUAL modes.
- Broadcast Support: added a force refresh command using I2C
General Call (0x00) to synchronize snapshots across multiple
sensors (up to 16 instances) simultaneously.
- Configurable range: support for Unipolar, Bipolar, and Bipolar
Half FSR modes via Devicetree.
Tested on RISC-V (ESP32-C3) with 16 PAC1944 instances.
Signed-off-by: Wojciech Macek <wmacek@google.com>
Extend flash and I2C drivers to support BL808 register base addresses
and SoC-specific configuration guards.
Signed-off-by: William Markezana <william.markezana@gmail.com>
Rename BL61x GPIO and pinctrl drivers to bl61x_808 variants since
BL808 shares identical register layouts. Update compatible strings,
Kconfig, CMakeLists, and BL61x device tree accordingly. Extend the
DMA and IR receiver drivers' BL61x guards to also cover BL808.
Signed-off-by: William Markezana <william.markezana@gmail.com>
Combine the Cortex-M7 ENET workaround updates into one commit.
- clear CACHE_ENET on i.MX RT11xx Cortex-M7 for ERR050396
- disable ETH_NXP_ENET_USE_DTCM_FOR_DMA_BUFFER by default on Cortex-M7
- keep the final Kconfig condition independent of
DT_HAS_NXP_ENET1G_ENABLED
This avoids touching the same Kconfig and SoC files in follow-up
commits while preserving the intended behavior for PR #106679.
Validation:
- branch history squashed so workaround files are updated once
in the series
Signed-off-by: Hake Huang <hake.huang@nxp.com>
Handle both RX frame and RX buffer interrupts in the NXP ENET driver.
This matches the MCUX HAL interrupt handling and avoids leaving RX work
queued behind an unhandled RX buffer interrupt source.
Validation:
- built samples/net/dhcpv4_client for mimxrt1170_evk@B/mimxrt1176/cm7
with boards/nxp/mimxrt1170_evk/dts/nxp,enet1g.overlay
- verified MCUX HAL uses RX frame and RX buffer interrupts together
Signed-off-by: Hake Huang <hake.huang@nxp.com>
Add driver for the NXP RTC analog module found on MCX L series
SoCs. This RTC supports BCD time/date mode with hundredths-of-second
resolution and 3 independent alarms.
Signed-off-by: Yves Wang <zhengjia.wang@nxp.com>
Set tx_config.xferPending when a read follows the write so the PDL
holds the bus and generates a repeated START instead of STOP.
Signed-off-by: Alexpandi Muniyandi <alexpandi@linumiz.com>
The PDL bundles completion (RD_CMPLT/WR_CMPLT) and ERR events into
a single cbEvents() call. The handler gave transfer_sem twice, leaking
count to the next transfer on i2c_scan.
Make the error and completion paths mutually exclusive with else-if
so exactly one k_sem_give() occurs per callback.
Signed-off-by: Alexpandi Muniyandi <alexpandi@linumiz.com>
On STM32H5 / STM32U5 with GPDMA the USART can stop generating DMA RX
requests after uart_rx_disable() clears DMAR and DMAR is later re-enabled.
Toggling the USART enable (UE) before re-asserting DMAR resets the USART
internal state machine and allows RX DMA requests to resume.
Fixes: #101345
signed-off-by: Ashirwad Paswan <ashi06712@gmail.com>
This commit edits mspi_stm32_xspi and
mspi_stm32_ospi drivers to include S_D_D
data rate support and refactor some blocks.
Signed-off-by: Sara Touqan <zephyr@exalt.ps>
Signed-off-by: Sarah Younis <zephyr@exalt.ps>
This commit extends mspi_stm32_xspi and
mspi_stm32_ospi drivers to add timing support
required for external PSRAM devices.
Signed-off-by: Sara Touqan <zephyr@exalt.ps>
Signed-off-by: Sarah Younis <zephyr@exalt.ps>
This commit adds support for APS256 and APS6408L in RLC/WLC
configuration. This includes a dedicated mapping for these
variants.
also this commit updates:
- Read/write length handling for APS256/APS6408L
- Vendor ID read sequence to support APS256/APS6408L
register behavior
Signed-off-by: Sara Touqan <zephyr@exalt.ps>
Signed-off-by: Sarah Younis <zephyr@exalt.ps>
The `pinctrl_soc_pin_t` format occupied two uint32_t even though all info
it stores can be compressed in 32 bits only, and also didn't map very well
to the hardware (especially on STM32F1). Due to defects, the format was
also NOT what the `stm32_gpioport_configure_pin()` function consumed to
actually configure a GPIO port, requiring additional decoding/manipulation
logic.
Introduce a vastly reworked format which only requires 32-bit per pinctrl
entry and maps nicely to hardware and becomes the new format consumed by
stm32_gpioport_configure_pin(). This heavily simplifies the pinctrl driver
since it no longer needs to examine the actual values (except to determine
the target GPIO port and pin - this is done on purpose!). The GPIO driver
converts Zephyr flags to this new format too.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Instead of silently ignoring the flags, warn the user when an illegal
GPIO configuration is provided on STM32F1. To avoid breaking backwards
compatibility and tests, the old behavior is however retained.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Simplify the logic translating Zephyr GPIO flags into STM32-specific flags:
- flatten if chain for output type determination
- change how input modes are handled
- introduce new INPUT_FLOAT/INPUT_PUPD pincfg values which are used for
input mode depending on whether or not user requests pull-up/down
- these values can have the PULL_UP / PULL_DOWN OR'ed into them
- share PU/PD decoding between INPUT and OUTPUT mode
While at it, also return -ENOTSUP to caller if attempting to set a pull-up
or pull-down on a disabled pin instead of silently discarding the request.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Move the logic which sets the output level based on configuration to the
common `stm32_gpioport_configure_pin()` function to reduce duplication.
To support the GPIO use case where a pin's configuration is changed without
modifying its output state, a new parameter is introduced which specifies
whether or not the output level should be modified.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Use `_Pos`/`_Msk` suffixed defines for pinctrl format bits definitions and
declare `_Msk` already shifted. This is aligned with the CMSIS definitions
format which shorter, easier to understand and enables use of
macros _FLD2VAL/_VAL2FLD.
Update all code using these defines accordingly.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Flags were already converted to 'ret', but this value was not used in the
nsos_adapt_fcntl_setfl() invocation. Introduce 'mid_flags' to make it more
readable and pass that value to nsos_adapt_fcntl_setfl() for proper flags
conversion.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
This function already returns errors in "mid" namespace, so return
NSOS_MID_SO_ERROR in "mid" namespace, so propagate that value directly.
This error is converted to Zephyr error namespace in nsos_connect().
While at it, add a comment related to the 'ret' variable.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Return error code in "mid" namespace, to be consistent across all
nsos_adapt_sendmsg() return values.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Add addrinfo mapping between host and Zephyr. This fixes issues for example
when AF_INET had to be mapped between host (value 2 in glibc on Linux) and
Zephyr (value 1).
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
There was a copy-paste error, resulting in conversion to AF_UNIX.
Additionally sll_family needs to be converted to from "mid" to "host"
value.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
We don't need to save the MAC address in the data
struct, therfore use a local var in the iface init for it.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
move dev init into iface init. By registering the
uart pipe at the end of the iface init, we also no longer
need to check in the callback if the iface init was done.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Added support for the MDINT interrupt pin, through which the PHY signals
the MCU when certain link events occur.
Signed-off-by: Robert Khanafiev <robert.khanafiev@fischer-electronic.com>
The link was monitored in a separate thread that was initialized with
an incorrectly defined stack. This caused an exception on some systems.
The thread has been replaced with a dedicated workqueue.
Signed-off-by: Robert Khanafiev <robert.khanafiev@fischer-electronic.com>
Add rtc node on stm32n6 DT.
Enable backup domain access before RTC clock configuration and not after.
Add rtc to the supported tags
Signed-off-by: Basile GRUNER <basile.gruner@smile.fr>
This reverts commit 6685c3028b
in order to refactor the handling of indexed 4 bit pixel formats
We can handle indexed 4 bit pixel formats in a generic way without having
to resort to "private" pixel format definitions. This introduces a new
pixel format, PIXEL_FORMAT_I_4, for (up-to) 16-color palette displays.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Add a Kconfig CONFIG_DAI_MAX_BESPOKE_CFG_SIZE to configure the maximum
blob size for dai_config_set. This only affects user-space usage via
syscalls when the blob needs to be copied to kernel memory before
validation.
The default is increased to 1024 to make tests pass with upstream
SOF project configurations.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>