Configure the reference buffers when using external reference voltage for a
channel. For the internal reference the datasheet[1] recommends that the
buffers are disabled and for external references they should be disabled if
REFPx/REFNx is close to AVDD/AVSS. After reset the positive reference
buffer is enabled and the negative is disabled. The default values
correspond to the example circuit for a two-wire and four-wire PT100 RTD
measurement with low-side reference.[2][3]
The values configured by the driver are maybe a little opinionated, but the
current behaviour is kept to avoid surprises for people that are happy with
the drivers defaults.
The change applies to both ads11xs0x and ads124xs0x series.
Link: [1]: https://www.ti.com/lit/ds/symlink/ads124s08.pdf
Link: [2]: https://www.ti.com/lit/an/sbaa329b/sbaa329b.pdf
Link: [3]: https://www.ti.com/lit/an/sbaa336b/sbaa336b.pdf
Signed-off-by: Henrik Lindblom <henrik.lindblom@vaisala.com>
Implement PWM input capture functionality for the NXP SCTimer
driver with support for both pulse width and period measurement
in single-shot and continuous modes.
Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
1.Add mcux_sctimer_pwm_update_polarity() function to properly
reconfigure PWM output polarity when duty cycle is updated.
2.Update Match Reload Value register when Match register is
set.
3.Stop timer before update to prevent bus error
Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
The prescaler divides the clock by (prescaler + 1), not by the prescaler
value directly. Update the calculation to correctly account for this.
Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
Add support for PWM input capture functionality to the NXP MCUX PWM
driver. This enables measurement of pulse width and period of external
PWM signals.
Key features added:
- PWM capture configuration and control APIs
- Interrupt-driven capture with overflow handling
- Support for both pulse width and period measurement
- Configurable input filtering
- Support for continuous and one-shot capture modes
The implementation uses FlexPWM channel X as the dedicated input
capture channel, while channels 0 and 1 remain available for PWM
output. Capture functionality is conditionally compiled based on
CONFIG_PWM_CAPTURE configuration option.
Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
In PWM_SetupPwm implementation, there is a check:
temp = pwmClock / pwmFreq_Hz;
assert(temp <= 0xFFFFU);
Currently pwmFreq_Hz is 1, makes assert failed with
high frequency pwmClock. Since VALx values is set
directly for edge aligned PWM, the pwmFreq_Hz here is
a dummy value, set pwmFreq_Hz equal to pwmClock
frequency to pass assert check.
Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
The STMicroelectronics ST87M01 modem is an ultra-compact low-power
NB-IoT industrial module.
The ST87M01 is a high-performance, fully programmable, ultra-compact,
and low-power LTE Cat NB2 NB-IoT industrial module series,
offering comprehensive worldwide band coverage and advanced
security features.
Supporting a wide range of IoT protocols, the ST87M01 module includes
PDU SMS services and internet protocols such as TCP/IP, TLS/DTLS, CoAP,
LwM2M, MQTT, and HTTP/HTTPS, enabling versatile connectivity and
application scenarios.
This driver introduces support for AT commands to query modem
information and socket offloading for TCP/UDP transfers.
Signed-off-by: Isabelle OGER <isabelle.oger@st.com>
Add workaround for MCUXSDK FTFX driver when FTFx_DRIVER_IS_FLASH_RESIDENT
is enabled.
The SDK places the run command function in data section which
is not executable when Zephyr configures memory permissions.
Implement a RAM function to replace the FTFX driver's run command function
Fixes: #98560
Signed-off-by: Jason Yu <zejiang.yu@nxp.com>
If CONFIG_SDMMC_STM32_CLOCK_CHECK=y but the SDMMC node lacked domain clock,
the driver would perform an out-of-bounds access to priv->pclken[1] and
provide garbage as the "subsystem" in the call to clock_control_get_rate().
Detect this situation and error out with an explicit message instead to
prevent UB and help users.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Use NRF_DT_INST_IRQ_ macros which support building with and without
SW ISR table for all nordic socs.
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
Use NRF_DT_INST_IRQ_ macros which support building with and without
SW ISR table for all nordic socs.
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
Use NRF_DT_INST_IRQ_ macros which support building with and without
SW ISR table for all nordic socs.
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
nxp_ewm_install_timeout() accesses cfg fields before checking for
NULL, making the later NULL check ineffective.
Remove the redundant check.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
In order to make some basic tests on the OTP API, add an OTP memory
emulator driver. It implements the .program() and .read() APIs.
Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
Introduce a new OTP subsystem to be able to interact with One Time
Programmable(OTP) memory. For now, add basic read()/program() APIs.
Program() API is default disabled due to its sensitivity.
File drivers/otp.h is inspired by drivers/eeprom.h as the basic
features are similar.
Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
A set of preliminary (but harmless) changes to prepare for adding the HAL
implementation.
- Rename CMake variables for clarity and consistency, adding an 'LBM_LIB_'
prefix when the path is a library / module path.
- Change zephyr_library_include_directories to zephyr_include_directories
for the RAL/RALF includes, since these headers may be needed outside the
library itself.
- Make lbm_common.h available to code outside the driver directory.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
To add support for LTR553, we will migrate device-tree
properties to new ones and mark the old ones as deprecated.
We will also refactor variable names accordingly.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
The LTR329 is a functional subset of the LTR55X series,
lacking the proximity sensor functionality.
To maintain symbol consistency, we will use LTR55X as the base name.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Some NXP SAR ADC variants don't implement the MCR[ADCLKSEL] field.
Add conditional compilation guards to define compatibility macros
that evaluate to 0 when ADCLKSEL is not available, allowing the
driver to compile across different NXP SoCs.
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
We modified the Microchip MEC UART driver to be HAL
independent and be usuable on all MEC SoCs. The only
hardware difference is an extra register in the MEC174x/5x
family providing TX FIFO full and current byte count.
Signed-off-by: Scott Worley <scott.worley@microchip.com>
Add proper support for the 1-bit CAN protocol engine clock multiplexer
present in some NXP FlexCAN instances.
Both possible input clocks are now represented as named clocks in the
devicetree nodes ("clksrc0" and "clksrc1") and the existing devicetree
property "clk-source" now selects the correct clock in addition to setting
the multiplexer bit (CLKSRC) in the FlexCAN CTRL1 register.
Fixes: #94517
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Make the clk-source property of the NXP FlexCAN devicetree nodes optional
as not all FlexCAN instances have an internal clock multiplexer.
Remove the clk-source property from the SoCs where the internal clock
multiplexer is not present, limit the values this property can be assigned,
and default the clock selection bit to 0 in the driver.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
The explicit, and internal, _CONCAT_\d macros are used in a few
files instead of the public CONCAT() macro which automatically
expands to the correct _CONCAT_\d macro based on number of args
passed to it. Update files to use CONCAT().
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
Found when building with clang with -Winitializer-overrides:
drivers/gpio/gpio_max14906.c:495:29: error: initializer overrides prior
initialization of this subobject [-Werror,-Winitializer-overrides]
495 | DT_INST_FOREACH_STATUS_OKAY(GPIO_MAX14906_DEVICE)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
So far using recvfrom() and send() from two different threads was not
possible, since thread attempting send() was blocked by the thread
executing recvfrom(). All other APIs were also blocking each other, while
it was not necessary. One example use case in Zephyr tree is MCUMGR SMP
over UDP implementation, which resuled in communication timeouts.
Release socket lock while actively polling, so other APIs executed from
other threads can safely progress. Do this using k_condvar_wait() API with
socket mutex, so that mutex is safely released and reaquired during wait.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
When ESP32 operates in AP-only mode the network interface is
initialized with the STA MAC address, but the Wi-Fi hardware operates
with the AP MAC address (typically STA MAC + 1).
Some Wi-Fi clients correctly address frames to the AP MAC, causing them
to be dropped by the ethernet L2 layer with "Dropping frame, not for me"
because the interface link address doesn't match.
Fix this by updating the interface link address to the AP MAC when
enabling AP mode, and restoring the STA MAC when disabling AP mode.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Change init procedure of regulator_fixed and regulator_gpio to not rely
on reading the state of the enable pin as it might not be available.
Initialize the enable pin to the appropriate state based on the
REGULATOR_INIT_ENABLED flag.
Signed-off-by: Sergei Ovchinnikov <sergei.ovchinnikov@nordicsemi.no>
Since input buffer may not always be connected when a GPIO is configured
as an OUTPUT, setting its state based on what is returned by
gpio_pin_get_dt can lead to faulty behavior. Remove this check as
redundant.
Fixes#93012
Signed-off-by: Sergei Ovchinnikov <sergei.ovchinnikov@nordicsemi.no>
Increase the maximum allowed repeat count for flash speed tests from
10 to 10000. This allows for more accurate measurements over
longer test durations.
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
Set the content of the noise source control register if the corresponding
property is set in device tree.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
STM32L4 was using different LL functions from the other series.
With the latest HAL update, the usual functions are now defined, so
the L4-specific code can now be removed.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
DNS queries using native posix can return multiple results. Add a
relatively large default to pre-empt failures due to the query being
too successful.
Extra RAM usage can be ignored since NSOS sockets can only exist on
native posix, which has essentially infinite RAM.
Signed-off-by: Jordan Yates <jordan@embeint.com>
mbox_msg::data is a const pointer, but ipm_callback_t expects a
volatile void * payload. Passing the mailbox payload through the
IPM callback was triggering compiler warnings about discarded
qualifiers.
Convert the mailbox payload pointer to the IPM callback payload
type via a uintptr_t round-trip to avoid -Wdiscarded-qualifiers
or -Wcast-qual noise without changing the runtime behavior.
fix:https://github.com/zephyrproject-rtos/zephyr/issues/102057
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
Since the latest hal_renesas has updated the I2C Controller config
to build the IIC Controller source. Without this update, many
current PRs on mainstream which has the update for hal_renesas
revision will fail.
Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
numaker_usbd_ep_fifo_copy_to_user() never reports errors and always
returns 0.
The error check at the call site is therefore dead code.
Make the function void and drop the unused error handling.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
numaker_usbd_ep_fifo_copy_from_user() never reports errors and
always returns 0.
The error check at the call site is therefore dead code.
Make the function void and drop the unused error handling.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>